@layer reset, base, layout, components, utilities;
@font-face {
  font-family: "Noto Sans";
  src: url("../fonts/noto-sans-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans";
  src: url("../fonts/noto-sans-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif Display";
  src: url("../fonts/noto-serif-display-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  body,
  h1,
  h2,
  h3,
  p,
  ul {
    margin: 0;
  }
  ul {
    padding: 0;
  }
  img {
    display: block;
    max-width: 100%;
  }
  button,
  input,
  textarea,
  select {
    font: inherit;
  }
}

@layer base {
  :root {
    --ink: #102a43;
    --pine: #0b3b5c;
    --green: #0e7490;
    --blue-sky: #34b2e3;
    --cream: #f3f8fc;
    --paper: #ffffff;
    --clay: #075985;
    --muted: #334e68;
    --line: #cbd9e5;
    --focus: #f59e0b;
    --shadow: 0 18px 45px rgb(16 42 67 / 13%);
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    color: var(--ink);
    background: var(--cream);
    font-family:
      "Noto Sans",
      ui-sans-serif,
      system-ui,
      -apple-system,
      BlinkMacSystemFont,
      "Segoe UI",
      sans-serif;
    line-height: 1.5;
  }

  a {
    color: inherit;
  }

  h1,
  h2,
  h3 {
    font-family: "Noto Serif Display", Georgia, serif;
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.035em;
    text-wrap: balance;
  }

  h1 {
    max-width: 14ch;
    margin-bottom: 1.35rem;
    font-size: clamp(3.5rem, 5vw, 5.5rem);
    line-height: 0.92;
  }

  h2 {
    margin-bottom: 1rem;
    font-size: clamp(2.25rem, 4.4vw, 4.4rem);
  }

  h3 {
    font-size: 1.35rem;
  }

  :focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
  }

  @media (max-width: 960px) {
    h1 {
      max-width: 10ch;
      font-size: clamp(3.15rem, 8vw, 5.6rem);
    }
  }

  @media (max-width: 560px) {
    h1 {
      max-width: 100%;
      font-size: clamp(2.8rem, 17vw, 4.6rem);
      line-height: 0.95;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

@layer layout {
  .shell {
    width: min(1160px, calc(100% - 3rem));
    margin-inline: auto;
  }
  .section {
    padding-block: clamp(5.5rem, 10vw, 8rem);
  }
  .section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    margin-bottom: 2.8rem;
  }
  .work .section-heading h2 {
    font-size: clamp(2.25rem, 3.9vw, 3.5rem);
  }
  .intro-grid,
  .statement-grid,
  .cta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.5rem, 8vw, 8rem);
    align-items: center;
  }
  .statement-grid {
    grid-template-columns: 0.8fr 1.2fr;
    gap: 3rem;
  }
  .spaces-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.25rem;
  }
  .cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }
  .impact-grid {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
  }
}

