/* Self-hosted Hanken Grotesk (OFL 1.1, see fonts/OFL.txt). Replaces the Google
   Fonts CDN so the site makes no third-party request for fonts. The latin
   subset covers English plus German umlauts. */
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/hanken-grotesk-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/hanken-grotesk-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/hanken-grotesk-latin-700-normal.woff2") format("woff2");
}

:root {
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px;

  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-base: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.5rem;
  --t-2xl: 2rem;
  --t-hero: clamp(2rem, 1rem + 3.5vw, 3.25rem);

  --w-wide: 56rem;

  --r-1: 4px; --r-2: 8px; --r-3: 12px; --r-4: 16px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-1: 120ms;
  --dur-2: 220ms;

  color-scheme: light;
}

:root {
  --accent:       oklch(0.55 0.16 245);
  --accent-2:     oklch(0.48 0.16 245);
  --accent-on:    oklch(0.99 0.003 245);
  --accent-soft:  oklch(0.95 0.04 245);
  --surface:      oklch(0.99 0.003 245);
  --surface-2:    oklch(0.965 0.005 245);
  --surface-3:    oklch(0.93 0.008 245);
  --surface-4:    oklch(0.86 0.010 245);
  --ink:          oklch(0.22 0.015 245);
  --ink-2:        oklch(0.42 0.013 245);
  --ink-3:        oklch(0.54 0.012 245);
  --brick:        #c25000;
  --brick-mist:   color-mix(in srgb, var(--brick) 10%, transparent);
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--t-base);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in oklch, var(--accent) 40%, transparent);
  font-weight: 500;
  transition: color var(--dur-1) var(--ease),
    text-decoration-color var(--dur-1) var(--ease);
}

a:hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

h1, h2, h3, h4 {
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.005em;
}

p { text-wrap: pretty; margin: 0; }

code, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-3);
  color: var(--ink-2);
  padding: 0.05em 0.35em;
  border-radius: var(--r-1);
  border: 1px solid var(--surface-4);
  font-variant-ligatures: none;
}

kbd { background: var(--surface-3); font-size: 0.85em; }

code.locale-code { white-space: nowrap; }

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  padding: var(--s-3) var(--s-5);
  background: var(--ink);
  color: var(--surface);
  text-decoration: none;
  transform: translateY(-110%);
  transition: transform var(--dur-2) var(--ease);
  z-index: 100;
  border-radius: 0 0 var(--r-2) 0;
}
.skip-link:focus { transform: translateY(0); }

.hero {
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: var(--s-9) var(--s-6) var(--s-8);
  display: grid;
  gap: var(--s-7);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.eyebrow,
.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--s-3);
}

.hero h1 {
  font-size: var(--t-hero);
  letter-spacing: -0.018em;
  margin-bottom: var(--s-4);
}

/* Hero deck only: the single deliberately larger intro. */
.lead {
  font-size: var(--t-lg);
  line-height: 1.5;
  color: var(--ink-2);
  margin-bottom: var(--s-6);
  max-width: 56ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px var(--s-4);
  border-radius: var(--r-2);
  font-weight: 600;
  font-size: var(--t-base);
  text-decoration: none;
  line-height: 1;
  min-height: 44px;
  border: 1px solid transparent;
  transition: background var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease);
}

.button-primary {
  background: var(--accent);
  color: var(--accent-on);
  box-shadow: inset 0 1px 0 0 color-mix(in oklch, var(--accent-on) 25%, transparent);
}

.button-primary:hover {
  background: var(--accent-2);
  color: var(--accent-on);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Section scaffold: one source of truth for every content section
   (first-run, after-install, privacy). The hero is the single exception. */
.section {
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: var(--s-8) var(--s-6);
}

.section h2 {
  font-size: var(--t-2xl);
  margin-bottom: var(--s-3);
  letter-spacing: -0.012em;
}

.section h3 {
  font-size: var(--t-xl);
  margin-bottom: var(--s-3);
}

/* Uniform body copy: one size everywhere. The hero deck (.lead) is the
   single deliberately larger intro; section openers are plain body. */
.section > p:not(.section-eyebrow):not(.back-link):not(.updated) {
  max-width: 64ch;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: var(--s-5);
}

.section > p:not(.section-eyebrow):not(.back-link):not(.updated):last-child {
  margin-bottom: 0;
}

.section > h3 {
  margin-top: var(--s-7);
}

.updated {
  color: var(--ink-3);
  font-size: var(--t-sm);
  margin-top: 0;
  margin-bottom: var(--s-5);
}

.back-link {
  font-size: var(--t-sm);
  margin-bottom: var(--s-5);
}

/* Demo video: responsive 16:9 with a click-to-load facade. The poster is
   local, so nothing is requested from YouTube until the visitor hits play. */
.video {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  margin-top: var(--s-5);
  aspect-ratio: 16 / 9;
  border-radius: var(--r-3);
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--surface-3);
  box-shadow: 0 14px 30px -18px color-mix(in oklch, var(--ink) 26%, transparent);
}

.video iframe,
.video .video-facade,
.video .video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-facade {
  display: block;
  padding: 0;
  margin: 0;
  background: none;
  cursor: pointer;
}

