@layer reset, base, layout, components, motion;

@layer reset {
  *,
  *::before,
  *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body, h1, h2, h3, h4, p { margin: 0; }
  body { min-width: 320px; }
  a { color: inherit; text-decoration: none; }
}

@layer base {
  :root {
    --paper: #f3f1e8;
    --ink: #121612;
    --muted: #62675f;
    --line: rgba(18, 22, 18, 0.16);
    --learning: #3157ff;
    --training: #c9ff45;
    --story: #ff7a45;
    --header-height: 5rem;
    --page-pad: clamp(1.25rem, 4vw, 4.5rem);
    --content: 90rem;
    --route-progress: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
  }

  body {
    overflow-x: hidden;
    background:
      radial-gradient(circle at 84% 2%, rgba(201, 255, 69, 0.22), transparent 24rem),
      var(--paper);
  }

  ::selection { color: var(--paper); background: var(--ink); }
  :focus-visible { outline: 3px solid var(--learning); outline-offset: 5px; }

  .skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.7rem 1rem;
    transform: translateY(-150%);
    color: var(--paper);
    background: var(--ink);
    border-radius: 999px;
    transition: transform 160ms ease;
  }
  .skip-link:focus { transform: translateY(0); }

  .eyebrow,
  .path-kicker,
  .app-type,
  .status,
  .card-note,
  footer {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    line-height: 1.3;
    text-transform: uppercase;
  }

  h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.055em; }
}

