/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, picture, svg { display: block; max-width: 100%; }
input, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; }

/* ---------- fonts ---------- */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/archivo-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/archivo-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0300-0301, U+0303-0304, U+0308-0309, U+1E00-1EFF;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/archivo-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/archivo-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0300-0301, U+0303-0304, U+0308-0309, U+1E00-1EFF;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/public-sans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/public-sans-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0300-0301, U+0303-0304, U+0308-0309, U+1E00-1EFF;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/public-sans-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/public-sans-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0300-0301, U+0303-0304, U+0308-0309, U+1E00-1EFF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/plex-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/plex-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0300-0301, U+0303-0304, U+0308-0309, U+1E00-1EFF;
}

/* ---------- tokens ---------- */
:root {
  --petrol-900:  #0B1A1E;
  --petrol-800:  #10262B;
  --petrol-700:  #17343A;
  --rule:        #21454C;
  --bone:        #E9E3D6;
  --bone-dim:    #94A9AC;
  --brass:       #D9A441;
  --brass-deep:  #B4832C;
  --on-track:    #4FA98A;
  --off-track:   #D0685C;

  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'Public Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --step--1: 0.8125rem;  /* 13 */
  --step-0:  0.9375rem;  /* 15 */
  --step-1:  1.0625rem;  /* 17 */
  --step-2:  1.3125rem;  /* 21 */
  --step-3:  1.75rem;    /* 28 */
  --step-4:  2.5rem;     /* 40 */
  --step-5:  clamp(2.5rem, 1.6rem + 3.6vw, 3.75rem);   /* 60 */
  --step-6:  clamp(3rem, 1.3rem + 6.8vw, 5.25rem);     /* 84 */

  --content-max: 1180px;
  --gutter: 24px;
  --section-space: 128px;
}

@media (max-width: 640px) {
  :root { --gutter: 16px; --section-space: 80px; }
}

/* ---------- base ---------- */
html { background: var(--petrol-900); color-scheme: dark; }
body {
  background: var(--petrol-900);
  color: var(--bone);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--step-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 120%;
  letter-spacing: -0.02em;
  line-height: 1.02;
  color: var(--bone);
}
h1 { font-size: var(--step-6); font-weight: 700; }
h2 { font-size: var(--step-5); font-weight: 600; font-stretch: 118%; }
h3 { font-size: var(--step-2); font-weight: 600; }

p { max-width: 62ch; }

a { text-decoration: none; }
a:hover { text-decoration: underline; }

.eyebrow, .mono {
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--step--1);
  color: var(--bone-dim);
}

.tm { font-size: 0.55em; font-weight: 400; }