@layer components {
  .skip-link {
    position: absolute;
    z-index: 100;
    top: -5rem;
    left: 1rem;
    padding: 0.7rem 1rem;
    color: var(--ink);
    background: #fff;
    border-radius: 0.35rem;
    font-weight: 800;
  }
  .skip-link:focus {
    top: 1rem;
  }
  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .eyebrow::before {
    width: 0.55rem;
    height: 0.55rem;
    content: "";
    background: var(--clay);
    border-radius: 50%;
  }
  .lede {
    color: var(--muted);
    font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  }
  .section-heading .lede {
    max-width: none;
  }
  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.1rem;
    padding: 0.85rem 1.15rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    transition:
      transform 0.2s ease,
      background 0.2s ease;
  }
  .button:hover {
    transform: translateY(-2px);
  }
  .button--primary {
    color: var(--ink);
    background: var(--blue-sky);
  }
  .button--outline {
    color: #fff;
    border-color: rgb(255 255 255 / 72%);
  }
  .button--dark {
    color: #fff;
    background: var(--ink);
  }
  .site-header {
    position: absolute;
    z-index: 5;
    width: 100%;
    color: #fff;
  }
  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 5.5rem;
  }
  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.03rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    text-decoration: none;
  }
  .brand-mark {
    width: min(9rem, 35vw);
    height: auto;
    max-width: 100%;
    object-fit: contain;
  }
  .nav-links {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    list-style: none;
    font-size: 0.93rem;
    font-weight: 700;
  }
  .nav-links a {
    text-decoration: none;
  }
  .nav-links a:not(.button):hover {
    color: var(--blue-sky);
  }
  .menu-toggle {
    display: none;
    padding: 0.55rem;
    color: #fff;
    background: transparent;
    border: 1px solid rgb(255 255 255 / 55%);
    border-radius: 0.35rem;
  }
  .hero {
    position: relative;
    isolation: isolate;
    min-height: 720px;
    padding: 9.7rem 0 3.5rem;
    color: #fff;
    overflow: hidden;
    background: var(--pine);
  }
  .hero::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background: linear-gradient(
      90deg,
      rgb(7 30 50 / 94%) 4%,
      rgb(9 45 72 / 77%) 42%,
      rgb(11 59 92 / 25%) 76%
    );
  }
  .hero-media {
    position: absolute;
    z-index: -2;
    inset: 0;
    background: var(--pine);
  }
  .hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
  }
  .hero-image.is-active {
    opacity: 1;
  }
  .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.55fr);
    align-items: end;
    min-height: 555px;
    gap: 3rem;
  }
  .hero .eyebrow,
  .statement .eyebrow {
    color: var(--blue-sky);
  }
  .hero .eyebrow::before {
    background: var(--blue-sky);
  }
  .hero .lede {
    color: #e8f0ec;
  }
  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
  }
  .hero-note {
    align-self: end;
    padding: 1.25rem 1.35rem;
    border-top: 1px solid rgb(255 255 255 / 55%);
    font-weight: 700;
  }
  .hero-note strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--blue-sky);
    font-size: 2.6rem;
    letter-spacing: -0.08em;
    line-height: 1;
  }
  .impact {
    background: var(--blue-sky);
  }
  .impact-item {
    min-height: 135px;
    padding: 1.6rem;
    border-right: 1px solid rgb(20 37 31 / 22%);
  }
  .impact-item:last-child {
    border: 0;
  }
  .impact-item span {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 2.55rem;
    font-weight: 900;
    letter-spacing: -0.08em;
    line-height: 1;
  }
  .impact-item p {
    font-size: 0.92rem;
    font-weight: 750;
  }
  .intro-art {
    position: relative;
    min-height: 470px;
  }
  .history-carousel {
    position: absolute;
    inset: 0 3rem 0 0;
    perspective: 1200px;
    overflow: hidden;
    border-radius: 1rem;
  }
  .history-slides {
    width: 100%;
    height: 100%;
  }
  .history-slide {
    position: absolute;
    inset: 0;
    height: 100%;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: rotateY(-90deg);
    transform-origin: left center;
    backface-visibility: hidden;
  }
  .history-slide[aria-hidden="false"] {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    transform: rotateY(0);
    animation: page-turn-in 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
  .history-slide.is-leaving {
    z-index: 2;
    opacity: 0;
    visibility: visible;
    transform: rotateY(90deg);
    transform-origin: right center;
    animation: page-turn-out 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
  .intro-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.9);
  }
  .stamp {
    position: absolute;
    right: 0;
    bottom: 2.4rem;
    display: grid;
    place-content: center;
    width: 160px;
    aspect-ratio: 1;
    padding: 1rem;
    color: #fff;
    background: var(--clay);
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 850;
    line-height: 1.2;
    text-align: center;
    transform: rotate(12deg);
  }
  @keyframes page-turn-in {
    from {
      opacity: 0.4;
      transform: rotateY(-90deg);
    }
    to {
      opacity: 1;
      transform: rotateY(0);
    }
  }
  @keyframes page-turn-out {
    from {
      opacity: 1;
      transform: rotateY(0);
    }
    to {
      opacity: 0;
      transform: rotateY(90deg);
    }
  }
  .statement {
    color: #fff;
    background: var(--pine);
  }
  .statement h2 {
    color: var(--blue-sky);
  }
  .statement p {
    color: #edf3ef;
    font-size: 1.25rem;
  }
  .card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 325px;
    padding: 2rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 2px 0 rgb(20 37 31 / 4%);
  }
  .card-tag {
    margin-bottom: auto;
    color: var(--green);
    font-size: 0.77rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .card:not(:has(.cooperative-logo)) > .card-tag {
    margin-bottom: 1rem;
  }
  .card h3 {
    margin-block: 0.65rem 0.8rem;
    font-size: 2rem;
  }
  .card p {
    color: var(--muted);
  }
  .card--feature {
    color: var(--ink);
    background: var(--paper);
    border-color: var(--line);
  }
  .card--feature :is(.card-tag, p) {
    color: var(--muted);
  }
  .cooperative-logo {
    display: block;
    width: min(11rem, 100%);
    height: 11rem;
    margin: 0.8rem auto 1rem;
    object-fit: contain;
    object-position: center;
  }
  .history-press {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
  }
  .history-press h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
  }
  .history-press ul {
    display: grid;
    gap: 0.75rem;
    padding-left: 1.25rem;
  }
  .history-press a {
    text-underline-offset: 0.2em;
  }
  .gallery {
    background: none;
  }
  .carousel {
    position: relative;
    overflow: hidden;
    background: none;
  }
  .slides {
    display: flex;
    align-items: flex-start;
    transition: transform 0.55s cubic-bezier(0.2, 0.75, 0.2, 1);
  }
  .slide {
    position: relative;
    flex: 0 0 100%;
    display: grid;
    place-items: center;
    height: auto;
    margin: 0;
  }
  .slide-media {
    position: relative;
    display: grid;
    place-items: center;
    width: fit-content;
    max-width: 100%;
  }
  .slide img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 570px;
    object-fit: contain;
  }
  .slide figcaption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 3rem 1rem 1.25rem;
    color: #fff;
    background: linear-gradient(transparent, rgb(0 0 0 / 72%));
    font-weight: 750;
    text-align: center;
    pointer-events: none;
  }
  .carousel-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0;
  }
  .control {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    color: var(--ink);
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
  }
  .carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
  }
  .dot {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 50%;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
  }
  .dot[aria-current="true"] {
    color: var(--green);
    border-color: currentColor;
  }
  .location {
    padding: 2.1rem;
    border-radius: 1rem;
  }
  .location:first-child {
    color: #fff;
    background: var(--pine);
  }
  .location:last-child {
    background: var(--blue-sky);
  }
  .place {
    display: inline-block;
    margin-bottom: 2rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 850;
    text-transform: uppercase;
  }
  .location h3 {
    margin-bottom: 0.75rem;
    font-size: 2.1rem;
  }
  .location p + p {
    margin-top: 1rem;
  }
  .partners {
    border-top: 1px solid var(--line);
  }
  .partner-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
    list-style: none;
  }
  .partner-list li {
    padding: 0.7rem 1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 800;
  }
  .cta {
    color: #fff;
    background: var(--clay);
  }
  .cta .eyebrow {
    color: #fff;
  }
  .cta .eyebrow::before {
    background: var(--blue-sky);
  }
  .cta h2 {
    max-width: 100%;
    font-size: clamp(2rem, 4vw, 3.5rem);
  }
  footer {
    padding-block: 2.2rem;
    color: #dbeafe;
    background: #082f49;
  }
  .footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
    min-width: 0;
    align-items: start;
    gap: clamp(2rem, 5vw, 4rem);
    font-size: 0.88rem;
  }
  .footer-grid > * {
    min-width: 0;
  }
  .footer-brand {
    display: grid;
    gap: 0.75rem;
  }
  .footer-brand strong {
    margin-right: 0.35rem;
  }
  .footer-contact h2 {
    margin-bottom: 0.9rem;
    font-family: inherit;
    font-size: 1.2rem;
    letter-spacing: normal;
    line-height: 1.2;
  }
  .footer-contact-list {
    display: grid;
    gap: 0.8rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
  }
  .footer-contact-list li {
    display: grid;
    grid-template-columns: 1.25rem minmax(0, 1fr);
    min-width: 0;
    gap: 0.65rem;
    align-items: start;
  }
  .footer-contact-list svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
  }
  .footer-contact-list a {
    min-width: 0;
    overflow-wrap: anywhere;
    text-underline-offset: 0.2em;
  }
  .footer-map {
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 9;
    min-height: 13rem;
    overflow: hidden;
    border-radius: 0.75rem;
  }
  .footer-map iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
  }
}

