/* ==========================================================================
   Window Scene — Components & layout
   PR: responsive hero shell + overflow fix. Header, hero, proof strip,
   section stubs, footer. Later PRs fill in scenes, fit, panel, comparison, etc.
   ========================================================================== */

/* --- Striped placeholder utility (no real photography exists) ------------- */
.ph {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  background-image: repeating-linear-gradient(
    135deg,
    var(--placeholder-a) 0,
    var(--placeholder-a) 6px,
    var(--placeholder-b) 6px,
    var(--placeholder-b) 12px
  );
  color: var(--ink-quiet);
}

.ph__label {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.72);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-align: center;
  max-width: 90%;
}

.ph--before {
  background-image: repeating-linear-gradient(
    135deg,
    var(--placeholder-before-a) 0,
    var(--placeholder-before-a) 6px,
    var(--placeholder-before-b) 6px,
    var(--placeholder-before-b) 12px
  );
}

.ph--after {
  background-image: repeating-linear-gradient(
    135deg,
    var(--placeholder-after-a) 0,
    var(--placeholder-after-a) 6px,
    var(--placeholder-after-b) 6px,
    var(--placeholder-after-b) 12px
  );
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

/* The one accent object: the primary CTA. */
.btn--primary {
  background: var(--accent-deep);
  color: var(--on-accent);
}

.btn--primary:hover {
  background: var(--accent-deep-hover);
  color: var(--on-accent);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--accent-deep);
  color: var(--accent-deep);
}

.btn--lg {
  min-height: 54px;
  padding: 0 28px;
  font-size: 16px;
}

.text-link {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}

.text-link:hover {
  color: var(--accent-deep);
  text-decoration-color: var(--accent-deep);
}

/* --- Header (§1.1) -------------------------------------------------------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: clamp(14px, 2.5vw, 22px) var(--section-inline);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

/* Optional sticky-on-scroll: compact + translucent. */
.site-header.is-stuck {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 242, 236, 0.92);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--ink);
}

.brand__mark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(15px, 2.2vw, 18px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand__by {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(14px, 2.4vw, 26px);
}

.site-nav a:not(.btn) {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.site-nav a:not(.btn):hover {
  color: var(--ink);
}

/* --- Hero (§1.2): the reveal shell --------------------------------------- */
.hero {
  padding: 0 0 clamp(28px, 5vw, 56px);
}

.hero-media {
  --reveal: 45; /* percent shown as BEFORE from the left; JS + range bind here.
                   Rests on the side-by-side split so the before/after story reads
                   at a glance. JS enhances with a one-time reveal on load. */
  position: relative;
  width: 100%;
  /* Full-bleed, near-full-viewport on load (fills below the header). */
  height: min(calc(100vh - 4.5rem), 60rem);
  height: min(calc(100svh - 4.5rem), 60rem);
  min-height: 28rem;
  overflow: hidden;
  /* No touch-action lock here: the page must scroll normally over the hero.
     Only the handle captures drags (see .hero-handle). */
  user-select: none;
  -webkit-user-select: none;
  background: var(--bg-raised);
}

.hero-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Images never intercept pointers — no native image-drag, and touch scroll
     passes straight through to the page. */
  pointer-events: none;
}

.hero-layer .ph {
  height: 100%;
}

.hero-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* AFTER sits on top and is clipped from the left by --reveal%. */
.hero-layer--after {
  clip-path: inset(0 0 0 calc(var(--reveal) * 1%));
}

/* Divider + handle share the same left position. */
.hero-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--reveal) * 1%);
  z-index: 3;
  width: 2px;
  transform: translateX(-1px);
  background: rgba(255, 255, 255, 0.95);
  pointer-events: none;
}

.hero-handle {
  position: absolute;
  top: 50%;
  left: calc(var(--reveal) * 1%);
  z-index: 3;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: var(--handle-size);
  height: var(--handle-size);
  border-radius: 50%;
  background: #ffffff;
  color: var(--accent-deep);
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 22px 60px -34px rgba(10, 24, 45, 0.6);
  /* The one draggable thing. touch-action:none lets a finger drag it sideways
     without scrolling the page; everywhere else on the hero scrolls normally. */
  pointer-events: auto;
  cursor: ew-resize;
  touch-action: none;
}