.visually-hidden {
  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 {
  position: absolute;
  left: 12px; top: -60px;
  background: var(--brass);
  color: var(--petrol-900);
  padding: 10px 16px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 500;
  z-index: 100;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------- layout ---------- */
.section-inner, .nav-inner, .hero-inner, .footer-inner {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main > section { padding-block: var(--section-space); }
main > section:first-of-type { padding-top: calc(var(--section-space) * 0.6); }

.reveal { opacity: 1; transform: none; }
.js .reveal[data-revealed="false"] {
  opacity: 0;
  transform: translateY(16px);
}
.js .reveal {
  transition: opacity .5s cubic-bezier(.2,.7,.2,1), transform .5s cubic-bezier(.2,.7,.2,1);
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  background: rgba(11, 26, 30, 0);
  transition: background-color .2s ease, border-color .2s ease;
}
.nav.is-scrolled {
  background: rgba(11, 26, 30, 0.92);
  border-bottom-color: var(--rule);
  backdrop-filter: blur(6px);
}
.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-stretch: 118%;
  font-size: var(--step-2);
  text-transform: lowercase;
}
.brand:hover { text-decoration: none; }
.brand-dot { position: relative; }
.brand-dot::before {
  content: "";
  position: absolute;
  left: 50%; top: -0.62em;
  width: 5px; height: 5px;
  background: var(--brass);
  transform: translateX(-50%) rotate(45deg);
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bone-dim);
}
.nav-links a:hover { color: var(--bone); }

@media (max-width: 640px) {
  .nav-links a:not(.btn) { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  border: 1px solid transparent;
  min-height: 44px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brass);
  color: var(--petrol-900);
  border-color: var(--brass);
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.btn-primary:hover {
  background: var(--brass-deep);
  border-color: var(--brass-deep);
  box-shadow: 0 0 0 1px var(--brass), 0 8px 32px -12px rgba(217,164,65,.35);
}
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-small { min-height: 36px; padding: 0 14px; }
.btn-text {
  background: transparent;
  border: none;
  color: var(--brass);
  padding: 0;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-text:hover { color: var(--brass-deep); }

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: none;
}
.footer-link-btn:hover { text-decoration: underline; }

/* ---------- hero ---------- */
.hero { padding-top: 96px; }
.hero-inner { display: flex; flex-direction: column; gap: 24px; }
.hero h1 { max-width: 16ch; }
.subhead { font-size: var(--step-2); color: var(--bone-dim); max-width: 54ch; }

/* agenda bar */
.agenda-bar-wrap { margin-top: 8px; }
.agenda-bar {
  display: flex;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  height: 88px;
}
.agenda-segment {
  flex-grow: var(--grow, 1);
  flex-basis: 0;
  min-width: 44px;
  background: var(--petrol-800);
  border: none;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  font-family: var(--font-mono);
  color: var(--bone-dim);
  transition: background-color .15s ease, opacity .15s ease;
}
.agenda-segment:last-child { border-right: none; }
.agenda-segment .seg-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
}
.agenda-segment .seg-min {
  font-size: var(--step-1);
  color: var(--bone);
  font-weight: 500;
}
.agenda-segment--ids {
  background: color-mix(in srgb, var(--brass) 12%, var(--petrol-800));
  border-top: 2px solid var(--brass);
  color: var(--bone);
}
.agenda-segment:hover,
.agenda-segment:focus-visible,
.agenda-segment.is-active {
  background: color-mix(in srgb, var(--brass) 22%, var(--petrol-800));
}
.agenda-segment--ids:hover,
.agenda-segment--ids:focus-visible,
.agenda-segment--ids.is-active {
  background: color-mix(in srgb, var(--brass) 30%, var(--petrol-800));
}
.js .agenda-bar {
  animation: none;
}
.js .agenda-segment[data-drawn="false"] {
  transform: scaleX(0);
  transform-origin: left;
}
.agenda-desc {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--brass);
  min-height: 1.4em;
}

@media (max-width: 720px) {
  .agenda-bar { flex-direction: column; height: auto; }
  .agenda-segment {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 12px 16px;
    min-height: 44px;
  }
  .agenda-segment:last-child { border-bottom: none; }
  .agenda-segment--ids { border-top: none; border-left: 2px solid var(--brass); }
  .agenda-segment .seg-label { text-align: left; }
}

/* email form */
.email-form { margin-top: 8px; max-width: 620px; }
.email-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--petrol-700);
  overflow: hidden;
}
.email-row input[type="email"] {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--bone);
  padding: 0 16px;
  min-height: 48px;
  font-size: var(--step-1);
}
.email-row input[type="email"]::placeholder { color: var(--bone-dim); }
.email-row input[type="email"]:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: -2px;
}
.email-row .btn { border-radius: 0; min-height: 48px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 520px) {
  .email-row { flex-direction: column; }
  .email-row .btn { border-radius: 0; }
}

.email-micro { margin-top: 10px; font-size: var(--step--1); color: var(--bone-dim); }
.email-status { margin-top: 10px; font-size: var(--step-0); min-height: 1.4em; }
.email-status[data-state="success"] { color: var(--on-track); display: flex; align-items: center; gap: 8px; }
.email-status[data-state="error"] { color: var(--off-track); }
.email-status .diamond { background: var(--on-track); }

/* ---------- demo ---------- */
.demo-intro { color: var(--bone-dim); margin-top: 16px; }
.demo-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 880px) {
  .demo-grid { grid-template-columns: 1fr; }
}
.demo-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
  margin-bottom: 10px;
}
.demo-textarea {
  width: 100%;
  min-height: 340px;
  background: var(--petrol-700);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--bone);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1.6;
  resize: vertical;
}
.demo-textarea:focus-visible { outline: 2px solid var(--brass); outline-offset: -2px; }
.demo-note { margin-top: 10px; font-size: var(--step--1); color: var(--bone-dim); }
#demo-run { margin-top: 16px; }

.demo-output {
  min-height: 340px;
  background: var(--petrol-800);
  border: 1px dashed var(--rule);
  border-radius: 4px;
  padding: 20px;
  position: relative;
}
.demo-output:has(.demo-block:not([hidden])) { border-style: solid; }
.demo-empty { color: var(--bone-dim); }

.demo-working { display: flex; flex-direction: column; gap: 10px; }
.demo-working-label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brass);
}
.demo-working-bar {
  display: block;
  height: 2px;
  background: var(--rule);
  overflow: hidden;
  position: relative;
}
.demo-working-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--brass);
  animation: indeterminate 1s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.demo-block { margin-top: 22px; }