.video-poster { object-fit: cover; }

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-on);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px -6px color-mix(in oklch, var(--ink) 40%, transparent);
  transition: background var(--dur-2) var(--ease),
    transform var(--dur-2) var(--ease);
}

.video-play svg {
  width: 32px;
  height: 32px;
  margin-left: 3px; /* optical-center the triangle */
}

.video-facade:hover .video-play,
.video-facade:focus-visible .video-play {
  background: var(--accent-2);
  transform: translate(-50%, -50%) scale(1.06);
}

.install-step-media {
  margin: var(--s-3) 0 0 0;
  max-width: 640px;
}

.install-step-media--pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  max-width: none;
  margin: 0 0 var(--s-5) 0;
}

@media (min-width: 56rem) {
  .install-step-media--pair {
    grid-template-columns: 1fr 1fr;
  }
}

.install-step-media--pair img {
  border: 1px solid var(--surface-3);
  border-radius: var(--r-2);
}

.install-step-media--small {
  max-width: 380px;
}

.after-install-aside {
  margin-top: var(--s-8);
}

.after-install-aside p:not(.section-eyebrow) {
  font-size: var(--t-sm);
  color: var(--ink-2);
  max-width: 64ch;
}

.welcome-layout {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: 1fr;
  margin-top: var(--s-5);
  align-items: start;
}

@media (min-width: 50rem) {
  .welcome-layout {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--s-8);
  }
}

.welcome-steps {
  list-style: none;
  counter-reset: welcome-step;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  max-width: 56ch;
}

.welcome-steps > li {
  counter-increment: welcome-step;
  position: relative;
  padding-left: calc(var(--s-6) + var(--s-3));
}

.welcome-steps > li::before {
  content: counter(welcome-step);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: var(--s-6);
  height: var(--s-6);
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font-weight: 700;
  font-size: var(--t-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.welcome-steps h3 {
  margin: 0 0 var(--s-2);
  color: var(--ink);
}

.welcome-steps p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.6;
}

.welcome-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 360px;
  justify-self: start;
}

@media (min-width: 50rem) {
  .welcome-figure {
    justify-self: end;
    position: sticky;
    top: var(--s-6);
  }
}

.welcome-shot {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--surface-3);
  box-shadow: 0 14px 30px -18px color-mix(in oklch, var(--ink) 26%, transparent);
  overflow: hidden;
}

.welcome-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.welcome-shot--single {
  border-radius: var(--r-3);
}

.welcome-figure figcaption {
  font-size: var(--t-sm);
  color: var(--ink-3);
  text-align: center;
  margin-top: var(--s-3);
}

.permissions {
  display: flex;
  flex-direction: column;
  margin: var(--s-6) 0 var(--s-6) 0;
  border: 1px solid var(--surface-3);
  border-radius: var(--r-3);
  overflow: hidden;
  max-width: 64ch;
}

.perm {
  padding: var(--s-5) var(--s-6);
  background: var(--surface-2);
}

.perm + .perm { border-top: 1px solid var(--surface-3); }

.perm dt {
  font-size: var(--t-xl);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--s-2);
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
}

.perm dd {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.6;
}

.site-footer-min {
  max-width: var(--w-wide);
  margin: var(--s-9) auto 0;
  padding: var(--s-5) var(--s-6) var(--s-7);
  border-top: 1px solid var(--surface-3);
}
.site-footer-min p {
  margin: 0;
  max-width: 64ch;
  color: var(--ink-3);
  font-size: var(--t-xs);
  line-height: 1.55;
}

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

.hero .hero-copy { max-width: 64ch; }
.hero h1 { max-width: 22ch; }

.storyboard {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--s-4);
  grid-template-columns: 1fr;
}

@media (min-width: 56rem) {
  .storyboard {
    grid-template-columns: 1fr 24px 1fr;
    align-items: start;
    gap: var(--s-4);
  }
  .storyboard li.sep { align-self: center; }
}

.storyboard li.sep {
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
}

@media (max-width: 55.999rem) {
  .storyboard li.sep {
    transform: rotate(90deg);
    padding: 8px 0;
  }
  .real-toast-anchor { transform: translateX(-50%) scale(1); }
  .frame:hover .real-toast-anchor,
  .frame:focus-within .real-toast-anchor {
    transform: translateX(-50%) scale(1);
  }
  .hero figure {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
  }
  .hero figure .storyboard,
  .hero figure .frame-captions-row {
    display: contents;
  }
  .hero figure .storyboard .frame:first-of-type { order: 1; }
  .hero figure .frame-caption--left { order: 2; }
  .hero figure .storyboard .sep { order: 3; }
  .hero figure .storyboard .frame:last-of-type { order: 4; }
  .hero figure .frame-caption--right { order: 5; }
  .hero figure .story-figcaption { order: 6; }
}