.hero-handle:active {
  cursor: grabbing;
}

/* Corner labels. */
.hero-tag {
  position: absolute;
  top: 14px;
  z-index: 3;
  padding: 5px 9px;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  pointer-events: none;
}

.hero-tag--before {
  left: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: #12233a;
}

.hero-tag--after {
  right: 14px;
  background: var(--accent-deep);
  color: var(--on-accent);
}

/* Light scrim over the bottom 62% so copy stays legible on imagery. */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  /* Full-color photo stays vivid; only the bottom-left corner darkens so the
     white copy reads. Top-right of the scene is untouched. */
  background:
    linear-gradient(
      to top,
      rgba(10, 19, 33, 0.82) 0%,
      rgba(10, 19, 33, 0.5) 24%,
      rgba(10, 19, 33, 0.16) 44%,
      transparent 62%
    ),
    linear-gradient(
      to right,
      rgba(10, 19, 33, 0.6) 0%,
      rgba(10, 19, 33, 0.16) 34%,
      transparent 58%
    );
}

.hero-copy {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(20px, 4vw, 44px);
  max-width: 40em;
}

.hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.2em;
}

.hero-copy .eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: rgba(255, 255, 255, 0.5);
}

.hero-copy h1 {
  margin: 12px 0 0;
  color: #ffffff;
  /* The one loud thing on the screen. Capped so the copy stays inside the
     media box and on the scrim at desktop. */
  font-size: clamp(38px, 7.4vw, 82px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-shadow: 0 1px 30px rgba(10, 19, 33, 0.35);
}

/* Editorial italic accent — Newsreader italic on a single emphasized word. */
.hero-copy h1 em,
.display-em {
  font-style: italic;
  font-weight: 400;
}

.hero-copy .lead {
  margin: 14px 0 0;
  max-width: 31em;
  color: rgba(255, 255, 255, 0.92);
}

.hero-copy .text-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration-color: rgba(255, 255, 255, 0.45);
}

.hero-copy .text-link:hover {
  color: #ffffff;
  text-decoration-color: #ffffff;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

/* Accessible range fallback, bound to the same reveal state. */
.hero-range {
  margin-top: 16px;
}

.hero-range label {
  display: block;
  margin-bottom: 8px;
}

.hero-range input[type="range"] {
  width: 100%;
  min-height: 44px;
  accent-color: var(--accent-deep);
}

/* --- Proof strip (§1.3): four defensible facts, hairline grid ------------- */
.proof {
  padding-block: 0;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.proof-grid li {
  list-style: none;
  padding: clamp(18px, 3vw, 28px);
  background: var(--bg);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-body);
}

.proof-grid ol,
.proof-grid ul {
  margin: 0;
  padding: 0;
}

/* --- Scene gallery (#scenes) --------------------------------------------- */
.scenes-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--grid-gap);
  margin-top: clamp(24px, 4vw, 40px);
  align-items: start;
}

.scene-frame {
  margin: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.scene-frame > img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.scene-frame figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-top: 0;
}

.scene-frame__name {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.2vw, 26px);
  color: var(--ink);
}

.scene-frame__mood {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

.scene-list {
  display: grid;
  gap: 10px;
}

.scene-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.scene-btn:hover {
  border-color: var(--accent-deep);
}

.scene-btn.is-active {
  border-color: var(--accent-deep);
  background: var(--bg-raised);
}

.scene-btn__name {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 15px;
}

.scene-btn__cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

/* --- Testing-status card (#panel) ---------------------------------------- */
.test-card {
  margin-top: clamp(28px, 4vw, 44px);
  max-width: 58em;
  padding: var(--card-pad);
  background: var(--surface);
  border: 1px solid var(--line);
}

.test-card h3 {
  margin-top: 8px;
  max-width: 26em;
}

.test-card__body {
  margin-top: 12px;
  max-width: 52em;
  color: var(--ink-body);
}

.test-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.test-list li {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-body);
  font-size: 14.5px;
  line-height: 1.55;
}