.demo-block:first-of-type { margin-top: 0; }
.demo-block-title {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
  font-weight: 500;
  margin-bottom: 10px;
}
.js .demo-block { transition: opacity .35s ease, transform .35s ease; }
.js .demo-block[data-entering="true"] { opacity: 0; transform: translateY(8px); }

.demo-bullets li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
}
.demo-bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.5em;
  width: 6px; height: 6px;
  background: var(--brass);
  transform: rotate(45deg);
}

.demo-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: var(--step--1); }
.demo-table th, .demo-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rule); }
.demo-table th { color: var(--bone-dim); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; }
.demo-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 2px;
  color: var(--petrol-900);
}
.chip--on { background: var(--on-track); }
.chip--off { background: var(--off-track); }

.demo-rocks li, .demo-todos li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--step--1);
}
.demo-rocks li:last-child, .demo-todos li:last-child { border-bottom: none; }
.owner-sq {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--petrol-700);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  flex: none;
}
.rock-name { flex: 1; }
.todo-owner { font-family: var(--font-mono); color: var(--bone-dim); width: 70px; flex: none; }
.todo-text { flex: 1; }
.todo-due { font-family: var(--font-mono); color: var(--brass); text-transform: uppercase; letter-spacing: 0.06em; }

.demo-issues { counter-reset: issue; display: flex; flex-direction: column; gap: 14px; }
.demo-issues li { counter-increment: issue; position: relative; padding-left: 30px; }
.demo-issues li::before {
  content: counter(issue);
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px;
  background: var(--petrol-700);
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.issue-title { display: block; font-weight: 500; }
.issue-why { display: block; color: var(--bone-dim); font-size: var(--step--1); margin-top: 2px; }

/* ---------- how ---------- */
.how { background: var(--petrol-800); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.how-list { margin-top: 40px; display: flex; flex-direction: column; }
.how-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  transition: background-color .15s ease;
}
.how-row:last-child { border-bottom: none; }
.how-row.is-active { background: color-mix(in srgb, var(--brass) 8%, transparent); }
.how-seg {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass);
}
.how-copy { color: var(--bone); max-width: 56ch; }

@media (max-width: 640px) {
  .how-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- principles ---------- */
.principles-list { margin-top: 40px; display: flex; flex-direction: column; gap: 32px; }
.principles-list li { display: flex; gap: 16px; align-items: flex-start; }
.diamond {
  flex: none;
  width: 10px; height: 10px;
  margin-top: 8px;
  background: var(--brass);
  transform: rotate(45deg);
}
.principles-list p { max-width: 58ch; }
.principles-list strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); margin-bottom: 4px; }

/* ---------- closing ---------- */
.closing h2 { max-width: 22ch; }
.closing-note { margin-top: 20px; color: var(--bone-dim); font-size: var(--step--1); font-family: var(--font-mono); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 32px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--bone-dim);
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.footer-left, .footer-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-brand { color: var(--bone); letter-spacing: 0.08em; }
.footer-right a, .footer-right button { color: var(--bone-dim); }
.footer-right a:hover, .footer-right button:hover { color: var(--bone); }
.footer-legal {
  max-width: var(--content-max);
  margin: 20px auto 0;
  padding-inline: var(--gutter);
  font-size: 11px;
  color: var(--bone-dim);
  opacity: .8;
}

/* ---------- dialog ---------- */
dialog#privacy-dialog {
  background: var(--petrol-800);
  color: var(--bone);
  border: 1px solid var(--rule);
  border-radius: 4px;
  max-width: 480px;
  width: calc(100vw - 32px);
  padding: 28px;
}
dialog#privacy-dialog::backdrop { background: rgba(11,26,30,0.7); }
.dialog-form { display: flex; flex-direction: column; gap: 14px; }
.dialog-form h2 { font-size: var(--step-3); }
.dialog-form .btn { align-self: flex-start; margin-top: 8px; }

/* ---------- no-js fallback: demo renders fully populated, statically ---------- */
.no-js #demo-run,
.no-js #demo-again,
.no-js #demo-empty,
.no-js #demo-working,
.no-js .demo-note { display: none !important; }
.no-js .demo-block[hidden] { display: block !important; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal[data-revealed="false"] { opacity: 1; transform: none; }
  .js .agenda-segment[data-drawn="false"] { transform: none; }
  .js .demo-block[data-entering="true"] { opacity: 1; transform: none; }
}
