/* MY LIFE BECAME THIS — a webtoon page on a night desk: deep navy, paper-white captions, ink-black borders, one warm gold. */
:root {
  --night: #0b0d14; --ink: #14161c; --paper: #fbf8f1; --gold: #f0c27a; --dim: #8f9bb8; --line: rgba(255,255,255,.12);
  --sys: -apple-system, "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", "Noto Sans Thai", "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--night); color: #eef0f6; font: 500 16px/1.45 var(--sys); }
html:lang(ko) { word-break: keep-all; }
html:lang(ja) { line-break: strict; }
button, input, textarea { font: inherit; color: inherit; }
.mute { position: fixed; z-index: 40; top: calc(10px + var(--safe-t)); right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(11,13,20,.75); color: #eef0f6; display: grid; place-items: center; padding: 0; }
.mute svg { width: 20px; height: 20px; }
.screen { max-width: 480px; margin: 0 auto; padding: calc(18px + var(--safe-t)) 18px calc(28px + var(--safe-b)); display: grid; gap: 14px; }

/* the front door */
.kicker { margin: 0; padding-right: 48px; font: 800 11px var(--mono); letter-spacing: .16em; color: var(--gold); text-transform: uppercase; }
.hero h1 { margin: 0; font: 900 clamp(40px, 12.5vw, 60px)/.98 var(--sys); letter-spacing: -.02em; }
:lang(ja) .hero h1, :lang(ko) .hero h1, :lang(th) .hero h1 { letter-spacing: 0; font-size: clamp(32px, 9.5vw, 46px); line-height: 1.12; }
.demo { position: relative; margin: 6px auto 0; width: 68%; transform: rotate(-1.6deg); }
.demo canvas { width: 100%; height: auto; display: block; border: 4px solid var(--ink); outline: 2px solid rgba(255,255,255,.08); box-shadow: 0 30px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(240,194,122,.25); }
.demo::after { content: ''; position: absolute; inset: -12px auto auto -16px; width: 64px; height: 24px; background: rgba(240,194,122,.85); transform: rotate(-24deg); box-shadow: 0 4px 10px rgba(0,0,0,.4); } /* a strip of tape */
.sub { margin: 0; font: 700 18px/1.35 var(--sys); text-wrap: balance; }
.friend { margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(240,194,122,.12); border: 1px solid rgba(240,194,122,.5); font-weight: 700; }
form { display: grid; gap: 10px; }
textarea { width: 100%; min-height: 96px; resize: none; padding: 16px 18px; border: 4px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); font: 800 21px/1.3 var(--sys); box-shadow: 6px 7px 0 rgba(0,0,0,.45); transform: rotate(-.6deg); }
textarea::placeholder { color: #9a9483; font-weight: 700; }
textarea:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
input#name { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(255,255,255,.05); font-weight: 700; }
.go { min-height: 58px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #ffe2b0, var(--gold)); color: #1b1206; font: 900 19px var(--sys); cursor: pointer; box-shadow: 0 12px 30px rgba(240,194,122,.25), 0 10px 22px rgba(0,0,0,.45); }
.go:active { transform: scale(.98); }
.ghost { min-height: 48px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.25); background: transparent; color: #eef0f6; font-weight: 800; cursor: pointer; padding: 0 12px; }
.err { margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(255,90,90,.12); border: 1px solid rgba(255,120,120,.5); font-weight: 700; }
.fine { margin: 0; font-size: 12.5px; color: var(--dim); text-align: center; }
.ph { display: inline-block; } .flow .ph { display: inline; } /* one sentence never breaks across a stray line end, unless it is longer than a line */

/* inking */
.inking { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 18px; background: rgba(11,13,20,.92); }
.inking p { margin: 0; font: 800 15px var(--mono); letter-spacing: .14em; color: var(--gold); text-transform: uppercase; }
.nib { width: 160px; height: 4px; background: linear-gradient(90deg, transparent, var(--paper)); border-radius: 2px; animation: ink 1.1s ease-in-out infinite; transform-origin: left; }
@keyframes ink { 0% { transform: scaleX(.05); opacity: .4; } 60% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1) translateX(30px); opacity: 0; } }

/* the page */
.strip { display: grid; gap: 14px; padding: 12px; margin: 0 -18px; background: #07080d; }
.strip canvas { width: 100%; height: auto; display: block; border: 3px solid #000; clip-path: inset(0 0 100% 0); opacity: 0; }
.strip canvas.in { animation: reveal .75s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes reveal { 0% { clip-path: inset(0 0 100% 0); opacity: 1; filter: brightness(1.6) contrast(.8); } 100% { clip-path: inset(0 0 0 0); opacity: 1; filter: none; } }
.claim { margin: 6px 0 0; text-align: center; font: italic 800 21px/1.35 var(--sys); color: var(--paper); text-wrap: balance; }
.actions { display: grid; gap: 10px; }
.actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.door { display: block; padding: 15px; border-radius: 14px; background: #2a1c14; color: #f6e8d6; text-decoration: none; font-weight: 800; text-align: center; }

/* a heavy sentence */
.crisis { min-height: 100vh; align-content: center; text-align: center; }
.crisis h2 { margin: 0; font: 900 28px/1.2 var(--sys); }
.crisis p { margin: 0; font-size: 17px; }
a.go { display: grid; place-items: center; text-decoration: none; padding: 0 16px; }
.crisis .res { padding: 14px; border-radius: 14px; background: rgba(240,194,122,.1); border: 1px solid rgba(240,194,122,.45); font-weight: 800; color: var(--paper); }
@media (prefers-reduced-motion: reduce) { .strip canvas { clip-path: none; opacity: 1; } .strip canvas.in { animation: none; } .nib { animation: none; } .demo { transform: none; } }
/* share as a video: its own colour (the feed's red), a play mark, a pulse when ready */
.vid { min-height: 56px; border-radius: 14px; border: 2px solid #ff4d5e; background: rgba(255,77,94,.1); color: #fff; font: 900 18px var(--sys); cursor: pointer; }
.vid::before { content: '▶'; margin-right: 10px; color: #ff4d5e; }
.vid.ready { background: linear-gradient(180deg, #ff6b7a, #e11d48); border-color: transparent; animation: vidReady 1.4s ease-in-out infinite; }
.vid.ready::before { color: #fff; }
@keyframes vidReady { 50% { box-shadow: 0 0 0 8px rgba(255,77,94,.18); } }
@media (prefers-reduced-motion: reduce) { .vid.ready { animation: none; } }
