/* night-beam.html: the original Cairn page, restyled around the light-beam hero.
   Loaded after the original stylesheets; everything here layers on top of them. */
:root { --glow: #8cc4ff; --glow-deep: #2f7fe0; --muted-head: #6f7d89; --card: rgba(255,255,255,.022); --card-line: rgba(220,235,247,.09); }

/* ---------- shared section language ---------- */
.section { position: relative; border-top: 0; }
.section::before { content: ""; position: absolute; top: 0; left: 50%; width: min(1260px, 100% - 64px); height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(160,205,255,.24) 50%, transparent); }
.section-label { color: var(--glow); }
.section h2 > span, .product-tour-copy h2 > span { display: block; text-wrap: balance; }
.section h2 > span + span, .product-tour-copy h2 > span + span { color: var(--muted-head); }
.text-link span[aria-hidden] { transition: transform .2s ease; display: inline-block; margin-left: 6px; }
.text-link:hover span[aria-hidden] { transform: translateX(3px); }

/* ---------- hero: copy on top, real screenshot below, beam landing on it ---------- */
.beam-hero { --hit: 50%; }
.beam-hero .hero-layout { display: block; padding-block: 64px 72px; }
.beam-hero .hero-copy { max-width: 1040px; margin-inline: auto; text-align: center; container-type: normal; position: relative; z-index: 3; }
.beam-hero .hero-description { max-width: 540px; margin-inline: auto; }
.beam-hero .hero-actions { justify-content: center; }
.beam-hero .product-composition figcaption { justify-content: center; }
.beam-hero h1 { font-size: clamp(34px, 4.3vw, 58px); line-height: 1.06; text-wrap: balance; }
.beam-hero .hero-copy .section-label { margin-bottom: 14px; }
.beam-hero .hero-description { margin-top: 18px; }
.beam-hero .hero-actions { margin-top: 24px; }
.beam-hero h1 > span { display: inline; white-space: normal; color: var(--muted-head); }
/* the stone photo stays, faded right down so the beam has a dark stage */
.beam-hero .hero-atmosphere img { opacity: .14; filter: saturate(.6); -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 70%); mask-image: linear-gradient(to bottom, #000 30%, transparent 70%); }
.beam-hero .product-composition { position: relative; width: 100%; margin-top: 84px; }
/* the beam falls behind the words: a soft dark pool keeps the headline clean */
.beam-hero .hero-copy::before { content: ""; position: absolute; inset: -40px -60px -70px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(9,11,13,.97) 62%, rgba(9,11,13,.75) 80%, transparent); }
.beam-hero .product-screen { width: 100%; max-width: 100%; -webkit-mask-image: none; mask-image: none; border-color: rgba(160,205,255,.42);
  box-shadow: 0 -30px 80px -40px rgba(47,127,224,.55), 0 26px 70px rgba(0,0,0,.4); }
.beam-hero .product-composition::after { display: none; }
.beam-hero .product-composition figcaption { position: static; }
@media (min-width: 1051px) {
  .beam-hero .hero-layout { padding-block: 64px 72px; }
  .beam-hero .product-screen { width: 100%; max-width: 100%; }
}

