/* Shell: floating pill nav, dark footer, Send-a-note dialog, contact panel, lead form. */

/* ---- Pill nav ---- */
.nav-wrap { position: fixed; top: calc(var(--gutter) + 18px); left: 0; right: 0; display: flex; justify-content: center; z-index: 50; pointer-events: none; }
.pill-nav { pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px; background: rgb(28 28 28 / .72); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); border: 1px solid var(--line-inv); color: #fff; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.pill-nav a { -webkit-tap-highlight-color: transparent; }
.pill-nav a:focus-visible { border-radius: 999px; outline-offset: 2px; }
.pill-brand { display: flex; align-items: center; gap: 10px; padding-right: 10px; color: #fff; text-decoration: none; border-radius: 999px; }
.pill-brand .brand-mark { width: 36px; height: 36px; flex: none; }
.pill-brand span { font: 400 19px/1 var(--serif); letter-spacing: -0.01em; text-transform: none; white-space: nowrap; }
.pill-sep { width: 1px; height: 18px; background: var(--line-inv); flex: none; }
.pill-links { position: relative; display: flex; align-items: center; }
.pill-links a { position: relative; z-index: 1; padding: 12px 16px; border-radius: 999px; color: var(--muted-inv); text-decoration: none; transition: color 160ms ease; }
.pill-links a[aria-current="page"] { color: #fff; }
/* M7: spans the link group and is clipped down to one link by js/nav.js; invisible until then and without JS. */
.pill-indicator { position: absolute; inset: 0; border-radius: 999px; background: rgb(255 255 255 / .1); opacity: 0; pointer-events: none; }
.pill-indicator.is-ready { transition: clip-path 220ms var(--ease-out), opacity 160ms ease; }
.pill-cta { display: inline-flex; align-items: center; padding: 12px 18px; border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .pill-links a:hover { color: #fff; }
  .pill-cta:hover { background: var(--tile-grey); }
}
/* M8: past 80px the pill tightens; scrolling down tucks the bar above the viewport (exit quicker than return). */
.nav-wrap { transition: transform 300ms var(--ease-out); }
.nav-wrap.is-hidden { transform: translateY(calc(-100% - var(--gutter) - 24px)); transition-duration: 220ms; }
.pill-nav { transition: transform 250ms var(--ease-out); }
.nav-wrap.is-compact .pill-nav { transform: scale(.96); }
@media (prefers-reduced-motion: reduce) {
  .nav-wrap.is-compact .pill-nav { transform: none; }
  .pill-indicator.is-ready { transition: opacity 160ms ease; }
}
@media (max-width: 640px) {
  .pill-nav { max-width: calc(100vw - 32px); }
  .pill-brand { padding-right: 0; }
  .pill-brand span { display: none; }
  .pill-links a { padding-inline: 13px; }
  .pill-cta { padding-inline: 16px; }
}

/* ---- Pressables (M18) ---- */
.button, .pill-cta, .submit-action, .note-close { transition: transform 140ms var(--ease-out), background-color 160ms ease; -webkit-tap-highlight-color: transparent; }
:is(.button, .pill-cta, .submit-action, .note-close):active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) {
  :is(.button, .pill-cta, .submit-action, .note-close):active { transform: none; }
}

/* ---- M11: cursor label over [data-cursor] targets (js/cursor.js; fine pointers only, created by JS) ---- */
/* Position is the `translate` property (JS); `scale` pops it in about its own centre. */
.cursor-label { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 70; padding: 8px 12px; border-radius: 999px; background: #fff; color: var(--ink); white-space: nowrap; opacity: 0; scale: .9; transition: opacity 120ms ease, scale 120ms var(--ease-out); }
.cursor-label.is-on { opacity: 1; scale: 1; transition-duration: 160ms; }

/* ---- Footer ---- */
/* Full-bleed to the bottom and sides like the top panels; the gutter moves into the side padding. */
.site-footer { margin: var(--gutter) 0 0; background: var(--ink-2); color: #fff; padding: clamp(28px, 4vw, 56px) calc(var(--gutter) + clamp(28px, 4vw, 56px)); overflow: hidden; }
/* Contact's panel is the same ink: a hairline instead of a white strip between the two. */
.page-contact .site-footer { margin-top: 0; border-top: 1px solid var(--line-inv); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 40px 32px; }
.site-footer p { margin: 0; }
.footer-intro { display: grid; align-content: start; gap: 12px; }
.footer-clock { color: var(--muted-inv); font-variant-numeric: tabular-nums; }
/* M22: js/clock.js turns the time into four digit reels, each a column 0..max+0 inside a one-line window. */
.reels { display: inline-flex; vertical-align: top; -webkit-user-select: none; user-select: none; }
.reel { display: block; height: 1lh; overflow: clip; }
.reel > span { display: block; transition: transform 300ms var(--ease-out); }
.reel i { display: block; height: 1lh; font-style: normal; }
.footer-col > .label { color: var(--muted-inv); margin-bottom: 18px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { display: inline-flex; align-items: center; gap: 6px; font: 400 16px/1.4 var(--sans); color: #fff; text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 4px; overflow-wrap: anywhere; transition: text-decoration-color 160ms ease; }
.footer-col a .icon { width: .85em; height: .85em; }
@media (hover: hover) and (pointer: fine) {
  .footer-col a:hover { text-decoration-color: currentColor; }
}
.footer-wordmark { font: 400 clamp(64px, 16vw, 260px)/.8 var(--serif); letter-spacing: -0.04em; padding-top: .14em; color: #fff; white-space: nowrap; }
/* Scoped past `.site-footer p { margin: 0 }`, which otherwise wins and glues the wordmark to the links. */
.site-footer .footer-wordmark { margin-top: clamp(32px, 4vw, 48px); }
/* line-height .8 lets the ascenders rise above the line box; the padding keeps them clear of the links above. */
.footer-bottom a { color: inherit; text-underline-offset: 3px; }
.footer-legal { flex-basis: 100%; font-style: normal; }
/* One run of parts on wide screens, broken only between parts; one part per line on phones. */
.footer-legal > span { white-space: nowrap; }
.footer-legal > span:not(:last-child)::after { content: " ·"; }
.footer-legal .nobr { white-space: nowrap; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line-inv); color: var(--muted-inv); font: 400 13px/1.4 var(--mono); }
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: auto minmax(0, 1fr); column-gap: 28px; }
  .footer-intro { grid-column: 1 / -1; }
  .footer-legal > span { display: block; white-space: normal; }
  .footer-legal > span:not(:last-child)::after { content: none; }
}

/* ---- Contact page panel ---- */
.contact-panel { margin: 0; background: var(--ink-2); color: #fff; min-height: 100svh; padding: clamp(116px, 15vh, 168px) calc(var(--gutter) + clamp(24px, 4vw, 56px)) clamp(28px, 4vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px clamp(32px, 6vw, 112px); align-items: start; }
.contact-panel h1 { font-size: clamp(52px, 6.6vw, 96px); line-height: .92; letter-spacing: -0.03em; text-wrap: balance; }
.contact-lede { margin: 28px 0 0; max-width: 34ch; color: var(--muted-inv); font-size: 18px; line-height: 1.5; }
@media (max-width: 900px) {
  .contact-panel { grid-template-columns: minmax(0, 1fr); min-height: 0; }
}

/* ---- Lead form (on dark) ---- */
.lead-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
.lead-form .wide { grid-column: 1 / -1; }
.lead-form .field { display: grid; gap: 8px; align-content: start; }
.lead-form label { font: 500 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted-inv); }
.lead-form input, .lead-form textarea { width: 100%; margin: 0; appearance: none; background: rgb(255 255 255 / .06); border: 1px solid var(--line-inv); border-radius: 12px; color: #fff; font: 400 16px/1.4 var(--sans); padding: 14px 16px; caret-color: #fff; transition: border-color 160ms ease, background-color 160ms ease; }
.lead-form textarea { resize: vertical; min-height: 140px; }
.lead-form ::placeholder { color: rgb(255 255 255 / .45); opacity: 1; }
.lead-form input:focus, .lead-form textarea:focus { border-color: rgb(255 255 255 / .42); background: rgb(255 255 255 / .09); }
.lead-form input:focus-visible, .lead-form textarea:focus-visible { outline: 2px solid rgb(255 255 255 / .9); outline-offset: 2px; border-radius: 12px; }
.lead-form [aria-invalid="true"] { border-color: rgb(255 255 255 / .62); }
@media (hover: hover) and (pointer: fine) {
  .lead-form input:hover:not(:focus), .lead-form textarea:hover:not(:focus) { border-color: rgb(255 255 255 / .22); }
}
.lead-form .field-error { font: 400 12px/1.4 var(--mono); color: #fff; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lead-form .field-error:empty { display: none; }
.lead-form .field-error:not(:empty)::before { content: "✕"; display: inline-block; margin-right: .5em; text-decoration: none; }
.lead-form .trap { position: absolute; left: -9999px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 8px; }
.form-note { margin: 0; max-width: 42ch; color: var(--muted-inv); font-size: 14px; line-height: 1.5; }
.form-note a { color: #fff; }
.form-status { margin: 0; min-height: 1.4em; color: var(--muted-inv); font: 400 13px/1.4 var(--mono); }
.form-status[data-state="success"] { color: #fff; animation: rise 250ms var(--ease-out); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.form-status[data-state="error"] { color: #fff; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.form-status[data-state="error"]::before { content: "✕"; display: inline-block; margin-right: .5em; text-decoration: none; }

/* Submit (M17): label, spinner and "Sent" stack in one cell; the form's data-state picks which shows, and the swap
   cross-fades through a 2px blur so it reads as one morphing label rather than two overlapping. */
.submit-action { display: inline-grid; place-items: center; min-height: 48px; padding: 0 26px; border: 0; border-radius: 999px; background: #fff; color: var(--ink); font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.submit-action > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 8px; transition: opacity 200ms ease, filter 200ms ease, transform 200ms var(--ease-out); }
.submit-action:disabled { cursor: progress; }
.submit-action:focus-visible { border-radius: 999px; outline-offset: 3px; }
.submit-spinner, .submit-done { opacity: 0; filter: blur(2px); }
.lead-form:is([data-state="sending"], [data-state="sent"]) .submit-label { opacity: 0; filter: blur(2px); }
.lead-form[data-state="sending"] .submit-spinner, .lead-form[data-state="sent"] .submit-done { opacity: 1; filter: none; }
.submit-spinner::before { content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; }
/* Spins while visible (sending, and through its fade into "Sent"); idle it costs nothing. */
.lead-form:is([data-state="sending"], [data-state="sent"]) .submit-spinner::before { animation: spin 600ms linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
@media (hover: hover) and (pointer: fine) {
  .submit-action:hover { background: var(--tile-grey); }
}

/* ---- Send-a-note dialog ---- */
/* The scroll lock below removes the scrollbar; a stable gutter keeps the page from shifting sideways when it does. */
html { scrollbar-gutter: stable; }
html:has(.note-dialog[open]) { overflow: hidden; }
.note-dialog { border: 0; padding: 0; background: transparent; max-width: min(640px, calc(100vw - 32px)); width: 100%; max-height: calc(100dvh - 32px); overflow: visible; color: #fff; }
.note-dialog::backdrop { background: rgb(0 0 0 / .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
/* M16: the panel settles in from a slightly smaller, lower pose; js/dialog.js holds close() for 160ms so the exit
   (faster than the entrance) is seen. Modals are not anchored to a trigger, so the origin stays centred. */
.note-dialog[open] .note-panel { opacity: 1; transform: none; transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); @starting-style { opacity: 0; transform: scale(.96) translateY(8px); } }
.note-dialog[open]::backdrop { opacity: 1; transition: opacity 200ms ease; @starting-style { opacity: 0; } }
.note-dialog[data-closing] .note-panel { opacity: 0; transform: scale(.98); transition-duration: 160ms; }
.note-dialog[data-closing]::backdrop { opacity: 0; transition: opacity 160ms ease; }
.note-panel { position: relative; background: var(--ink-2); border-radius: var(--r-panel); padding: clamp(24px, 4vw, 40px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; }
.note-panel > .label { margin: 0; color: var(--muted-inv); }
.note-panel h2 { margin: 16px 0 14px; font-size: clamp(40px, 6vw, 60px); text-wrap: balance; }
.note-panel h2 + p { margin: 0 0 28px; max-width: 42ch; color: var(--muted-inv); }
.note-close { position: absolute; top: clamp(14px, 2.4vw, 22px); right: clamp(14px, 2.4vw, 22px); display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-inv); border-radius: 999px; background: transparent; color: #fff; font: 300 22px/1 var(--sans); cursor: pointer; }
.note-close:focus-visible { border-radius: 999px; }
@media (hover: hover) and (pointer: fine) {
  .note-close:hover { background: rgb(255 255 255 / .08); }
}
@media (max-width: 640px) {
  .lead-form { grid-template-columns: minmax(0, 1fr); }
  .lead-form .submit-action { width: 100%; }
}

/* Reduced motion: the dialog and the submit label only fade; the clock digits change in place. Keep this block last. */
@media (prefers-reduced-motion: reduce) {
  .note-dialog[open] .note-panel { transition: opacity 160ms ease; }
  .note-dialog[data-closing] .note-panel { transform: none; }
  .submit-action > span { filter: none !important; transition: opacity 160ms ease; }
  .reel > span { transition: none; }
  .form-status[data-state="success"] { animation: none; }
}