@layer layout {
  .site-header {
    position: fixed;
    z-index: 20;
    inset: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--page-pad);
    border-bottom: 1px solid transparent;
    transition: background-color 180ms ease, border-color 180ms ease, backdrop-filter 180ms ease;
  }

  .site-header.is-scrolled {
    background: rgba(243, 241, 232, 0.8);
    border-color: var(--line);
    backdrop-filter: blur(18px);
  }

  .site-header nav {
    display: flex;
    gap: clamp(1rem, 2.4vw, 2.6rem);
    font-size: 0.78rem;
    font-weight: 700;
  }

  .site-header nav a { position: relative; padding: 0.6rem 0; }
  .site-header nav a::after {
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    content: "";
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 180ms ease;
  }
  .site-header nav a:hover::after,
  .site-header nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.035em;
  }

  .brand-mark {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    width: 1.7rem;
    height: 1.7rem;
    padding: 0.3rem;
    overflow: hidden;
    background: var(--ink);
    border-radius: 50%;
  }
  .brand-mark i { display: block; width: 4px; height: 4px; background: var(--paper); border-radius: 50%; }
  .brand-mark i:nth-child(2) { transform: translateY(-4px); }
  .brand-mark i:nth-child(3) { transform: translateY(3px); }

  .hero {
    position: relative;
    display: flex;
    min-height: max(42rem, 100svh);
    padding: calc(var(--header-height) + 3rem) var(--page-pad) 2rem;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
  }

  .hero-copy {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 1;
    max-width: var(--content);
    margin: 0 auto;
    flex-direction: column;
    justify-content: space-between;
  }

  .hero h1 {
    max-width: 11ch;
    margin: auto 0;
    font-size: clamp(4.2rem, 10.6vw, 10.5rem);
    line-height: 0.84;
  }
  .hero h1 span { display: block; color: transparent; -webkit-text-stroke: max(1px, 0.012em) var(--ink); }

  .hero-lower {
    display: grid;
    width: min(43rem, 64%);
    margin-left: auto;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 2.5rem;
  }

  .hero-intro { max-width: 34rem; font-size: clamp(1.05rem, 1.5vw, 1.35rem); line-height: 1.48; }
  .text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid currentColor;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
  }
  .text-link span { transition: transform 180ms ease; }
  .text-link:hover span { transform: translateY(4px); }

  .hero-foot {
    position: absolute;
    z-index: 2;
    bottom: 2rem;
    left: var(--page-pad);
    display: flex;
    width: min(12rem, 22vw);
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
  }
  .hero-foot-line { flex: 1; height: 1px; background: var(--line); }

  .hero-orbit { position: absolute; border: 1px solid rgba(18, 22, 18, 0.1); border-radius: 50%; }
  .hero-orbit::before {
    position: absolute;
    width: 0.75rem;
    height: 0.75rem;
    content: "";
    background: var(--training);
    border: 2px solid var(--ink);
    border-radius: 50%;
  }
  .hero-orbit-one { top: -18vw; right: -7vw; width: 50vw; height: 50vw; }
  .hero-orbit-one::before { top: 76%; left: 5%; }
  .hero-orbit-two { right: 6vw; bottom: -25vw; width: 40vw; height: 40vw; }
  .hero-orbit-two::before { top: 4%; right: 24%; background: var(--story); }

  .journey { max-width: var(--content); margin: 0 auto; padding: clamp(7rem, 13vw, 13rem) var(--page-pad); }
  .section-intro {
    display: grid;
    margin-bottom: clamp(8rem, 14vw, 15rem);
    grid-template-columns: 1fr 3fr;
    gap: 2rem;
  }
  .section-intro h2 { max-width: 15ch; font-size: clamp(2.8rem, 6.8vw, 7rem); line-height: 0.95; }

  .route { position: relative; }
  .route-line {
    position: absolute;
    z-index: 0;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    overflow: hidden;
    background: var(--line);
  }
  .route-progress {
    position: absolute;
    inset: 0;
    background: var(--ink);
    transform: scaleY(var(--route-progress));
    transform-origin: top;
  }

  .path-stop {
    --accent: var(--learning);
    position: relative;
    display: grid;
    min-height: 49rem;
    padding: 3rem 0 10rem;
    grid-template-columns: 1fr 1fr;
    gap: clamp(4rem, 9vw, 10rem);
    align-items: start;
  }
  .path-stop:last-child { padding-bottom: 2rem; }
  .path-stop.training { --accent: var(--training); }
  .path-stop.story { --accent: var(--story); }

  .route-marker {
    position: absolute;
    z-index: 3;
    top: 2.65rem;
    left: 50%;
    display: grid;
    width: 3.3rem;
    height: 3.3rem;
    border: 2px solid var(--ink);
    background: var(--paper);
    border-radius: 50%;
    place-items: center;
    transform: translateX(-50%);
    transition: background-color 220ms ease, transform 220ms ease;
  }
  .route-marker span { font-size: 0.65rem; font-weight: 800; }
  .path-stop.is-active .route-marker { background: var(--accent); transform: translateX(-50%) scale(1.08); }

  .path-heading { position: sticky; top: calc(var(--header-height) + 3rem); padding-right: 2rem; }
  .path-heading::before {
    display: block;
    width: 0.7rem;
    height: 0.7rem;
    margin-bottom: 2rem;
    content: "";
    background: var(--accent);
    border: 2px solid var(--ink);
    border-radius: 50%;
  }
  .path-heading h3 { margin: 1rem 0 2rem; font-size: clamp(2.5rem, 4.8vw, 5.4rem); line-height: 0.96; }
  .path-heading > p:last-child { max-width: 29rem; color: var(--muted); font-size: 1.05rem; line-height: 1.55; }

  .app-grid { display: grid; margin-top: 7rem; gap: 1rem; }
  .app-grid.one-up { margin-top: 11rem; }
  .app-card {
    display: flex;
    min-height: 22rem;
    padding: clamp(1.4rem, 2.5vw, 2.25rem);
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--ink);
    background: var(--accent);
    border-radius: 0.4rem;
    box-shadow: 0 0 0 var(--ink);
    transition: transform 180ms ease, box-shadow 180ms ease;
  }
  .app-card:hover { box-shadow: 0.7rem 0.7rem 0 var(--ink); transform: translate(-0.35rem, -0.35rem); }
  .app-card.card-dark { color: var(--paper); background: var(--ink); }
  .app-card.card-story {
    background:
      radial-gradient(circle at 82% 18%, rgba(243, 241, 232, 0.7) 0 0.55rem, transparent 0.62rem),
      radial-gradient(circle at 82% 18%, transparent 0 4rem, rgba(18, 22, 18, 0.15) 4.05rem 4.1rem, transparent 4.16rem),
      var(--story);
  }
  .app-card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .app-symbol {
    display: grid;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 800;
    place-items: center;
  }
  .status { padding: 0.45rem 0.65rem; border: 1px solid currentColor; border-radius: 999px; letter-spacing: 0.06em; }
  .app-card h4 { max-width: 11ch; margin-top: 0.65rem; font-size: clamp(1.8rem, 3vw, 3.2rem); line-height: 1; }
  .app-type { letter-spacing: 0.07em; }
  .card-note { max-width: 25rem; letter-spacing: 0.04em; line-height: 1.5; text-transform: none; }

  .approach {
    display: grid;
    padding: clamp(6rem, 12vw, 12rem) var(--page-pad);
    color: var(--paper);
    background: var(--ink);
    grid-template-columns: minmax(0, 1.2fr) minmax(20rem, 0.8fr);
    gap: clamp(4rem, 10vw, 12rem);
  }
  .approach-lead h2 { max-width: 10ch; margin: 1rem 0 2rem; font-size: clamp(3rem, 7vw, 7.5rem); line-height: 0.92; }
  .approach-lead > p:last-child {
    max-width: 38rem;
    color: rgba(243, 241, 232, 0.68);
    font-size: clamp(1.05rem, 1.45vw, 1.3rem);
    line-height: 1.55;
  }
  .principles { margin: 0; padding: 0; list-style: none; align-self: end; }
  .principles li {
    display: grid;
    padding: 1.6rem 0;
    border-top: 1px solid rgba(243, 241, 232, 0.2);
    grid-template-columns: 3rem 1fr;
    gap: 1rem;
  }
  .principles li:last-child { border-bottom: 1px solid rgba(243, 241, 232, 0.2); }
  .principles li > span { color: var(--training); font-size: 0.68rem; font-weight: 800; }
  .principles h3 { margin-bottom: 0.35rem; font-size: 1.5rem; letter-spacing: -0.03em; }
  .principles p { color: rgba(243, 241, 232, 0.6); line-height: 1.5; }

  .contact {
    position: relative;
    display: grid;
    min-height: 42rem;
    padding: clamp(6rem, 12vw, 12rem) var(--page-pad);
    overflow: hidden;
    background: var(--training);
    place-items: center;
    text-align: center;
  }
  .contact > div:not(.contact-mark) { position: relative; z-index: 2; }
  .contact h2 { max-width: 13ch; margin: 1rem auto 1.7rem; font-size: clamp(3rem, 7.2vw, 7.5rem); line-height: 0.92; }
  .contact p:not(.eyebrow) { max-width: 38rem; margin: 0 auto; font-size: clamp(1.05rem, 1.4vw, 1.25rem); line-height: 1.55; }
  .button {
    display: inline-flex;
    margin-top: 2.5rem;
    padding: 1rem 1.3rem;
    align-items: center;
    gap: 3rem;
    color: var(--paper);
    background: var(--ink);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 750;
    transition: gap 180ms ease, transform 180ms ease;
  }
  .button:hover { gap: 3.6rem; transform: translateY(-2px); }
  .contact-mark {
    position: absolute;
    inset: 50% auto auto 50%;
    width: min(80vw, 60rem);
    aspect-ratio: 1;
    border: 1px solid rgba(18, 22, 18, 0.13);
    border-radius: 50%;
    transform: translate(-50%, -50%);
  }
  .contact-mark::before,
  .contact-mark::after {
    position: absolute;
    inset: 15%;
    content: "";
    border: 1px solid rgba(18, 22, 18, 0.13);
    border-radius: 50%;
  }
  .contact-mark::after { inset: 32%; }
  .contact-mark span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.75rem;
    height: 0.75rem;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 50%;
  }
  .contact-mark span:nth-child(1) { transform: translate(-24rem, -8rem); }
  .contact-mark span:nth-child(2) { transform: translate(19rem, 9rem); }
  .contact-mark span:nth-child(3) { transform: translate(-2rem, 23rem); }

  footer {
    display: grid;
    padding: 2.25rem var(--page-pad);
    align-items: center;
    background: var(--paper);
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    letter-spacing: 0.04em;
  }
  footer > div { display: flex; justify-content: flex-end; gap: 2rem; }
  footer a:not(.brand) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
  .footer-brand { text-transform: none; }
}

