/* foundercamera.com — "The Lamp".
   The page is a room with the light off: warm near-black, ivory type, the
   store frames' own palette. The Light switch in the bar does what the app
   does to a face: it turns the whole page into a warm lit sheet. Gold is
   the ring on the app icon's lens; red is the record button, used once. */

:root {
    --ground: #121110;
    --raise: #1b1917;
    --ink: #f7f3ec;
    --sub: #b5aea3;
    --line: rgba(247, 243, 236, 0.12);
    --gold: #d9a441;
    --record: #e5483b;
    --code: #efe6d6;

    --lamp-warm: #f4d3a8;
    --lamp-daylight: #fbfaf7;
    --lamp-cool: #dfe8f3;
    --lamp-rose: #f3d3d2;
    --lamp-off: #0b0a09;

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
    --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --gutter: clamp(16px, 4vw, 40px);
    --max: 1120px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    color-scheme: dark;
}

/* The light on: the warm sheet of frame 03. */
:root[data-light="on"] {
    --ground: #f3e6d3;
    --raise: #fbf4e8;
    --ink: #1a1612;
    --sub: #6b5f52;
    --line: rgba(26, 22, 18, 0.12);
    --gold: #9a6a12;
    --code: #2a241d;
    color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font: 17px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.6s var(--ease), color 0.6s var(--ease);
}

img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; }

.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--ink); color: var(--ground); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { inset-inline-start: 8px; }

h1, h2 { font-family: var(--display); letter-spacing: -0.025em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); line-height: 1.02; font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); line-height: 1.06; font-weight: 700; }
p { margin: 0 0 1em; }

.kicker { font-size: 0.95rem; font-weight: 600; letter-spacing: 0.01em; color: var(--gold); margin-bottom: 0.9rem; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--sub); max-width: 34em; margin-top: 1.4rem; }
.quiet { color: var(--sub); }
.prose { color: var(--sub); max-width: 34em; }
.prose p { margin-bottom: 1.1em; }

/* The bar */
.bar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--ground) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); transition: background-color 0.6s var(--ease); }
.bar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.brand img { border-radius: 7px; }
.bar-links { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 24px); font-size: 0.95rem; }
.bar-links a { text-decoration: none; color: var(--sub); }
.bar-links a:hover, .bar-links a[aria-current] { color: var(--ink); }
.light-switch { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--ink); background: var(--raise); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px 7px 11px; min-height: 36px; cursor: pointer; transition: background-color 0.3s, border-color 0.3s; }
.light-switch svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.light-switch svg circle { fill: transparent; transition: fill 0.3s; }
.light-switch[aria-pressed="true"] { border-color: var(--gold); }
.light-switch[aria-pressed="true"] svg circle { fill: var(--gold); stroke: var(--gold); }

/* Hero */
.hero { padding-block: clamp(48px, 8vw, 104px) clamp(56px, 8vw, 112px); overflow-x: clip; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.soon { display: inline-flex; align-items: center; gap: 10px; margin-top: 2rem; margin-bottom: 0.8rem; font-weight: 600; border: 1px solid var(--line); background: var(--raise); padding: 12px 18px; border-radius: 12px; }
.soon .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--record); box-shadow: 0 0 0 4px color-mix(in srgb, var(--record) 25%, transparent); }
.badge { display: inline-block; margin-top: 2rem; margin-bottom: 0.8rem; }
.badge img { display: block; height: 50px; width: auto; }
.note { color: var(--sub); font-size: 0.95rem; }

/* The lamp: a screen as the app lights it */
.hero-device { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.lamp { --lamp: var(--lamp-warm); --lamp-ink: #1a1612; --ink-strength: 0.15; position: relative; margin: 0; width: min(320px, 76vw); aspect-ratio: 1470 / 3000; isolation: isolate; }
.lamp[data-lamp="daylight"] { --lamp: var(--lamp-daylight); }
.lamp[data-lamp="cool"] { --lamp: var(--lamp-cool); }
.lamp[data-lamp="rose"] { --lamp: var(--lamp-rose); }
.lamp[data-lamp="off"] { --lamp: var(--lamp-off); --lamp-ink: #f2eee7; --ink-strength: 0.22; }
/* The lamp's light in the room: a pool on the page behind the phone, never a
   shadow or glow on Apple's bezel itself. */
.lamp::before { content: ""; position: absolute; inset: 8% -30% 4%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--lamp) 34%, transparent), transparent); filter: blur(24px); transition: background 0.6s var(--ease); }
/* Apple's screen hole in the 1470 x 3000 bezel: 1320 x 2868 at (75, 66), corner radius 190. */
.screen { position: absolute; left: 5.102%; top: 2.2%; width: 89.796%; height: 95.6%; border-radius: 14.4% / 6.62%; overflow: hidden; background: var(--lamp); color: var(--lamp-ink); container-type: inline-size; transition: background-color 0.6s var(--ease), color 0.6s var(--ease); }
.bezel { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
/* The app draws the depth mask as ink at the outline's strength, blurred by 10 points on a 440-point screen. */
.outline { position: absolute; inset: 0; width: 100%; height: 100%; fill: currentColor; opacity: var(--ink-strength); filter: blur(2.3cqw); }
/* The app's default reading position, High: the reading line 18% down, the words gone to paper by half way. */
.roll { position: absolute; inset: 6.5% 7% 50% 7%; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 9%, #000 58%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0%, #000 9%, #000 58%, transparent 100%); }
.roll-inner { padding-top: 8cqw; animation: roll 30s linear infinite; }
.roll-inner p { font-size: 7.4cqw; line-height: 1.3; font-weight: 550; letter-spacing: -0.01em; margin: 0 0 0.75em; }
@keyframes roll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.rec { position: absolute; bottom: 7%; left: 50%; width: 17cqw; height: 17cqw; transform: translateX(-50%); border-radius: 50%; border: 0.9cqw solid color-mix(in srgb, var(--lamp-ink) 28%, transparent); z-index: 2; }
.rec::after { content: ""; position: absolute; inset: 1.4cqw; border-radius: 50%; background: var(--record); }

.swatches { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 420px; }
.swatches button { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 0.82rem; color: var(--sub); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px 6px 7px; min-height: 36px; cursor: pointer; }
.swatches button[aria-checked="true"] { color: var(--ink); border-color: var(--gold); }
.chip { display: inline-block; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.chip-warm { background: var(--lamp-warm); }
.chip-daylight { background: var(--lamp-daylight); }
.chip-cool { background: var(--lamp-cool); }
.chip-rose { background: var(--lamp-rose); }
.chip-off { background: var(--lamp-off); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }

/* Bands */
.band { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 6vw, 80px); align-items: start; }
.split h2 { margin-bottom: 1.2rem; }

.md-card { background: var(--raise); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 3vw, 28px); }
.md-title { font-weight: 650; margin-bottom: 1rem; }
.md { margin: 0; display: grid; gap: 14px; }
.md > div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 16px; align-items: baseline; padding-top: 14px; border-top: 1px solid var(--line); }
.md dt code { font-family: var(--mono); font-size: 0.9rem; color: var(--code); overflow-wrap: anywhere; }
.md dd { margin: 0; color: var(--sub); font-size: 0.95rem; }