@layer utilities {
  @media (max-width: 760px) {
    .shell {
      width: min(100% - 2rem, 1160px);
    }
    .nav {
      min-height: 4.5rem;
    }
    .menu-toggle {
      display: block;
    }
    .nav-links {
      position: absolute;
      top: 4.25rem;
      right: 1rem;
      left: 1rem;
      display: none;
      flex-direction: column;
      align-items: stretch;
      padding: 1rem;
      color: var(--ink);
      background: var(--paper);
      border-radius: 0.8rem;
      box-shadow: var(--shadow);
    }
    .nav-links.is-open {
      display: flex;
    }
    .nav-links .button {
      color: #fff;
    }
    .hero {
      min-height: 650px;
      padding-top: 7.5rem;
    }
    .brand-mark {
      width: min(7rem, 35vw);
    }
    .hero-grid,
    .intro-grid,
    .statement-grid,
    .spaces-grid,
    .cta-grid {
      grid-template-columns: 1fr;
    }
    .hero-grid {
      min-height: 525px;
      gap: 1rem;
    }
    h1 {
      max-width: 11ch;
    }
    .impact-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .impact-item {
      min-height: 100px;
      padding: 1.15rem;
      border-bottom: 1px solid rgb(20 37 31 / 22%);
      min-width: 0;
    }
    .impact-item:nth-child(2) {
      border-right: 0;
    }
    .intro-art {
      min-height: 0;
      height: clamp(15rem, 60vw, 24rem);
    }
    .history-carousel {
      inset: 0 2rem 0 0;
    }
    .stamp {
      bottom: 1.5rem;
      width: 7rem;
      font-size: 0.68rem;
    }
    .section-heading {
      grid-template-columns: 1fr;
    }
    .cards {
      grid-template-columns: minmax(0, 1fr);
    }
    .slide {
      min-height: 0;
    }
    .slide img {
      max-height: clamp(10rem, 52vw, 24rem);
    }
    .slide figcaption {
      padding: 0.75rem 0.5rem 0.5rem;
      font-size: 0.95rem;
      line-height: 1.3;
    }
    .carousel-navigation .control,
    .dot {
      width: 2.25rem;
      height: 2.25rem;
      flex-basis: 2.25rem;
    }
    .card {
      min-height: 265px;
    }
    .cooperative-logo {
      width: min(12rem, 100%);
      height: 12rem;
    }
    .footer-grid {
      grid-template-columns: minmax(0, 1fr);
    }
    .cta h2 {
      font-size: clamp(1.75rem, 7vw, 2.5rem);
    }
  }
  @media (max-width: 380px) {
    .impact-grid {
      grid-template-columns: 1fr;
    }
    .impact-item {
      border-right: 0;
    }
    .carousel-navigation {
      gap: 0.125rem;
    }
    .carousel-dots {
      gap: 0.125rem;
    }
    .carousel-navigation .control,
    .dot {
      width: 1.875rem;
      height: 1.875rem;
      flex-basis: 1.875rem;
    }
  }
}
