/* placeanew.com home page: dark, cinematic, scroll-driven.
   Loaded only on the home page (see "styles:" in src/pages/index.html).
   Same system font and brand blue as the app; the night background lets the scan glow. */

.page-index {
  --night: #04060d;
  --ink: #f4f6fb;
  --ink-2: rgba(236, 240, 250, 0.74);
  --ink-3: rgba(236, 240, 250, 0.52);
  --edge: rgba(255, 255, 255, 0.09);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --section: 112px;
  background: var(--night);
  color: var(--ink);
}
@media (max-width: 819px) { .page-index { --section: 76px; } }
.page-index a:not(.btn) { color: #8fb0ff; }
.page-index .muted, .page-index .lead { color: var(--ink-2); }
.page-index .eyebrow { color: #7fa3ff; }

.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;
}

/* Header over the night sky */
.page-index .site-header {
  background: rgba(4, 6, 13, 0.35);
  border-bottom-color: transparent;
  transition: background-color 300ms ease, border-color 300ms ease;
}
.page-index .site-header.scrolled { background: rgba(4, 6, 13, 0.78); border-bottom-color: var(--edge); }
.page-index .brand { color: var(--ink); }
.page-index .site-nav a { color: var(--ink-2); }
.page-index .site-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* Buttons on dark */
.page-index .btn-glow { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 10px 40px rgba(15, 84, 242, 0.55); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }
@media (hover: hover) and (pointer: fine) {
  .page-index .btn { transition: transform 160ms var(--ease-out), background-color 160ms ease, box-shadow 160ms ease; }
  .page-index .btn:hover { transform: translateY(-1px); }
}
.page-index .btn:active { transform: scale(0.97); }

/* ---------------------------------------------------------------------- */
/* The story: a pinned stage with one card per step, five screens of scroll */
/* ---------------------------------------------------------------------- */
.story { position: relative; background: var(--night); }
.story-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh; /* always covers the screen, also when the phone's toolbar hides */
  overflow: hidden;
  background: radial-gradient(120% 90% at 60% 55%, #0b1430 0%, #050811 55%, #03050b 100%);
  z-index: 1;
}
.story-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 600ms ease; }
.story.is-live .story-canvas { opacity: 1; }
/* The still picture shows only without JavaScript (noscript) or without WebGL. */
.story-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.story-fallback:not(.nojs) { display: none; }
.story.no-webgl .story-fallback { display: block; }

/* Real renders from the app's 3D view, moved by the page's camera. */
.story-renders { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.story-pic {
  position: absolute; left: 0; top: 0; max-width: none;
  transform-origin: 0 0; opacity: 0; will-change: transform, opacity;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 72%, transparent 100%);
}
.story-focus {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at var(--fx, 60%) var(--fy, 50%), transparent 0, transparent 16%, rgba(4, 6, 13, 0.5) 38%, rgba(4, 6, 13, 0.82) 72%);
}
.story-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(140% 100% at 50% 50%, transparent 58%, rgba(2, 3, 8, 0.7) 100%),
    linear-gradient(to bottom, rgba(4, 6, 13, 0.5), transparent 20%, transparent 80%, rgba(4, 6, 13, 0.6));
}