.lamps { display: flex; gap: 10px; margin-block: 0.4rem 1rem; }
.lamps .chip { width: 44px; height: 44px; border-radius: 12px; }

.ask { margin: 0.4rem 0 0; padding: 16px 20px; background: var(--raise); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; color: var(--ink); font-weight: 550; max-width: 30em; }

.receipt { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); background: var(--raise); border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px 10px 12px; font-size: 0.95rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.tick { width: 18px; height: 18px; border-radius: 50%; background: #3fa66b; position: relative; flex: none; }
.tick::after { content: ""; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.frames-band h2 { margin-bottom: 2rem; }
.frames { display: flex; gap: clamp(12px, 2vw, 20px); overflow-x: auto; scroll-snap-type: x mandatory; padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); padding-bottom: 12px; scrollbar-width: thin; }
.frames img { flex: none; width: clamp(200px, 24vw, 250px); height: auto; border-radius: 18px; scroll-snap-align: center; border: 1px solid var(--line); }

.system h2 { max-width: 16em; margin-bottom: 1.4rem; }
.arrow { font-weight: 600; color: var(--ink); }
.arrow::after { content: " →"; }
[dir="rtl"] .arrow::after { content: " ←"; }

.closer { text-align: center; }
.closer .wrap { display: flex; flex-direction: column; align-items: center; }
.closer-icon { border-radius: 22px; margin-bottom: 1.4rem; }
.closer .soon, .closer .badge { margin-top: 1.6rem; }
.req { max-width: 40em; font-size: 0.95rem; margin-bottom: 0.4rem; word-break: keep-all; line-break: strict; }

/* Line breaking: Japanese breaks at phrase boundaries, Korean between words,
   so a headline never strands one character on its own line. */
:lang(ja) { word-break: auto-phrase; }
:lang(ko) { word-break: keep-all; }

/* Pages */
.page { padding-block: clamp(40px, 7vw, 88px); }
.page h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.page h2 { font-size: 1.35rem; letter-spacing: -0.01em; margin-top: 2.6rem; margin-bottom: 0.8rem; }
.prose-page p, .prose-page li { color: var(--sub); }
.prose-page strong { color: var(--ink); font-weight: 600; }
.prose-page ul { padding-inline-start: 1.2em; }
.prose-page li { margin-bottom: 0.8em; }
.qa { border-top: 1px solid var(--line); padding-block: 14px; }
.qa:last-of-type { border-bottom: 1px solid var(--line); }
.qa summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; min-height: 28px; align-items: center; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--sub); font-weight: 400; font-size: 1.3rem; }
.qa[open] summary::after { content: "−"; }
.qa p { color: var(--sub); margin: 0.7rem 0 0.2rem; max-width: 40em; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 40px calc(28px + env(safe-area-inset-bottom, 0px)); font-size: 0.92rem; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.foot .brand { margin-bottom: 0.8rem; }
.langs { display: flex; flex-wrap: wrap; gap: 6px 14px; align-content: start; }
.langs a { color: var(--sub); text-decoration: none; }
.langs a[aria-current] { color: var(--ink); font-weight: 600; }
.fine { color: var(--sub); font-size: 0.8rem; margin-top: 24px; opacity: 0.8; }

/* 404 */
.missing { min-height: 60vh; display: grid; place-items: center; text-align: center; }

@media (max-width: 860px) {
    .hero-grid, .split { grid-template-columns: 1fr; }
    .hero-device { order: 2; }
}

@media (max-width: 480px) {
    .brand span { display: none; }
    .md > div { grid-template-columns: 1fr; gap: 4px; }
}

/* Reduced motion: the script rests on its first lines, the light changes without fading. */
@media (prefers-reduced-motion: reduce) {
    .roll-inner { animation: none; }
    body, .screen, .lamp, .bar { transition: none; }
}
