:root {
  color-scheme: light dark;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI",
    ui-sans-serif, system-ui, sans-serif;

  /* Courtyard D palette — Light */
  --bg: #f8f6f1;
  --surface: #ffffff;
  --surface-soft: #efece3;
  --ink: #1f241d;
  --ink-2: #485044;
  --ink-3: #666f61;
  --olive: #404a3b;
  --olive-hover: #313a2d;
  --olive-mid: #626d56;
  --cream: #f7ead0;
  --cream-deep: #e7d0a9;
  --ochre: #ca965f;
  --border: rgba(64, 74, 59, 0.13);
  --border-strong: rgba(64, 74, 59, 0.24);
  --frame-bg: #fcfbf8;
  --frame-shadow: 0 1px 2px rgba(31, 36, 29, 0.06), 0 20px 48px -24px rgba(31, 36, 29, 0.16);

  /* Courtyard waitlist enclosure */
  --enclosure-bg: linear-gradient(168deg, #4b5644 0%, #394335 100%);
  --enclosure-border: rgba(247, 234, 208, 0.12);
  --enclosure-ink: #f7ead0;
  --enclosure-ink-2: #d8d5c7;
  --enclosure-input-bg: rgba(24, 29, 22, 0.34);
  --enclosure-input-border: rgba(247, 234, 208, 0.24);
  --enclosure-btn-bg: #f7ead0;
  --enclosure-btn-hover: #e7d0a9;
  --enclosure-btn-ink: #1f241d;
  --shot-filter: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141713;
    --surface: #1b201a;
    --surface-soft: #232921;
    --ink: #f4edd9;
    --ink-2: #c5cbbd;
    --ink-3: #969e8e;
    --olive: #e7d0a9;
    --olive-hover: #f7ead0;
    --olive-mid: #7d8a70;
    --border: rgba(244, 237, 217, 0.11);
    --border-strong: rgba(244, 237, 217, 0.22);
    --frame-bg: #1e241d;
    --frame-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 28px 60px -24px rgba(0, 0, 0, 0.72);

    --enclosure-bg: linear-gradient(168deg, #22291f 0%, #191f17 100%);
    --enclosure-border: rgba(244, 237, 217, 0.14);
    --enclosure-ink: #f4edd9;
    --enclosure-ink-2: #c5cbbd;
    --enclosure-input-bg: rgba(12, 15, 11, 0.56);
    --enclosure-input-border: rgba(244, 237, 217, 0.2);
    --enclosure-btn-bg: #e7d0a9;
    --enclosure-btn-hover: #f7ead0;
    --enclosure-btn-ink: #171b15;
    --shot-filter: brightness(0.96) contrast(1.01);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141713;
  --surface: #1b201a;
  --surface-soft: #232921;
  --ink: #f4edd9;
  --ink-2: #c5cbbd;
  --ink-3: #969e8e;
  --olive: #e7d0a9;
  --olive-hover: #f7ead0;
  --olive-mid: #7d8a70;
  --border: rgba(244, 237, 217, 0.11);
  --border-strong: rgba(244, 237, 217, 0.22);
  --frame-bg: #1e241d;
  --frame-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 28px 60px -24px rgba(0, 0, 0, 0.72);

  --enclosure-bg: linear-gradient(168deg, #22291f 0%, #191f17 100%);
  --enclosure-border: rgba(244, 237, 217, 0.14);
  --enclosure-ink: #f4edd9;
  --enclosure-ink-2: #c5cbbd;
  --enclosure-input-bg: rgba(12, 15, 11, 0.56);
  --enclosure-input-border: rgba(244, 237, 217, 0.2);
  --enclosure-btn-bg: #e7d0a9;
  --enclosure-btn-hover: #f7ead0;
  --enclosure-btn-ink: #171b15;
  --shot-filter: brightness(0.96) contrast(1.01);
}

:root[data-theme="light"] {
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

figure {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.shell {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

/* Header */
.site-header {
  padding-block: 1.5rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.theme-toggle:hover {
  background: var(--surface-soft);
  color: var(--ink);
  border-color: var(--border-strong);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.icon-sun {
  display: none;
}

.icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }
}

:root[data-theme="dark"] .icon-sun {
  display: block;
}

:root[data-theme="dark"] .icon-moon {
  display: none;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding-inline: 0.95rem;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  transition: background-color 140ms ease, border-color 140ms ease;
}

.header-cta:hover {
  background: var(--surface-soft);
}

/* Hero */
.hero {
  padding-top: clamp(2.5rem, 6vw, 4.75rem);
  padding-bottom: clamp(2.75rem, 5vw, 4rem);
}

.hero-mark {
  width: 68px;
  height: 68px;
  margin-bottom: 1.5rem;
}

.hero-name {
  margin: 0 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}

.hero-title {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.3rem, 5.2vw, 3.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.034em;
  color: var(--ink);
}

.hero-sub {
  margin: 1.35rem 0 0;
  max-width: 54ch;
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  line-height: 1.58;
  color: var(--ink-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.4rem;
  margin-top: 2rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.4rem;
  border: 0;
  border-radius: 10px;
  background: var(--olive);
  color: var(--bg);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, transform 120ms ease;
}

.btn-primary:hover {
  background: var(--olive-hover);
}

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

.hero-meta {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-3);
}

/* Board roster rule */
.board-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 3.75rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.board-strip-label {
  font-size: 0.875rem;
  color: var(--ink-3);
  margin-right: auto;
}

.board-strip li:not(.board-strip-label) {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}

/* Product beats */
.beats {
  display: flex;
  flex-direction: column;
  gap: clamp(4rem, 9vw, 7rem);
  padding-bottom: clamp(4.5rem, 9vw, 7rem);
}

.beat-feature {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.shot-frame {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--frame-bg);
  box-shadow: var(--frame-shadow);
}

.shot-frame img {
  width: 100%;
  height: auto;
  filter: var(--shot-filter);
}

.beat-feature-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 1rem 3rem;
  align-items: start;
  padding-top: 0.25rem;
}

.beat-heading {
  margin: 0;
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.beat-body {
  margin: 0;
  max-width: 54ch;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-2);
}

/* Asymmetric split beats */
.beat-split {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.35fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
}

.beat-split--visual-first {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.82fr);
}

.beat-copy-stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* Focused canvas framing for Map board screenshot (hides legacy left rail cleanly) */
.shot-frame--map {
  aspect-ratio: 2418 / 1728;
}

.shot-frame--map img {
  width: 116.2%;
  max-width: none;
  margin-left: -16.2%;
  margin-top: -3.8%;
}

/* Storyboard diptych for Beat 3 */
.diptych {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.diptych .shot-frame {
  border-radius: 14px;
}

/* Courtyard Waitlist Enclosure */
.waitlist-section {
  padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
}

.courtyard-box {
  position: relative;
  padding: clamp(2rem, 5vw, 3.75rem);
  border-radius: 22px;
  border: 1px solid var(--enclosure-border);
  background: var(--enclosure-bg);
  color: var(--enclosure-ink);
  box-shadow: var(--frame-shadow);
}

.courtyard-step {
  width: 52px;
  height: 6px;
  border-radius: 3px;
  background: var(--ochre);
  margin-bottom: 1.6rem;
}

.courtyard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
}

.waitlist-title {
  margin: 0;
  font-size: clamp(1.625rem, 3vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.028em;
  color: var(--enclosure-ink);
}

.waitlist-sub {
  margin: 0.9rem 0 0;
  max-width: 42ch;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--enclosure-ink-2);
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form-row {
  display: flex;
  gap: 0.65rem;
}

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

.email-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 1rem;
  border: 1px solid var(--enclosure-input-border);
  border-radius: 10px;
  background: var(--enclosure-input-bg);
  color: var(--enclosure-ink);
  font-family: inherit;
  font-size: 0.96875rem;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.email-input::placeholder {
  color: rgba(247, 234, 208, 0.56);
}

.email-input:focus {
  outline: none;
  border-color: var(--ochre);
  box-shadow: 0 0 0 3px rgba(202, 150, 95, 0.28);
}

.submit-btn {
  flex: 0 0 auto;
  height: 48px;
  padding: 0 1.35rem;
  border: 0;
  border-radius: 10px;
  background: var(--enclosure-btn-bg);
  color: var(--enclosure-btn-ink);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 140ms ease, opacity 140ms ease, transform 120ms ease;
}

.submit-btn:hover:not(:disabled) {
  background: var(--enclosure-btn-hover);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.submit-btn:disabled {
  opacity: 0.68;
  cursor: wait;
}

.turnstile-slot {
  min-height: 0;
}

.turnstile-slot:empty {
  display: none;
}

.form-status {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--enclosure-ink);
}

.form-status:empty {
  display: none;
}

.form-status[data-tone="error"] {
  color: #f8c6a6;
}

.form-status[data-tone="success"] {
  color: #e7f1c8;
}

.form-footnote {
  margin: 0;
  font-size: 0.84375rem;
  color: var(--enclosure-ink-2);
}

.form-footnote a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(247, 234, 208, 0.45);
}

.form-footnote a:hover {
  color: var(--enclosure-ink);
  text-decoration-color: var(--ochre);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.75rem 2.5rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink-2);
  transition: color 140ms ease;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Prose pages (/privacy, /404) */
.prose-main {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: clamp(4rem, 8vw, 6rem);
}

.prose {
  max-width: 62ch;
}

.prose-back {
  display: inline-block;
  margin-bottom: 1.75rem;
  font-size: 0.9375rem;
  color: var(--ink-3);
  text-decoration: none;
}

.prose-back:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.prose h2 {
  margin: 2.25rem 0 0.6rem;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.prose p,
.prose li {
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.65;
}

.prose ul {
  padding-left: 1.25rem;
  margin: 0.6rem 0 0;
}

.prose li + li {
  margin-top: 0.45rem;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
}

.prose a:hover {
  text-decoration-color: var(--ochre);
}

/* Responsive */
@media (max-width: 860px) {
  .beat-feature-copy,
  .beat-split,
  .beat-split--visual-first,
  .courtyard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .beat-split--visual-first .beat-copy-stack {
    order: -1;
  }

  .board-strip-label {
    flex-basis: 100%;
    margin-bottom: 0.15rem;
  }
}

@media (max-width: 560px) {
  .header-cta {
    display: none;
  }

  .hero-mark {
    width: 58px;
    height: 58px;
  }

  .board-strip {
    gap: 0.4rem 1.25rem;
  }

  .form-row {
    flex-direction: column;
  }

  .submit-btn {
    width: 100%;
  }

  .diptych {
    grid-template-columns: minmax(0, 1fr);
  }

  .courtyard-box {
    padding: 1.65rem 1.35rem;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
