/* layout.css — nav pill + burger + menu overlay, shell/section primitives, hero base visuals, manifesto band, footer */
    /* ---------- floating pill nav ---------- */
    .nav-wrap {
      position: fixed;
      top: 1.25rem;
      left: 50%;
      transform: translateX(-50%);
      z-index: 40;
      width: min(42rem, calc(100vw - 2rem));
      /* Hyprland-style entrance: the topbar opens from a narrow centered pill and
         expands purely horizontally to full width on load. "both" holds the
         collapsed start until the animation begins (async layout.css). */
      animation: nav-in 0.7s var(--ease-spring) both;
    }
    @keyframes nav-in {
      from {
        width: 3rem;
        opacity: 0;
      }
      to {
        width: min(42rem, calc(100vw - 2rem));
        opacity: 1;
      }
    }
    .nav {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      padding: 0.55rem 0.55rem 0.55rem 1.15rem;
      border-radius: 999px;
      background: var(--glass-bg);
      -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
      backdrop-filter: var(--glass-blur) var(--glass-saturate);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 12px 40px rgba(0, 0, 0, 0.35);
      border: 1px solid var(--hairline);
    }
    .nav-logo {
      font-family: var(--font-mono);
      font-weight: 500;
      font-size: 0.95rem;
      letter-spacing: -0.01em;
      transition: color 0.4s var(--ease-out);
    }
    .nav-logo span { color: var(--neon); }
    .nav-links {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      list-style: none;
    }
    .nav-link {
      position: relative;
      padding: 0.45rem 0.85rem;
      font-size: 0.9rem;
      color: var(--ink-muted);
      border-radius: 999px;
      transition: color 0.4s var(--ease-out);
    }
    .nav-link::after {
      content: "";
      position: absolute;
      left: 0.85rem;
      right: 0.85rem;
      bottom: 0.32rem;
      height: 1px;
      background: var(--neon);
      transform: scaleX(0);
      transform-origin: left;
      transition: transform 0.45s var(--ease-heavy);
    }
    .nav-link:hover { color: var(--ink); }
    .nav-link:hover::after { transform: scaleX(1); }
    .nav-link.active { color: var(--ink); }
    .nav-link.active::after { transform: scaleX(1); }
    /* grouped state: while hovering the nav, only the hovered link keeps its underline */
    .nav:hover .nav-link.active:not(:hover)::after {
      transform: scaleX(0);
    }
    .nav-cta {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4rem 0.45rem 0.4rem 1rem;
      border-radius: 999px;
      background: var(--ink);
      color: var(--ink-on-neon);
      font-weight: 500;
      font-size: 0.88rem;
      transition: transform 0.45s var(--ease-heavy);
    }
    .nav-cta i {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 1.65rem;
      height: 1.65rem;
      border-radius: 999px;
      background: rgba(22, 22, 30, 0.08);
      font-style: normal;
      font-size: 0.8rem;
      transition: transform 0.45s var(--ease-spring), background-color 0.4s var(--ease-out);
    }
    .nav-cta:hover { transform: scale(1.03); }
    .nav-cta:hover i { transform: translate(2px, -2px); background: rgba(22, 22, 30, 0.16); }
    .nav-cta:active { transform: scale(0.97); }

    /* hamburger (mobile) */
    .burger {
      display: none;
      flex-direction: column;
      justify-content: center;
      gap: 5px;
      width: 2.75rem;
      height: 2.75rem;
      border-radius: 999px;
      background: rgba(230, 237, 240, 0.06);
      align-items: center;
    }
    .burger i {
      display: block;
      width: 1.05rem;
      height: 1.5px;
      background: var(--ink);
      transition: transform 0.5s var(--ease-heavy);
    }
    .menu-open .burger i:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
    .menu-open .burger i:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

    /* fullscreen glass menu overlay */
    .menu-overlay {
      position: fixed;
      inset: 0;
      z-index: 30;
      background: rgba(26, 27, 38, 0.86);
      -webkit-backdrop-filter: blur(24px);
      backdrop-filter: blur(24px);
      display: none;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 1rem;
      padding: 0 var(--pad-x);
    }
    .menu-open .menu-overlay { display: flex; }
    .menu-overlay a {
      font-size: clamp(2.2rem, 9vw, 3.4rem);
      font-weight: 700;
      letter-spacing: -0.01em;
      line-height: 1.25;
      padding: 0.35rem 0;
      color: var(--ink);
      opacity: 0;
      transform: translateY(2.5rem);
      transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out), color 0.3s;
    }
    .menu-open .menu-overlay a { opacity: 1; transform: translateY(0); }
    .menu-open .menu-overlay a:nth-child(1) { transition-delay: 0.08s; }
    .menu-open .menu-overlay a:nth-child(2) { transition-delay: 0.16s; }
    .menu-open .menu-overlay a:nth-child(3) { transition-delay: 0.24s; }
    .menu-open .menu-overlay a:nth-child(4) { transition-delay: 0.32s; }
    .menu-overlay a:hover { color: var(--neon); }
    .menu-overlay a.active { color: var(--neon); }

    @media (max-width: 767px) {
      .nav-links { display: none; }
      .burger { display: flex; }
    }

    /* ---------- layout primitives ---------- */
    section { padding: clamp(6rem, 12vh, 11rem) var(--pad-x); }
    .shell { max-width: 78rem; margin: 0 auto; }

    h2.section-title {
      font-size: clamp(2rem, 5vw, 3.4rem);
      font-weight: 700;
      letter-spacing: -0.015em;
      line-height: 1.05;
      max-width: 18ch;
    }
    .section-lede {
      color: var(--ink-muted);
      max-width: 52ch;
      margin-top: 1.25rem;
      font-size: 1.05rem;
    }
    .section-head { margin-bottom: clamp(3rem, 6vh, 5rem); }

    /* ---------- hero ---------- */
    .hero {
      min-height: 100dvh;
      display: flex;
      align-items: center;
      padding-top: 7rem;
      position: relative;
      overflow: hidden;
    }
    /* blueprint grid, hero only */
    .hero::after {
      content: "";
      position: absolute;
      inset: 0;
      background-image:
        linear-gradient(rgba(122, 162, 247, 0.11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(122, 162, 247, 0.11) 1px, transparent 1px);
      background-size: 44px 44px;
      -webkit-mask-image: radial-gradient(80% 70% at 60% 38%, #000 0%, transparent 100%);
      mask-image: radial-gradient(80% 70% at 60% 38%, #000 0%, transparent 100%);
      pointer-events: none;
    }
    .hero-inner { position: relative; width: 100%; }
    .hero h1 {
      font-size: clamp(3rem, 8vw, 6.5rem);
      font-weight: 700;
      letter-spacing: -0.015em;
      line-height: 1.02;
      max-width: 16ch;
    }
    .hero h1 em { font-style: italic; color: var(--magenta); }
    .hero-sub {
      margin-top: 2rem;
      color: var(--ink-muted);
      font-size: clamp(1rem, 1.6vw, 1.2rem);
      max-width: 46ch;
    }
    /* typing effect: bar cursor sits after the typed line, blinks when done */
    .type-cursor {
      display: inline-block;
      width: 2px;
      height: 1.05em;
      margin-left: 0.15em;
      vertical-align: text-bottom;
      background: var(--neon);
    }
    .type-cursor.done { animation: blink 1.1s steps(1) infinite; }
    @keyframes blink {
      0%, 49% { opacity: 1; }
      50%, 100% { opacity: 0; }
    }
    .hero-actions {
      margin-top: 2.75rem;
      display: flex;
      flex-wrap: wrap;
      gap: 0.9rem;
      align-items: center;
    }
    .btn-primary {
      display: inline-flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0.55rem 0.6rem 0.55rem 1.5rem;
      border-radius: 999px;
      background: var(--neon);
      color: var(--ink-on-neon);
      font-weight: 500;
      font-size: 1rem;
      transition: transform 0.5s var(--ease-spring), background-color 0.4s var(--ease-out);
    }
    .btn-primary i {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 2.1rem;
      height: 2.1rem;
      border-radius: 999px;
      background: rgba(22, 22, 30, 0.14);
      font-style: normal;
      transition: transform 0.5s var(--ease-spring);
    }
    .btn-primary:hover { transform: scale(1.03); background: #89ddff; }
    .btn-solo { padding-right: 1.5rem; } /* text-only variant, no icon chip */
    .btn-primary:hover i { transform: translate(2px, -2px); }
    .btn-primary:active { transform: scale(0.97); }

    .btn-ghost {
      display: inline-flex;
      align-items: center;
      gap: 0.55rem;
      padding: 0.8rem 1.5rem;
      border-radius: 999px;
      border: 1px solid var(--hairline-strong);
      color: var(--ink-muted);
      font-size: 1rem;
      transition: color 0.4s var(--ease-out), border-color 0.4s var(--ease-out), transform 0.5s var(--ease-spring);
    }
    .btn-ghost:hover { color: var(--ink); border-color: var(--ink-faint); transform: translateY(-2px); }
    .btn-ghost:active { transform: scale(0.98); }

    /* ---------- runtime handoff / about band ---------- */
    .manifesto {
      border-top: 1px solid var(--hairline);
      border-bottom: 1px solid var(--hairline);
      background:
        radial-gradient(90% 130% at 85% 20%, color-mix(in srgb, var(--neon) 9%, transparent) 0%, transparent 55%),
        var(--bg-raised);
      min-height: 100dvh;
      display: flex;
      align-items: center;
      padding-block: 0;
    }
    .manifesto .shell { width: 100%; }
    .manifesto-grid {
      display: grid;
      grid-template-columns: 1.2fr 0.8fr;
      gap: clamp(1.5rem, 3vw, 3rem);
      align-items: center;
    }
    .manifesto-copy {
      display: flex;
      flex-direction: column;
      gap: clamp(1.25rem, 2.5vw, 2rem);
    }
    .manifesto-command {
      display: inline-flex;
      align-items: center;
      gap: 0.7rem;
      width: fit-content;
      color: var(--ink-faint);
      font-family: var(--font-mono);
      font-size: 0.72rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }
    .manifesto-command::before {
      content: ">";
      color: var(--neon);
      font-size: 1rem;
    }
    .manifesto-command i {
      width: 0.42rem;
      height: 0.9rem;
      background: var(--neon);
      animation: manifesto-caret 1.1s steps(1) infinite;
    }
    @keyframes manifesto-caret {
      0%, 48% { opacity: 1; }
      49%, 100% { opacity: 0; }
    }
    .manifesto-heading {
      display: grid;
      gap: 0.55rem;
    }
    .manifesto-kicker {
      color: var(--neon);
      font-family: var(--font-mono);
      font-size: 0.72rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }
    .manifesto-heading h2 {
      font-size: clamp(2.8rem, 6vw, 5.8rem);
      line-height: 0.98;
      letter-spacing: -0.035em;
    }
    .manifesto-heading h2 em {
      color: var(--magenta);
      font-style: italic;
    }
    .manifesto blockquote {
      max-width: 25ch;
      padding-left: 1.1rem;
      border-left: 1px solid var(--neon);
      font-size: clamp(1.25rem, 2.4vw, 1.75rem);
      font-weight: 500;
      letter-spacing: -0.015em;
      line-height: 1.42;
    }
    .manifesto blockquote em { font-style: italic; color: var(--magenta); }
    .manifesto-body {
      display: grid;
      max-width: 54ch;
    }
    .manifesto-body p {
      color: var(--ink-muted);
      font-size: 1rem;
      line-height: 1.7;
    }
    .manifesto-panel {
      position: relative;
      padding: clamp(1rem, 2vw, 1.4rem);
      border-radius: 1.25rem;
      background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 2%, transparent), color-mix(in srgb, var(--neon) 5%, transparent));
      border: 1px solid var(--hairline-strong);
      box-shadow: var(--glass-shadow);
      overflow: hidden;
    }
    .manifesto-panel::before {
      content: "";
      position: absolute;
      inset: 0 auto auto 0;
      width: 100%;
      height: 2px;
      background: linear-gradient(90deg, transparent, var(--neon), transparent);
      opacity: 0.8;
    }
    .panel-head {
      display: flex;
      justify-content: space-between;
      gap: 0.75rem;
      margin-bottom: 1rem;
    }
    .panel-tag {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      border: 1px solid var(--hairline-strong);
      background: rgba(122, 162, 247, 0.08);
      color: var(--ink);
      font-family: var(--font-mono);
      font-size: 0.68rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding: 0.42rem 0.7rem;
    }
    .panel-tag-alt { color: var(--magenta); }
    .runtime-window {
      border: 1px solid var(--hairline-strong);
      border-radius: 0.9rem;
      background: color-mix(in srgb, var(--bg) 82%, transparent);
      overflow: hidden;
    }
    .runtime-bar,
    .runtime-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      font-family: var(--font-mono);
      font-size: 0.68rem;
      letter-spacing: 0.06em;
      color: var(--ink-faint);
    }
    .runtime-bar {
      justify-content: flex-start;
      padding: 0.8rem 0.9rem;
      border-bottom: 1px solid var(--hairline);
    }
    .runtime-dot {
      width: 0.42rem;
      height: 0.42rem;
      border-radius: 50%;
      background: var(--hairline-strong);
    }
    .runtime-dot:first-child { background: var(--red); }
    .runtime-dot:nth-child(2) { background: var(--magenta); }
    .runtime-dot:nth-child(3) { background: var(--neon); }
    .runtime-trace {
      display: grid;
      gap: 0;
      list-style: none;
      padding: 0.7rem 0;
    }
    .runtime-trace li {
      display: grid;
      grid-template-columns: 2rem 5.5rem 1fr;
      align-items: baseline;
      gap: 0.65rem;
      padding: 0.78rem 0.9rem;
      border-bottom: 1px solid var(--hairline);
      opacity: 0;
      transform: translateX(1rem);
      animation: trace-enter 0.7s var(--ease-out) forwards;
    }
    .runtime-trace li:nth-child(1) { animation-delay: 0.12s; }
    .runtime-trace li:nth-child(2) { animation-delay: 0.2s; }
    .runtime-trace li:nth-child(3) { animation-delay: 0.28s; }
    .runtime-trace li:nth-child(4) { animation-delay: 0.36s; border-bottom: 0; }
    @keyframes trace-enter {
      to { opacity: 1; transform: translateX(0); }
    }
    .trace-index,
    .trace-key {
      font-family: var(--font-mono);
      font-size: 0.68rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--ink-faint);
    }
    .trace-key { color: var(--neon); }
    .runtime-trace strong {
      color: var(--ink);
      font-size: 0.95rem;
      font-weight: 500;
      line-height: 1.35;
    }
    .runtime-footer {
      padding: 0.8rem 0.9rem;
      border-top: 1px solid var(--hairline);
    }
    .runtime-footer i {
      display: inline-block;
      width: 0.42rem;
      height: 0.42rem;
      margin-right: 0.35rem;
      border-radius: 50%;
      background: var(--neon);
      vertical-align: 1px;
    }

    @media (max-width: 767px) {
      .manifesto-grid {
        grid-template-columns: 1fr;
      }
      .manifesto {
        min-height: auto;
        padding-block: clamp(5rem, 12vh, 8rem);
      }
      .manifesto blockquote {
        max-width: none;
      }
      .manifesto-body p {
        font-size: 0.98rem;
      }
      .manifesto-heading h2 { font-size: clamp(2.7rem, 13vw, 4.8rem); }
      .runtime-trace li {
        grid-template-columns: 1.8rem 1fr;
        gap: 0.3rem 0.6rem;
      }
      .trace-key { grid-column: 2; grid-row: 1; }
      .runtime-trace strong { grid-column: 2; grid-row: 2; }
      .runtime-footer { align-items: flex-start; flex-direction: column; gap: 0.3rem; }
    }

    /* ---------- footer CTA ---------- */
    .footer {
      position: relative;
      min-height: 100dvh;
      display: flex;
      align-items: center; /* vertically center the CTA content block */
      padding: 0 var(--pad-x) 6rem; /* bottom room so the base sits below the centered content */
    }
    .footer-inner {
      width: 100%;
      max-width: 60rem;
      margin: 0 auto;
    }
    .footer-kicker {
      font-family: var(--font-mono);
      color: var(--ink-muted);
      font-size: 0.95rem;
      letter-spacing: 0.021em;
      margin-bottom: 1rem;
    }
    .footer h2 {
      font-size: clamp(2.8rem, 7.5vw, 5.6rem);
      font-weight: 700;
      letter-spacing: -0.015em;
      line-height: 1.05;
      margin-bottom: 1.6rem;
    }
    .footer h2 em { font-style: italic; color: var(--neon); }
    .footer-mail {
      display: inline-flex;
      align-items: center;
      gap: 0.6rem;
      margin-top: 1.5rem;
      padding: 0.6rem 0.8rem 0.6rem 1.6rem;
      border-radius: 10px;
      background: var(--ink);
      color: var(--ink-on-neon);
      font-weight: 600;
      font-size: clamp(1rem, 2vw, 1.15rem);
      transition: transform 0.5s var(--ease-spring);
    }
    .footer-mail i {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 2.3rem;
      height: 2.3rem;
      border-radius: 8px;
      background: rgba(22, 22, 30, 0.08);
      font-style: normal;
      transition: transform 0.5s var(--ease-spring), background-color 0.4s var(--ease-out);
    }

    /* ---------- live workbench status strip ---------- */
    .footer-status {
      margin-top: 0;
      padding-top: 0;
      margin-bottom: 1.4rem;
      max-width: 26rem;
      font-family: var(--font-mono);
      font-size: 0.85rem;
      color: var(--ink-muted);
      line-height: 1.9;
    }
    .footer-status p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .footer-status .tag {
      display: inline-block;
      margin-left: 0.4rem;
      padding: 0.1rem 0.45rem;
      border-radius: 2px;
      background: rgba(122, 162, 247, 0.12);
      color: var(--neon);
      font-size: 0.78rem;
    }
    .footer-status .segs { display: inline-flex; gap: 2px; margin-left: 0.6rem; vertical-align: 1px; }
    .footer-status .segs i { width: 8px; height: 12px; border-radius: 1px; background: var(--hairline-strong); }
    .footer-status .segs i.on { background: var(--neon); }
    .footer-status .reach { color: var(--neon); }
    .footer-status .dim { color: var(--ink-faint); }
    /* Workbench echo line — accepted live variant: shell prompt + blinking block caret */
    .footer-status .ws-echo .dot { display: none; }
    .footer-status .ws-echo .ws-prompt { font-style: normal; color: var(--neon); margin-right: 0.55em; }
    .footer-status .ws-echo .ws-caret { font-style: normal; color: var(--neon); margin-left: 0.25em; }
    @media (prefers-reduced-motion: no-preference) {
      .footer-status .ws-echo .ws-caret { animation: ws-blink 1.06s steps(1) infinite; }
    }
    @keyframes ws-blink { 0%, 45% { opacity: 1; } 50%, 100% { opacity: 0; } }
    .footer-mail:hover { transform: scale(1.03); }
    .footer-mail:hover i { transform: translate(2px, -2px); background: rgba(22, 22, 30, 0.16); }
    .footer-mail:active { transform: scale(0.97); }
    .footer-base {
      position: absolute;
      left: var(--pad-x);
      right: var(--pad-x);
      bottom: 2rem;
      margin: 0 auto;
      max-width: 78rem;
      padding-top: 2rem;
      border-top: 1px solid var(--hairline);
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
      gap: 1rem;
      color: var(--ink-faint);
      font-size: 0.85rem;
    }
    .footer-social { display: flex; gap: 0.7rem; }
    .footer-social a {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 2.75rem;
      height: 2.75rem;
      border-radius: 999px;
      color: var(--ink-muted);
      transition: color 0.35s var(--ease-out), transform 0.45s var(--ease-spring);
    }
    .footer-social a:hover { color: var(--neon); transform: translateY(-2px); }
    .footer-social a:active { transform: scale(0.96); }

    /* ---------- theme toggle ---------- */
    .theme-toggle {
      position: fixed;
      right: 1.15rem;
      bottom: 1.15rem;
      z-index: 45; /* above the nav (40), below the modal (50) */
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 2.75rem;
      height: 2.75rem;
      border-radius: 999px;
      border: 1px solid var(--hairline-strong);
      background: rgba(31, 35, 53, 0.72);
      -webkit-backdrop-filter: blur(16px);
      backdrop-filter: blur(16px);
      color: var(--ink-muted);
      font-size: 1rem;
      line-height: 1;
      cursor: pointer;
      transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), transform 0.45s var(--ease-spring);
    }
    .theme-toggle:hover { color: var(--neon); border-color: var(--neon); transform: rotate(30deg); }
    .theme-toggle:active { transform: scale(0.94); }

    /* ---------- light theme page-surface overrides (chrome stays dark) ---------- */
    [data-theme="light"] .hero::after {
      background-image:
        linear-gradient(rgba(41, 89, 170, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(41, 89, 170, 0.16) 1px, transparent 1px);
    }
    [data-theme="light"] body {
      background-image:
        linear-gradient(rgba(41, 89, 170, 0.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(41, 89, 170, 0.09) 1px, transparent 1px);
    }
    [data-theme="light"] .btn-primary:hover { background: #1a54b8; }
    [data-theme="light"] .burger { background: rgba(52, 59, 88, 0.12); }
    [data-theme="light"] .runtime-window { background: color-mix(in srgb, var(--bg) 92%, white); }
    [data-theme="light"] .theme-toggle { background: rgba(255, 255, 255, 0.78); }
    /* light chrome: paper pill instead of dark glass */
    [data-theme="light"] .nav {
      background: rgba(252, 252, 255, 0.55);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 12px 40px rgba(52, 59, 88, 0.14);
    }
    [data-theme="light"] .menu-overlay { background: rgba(238, 240, 247, 0.9); }
    .footer-social svg { width: 1.05rem; height: 1.05rem; display: block; fill: currentColor; }

    /* ---------- mobile performance: reduce backdrop-filter cost ---------- */
    @media (max-width: 767px) {
      .nav {
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
      }
      .menu-overlay {
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
      }
      .theme-toggle {
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
      }
    }

    /* ---------- reduced motion: disable backdrop-filter transitions ---------- */
    @media (prefers-reduced-motion: reduce) {
      .nav,
      .menu-overlay,
      .theme-toggle,
      .btn-primary,
      .btn-ghost,
      .footer-mail,
      .footer-social a {
        transition: none !important;
      }
    }