/* the beam: React Bits "Light Rays" shader + bright core + impact sparks (beam-hero.js) */
.beam-hero .fx { position: absolute; left: -12%; width: 124%; bottom: calc(100% - 1px); height: min(980px, 150vh); pointer-events: none; z-index: 2;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 22%, #000 82%, transparent), linear-gradient(to bottom, transparent 8%, #000 30%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 22%, #000 82%, transparent), linear-gradient(to bottom, transparent 8%, #000 30%); mask-composite: intersect; }
.beam-hero .fx canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.beam-hero .fx #spark { mix-blend-mode: screen; }
.beam-hero .fx .core { position: absolute; bottom: 0; left: calc((12% + var(--hit)) / 1.24); width: 2px; height: 88%; transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(140,196,255,0), rgba(150,200,255,.45) 35%, #dcefff 88%, #fff);
  box-shadow: 0 0 6px 1px rgba(170,215,255,.8), 0 0 18px 4px rgba(90,160,240,.45), 0 0 60px 14px rgba(47,127,224,.22); }
.beam-hero .flare { position: absolute; left: 0; right: 0; top: -1px; height: 2px; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(140,196,255,.25) calc(var(--hit) - 30%), #d8ecff calc(var(--hit) - 4px), #fff var(--hit), #d8ecff calc(var(--hit) + 4px), rgba(140,196,255,.25) calc(var(--hit) + 30%), transparent 100%); }
.beam-hero .flare::after { content: ""; position: absolute; left: calc(var(--hit) - 300px); width: 600px; top: -90px; height: 180px;
  background: radial-gradient(ellipse at center, rgba(200,230,255,.7), rgba(140,196,255,.35) 22%, rgba(47,127,224,.14) 50%, transparent 72%); filter: blur(4px); }
@media (max-width: 760px) {
  .beam-hero .fx { height: 170px; }
  .beam-hero .fx .core { height: 100%; }
  .beam-hero .hero-layout { padding-block: 40px 48px; }
  .beam-hero .product-composition { margin-top: 110px; }
  .beam-hero .flare::after { left: calc(var(--hit) - 160px); width: 320px; }
}

/* ---------- the final Home screen the beam lands on ---------- */
.beam-hero .product-composition { perspective: 1600px; }
.beam-hero .night-window { position: relative; border-radius: 14px; overflow: hidden; cursor: zoom-in;
  transform-origin: 50% 0; transform: rotateX(var(--tilt, 0deg)) scale(var(--shrink, 1)); will-change: transform; }
.beam-hero .night-window img { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) { .beam-hero .night-window { transform: none; } }
.beam-hero .hero-availability { display: none; }
/* on a phone, zoom into the number and the graph so the screen stays readable */
@media (max-width: 760px) {
  .beam-hero .night-window { aspect-ratio: 1 / 1.02; }
  .beam-hero .night-window img { width: 205%; max-width: none; margin-left: -35.5%; }
}

/* ---------- problem: two quiet cards ---------- */
.problem { background: transparent; }
.work-map { gap: 24px; }
.work-group { padding: 28px 28px 14px; border: 1px solid var(--card-line); border-radius: 16px; background: var(--card); }
.work-group-protected { border-color: rgba(140,196,255,.3); background: linear-gradient(180deg, rgba(47,127,224,.07), rgba(255,255,255,.015) 60%);
  box-shadow: inset 0 1px 0 rgba(200,230,255,.18), 0 -24px 70px -50px rgba(47,127,224,.9); }
.work-group-heading > span { padding: 5px 10px; border: 1px solid var(--card-line); border-radius: 999px; font-size: 11.5px; }
.work-group-protected .work-group-heading > span { border-color: rgba(140,196,255,.4); color: var(--glow); }
.work-group li:last-child { border-bottom: 0; }
.work-group code { display: inline-block; padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.04); color: #dbe6ee; }
.work-group-protected code { background: rgba(140,196,255,.08); color: #d6eaff; }

/* ---------- how it works: four steps with the real screens ---------- */
.step-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 56px; }
.step-tabs button { position: relative; display: flex; align-items: baseline; gap: 10px; padding: 0 0 18px; border: 0; background: none; color: #7d8b97; text-align: left; font-size: 16px; font-weight: 500; }
.step-tabs button small { font: 500 11.5px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: .06em; }
.step-tabs button i { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: rgba(220,235,247,.1); overflow: hidden; }
.step-tabs button i::after { content: ""; position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; background: var(--glow); box-shadow: 0 0 12px rgba(140,196,255,.8); }
.step-tabs button:hover { color: #c5d6e3; }
.step-tabs button[aria-selected="true"] { color: var(--white); }
.step-tabs button[aria-selected="true"] small { color: var(--glow); }
.step-tabs button[aria-selected="true"] i::after { transform: scaleX(1); }
.steps.is-playing .step-tabs button[aria-selected="true"] i::after { animation: step-fill var(--step-time, 7s) linear forwards; }
@keyframes step-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.step-stage { margin-top: 40px; }
.step-panel { display: grid; grid-template-columns: minmax(0, .36fr) minmax(0, .64fr); gap: 56px; align-items: center; }
.step-panel:not([hidden]) { animation: step-in .45s ease-out; }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.step-kicker { margin-bottom: 18px; color: var(--glow); font: 500 12px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; }
.step-copy h3 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.1; text-wrap: balance; }
.step-description { margin-top: 20px; font-size: 17px; color: #b3c1cc; }
.step-note { margin-top: 14px; font-size: 14px; color: #8597a5; }
.step-link { margin-top: 18px; }
.step-shot { position: relative; display: block; overflow: hidden; border: 1px solid rgba(160,205,255,.3); border-radius: 12px; background: #191e23; cursor: zoom-in;
  box-shadow: 0 -30px 80px -50px rgba(47,127,224,.7), 0 30px 80px rgba(0,0,0,.45); transition: border-color .25s ease, transform .25s ease; }
.step-shot::before { content: ""; position: absolute; z-index: 1; top: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, #d8ecff, transparent); }
.step-shot:hover { border-color: rgba(190,225,255,.6); transform: translateY(-2px); }
.step-shot img { width: 100%; }
@media (max-width: 900px) {
  .step-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .step-panel { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- inside Cairn ---------- */
.screen-showcase { position: relative; }
.product-tour-copy h2 { line-height: 1.12; font-size: clamp(30px, 3.2vw, 46px); }
.product-tour-copy .section-label { margin-bottom: 18px; }
.product-tour-screen { border-color: rgba(160,205,255,.3) !important; border-radius: 12px !important; box-shadow: 0 -30px 80px -50px rgba(47,127,224,.7), 0 30px 80px rgba(0,0,0,.45) !important; }
.product-tour-trigger[data-state=open] .product-tour-number { border-color: var(--glow); color: var(--glow); }

/* ---------- features: card grid ---------- */
.feature-grid { gap: 16px; }
.feature-grid article { padding: 26px 26px 28px; border: 1px solid var(--card-line); border-radius: 16px; background: var(--card); transition: border-color .25s ease, background .25s ease, box-shadow .25s ease; }
.feature-grid article:hover { border-color: rgba(140,196,255,.35); background: linear-gradient(180deg, rgba(47,127,224,.06), rgba(255,255,255,.015)); box-shadow: 0 -20px 60px -45px rgba(47,127,224,.9); }
.feature-grid h3 { flex-direction: column; gap: 18px; font-size: 19px; }
.feature-grid .feature-icon { box-sizing: content-box; width: 20px; height: 20px; flex: none; margin: 0; padding: 10px; border: 1px solid rgba(140,196,255,.25); border-radius: 10px; background: rgba(140,196,255,.07); color: var(--glow); }
@media (max-width: 560px) { .feature-grid { row-gap: 12px; } .work-group { padding: 22px 18px 8px; } }

@media (prefers-reduced-motion: reduce) {
  .step-panel:not([hidden]) { animation: none; }
  .step-shot, .feature-grid article { transition: none; }
}

/* ---------- hero option: Wave (big centred words over a glowing particle wave) ---------- */
.wave-fx, .wave-tools { display: none; }
.beam-hero[data-option="wave"] .fx, .beam-hero[data-option="wave"] .flare, .beam-hero[data-option="wave"] .hero-copy::before { display: none; }
.beam-hero[data-option="wave"] .hero-atmosphere img { opacity: .06; }
.beam-hero[data-option="wave"] .hero-layout { padding-top: 0; }
.beam-hero[data-option="wave"] .hero-first { position: relative; z-index: 3; display: flex; flex-direction: column; justify-content: space-between; min-height: calc(100svh - 76px); padding: 12vh 0 34px; }
.beam-hero[data-option="wave"] h1 { font-size: clamp(40px, 5.6vw, 80px); font-weight: 600; line-height: 1.02; letter-spacing: -.04em; }
.beam-hero[data-option="wave"] h1 > span { color: #a9bccb; }
.beam-hero[data-option="wave"] .hero-description { color: #c4d0da; }
.beam-hero[data-option="wave"] .hero-actions .text-link { padding: 12px 22px; border: 1px solid rgba(220,235,247,.35); border-radius: 999px; }
.beam-hero[data-option="wave"] .hero-actions .button { border-radius: 999px; }
.beam-hero[data-option="wave"] .wave-fx { display: block; position: absolute; left: 0; right: 0; top: 0; height: calc(100svh - 76px + 150px); z-index: 1; pointer-events: none; }
.wave-fx canvas { display: block; width: 100%; height: 100%; }
.beam-hero[data-option="wave"] .wave-tools { display: block; text-align: center; }
.wave-tools p { margin: 0 0 16px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #dfe9f2; }
.wave-tools ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 34px; margin: 0; padding: 0; list-style: none; }
.wave-tools li { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 500; color: #d3dde6; }
.wave-tools img { width: 20px; height: 20px; filter: brightness(0) invert(.86); }
.beam-hero[data-option="wave"] .product-composition { margin-top: 72px; }
.beam-hero[data-option="wave"] .stack-strip { display: none; }
@media (max-width: 760px) {
  .beam-hero[data-option="wave"] .hero-first { padding-top: 9vh; min-height: calc(100svh - 64px); }
  .wave-tools ul { gap: 12px 22px; }
  .wave-tools li { font-size: 14px; }
}

/* review switcher (remove once a hero is chosen) */
.hero-switch { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; align-items: center; gap: 4px; padding: 5px; border: 1px solid rgba(220,235,247,.18); border-radius: 999px; background: rgba(12,16,20,.86); backdrop-filter: blur(10px); font-size: 13px; }
.hero-switch span { padding: 0 10px 0 12px; color: #8b98a4; }
.hero-switch button { padding: 7px 16px; border: 0; border-radius: 999px; background: none; color: #c9d4dd; font: inherit; cursor: pointer; }
.hero-switch button[aria-pressed="true"] { background: #cfe6ff; color: #0e1a26; }