.test-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.test-list__what {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

/* --- Comparison table (#compare) ----------------------------------------- */
.table-wrap {
  margin-top: clamp(24px, 4vw, 40px);
  overflow-x: auto; /* table scrolls inside its box; the page never overflows */
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  background: var(--surface);
}

.compare-table {
  width: 100%;
  min-width: 660px; /* forces horizontal scroll rather than squashing on mobile */
  border-collapse: collapse;
  font-size: 14px;
}

.compare-table th,
.compare-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.compare-table thead th {
  background: var(--bg);
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.compare-table tbody th[scope="row"] {
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
}

/* Draw the eye to the Window Scene column (2nd cell in each row). */
.compare-table th:nth-child(2),
.compare-table td:nth-child(2) {
  background: var(--wash-select);
  color: var(--ink);
  font-weight: 600;
}

.compare-table th:last-child,
.compare-table td:last-child {
  border-right: 0;
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.compare-note {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-quiet);
}

/* --- Helpers: text on the deep navy band --------------------------------- */
.eyebrow--on-deep {
  color: var(--on-deep-quiet);
}

.lead--on-deep {
  color: var(--on-deep);
}

/* --- Wishlist (#claim) ---------------------------------------------------- */
.wishlist-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--grid-gap);
  align-items: start;
}

.wishlist-intro h2 {
  color: var(--on-deep);
}

.wishlist-intro .lead--on-deep {
  margin-top: 14px;
  max-width: 30em;
}

.wishlist-form {
  display: grid;
  gap: 16px;
  padding: var(--card-pad);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(233, 239, 248, 0.16);
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--on-deep);
}

.field__opt,
.req {
  color: var(--on-deep-quiet);
}

.wishlist-form input[type="email"],
.wishlist-form input[type="text"],
.wishlist-form select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.wishlist-form select {
  padding-block: 10px;
}

.wishlist-form input::placeholder {
  color: var(--ink-quiet);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--on-deep);
  cursor: pointer;
}

.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent-deep);
}

.wishlist-form .btn--primary {
  width: 100%;
}

.wishlist-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--on-deep-quiet);
}

.wishlist-note[data-state="ok"] {
  color: var(--on-deep);
}

.wishlist-note[data-state="error"] {
  color: #f2b8b0; /* semantic error only — not a second brand accent */
}

/* --- Mobile sticky CTA ---------------------------------------------------- */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 10px var(--section-inline);
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: rgba(244, 242, 236, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}

.sticky-cta .btn {
  width: 100%;
}

.sticky-cta[hidden] {
  display: none;
}

@media (min-width: 768px) {
  /* On larger screens the header CTA is always visible. */
  .sticky-cta {
    display: none;
  }
}

/* --- Footer (§1.12) ------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(32px, 5vw, 56px);
  color: var(--ink-muted);
}

.site-footer .footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--grid-gap);
}

.site-footer a {
  color: var(--ink-muted);
}

.site-footer a:hover {
  color: var(--accent-deep);
}

.footer-legal {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* --- Static content pages (our-story, investors, privacy, thanks) -------- */
.prose {
  max-width: 44em;
  margin-top: 16px;
}

.prose > p {
  color: var(--ink-body);
  font-size: clamp(15px, 2.1vw, 19px);
  line-height: 1.65;
}

.prose > p + p {
  margin-top: 1.1em;
}

.prose h2 {
  font-size: clamp(20px, 2.6vw, 30px);
  margin-top: 1.6em;
  margin-bottom: 0.4em;
}

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

.page-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

/* --- Breakpoints: layout expands upward from the 360px base -------------- */
/* Hero height is viewport-driven (see .hero-media), so no aspect-ratio steps. */