/* Room labels: white chips, like the app's 3D labels. */
.story-labels { position: absolute; inset: 0; pointer-events: none; }
.room-label {
  position: absolute; left: 0; top: 0;
  padding: 5px 10px 6px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.95);
  color: #0b1020;
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  opacity: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  will-change: transform, opacity;
  transition: background-color 300ms ease, color 300ms ease, box-shadow 300ms ease;
}
.room-label b { display: block; font-weight: 650; letter-spacing: -0.01em; }
.room-label span { color: #5b6476; font-variant-numeric: tabular-nums; }
.room-label.is-focus { background: #0f54f2; color: #fff; box-shadow: 0 8px 28px rgba(15, 84, 242, 0.65); }
.room-label.is-focus span { color: rgba(255, 255, 255, 0.85); }
@media (min-width: 820px) { .room-label { font-size: 13px; padding: 6px 11px 7px; } }
@media (max-width: 519px) { .room-label { font-size: 10.5px; padding: 3px 7px 4px; border-radius: 7px; } }

/* The four step cards live on the stage; one shows at a time. */
.story-cards-wrap { position: absolute; inset: 0; display: flex; align-items: center; pointer-events: none; z-index: 3; }
.story-cards { display: grid; width: 440px; max-width: 100%; }
.step-card {
  grid-area: 1 / 1;
  align-self: center;
  padding: 28px 30px 26px;
  border-radius: 22px;
  background: rgba(8, 12, 26, 0.9);
  border: 1px solid var(--edge);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 380ms ease-out, transform 560ms var(--ease-out);
  pointer-events: none;
}
.step-card.is-on, .step-card:focus-within { opacity: 1; transform: none; pointer-events: auto; }
.step-card h2 { font-size: clamp(1.55rem, 2.6vw, 2.25rem); color: #fff; margin-bottom: 12px; letter-spacing: -0.025em; }
.step-card p { color: var(--ink-2); margin-bottom: 0.7em; }
.step-card p:last-child { margin-bottom: 0; }
.story-kicker {
  display: inline-block; margin-bottom: 12px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #8fb0ff;
}
.step-fine { font-size: 0.86rem; color: var(--ink-3) !important; }
.text-link { font-weight: 600; pointer-events: auto; }

.stats { display: grid; grid-template-columns: repeat(4, auto); gap: 14px; margin: 18px 0 0; justify-content: start; }
.stats dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.stats dd { margin: 2px 0 0; font-size: clamp(1.25rem, 5vw, 1.6rem); font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }

/* Tall screens: the card sits at the bottom, the picture above it. Same rule as home.js. */
@media (max-width: 719px), (max-aspect-ratio: 17/20) {
  .story-cards-wrap { align-items: flex-end; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .story-cards { width: 100%; }
  .step-card { align-self: end; padding: 20px 20px 18px; border-radius: 20px; }
  .step-card h2 { font-size: clamp(1.35rem, 6vw, 1.7rem); margin-bottom: 8px; }
  .step-card p { font-size: 0.97rem; }
  .step-fine { display: none; }
  .stats { gap: 12px; margin-top: 12px; }
}

/* Scroll length: the hero, then one screen per step. */
.story-steps { position: relative; margin-top: -100vh; margin-top: -100lvh; z-index: 2; pointer-events: none; }
.story-step { min-height: 100vh; min-height: 100svh; }
.story-hero { pointer-events: auto; }

/* Hero (unchanged since the owner approved it) */
.story-hero { display: flex; align-items: flex-start; text-align: center; padding-top: 18vh; position: relative; overflow: hidden; }
@media (min-width: 820px) { .story-hero { align-items: flex-start; padding-top: 16vh; } }
.hero-copy { display: flex; flex-direction: column; align-items: center; position: relative; }
/* A soft shadow of night behind the hero text, so the scan glows around it, not through it. */
.hero-copy::before {
  content: ""; position: absolute; left: 50%; top: 48%; width: min(1100px, 100vw); height: 130%;
  transform: translate(-50%, -50%); z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(4, 6, 13, 0.82), rgba(4, 6, 13, 0.5) 55%, transparent);
}
.hero-copy .lead { max-width: 640px; margin: 0 auto 26px; font-size: clamp(1.05rem, 2.6vw, 1.25rem); }
.hero-copy .btn-row { justify-content: center; }
.hero-title {
  font-size: clamp(2.5rem, 9.2vw, 5.6rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
  margin: 6px 0 22px;
  color: #fff;
}
.hero-title .line { display: block; }
.hero-title .glow .word {
  background: linear-gradient(100deg, #7ea6ff 0%, #ffffff 42%, #ffd2c4 68%, #7ea6ff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: word-in 1000ms var(--ease-out) both, shimmer 9s linear 1.6s infinite;
}
.hero-title .glow { filter: drop-shadow(0 0 28px rgba(70, 120, 255, 0.45)); }
.hero-note { justify-content: center; color: var(--ink-3); margin-top: 16px; }
.hero-title .word { display: inline-block; animation: word-in 1000ms var(--ease-out) both; }
.hero-title .line:nth-child(1) .word:nth-child(1) { animation-delay: 120ms; }
.hero-title .line:nth-child(1) .word:nth-child(2) { animation-delay: 190ms; }
.hero-title .line:nth-child(1) .word:nth-child(3) { animation-delay: 260ms; }
.hero-title .line:nth-child(1) .word:nth-child(4) { animation-delay: 330ms; }
.hero-title .line:nth-child(2) .word:nth-child(1) { animation-delay: 470ms, 1.6s; }
.hero-title .line:nth-child(2) .word:nth-child(2) { animation-delay: 540ms, 1.6s; }
.hero-title .line:nth-child(2) .word:nth-child(3) { animation-delay: 610ms, 1.6s; }
.hero-title .line:nth-child(2) .word:nth-child(4) { animation-delay: 680ms, 1.6s; }
@keyframes word-in {
  from { opacity: 0; transform: translateY(0.35em); filter: blur(12px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -120% 0; } }
.reveal-load { animation: rise 900ms var(--ease-out) both; }
.hero-copy .eyebrow.reveal-load { animation-delay: 40ms; }
.hero-copy .lead.reveal-load { animation-delay: 760ms; }
.hero-copy .btn-row.reveal-load { animation-delay: 880ms; }
.hero-copy .hero-note.reveal-load { animation-delay: 1000ms; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------- */
/* After the story                                                         */
/* ---------------------------------------------------------------------- */
.night { position: relative; padding: var(--section) 0; background: var(--night); }
.night h2 { color: #fff; letter-spacing: -0.03em; font-size: clamp(2rem, 4.6vw, 3.25rem); }
.night h3 { color: #fff; }

.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 100ms); }
.js .reveal.in { opacity: 1; transform: none; }
.i1 { --i: 1; } .i2 { --i: 2; } .i3 { --i: 3; }

/* App screens: one device, the line in view picks its screen. */
.screens-grid { display: grid; gap: 40px; align-items: start; }
.screens-copy h2 { margin-bottom: 28px; }
.screen-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.screen-item button {
  all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer;
  padding: 16px 18px 16px 20px; border-radius: 16px; position: relative;
  color: var(--ink-3); transition: color 300ms ease, background-color 300ms ease;
}
.screen-item button:focus-visible { outline: 3px solid rgba(15, 84, 242, 0.6); outline-offset: 2px; }
.screen-item b { display: block; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; color: inherit; }
.screen-item span { display: block; margin-top: 4px; color: inherit; }
.screen-item button::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px;
  background: #0f54f2; box-shadow: 0 0 14px rgba(15, 84, 242, 0.9); opacity: 0; transform: scaleY(0.4);
  transition: opacity 300ms ease, transform 400ms var(--ease-out);
}
.screen-item.is-on button { color: #fff; background: rgba(255, 255, 255, 0.04); }
.screen-item.is-on button::before { opacity: 1; transform: none; }
.screen-item.is-on span { color: var(--ink-2); }
/* The glow behind the phone is wider than a phone screen; clip it at the section's sides so the page never scrolls
   sideways. "clip" (not "hidden") keeps the sticky phone on wide screens working. */
.app-screens { overflow-x: clip; }
@supports not (overflow: clip) {
  .screens-device::before { max-width: 100vw; }
}
.screens-device { display: flex; justify-content: center; position: relative; }
.screens-device::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 520px; height: 620px; max-width: 120vw;
  transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(closest-side, rgba(15, 84, 242, 0.32), transparent);
}
.device {
  position: relative; width: min(300px, 72vw); aspect-ratio: 600 / 1305;
  border-radius: 50px; padding: 11px;
  background: linear-gradient(150deg, #3a4150, #11141b 40%, #0b0d12 70%, #2a303c);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 50px 120px rgba(0, 0, 0, 0.65);
}
.screen-shot {
  position: absolute; left: 11px; top: 11px; width: calc(100% - 22px); height: calc(100% - 22px);
  object-fit: cover; border-radius: 40px; opacity: 0; transform: scale(1.015);
  transition: opacity 450ms ease, transform 650ms var(--ease-out);
}
.screen-shot.is-on { opacity: 1; transform: none; }
@media (min-width: 900px) {
  .screens-grid { grid-template-columns: 1fr 1fr; gap: 72px; }
  .screens-copy { padding: 6vh 0 30vh; }
  .screen-list { gap: 17vh; margin-top: 6vh; }
  .screens-device { position: sticky; top: calc(50vh - 300px); height: 600px; align-items: center; }
  .device { width: 290px; }
}
@media (max-width: 899px) {
  .screens-copy { text-align: center; }
  .screen-list { grid-template-columns: repeat(4, auto); justify-content: center; gap: 6px; margin-bottom: 8px; }
  .screen-item button { padding: 9px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); }
  .screen-item b { font-size: 0.95rem; }
  .screen-item span, .screen-item button::before { display: none; }
  .screen-item.is-on button { background: #0f54f2; }
}

/* The PDF as paper: two real pages, lifted off the dark. */
.docs-grid { display: grid; gap: 48px; align-items: center; }
.docs-copy h2 { margin-bottom: 16px; }
.docs-copy .muted { max-width: 480px; }
.formats { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.formats li {
  padding: 8px 14px; border-radius: 999px; font-size: 0.92rem; color: var(--ink-3);
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
}
.formats b { color: #fff; font-weight: 650; }
.paper-stack { position: relative; aspect-ratio: 1600 / 1143; margin: 6% 4% 8% 2%; perspective: 1600px; }
.paper {
  position: absolute; inset: 0; margin: 0; border-radius: 6px; overflow: hidden; background: #fbfaf7;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 60px 110px rgba(0, 0, 0, 0.6), 0 16px 36px rgba(0, 0, 0, 0.35);
  transition: transform 1200ms var(--ease-out);
}
.paper img { width: 100%; height: 100%; object-fit: cover; }
.paper-back { transform: translate(7%, -9%) rotate(5deg); filter: brightness(0.9); }
.paper-front { transform: translate(-2%, 3%) rotate(-3deg); }
.js .paper-stack:not(.in) .paper-back { transform: translate(2%, -2%) rotate(1deg); }
.js .paper-stack:not(.in) .paper-front { transform: translate(-1%, 6%) rotate(-1deg); }
@media (min-width: 900px) { .docs-grid { grid-template-columns: 0.85fr 1.15fr; gap: 72px; } }

/* Who it's for: one line naming the people it serves, two image-led tiles, then the privacy facts on one line. */
.audience-head h2 { margin-bottom: 14px; }
.audience-head .muted { max-width: 600px; margin: 0 auto; }
.tiles { display: grid; gap: 18px; }
.tile { position: relative; margin: 0; border-radius: 26px; overflow: hidden; aspect-ratio: 4 / 3.4; background: #0a0f1d; border: 1px solid var(--edge); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(4, 6, 13, 0.97) 0%, rgba(4, 6, 13, 0.82) 34%, rgba(4, 6, 13, 0.35) 58%, transparent 76%); }
@media (max-width: 819px) { .tile { aspect-ratio: 4 / 4.7; } }
/* The plan sits in the tile's top part over plain dark grid: a shorter shade keeps its room chips white. */
.tile-plan::after { background: linear-gradient(to top, rgba(4, 6, 13, 0.97) 0%, rgba(4, 6, 13, 0.85) 30%, rgba(4, 6, 13, 0.4) 38%, transparent 46%); }
.tile-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 26px 24px; z-index: 1; }
.tile-copy h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -0.025em; margin: 6px 0 8px; }
.tile-copy p { color: var(--ink-2); margin: 0; max-width: 420px; }
@media (hover: hover) and (pointer: fine) { .tile:hover img { transform: scale(1.035); } }
@media (min-width: 820px) { .tiles { grid-template-columns: 1fr 1fr; gap: 22px; } .tile { aspect-ratio: 4 / 3.6; } }

.trust {
  list-style: none; margin: 40px 0 0; padding: 18px 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 30px;
  border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge); color: var(--ink-2); font-weight: 550;
}
.trust li { display: inline-flex; align-items: center; gap: 10px; }
.trust svg { width: 20px; height: 20px; fill: none; stroke: #8fb0ff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Finale: the scan's light again, behind one line. */
.finale { overflow: hidden; text-align: center; padding: calc(var(--section) * 1.25) 0; }
.finale-bg {
  position: absolute; left: 50%; top: 50%; width: min(1600px, 160vw); height: auto; max-width: none;
  transform: translate(-50%, -46%); opacity: 0.75; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 55%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 55%, #000 35%, transparent 100%);
}
.finale-copy { position: relative; }
.finale h2 { font-size: clamp(2.3rem, 6.4vw, 4.4rem); line-height: 1.02; letter-spacing: -0.04em; margin-bottom: 16px; text-shadow: 0 2px 30px rgba(4, 6, 13, 0.8); }
.finale p { color: var(--ink-2); max-width: 560px; margin: 0 auto; }
.finale .btn-row { justify-content: center; margin-top: 28px; }
.finale .maker { margin-top: 44px; font-size: 0.9rem; color: var(--ink-3); max-width: 640px; }

/* Footer on the night page */
.page-index .site-footer { background: #03050b; border-top-color: var(--edge); margin-top: 0; }
.page-index .footer-brand p, .page-index .footer-links a { color: var(--ink-3); }
.page-index .footer-links a:hover { color: #fff; }
.page-index .site-footer .brand { color: var(--ink); }
.page-index .footer-legal p { color: rgba(236, 240, 250, 0.6); } /* 6:1 on #03050b; was 0.36 */

/* Review captures */
.still .story-steps, .still .site-header, .still .story-vignette, .still .story-labels, .still .story-cards-wrap { visibility: hidden; }
.still.still-labels .story-labels { visibility: visible; }
.still .site-header { display: none; } /* narrow screens keep the header in the flow; stills start at the top */
.story.at-review .hero-copy { opacity: 0 !important; }

/* No JavaScript: the steps as plain cards under the picture. */
html:not(.js) .story-stage { position: relative; height: auto; min-height: 100vh; }
html:not(.js) .story-cards-wrap { position: relative; display: block; padding: 60vh 0 40px; }
html:not(.js) .story-cards { display: grid; gap: 16px; width: auto; }
html:not(.js) .step-card { grid-area: auto; opacity: 1; transform: none; }
html:not(.js) .story-steps { margin-top: 0; }
html:not(.js) .story-step:not(.story-hero) { display: none; }

/* Reduced motion: no drifting, no blur, no loops; fades stay. */
@media (prefers-reduced-motion: reduce) {
  .hero-title .word, .hero-title .glow .word, .reveal-load { animation: fade 400ms ease both !important; }
  .js .reveal, .step-card, .screen-shot, .paper, .tile img { transform: none !important; transition: opacity 400ms ease !important; }
  .js .paper-stack .paper-back { transform: translate(7%, -9%) rotate(5deg) !important; }
  .js .paper-stack .paper-front { transform: translate(-2%, 3%) rotate(-3deg) !important; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