.frame {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--surface-3);
  border-radius: var(--r-3);
  overflow: visible;
  box-shadow: 0 14px 30px -18px color-mix(in oklch, var(--ink) 26%, transparent);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.frame .frame-chrome {
  border-top-left-radius: calc(var(--r-3) - 1px);
  border-top-right-radius: calc(var(--r-3) - 1px);
}
.frame .frame-body {
  border-bottom-left-radius: calc(var(--r-3) - 1px);
  border-bottom-right-radius: calc(var(--r-3) - 1px);
}

.frame-chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--surface-3);
  box-sizing: border-box;
  height: 44px;
}
.frame-chrome .d { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-4); }
.frame-url {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--surface-3);
  border-radius: 999px;
  padding: 3px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.frame-url .host { color: var(--ink); font-weight: 600; }
.frame-url .locale-now {
  background: var(--brick-mist);
  color: var(--brick);
  font-weight: 700;
  padding: 0 5px;
  border-radius: 3px;
}

.frame-body {
  position: relative;
  background: var(--surface);
  aspect-ratio: 1918 / 1488;
  overflow: hidden;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  min-height: 0;
  box-sizing: border-box;
}

.reddit-post {
  position: absolute;
  inset: 0;
  padding: 14px 16px 18px;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.reddit-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-3);
}
.reddit-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  display: block; object-fit: cover;
  background: var(--surface-3);
}
.reddit-sub { font-weight: 700; color: var(--ink); }
.reddit-time { color: var(--ink-3); }
.reddit-title {
  font-size: 15px; font-weight: 700; color: var(--ink);
  line-height: 1.3; margin: 0;
}
.reddit-body {
  font-size: 13px; color: var(--ink-2);
  line-height: 1.55;
  display: flex; flex-direction: column; gap: 6px;
}
.reddit-body p { margin: 0; }
.reddit-link {
  position: relative;
  display: inline-block;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: normal;
  overflow-wrap: anywhere;
}
.reddit-link .locale-was {
  font-weight: 700;
  background: var(--brick-mist);
  color: var(--brick);
  padding: 0 4px;
  border-radius: 3px;
  text-decoration: none;
  white-space: nowrap;
}
.reddit-meta-row {
  display: flex; gap: 14px;
  font-size: 12px; color: var(--ink-3);
  margin-top: 18px;
}

.lego-page {
  position: absolute; inset: 0;
  background-image: url(images/screenshots/lego-minas-tirith-page.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.real-toast-anchor {
  position: absolute;
  top: 46px;
  left: 50%;
  width: 580px;
  max-width: calc(220% - 32px);
  z-index: 4;
  transform: translateX(-50%) scale(0.45);
  transform-origin: top center;
  transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
  contain: layout;
}
.real-toast-anchor[hidden] { display: none; }
.frame:hover .real-toast-anchor,
.frame:focus-within .real-toast-anchor,
.real-toast-anchor:hover,
.real-toast-anchor:focus-within {
  transform: translateX(-50%) scale(1);
}
@media (prefers-reduced-motion: reduce) {
  .real-toast-anchor { transition: none; }
}

.bh-toast {
  background: #fff;
  color: #333;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", sans-serif;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}
.bh-toast__body { flex: 1; min-width: 0; }
.bh-toast__header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.bh-toast__name { font-weight: 600; font-size: 13px; }
.bh-toast__badge {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid #1976d2;
  color: #1976d2;
  white-space: nowrap;
}
.bh-toast__rows { display: flex; flex-direction: column; gap: 2px; }
.bh-toast__row {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px;
}
.bh-toast__label {
  font-size: 9px; color: #999;
  text-transform: uppercase; letter-spacing: 0.05em;
  width: 28px; flex-shrink: 0;
}
.bh-toast__host { font-weight: 600; color: #333; }
.bh-toast__path { color: #666; white-space: nowrap; }
.bh-toast__locale {
  color: #c25000; font-weight: 700;
  border-radius: 3px;
  background-color: rgba(194, 80, 0, 0.10);
  padding: 0 2px;
}
.bh-toast__close {
  pointer-events: auto;
  cursor: pointer;
  background: none;
  border: 0;
  font: inherit;
  padding: 0 4px;
  color: #999;
  font-size: 18px;
  line-height: 1;
  margin-top: -2px;
}

.frame-captions-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  margin-top: var(--s-5);
}
@media (min-width: 56rem) {
  .frame-captions-row {
    grid-template-columns: 1fr 24px 1fr;
  }
  .frame-caption--left { grid-column: 1; }
  .frame-caption--right { grid-column: 3; }
}
.frame-caption {
  font-size: var(--t-sm);
  line-height: 1.55;
  color: var(--ink-2);
  text-align: left;
  padding: 0;
  background: transparent;
  border: none;
}
.frame-caption strong {
  color: var(--ink); font-weight: 600;
  display: block; margin-bottom: 4px;
}
.frame-caption code { font-size: 0.92em; }

.story-figcaption {
  margin-top: var(--s-5);
  text-align: center;
  font-size: var(--t-sm);
  color: var(--ink-3);
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

@media (max-width: 55.999rem) {
  .frame-body:not(.frame-body--screenshot) {
    aspect-ratio: auto;
  }
  .reddit-post {
    position: static;
    justify-content: flex-start;
  }
}
