/* Sand live demo showcase (Liam, 30 Sept 2026): the real web app inside a phone, with a guided Info panel. */
:root {
  --espresso: #140d08; --roast: #22160e; --brown: #442F1C; --cream: #F0E4D3; --canvas: #FAF7F2;
  --ink: #F7EFE4; --muted: rgba(240, 228, 211, .66); --faint: rgba(240, 228, 211, .14); --line: rgba(240, 228, 211, .12);
  --accent: #D9A86C; --s: 1;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--espresso); color: var(--ink); font-family: 'Instrument Sans', system-ui, sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; display: grid; grid-template-rows: var(--hh, 72px) minmax(0, 1fr) var(--fh, 52px); height: 100vh; height: 100dvh; }

/* Background: warm espresso with soft light behind the phone */
.bg { position: fixed; inset: 0; z-index: 0; background: radial-gradient(1200px 800px at 28% 55%, #3a2618 0%, var(--roast) 38%, var(--espresso) 75%); }
.glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.g1 { width: 520px; height: 520px; left: calc(28% - 260px); top: calc(52% - 260px); background: radial-gradient(circle, rgba(217, 168, 108, .35), transparent 70%); animation: drift 14s var(--ease) infinite alternate; }
.g2 { width: 700px; height: 420px; right: -160px; top: -120px; background: radial-gradient(circle, rgba(240, 228, 211, .08), transparent 70%); }
.grain { position: absolute; inset: 0; opacity: .08; mix-blend-mode: overlay; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
@keyframes drift { to { transform: translate(40px, -30px) scale(1.08); } }

/* Top bar */
.top { position: relative; z-index: 3; grid-row: 1; height: var(--hh, 72px); display: flex; align-items: center; gap: 16px; padding: 0 40px; }
.brand img { height: 20px; width: auto; display: block; opacity: .95; }
.divider { width: 1px; height: 22px; background: var(--line); }
.client img { height: 18px; width: auto; display: block; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--cream); padding: 7px 12px; border-radius: 999px; background: rgba(240, 228, 211, .07); border: 1px solid var(--line); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #7FD08A; box-shadow: 0 0 0 0 rgba(127, 208, 138, .6); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(127, 208, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 208, 138, 0); } }
.mode { margin-left: auto; font-size: 13px; color: var(--muted); }
.mode b { color: var(--cream); font-weight: 600; }

/* Layout: header / stage / footer rows, so nothing can overlap at any window size */
.stage-wrap { position: relative; z-index: 1; grid-row: 2; min-height: 0; width: 100%; max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: minmax(360px, 1fr) minmax(380px, 560px); align-items: center; gap: clamp(24px, 3vw, 48px); padding: 0 clamp(24px, 5vw, 96px); animation: intro 1100ms var(--ease) both; }
.stage { position: relative; height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center; }
.phone-fit { position: relative; width: calc(417px * var(--s)); height: calc(876px * var(--s)); perspective: 2200px; flex: none; }
@keyframes intro { from { opacity: 0; transform: translateY(14px); } }

/* Phone (iPhone 15 Pro proportions: 393 × 852 screen) */
.phone { --w: 393px; --h: 852px; width: calc(var(--w) + 24px); height: calc(var(--h) + 24px); border-radius: 64px; padding: 4px;
  background: linear-gradient(145deg, #5b5550 0%, #2b2724 22%, #1a1714 50%, #3a3531 78%, #6a635d 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), inset 0 0 6px rgba(0, 0, 0, .9), 0 60px 120px -30px rgba(0, 0, 0, .75), 0 30px 60px -20px rgba(0, 0, 0, .6), -30px 50px 90px -40px rgba(20, 10, 4, .9);
  position: absolute; left: 50%; top: 50%; margin: -438px 0 0 -208.5px;
  transform: scale(var(--s)) rotateY(16deg) rotateX(5deg) rotateZ(1.2deg); transform-style: preserve-3d; transform-origin: 50% 50%;
  transition: transform 900ms var(--ease), box-shadow 900ms var(--ease); will-change: transform; }
.stage.flat .phone, .stage:hover .phone { transform: scale(var(--s)) rotateY(0) rotateX(0) rotateZ(0); }
.bezel { width: 100%; height: 100%; border-radius: 60px; background: #050505; padding: 8px; box-shadow: inset 0 0 0 1.5px #1c1c1c; }
.screen { position: relative; width: var(--w); height: var(--h); border-radius: 52px; overflow: hidden; background: var(--canvas); isolation: isolate; }
.btn { position: absolute; width: 4px; border-radius: 2px; background: linear-gradient(90deg, #6b645e, #2b2724); }
.b1 { left: -3px; top: 150px; height: 32px; } .b2 { left: -3px; top: 220px; height: 64px; } .b3 { left: -3px; top: 300px; height: 64px; } .b4 { right: -3px; top: 250px; height: 100px; background: linear-gradient(270deg, #6b645e, #2b2724); }

.statusbar { position: absolute; z-index: 2; top: 0; left: 0; right: 0; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 6px 30px 0 44px; color: #111; background: var(--canvas); font-weight: 600; font-size: 16.5px; letter-spacing: -.01em; }
.statusbar .time { width: 60px; }
.island { position: absolute; left: 50%; top: 11px; width: 124px; height: 36px; margin-left: -62px; background: #000; border-radius: 20px; }
.icons { display: inline-flex; align-items: center; gap: 6px; }
.icons svg { fill: currentColor; color: #111; display: block; }
#app { position: absolute; top: 54px; left: 0; width: 100%; height: calc(100% - 54px - 20px); border: 0; background: var(--canvas); display: block; }
.homebar { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; background: var(--canvas); display: flex; justify-content: center; align-items: flex-start; padding-top: 7px; }
.homebar span { width: 134px; height: 5px; border-radius: 3px; background: #111; opacity: .85; }
.gloss { position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: 52px; background: linear-gradient(245deg, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, .03) 26%, transparent 42%); opacity: 1; transition: opacity 900ms var(--ease); }
.stage:hover .gloss, .stage.flat .gloss { opacity: 0; }
.floor-shadow { position: absolute; left: 50%; bottom: calc(-22px * var(--s)); width: calc(340px * var(--s)); height: calc(46px * var(--s)); margin-left: calc(-170px * var(--s)); background: radial-gradient(ellipse at center, rgba(0, 0, 0, .55), transparent 70%); filter: blur(12px); transform: translateX(calc(-34px * var(--s))); transition: transform 900ms var(--ease), opacity 900ms; }
.stage:hover .floor-shadow, .stage.flat .floor-shadow { transform: translateX(0); opacity: .8; }
.hint { margin: 0; padding: 12px 0 6px; font-size: 13px; color: var(--muted); letter-spacing: .01em; transition: opacity 600ms; }
.stage.used .hint { opacity: 0; }

/* Info panel */
.info { position: relative; display: flex; flex-direction: column; justify-content: center; gap: clamp(20px, 4vh, 36px); min-height: 0; max-height: 100%; }
.info-inner { position: relative; min-height: var(--info-h, 0); }
.info-inner > * { transition: opacity 360ms var(--ease), transform 520ms var(--ease), filter 360ms var(--ease); }
.info-inner.out > * { opacity: 0; transform: translateY(10px); filter: blur(4px); }
.info-inner.in > * { opacity: 0; transform: translateY(16px); filter: blur(6px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.eyebrow::before { content: ''; width: 26px; height: 1px; background: currentColor; opacity: .7; }
.title { font-size: clamp(34px, 3.3vw, 48px); line-height: 1.04; font-weight: 600; letter-spacing: -.035em; margin: 0 0 18px; color: var(--ink); }
.title em { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -.01em; color: var(--cream); }
.lead { font-size: 17px; line-height: 1.6; color: var(--muted); margin: 0 0 28px; max-width: 48ch; }
.features { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 14px; }
.features li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; font-size: 15px; line-height: 1.5; color: var(--ink); }
.features li span.ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(240, 228, 211, .07); border: 1px solid var(--line); color: var(--accent); }
.features li span.ic svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.features li small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.tip { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 16px 18px; border-radius: 16px; background: linear-gradient(135deg, rgba(217, 168, 108, .14), rgba(217, 168, 108, .05)); border: 1px solid rgba(217, 168, 108, .28); font-size: 14.5px; line-height: 1.55; color: var(--ink); max-width: 52ch; }
.tip b { color: var(--accent); font-weight: 600; }
.tip.note { margin-top: 12px; background: rgba(240, 228, 211, .06); border-color: rgba(240, 228, 211, .16); font-size: 13.5px; color: var(--muted); }
.tip.note b { color: var(--cream); }
.tip code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; background: rgba(0, 0, 0, .25); padding: 2px 6px; border-radius: 6px; color: var(--cream); white-space: nowrap; }
.tip .ic { color: var(--accent); margin-top: 1px; }
.tip .ic svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Journey rail */
.journey { display: flex; gap: 6px; flex-wrap: wrap; }
.journey button { appearance: none; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 999px; cursor: default; transition: background 400ms var(--ease), color 400ms var(--ease), border-color 400ms var(--ease); }
.journey button.on { background: var(--cream); color: var(--brown); border-color: var(--cream); }
.journey button.done { color: var(--cream); border-color: rgba(240, 228, 211, .3); }

.foot { position: relative; z-index: 2; grid-row: 3; align-self: center; padding: 0 40px; font-size: 12.5px; color: rgba(240, 228, 211, .45); }
.foot strong { color: rgba(240, 228, 211, .75); font-weight: 600; }

.about, .sheet { display: none; }

/* Short desktop windows: tighten the copy so it fits beside the phone */
@media (max-height: 820px) and (min-width: 900px) {
  :root { --hh: 64px; --fh: 40px; }
  .eyebrow { margin-bottom: 12px; }
  .title { font-size: clamp(30px, 2.9vw, 40px); margin-bottom: 12px; }
  .lead { font-size: 15.5px; line-height: 1.55; margin-bottom: 20px; }
  .features { gap: 10px; margin-bottom: 20px; }
  .features li { font-size: 14.5px; line-height: 1.4; }
  .features li small { font-size: 13px; }
  .tip { padding: 12px 16px; font-size: 14px; line-height: 1.5; }
}
@media (max-height: 700px) and (min-width: 900px) {
  .lead { font-size: 14.5px; margin-bottom: 16px; }
  .features { gap: 8px; margin-bottom: 16px; }
  .features li { grid-template-columns: 30px 1fr; gap: 12px; }
  .features li span.ic { width: 30px; height: 30px; }
  .tip { font-size: 13.5px; }
}

/* Phones: the app full screen, the Info panel behind a button */
@media (max-width: 899px), (max-height: 560px) {
  body { display: block; overflow: hidden; background: var(--canvas); }
  .bg, .top, .foot, .info, .hint, .floor-shadow, .statusbar, .homebar, .btn, .gloss { display: none !important; }
  .stage-wrap { display: block; padding: 0; height: 100dvh; max-width: none; animation: none; }
  .stage { display: block; height: 100dvh; }
  .phone-fit { width: 100vw; height: 100dvh; perspective: none; }
  .phone, .stage:hover .phone { position: relative; left: auto; top: auto; width: 100vw; height: 100dvh; border-radius: 0; padding: 0; background: none; box-shadow: none; transform: none !important; margin: 0; }
  .bezel { border-radius: 0; padding: 0; background: none; box-shadow: none; }
  .screen { width: 100vw; height: 100dvh; border-radius: 0; }
  #app { top: 0; height: 100%; }
  .about { display: block; position: fixed; z-index: 5; right: 12px; top: calc(env(safe-area-inset-top) + 10px); font: 600 12px/1 'Instrument Sans', system-ui, sans-serif; color: var(--cream); background: rgba(34, 22, 14, .82); backdrop-filter: blur(10px); border: 1px solid rgba(240, 228, 211, .18); padding: 9px 12px; border-radius: 999px; }
  .sheet:not([hidden]) { display: flex; position: fixed; z-index: 6; inset: 0; background: rgba(10, 6, 3, .55); align-items: flex-end; animation: fade 240ms var(--ease); }
  .sheet-card { position: relative; width: 100%; max-height: 82dvh; overflow: auto; background: var(--roast); color: var(--ink); border-radius: 24px 24px 0 0; padding: 28px 22px calc(28px + env(safe-area-inset-bottom)); animation: rise 420ms var(--ease); }
  .sheet-card .title { font-size: 30px; }
  .sheet-close { position: absolute; right: 14px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--cream); font-size: 22px; line-height: 1; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
