/**
 * Terrain Life Science — site design system
 * Typography: Inter (UI), Michroma (logo), Source Serif 4 (hero display),
 *              DM Serif Display (section headlines / cards).
 * Surfaces: --paper / --paper-deep (light), --ink (dark), --bone (text on dark).
 * Layout: .container uses --max (1180px) and --pad; sections use .section-* helpers.
 * Link from root pages: <link rel="stylesheet" href="assets/css/site.css">
 * From a subfolder page: <link rel="stylesheet" href="../assets/css/site.css">
 */

:root {
      --ink: #11161a;
      --paper: #f3efe6;
      --paper-deep: #e6ded1;
      --bone: #fbf7ed;
      --teal: #6f95aa;
      --amber: #d9902f;
      --steel: #607381;
      --muted: #5d676d;
      --line: rgba(17, 22, 26, 0.16);
      --line-light: rgba(251, 247, 237, 0.22);
      --shade: rgba(17, 22, 26, 0.74);
      --max: 1180px;
      --pad: 24px;
      --nav: 76px;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    html {
      scroll-behavior: smooth;
    }

    body {
      min-width: 320px;
      background: var(--paper);
      color: var(--ink);
      font-family: "Inter", Arial, sans-serif;
      line-height: 1.55;
    }

    a {
      color: inherit;
      text-decoration: none;
    }

    .skip-link {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .skip-link:focus,
    .skip-link:focus-visible {
      position: fixed;
      left: 16px;
      top: 16px;
      z-index: 100;
      width: auto;
      height: auto;
      margin: 0;
      padding: 12px 18px;
      overflow: visible;
      clip: auto;
      white-space: normal;
      background: var(--paper);
      color: var(--ink);
      font-weight: 700;
      border-radius: 8px;
      box-shadow: 0 8px 24px rgba(17, 22, 26, 0.25);
      outline: 2px solid var(--teal);
      outline-offset: 2px;
    }

    img {
      display: block;
      max-width: 100%;
    }

    .container {
      width: min(var(--max), calc(100% - (var(--pad) * 2)));
      margin: 0 auto;
    }

    .nav {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 20;
      --nav-bg: rgba(17, 22, 26, 0.96);
      border-bottom: 1px solid rgba(251, 247, 237, 0.12);
      background: rgba(17, 22, 26, 0.72);
      backdrop-filter: blur(18px);
      color: var(--bone);
    }

    .nav-inner {
      min-height: var(--nav);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      width: min(var(--max), calc(100% - (var(--pad) * 2)));
      margin: 0 auto;
    }

    .brand {
      display: inline-flex;
      align-items: center;
      gap: 14px;
    }

    .brand img {
      width: 46px;
      height: auto;
    }

    .brand-text {
      display: flex;
      flex-direction: column;
      line-height: 1;
    }

    .brand-name {
      font-family: "Michroma", "Inter", Arial, sans-serif;
      font-size: 1rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--bone);
    }

    .brand-subtitle {
      margin-top: 4px;
      font-family: "Inter", Arial, sans-serif;
      font-size: 0.7rem;
      font-weight: 500;
      letter-spacing: 0.02em;
      color: rgba(251, 247, 237, 0.82);
    }

    .nav-links {
      display: flex;
      flex: 1;
      justify-content: space-evenly;
      align-items: center;
      gap: 0;
      list-style: none;
      margin: 0;
      padding: 0 12px;
      color: rgba(251, 247, 237, 0.76);
      font-size: 0.95rem;
    }

    .nav-links a:hover {
      color: var(--bone);
    }

    .nav-links a:focus-visible {
      outline: 2px solid rgba(111, 149, 170, 0.85);
      outline-offset: 3px;
      border-radius: 4px;
    }

    .footer-links a:focus-visible {
      outline: 2px solid rgba(111, 149, 170, 0.85);
      outline-offset: 3px;
      border-radius: 4px;
    }

    .nav-toggle {
      display: none;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      width: 44px;
      height: 44px;
      padding: 0;
      border: 1px solid rgba(251, 247, 237, 0.35);
      border-radius: 8px;
      background: transparent;
      color: var(--bone);
      cursor: pointer;
    }

    .nav-toggle:focus-visible {
      outline: 2px solid rgba(111, 149, 170, 0.85);
      outline-offset: 3px;
    }

    .nav-toggle-bars {
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 5px;
      width: 22px;
    }

    .nav-toggle-bars span {
      display: block;
      height: 2px;
      border-radius: 1px;
      background: currentColor;
    }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 46px;
      padding: 0 20px;
      border-radius: 8px;
      border: 1px solid transparent;
      font-weight: 700;
      font-size: 0.94rem;
      transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
    }

    .btn:hover {
      transform: translateY(-1px);
    }

    .btn-primary {
      background: var(--amber);
      color: var(--ink);
    }

    /* Outlined CTA on dark hero / closing — teal border, transparent fill */
    .btn-outline {
      background: transparent;
      border-color: rgba(111, 149, 170, 0.5);
      color: rgba(251, 247, 237, 0.92);
      font-weight: 600;
      letter-spacing: 0.05em;
    }

    .btn-outline:hover {
      background: rgba(111, 149, 170, 0.12);
      border-color: rgba(111, 149, 170, 0.78);
      color: var(--bone);
      transform: none;
    }

    .btn-outline:focus-visible {
      outline: 2px solid rgba(111, 149, 170, 0.85);
      outline-offset: 3px;
    }

    .hero {
      min-height: 100svh;
      display: grid;
      align-items: center;
      position: relative;
      overflow: hidden;
      color: var(--paper);
      background: #11161a;
    }

    .hero::before {
      content: "";
      position: absolute;
      inset: 0;
      background:
        linear-gradient(90deg, rgba(17, 22, 26, 0.96) 0%, rgba(17, 22, 26, 0.74) 34%, rgba(17, 22, 26, 0.58) 58%, rgba(17, 22, 26, 0.78) 100%),
        linear-gradient(180deg, rgba(17, 22, 26, 0.34) 0%, rgba(17, 22, 26, 0.86) 82%, rgba(17, 22, 26, 0.95) 100%),
        url("../images/backgrounds/immunofluorescence.png") center/cover no-repeat;
      transform: scale(1.02);
    }

    .hero-body {
      position: relative;
      z-index: 1;
      min-height: 100svh;
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: calc(var(--nav) + 34px) 0 54px;
    }

    .hero-intro {
      max-width: 900px;
      padding: 28px 0 22px;
      position: relative;
    }

    .hero-intro::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: -1;
      pointer-events: none;
      background: linear-gradient(90deg, rgba(17, 22, 26, 0.64) 0%, rgba(17, 22, 26, 0.4) 58%, rgba(17, 22, 26, 0) 100%);
      -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 82%, transparent 100%);
      mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 82%, transparent 100%);
    }

    .kicker {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 22px;
      color: var(--teal);
      font-weight: 700;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      font-size: 0.82rem;
    }

    .kicker::before {
      content: "";
      width: 28px;
      height: 1px;
      background: currentColor;
    }

    .hero h1 {
      font-family: "Source Serif 4", serif;
      font-weight: 500;
      line-height: 0.96;
      max-width: 700px;
      margin-bottom: 22px;
      font-size: 6.35rem;
      text-wrap: balance;
    }

    h2,
    h3 {
      font-family: "Inter", Arial, sans-serif;
      font-weight: 600;
      line-height: 1.04;
    }

    .hero-copy {
      max-width: 760px;
      color: rgba(251, 247, 237, 0.88);
      font-size: 1.18rem;
    }

    .hero-copy-emphasis {
      color: var(--amber);
    }

    .hero-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 14px;
      margin-top: 34px;
    }

    .hero-footer {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      column-gap: 54px;
      row-gap: 30px;
      margin-top: 132px;
      padding-top: 28px;
      border-top: 1px solid rgba(251, 247, 237, 0.22);
      counter-reset: hero-footnotes;
    }

    .hero-footnote {
      counter-increment: hero-footnotes;
      padding: 0;
      min-height: 0;
    }

    .hero-footnote-label {
      display: inline-block;
      margin-bottom: 14px;
      color: rgba(111, 149, 170, 0.92);
      font-size: 0.76rem;
      font-weight: 700;
      letter-spacing: 0.16em;
      text-transform: uppercase;
    }

    .hero-footnote-label::after {
      content: " / 0" counter(hero-footnotes);
      color: rgba(251, 247, 237, 0.42);
    }

    .hero-footnote strong {
      display: block;
      max-width: 360px;
      margin-bottom: 10px;
      color: var(--bone);
      font-family: "Source Serif 4", serif;
      font-size: 1.42rem;
      font-weight: 600;
      line-height: 1.08;
      letter-spacing: -0.02em;
    }

    .hero-footnote span {
      display: block;
      max-width: min(380px, 100%);
      color: rgba(251, 247, 237, 0.66);
      font-size: 1rem;
      line-height: 1.52;
      font-weight: 400;
    }

    .hero-scroll {
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      margin: 76px auto 0;
      color: rgba(251, 247, 237, 0.5);
      text-transform: uppercase;
      letter-spacing: 0.12em;
      font-size: 0.72rem;
    }

    .hero-scroll-icon {
      width: 22px;
      height: 34px;
      border: 1px solid rgba(251, 247, 237, 0.42);
      border-radius: 14px;
      position: relative;
    }

    .hero-scroll-icon::before {
      content: "";
      position: absolute;
      top: 6px;
      left: 50%;
      width: 4px;
      height: 7px;
      border-radius: 999px;
      background: rgba(251, 247, 237, 0.5);
      transform: translateX(-50%);
    }

    .section {
      padding: 104px 0;
    }

    .section-dark {
      background: var(--ink);
      color: var(--bone);
    }

    .section-muted {
      background: var(--paper-deep);
    }

    .section-header {
      display: grid;
      grid-template-columns: 0.85fr 1.15fr;
      gap: 56px;
      align-items: end;
      margin-bottom: 56px;
    }

    #requirements .section-header {
      grid-template-columns: 1.15fr 0.85fr;
    }

    #requirements .section-header .section-label {
      justify-self: end;
      text-align: right;
    }

    .section-dark .section-label {
      color: var(--teal);
    }

    .section-title {
      max-width: 760px;
      font-family: "DM Serif Display", serif;
      font-weight: 400;
      font-style: italic;
      font-size: 3.4rem;
      line-height: 1.1;
    }

    .section-label {
      color: #3d6070;
      font-weight: 600;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      font-size: 0.78rem;
    }

    .section-copy {
      max-width: 680px;
      font-size: 1rem;
      line-height: 1.7;
      color: var(--muted);
    }

    .section-dark .section-copy {
      color: rgba(251, 247, 237, 0.7);
    }

    .logic {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      border-top: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
    }

    .logic-step {
      min-height: 300px;
      padding: 32px 28px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      border-right: 1px solid var(--line);
    }

    .logic-step:last-child {
      border-right: 0;
    }

    .logic-number {
      color: #3d6070;
      font-weight: 600;
      font-size: 0.78rem;
      letter-spacing: 0.08em;
      margin-bottom: 24px;
    }

    .logic-step h3 {
      margin-bottom: 14px;
      font-family: "DM Serif Display", serif;
      font-size: 1.6rem;
      font-weight: 400;
      font-style: normal;
      line-height: 1.2;
    }

    .logic-step p {
      color: var(--muted);
      font-size: 0.95rem;
      line-height: 1.65;
    }

    .image-band {
      position: relative;
      min-height: 580px;
      display: grid;
      align-items: center;
      overflow: hidden;
      color: var(--bone);
      background: #11161a;
    }

    .image-band::before {
      content: "";
      position: absolute;
      inset: 0;
      background:
        linear-gradient(90deg, rgba(17, 22, 26, 0.78), rgba(17, 22, 26, 0.28), rgba(17, 22, 26, 0.72)),
        linear-gradient(180deg, rgba(17, 22, 26, 0.18), rgba(17, 22, 26, 0.72)),
        url("../images/tech/terraintech.png") center/cover no-repeat;
      filter: grayscale(100%);
    }

    .image-band-content {
      position: relative;
      z-index: 1;
      padding: 88px 0;
    }

    .image-band h2 {
      max-width: 780px;
      margin-bottom: 20px;
      font-family: "DM Serif Display", serif;
      font-weight: 400;
      font-style: italic;
      font-size: 3.6rem;
      line-height: 1.1;
      color: #f3efe6;
    }

    .image-band p {
      max-width: 580px;
      color: rgba(251, 247, 237, 0.78);
      font-size: 1rem;
      line-height: 1.7;
      font-weight: 400;
    }

    .founder-proof {
      display: grid;
      gap: 1px;
      grid-template-columns: repeat(3, 1fr);
      background: var(--line);
      border: 1px solid var(--line);
    }

    .proof-card {
      min-height: 300px;
      padding: 32px 28px;
      background: var(--paper);
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .proof-card span {
      color: #3d6070;
      font-weight: 600;
      letter-spacing: 0.08em;
      font-size: 0.78rem;
    }

    .proof-card h3 {
      font-family: "DM Serif Display", serif;
      font-size: 1.6rem;
      font-weight: 400;
      font-style: normal;
      line-height: 1.2;
    }

    .proof-card p {
      color: var(--muted);
      font-size: 0.95rem;
      line-height: 1.65;
    }

    .tessera {
      display: grid;
      grid-template-columns: 0.95fr 1.05fr;
      gap: 60px;
      align-items: center;
    }

    .tessera-visual {
      min-height: 520px;
      position: relative;
      overflow: hidden;
      border: 1px solid var(--line-light);
      background:
        linear-gradient(180deg, rgba(17, 22, 26, 0.08), rgba(17, 22, 26, 0.78)),
        url("../images/backgrounds/immunofluorescence.png") center/cover no-repeat;
    }

    .tessera-visual::after {
      content: "";
      position: absolute;
      inset: 0;
      background-image:
        linear-gradient(rgba(251, 247, 237, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(251, 247, 237, 0.08) 1px, transparent 1px);
      background-size: 64px 64px;
      opacity: 0.34;
    }

    .tessera-wordmark {
      position: absolute;
      left: 28px;
      bottom: 28px;
      z-index: 1;
      color: var(--bone);
    }

    .tessera-wordmark span {
      display: block;
      margin-bottom: 8px;
      color: var(--teal);
      font-weight: 500;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      font-size: 0.82rem;
    }

    .tessera-wordmark strong {
      font-family: "Inter", Arial, sans-serif;
      font-size: 4rem;
      font-weight: 600;
      line-height: 1;
    }

    .tessera-copy h2 {
      margin-bottom: 22px;
      font-family: "DM Serif Display", serif;
      font-weight: 400;
      font-style: italic;
      font-size: 3.4rem;
      line-height: 1.1;
    }

    .tessera-copy p {
      color: rgba(251, 247, 237, 0.72);
      font-size: 1rem;
      line-height: 1.7;
    }

    .tessera-copy p + p {
      margin-top: 18px;
    }

    .applications {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 1px;
      background: var(--line);
      border: 1px solid var(--line);
    }

    .application {
      min-height: 250px;
      padding: 32px 28px;
      background: var(--paper);
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .application h3 {
      font-family: "DM Serif Display", serif;
      font-size: 1.4rem;
      font-weight: 400;
      font-style: normal;
      line-height: 1.2;
    }

    .application p {
      color: var(--muted);
      font-size: 0.95rem;
      line-height: 1.65;
    }

    .application span {
      color: #3d6070;
      font-weight: 600;
      font-size: 0.78rem;
      letter-spacing: 0.08em;
    }

    .closing {
      min-height: 74vh;
      display: grid;
      align-items: center;
      color: var(--bone);
      background:
        linear-gradient(90deg, rgba(17, 22, 26, 0.9), rgba(17, 22, 26, 0.55), rgba(17, 22, 26, 0.84)),
        url("../images/hero/rockycoast.jpg") center/cover no-repeat;
    }

    .closing h2 {
      max-width: 860px;
      margin-bottom: 24px;
      font-family: "DM Serif Display", serif;
      font-weight: 400;
      font-style: italic;
      font-size: 3.8rem;
      line-height: 1.1;
    }

    .closing p {
      max-width: 580px;
      margin-bottom: 34px;
      color: rgba(251, 247, 237, 0.76);
      font-size: 1rem;
      line-height: 1.7;
    }

    .footer {
      padding: 34px 0;
      background: var(--ink);
      color: rgba(251, 247, 237, 0.64);
      font-size: 0.9rem;
    }

    .footer-inner {
      display: flex;
      justify-content: space-between;
      gap: 24px;
      border-top: 1px solid rgba(251, 247, 237, 0.14);
      padding-top: 24px;
    }

    .footer-links {
      display: flex;
      flex-wrap: wrap;
      gap: 20px;
    }

    .reveal {
      opacity: 0;
      transform: translateY(26px);
      transition: opacity 700ms ease, transform 700ms ease;
    }

    .reveal.visible {
      opacity: 1;
      transform: translateY(0);
    }

    @media (max-width: 980px) {
      .hero h1 {
        font-size: 4.7rem;
      }

      .hero-footer,
      .section-header,
      .logic,
      .founder-proof,
      .tessera,
      .applications {
        grid-template-columns: 1fr;
      }

      #requirements .section-header .section-label {
        order: -1;
        justify-self: start;
        text-align: left;
      }

      .logic-step,
      .logic-step:last-child {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
      }

      .logic-step:last-child {
        border-bottom: 0;
      }

      .hero-footer {
        row-gap: 28px;
      }

      .hero-footnote {
        grid-column: auto;
        max-width: 640px;
      }

      .applications,
      .founder-proof {
        gap: 1px;
      }

      .section-title,
      .image-band h2,
      .tessera-copy h2,
      .closing h2 {
        font-size: 3rem;
      }
    }

    @media (max-width: 720px) {
      :root {
        --pad: 18px;
        --nav: 68px;
      }

      .nav-toggle {
        display: inline-flex;
      }

      .nav-links {
        display: none;
        flex: none;
        justify-content: stretch;
        align-items: stretch;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 30;
        flex-direction: column;
        gap: 0;
        padding: 8px var(--pad) 16px;
        margin: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid rgba(251, 247, 237, 0.12);
      }

      .nav-links li {
        width: 100%;
      }

      .nav-links a {
        display: block;
        padding: 14px 10px;
        border-radius: 8px;
      }

      .nav.is-open .nav-links {
        display: flex;
      }

      .brand img {
        width: 40px;
      }

      .brand-name {
        font-size: 0.86rem;
      }

      .brand-subtitle {
        font-size: 0.62rem;
      }

      .nav .btn {
        min-height: 40px;
        padding: 0 14px;
      }

      .hero-body {
        justify-content: end;
        padding-top: calc(var(--nav) + 32px);
        padding-bottom: 42px;
      }

      .hero h1 {
        font-size: 3.5rem;
      }

      .hero-copy {
        font-size: 1.02rem;
      }

      .hero-footer {
        margin-top: 36px;
      }

      .hero-intro {
        padding: 20px 0 14px;
        background: linear-gradient(180deg, rgba(17, 22, 26, 0.52) 0%, rgba(17, 22, 26, 0.18) 100%);
      }

      .hero-footnote {
        min-height: auto;
        padding: 0 0 22px;
        border-bottom: 1px solid rgba(251, 247, 237, 0.12);
      }

      .hero-footnote:last-child {
        padding-bottom: 0;
        border-bottom: 0;
      }

      .hero-footnote strong {
        font-size: 1.28rem;
      }

      .hero-scroll {
        margin-top: 46px;
      }

      .section {
        padding: 76px 0;
      }

      .section-title,
      .image-band h2,
      .tessera-copy h2,
      .closing h2 {
        font-size: 2.35rem;
      }

      .image-band {
        min-height: 560px;
      }

      .proof-card {
        min-height: auto;
      }

      .tessera-visual {
        min-height: 410px;
      }

      .tessera-wordmark strong {
        font-size: 3rem;
      }

      .footer-inner {
        flex-direction: column;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      html {
        scroll-behavior: auto;
      }

      *, *::before, *::after {
        transition-duration: 1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
      }

      .reveal {
        opacity: 1;
        transform: none;
      }
    }