@layer motion {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .js [data-reveal].is-visible { opacity: 1; transform: translateY(0); }
  .hero-orbit-one { animation: drift 18s ease-in-out infinite alternate; }
  .hero-orbit-two { animation: drift-reverse 22s ease-in-out infinite alternate; }
  @keyframes drift { to { transform: translate(-2rem, 1.2rem) rotate(8deg); } }
  @keyframes drift-reverse { to { transform: translate(1.4rem, -1.6rem) rotate(-10deg); } }
}

@media (max-width: 800px) {
  :root { --header-height: 4.25rem; }
  .site-header nav { gap: 1rem; }
  .site-header nav a:nth-child(2) { display: none; }
  .hero { min-height: 48rem; padding-top: calc(var(--header-height) + 2.5rem); }
  .hero h1 { margin: 18vh 0 auto; font-size: clamp(4rem, 18.5vw, 7rem); }
  .hero-lower { width: 100%; margin-top: 4rem; padding-left: 18%; grid-template-columns: 1fr; align-items: start; gap: 1.5rem; }
  .hero-foot { display: none; }
  .hero-orbit-one { top: 15%; right: -38vw; width: 90vw; height: 90vw; }
  .hero-orbit-two { right: auto; bottom: -18vw; left: -30vw; width: 70vw; height: 70vw; }
  .section-intro { grid-template-columns: 1fr; }
  .route-line { left: 1.6rem; }
  .path-stop { min-height: 0; padding: 2rem 0 9rem 5rem; grid-template-columns: 1fr; gap: 3rem; }
  .route-marker { top: 1.7rem; left: 1.6rem; }
  .path-heading { position: static; padding: 0; }
  .path-heading::before { display: none; }
  .app-grid, .app-grid.one-up { margin-top: 0; }
  .app-card { min-height: 19rem; }
  .approach { grid-template-columns: 1fr; }
  .contact-mark span { display: none; }
  footer { grid-template-columns: 1fr; }
  footer > div { justify-content: flex-start; }
}

@media (max-width: 520px) {
  .site-header nav a:first-child { display: none; }
  .hero-lower { padding-left: 0; }
  .journey { padding-right: 1rem; padding-left: 1rem; }
  .path-stop { padding-left: 4.35rem; }
  .route-line, .route-marker { left: 1.25rem; }
  .app-card:hover { box-shadow: 0.35rem 0.35rem 0 var(--ink); }
  .contact { min-height: 38rem; }
  footer > div { flex-direction: column; gap: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
