@font-face {
  font-family: 'Afsaneh';
  src: url('fonts/Afsaneh.ttf') format('truetype');
  font-display: swap;
}

:root {
  /* alirezarajabi.com palette */
  --green: #142C2B;
  --green-2: #273D35;
  --cream: #F7F4EE;
  --copper: #DDA77D;
  --copper-dark: #9B673C;
  --sage: #B8C9C3;

  --bg: var(--green);
  --surface: #1C3634;
  --surface-2: var(--green-2);
  --line: rgba(184, 201, 195, 0.16);
  --line-strong: rgba(184, 201, 195, 0.32);
  --text: #F2EEE4;
  --muted: var(--sage);
  --accent: var(--copper);
  --accent-text: var(--copper);
  --on-accent: var(--green);
  --accent-soft: rgba(221, 167, 125, 0.14);
  --rec: #E07A5F;
  --cover: var(--green-2);
  --cover-text: #F2EEE4;
  --cover-sub: var(--copper);
  --shadow: 0 28px 60px rgba(4, 14, 13, 0.55);
  --m-calm: #8FB8AA;
  --m-hopeful: #DDA77D;
  --m-thoughtful: #8DA9C4;
  --m-sad: #A994B8;
  --m-upset: #C9735A;
  --m-none: rgba(184, 201, 195, 0.28);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --font: Vazirmatn, Manrope, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

html[data-theme='light'] {
  --bg: var(--cream);
  --surface: #FFFDF9;
  --surface-2: #EEE8DD;
  --line: rgba(20, 44, 43, 0.12);
  --line-strong: rgba(20, 44, 43, 0.24);
  --text: var(--green);
  --muted: #55706A;
  --accent: var(--green);
  --accent-text: var(--copper-dark);
  --on-accent: var(--cream);
  --accent-soft: rgba(155, 103, 60, 0.10);
  --rec: #B5533C;
  --cover: var(--green);
  --shadow: 0 24px 48px rgba(20, 44, 43, 0.22);
  --m-none: rgba(20, 44, 43, 0.18);
  color-scheme: light;
}

html[lang='en'] { --font: Manrope, system-ui, -apple-system, 'Segoe UI', sans-serif; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.screen {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 24px);
}
.grow { flex: 1; }
.center { align-items: center; text-align: center; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 700; flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }

.iconbtn {
  width: 44px; height: 44px; border-radius: 22px; flex: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.iconbtn svg { width: 20px; height: 20px; }
html[dir='ltr'] .flip-rtl svg, html[dir='rtl'] .flip-ltr svg { transform: scaleX(-1); }

.pill {
  height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--surface); display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
}
.pill .on { color: var(--accent-text); font-weight: 700; }
.pill .sep { color: var(--muted); }

.btn {
  height: 56px; border-radius: 28px; border: none; padding: 0 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 700; text-decoration: none;
}
.btn svg { width: 22px; height: 22px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px rgba(4, 14, 13, 0.18); }
.btn-big { height: 64px; border-radius: 32px; font-size: 18px; }
.btn-ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--text); }
.btn-danger { background: transparent; border: 1px solid var(--line-strong); color: var(--rec); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn { flex: 1; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; }
.card-accent { border-color: var(--accent); }
.card-row { display: flex; align-items: center; gap: 14px; }
.card .label { font-size: 12px; color: var(--muted); }
.card .value { font-size: 17px; font-weight: 700; }
.card button.linklike { all: unset; cursor: pointer; display: block; width: 100%; }

/* ---------- cover ---------- */
.cover-wrap { display: flex; justify-content: center; padding: 6px 0; }
.cover {
  all: unset; cursor: pointer;
  width: 260px; height: 360px; position: relative; overflow: hidden;
  background: var(--cover); box-shadow: var(--shadow);
  /* Persian book: spine on the right. English book: spine on the left. */
  border-radius: 18px 6px 6px 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 30px 40px 24px 24px; text-align: center;
}
html[dir='ltr'] .cover { border-radius: 6px 18px 18px 6px; padding: 30px 24px 24px 40px; }
.cover.small { width: 170px; height: 232px; padding: 18px 24px 16px 14px; cursor: default; }
html[dir='ltr'] .cover.small { padding: 18px 14px 16px 24px; }
.cover .spine { position: absolute; top: 0; bottom: 0; right: 0; width: 14px; display: flex; flex-direction: column; }
html[dir='ltr'] .cover .spine { right: auto; left: 0; }
.cover.small .spine { width: 10px; }
.cover .spine span { flex: 1; }
.cover .frame { position: absolute; inset: 14px 26px 14px 12px; border: 1px solid rgba(221, 167, 125, 0.45); border-radius: 10px 4px 4px 10px; pointer-events: none; }
html[dir='ltr'] .cover .frame { inset: 14px 12px 14px 26px; border-radius: 4px 10px 10px 4px; }
.cover.small .frame { display: none; }
.cover .vol { font-size: 11px; letter-spacing: 2px; color: var(--copper); padding-top: 6px; font-family: Manrope, Vazirmatn, sans-serif; text-transform: uppercase; }
.cover .title { display: flex; flex-direction: column; align-items: center; }
.cover .t1 { font-family: 'Afsaneh', Vazirmatn, serif; font-size: 28px; line-height: 1.7; color: var(--cover-sub); }
.cover .t2 { font-family: 'Afsaneh', Vazirmatn, serif; font-size: 48px; line-height: 1.5; color: var(--cover-text); word-break: break-word; }
.cover.small .t1 { font-size: 18px; }
.cover.small .t2 { font-size: 30px; }
html[lang='en'] .cover .t1, html[lang='en'] .cover .t2 { font-family: var(--serif), 'Afsaneh'; font-style: italic; }
html[lang='en'] .cover .t1 { font-size: 26px; line-height: 1.3; }
html[lang='en'] .cover .t2 { font-size: 52px; line-height: 1.05; font-weight: 600; }
.cover .meta { font-size: 12px; color: var(--sage); }

.mood-calm { background: var(--m-calm); }
.mood-hopeful { background: var(--m-hopeful); }
.mood-thoughtful { background: var(--m-thoughtful); }
.mood-sad { background: var(--m-sad); }
.mood-upset { background: var(--m-upset); }
.mood-none { background: var(--m-none); }

/* ---------- welcome / login ---------- */
.hero-title { font-family: 'Afsaneh', Vazirmatn, serif; font-size: 34px; line-height: 1.7; color: var(--accent-text); margin: 0; font-weight: 400; }
html[lang='en'] .hero-title { font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 36px; line-height: 1.2; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field .label { font-size: 16px; font-weight: 700; }
.field input[type='text'], .field input[type='password'], .field select {
  height: 54px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 0 16px; font-size: 17px; width: 100%;
}
.field input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.seg button {
  height: 52px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 16px;
}
.seg button[aria-pressed='true'] { border: 2px solid var(--accent); background: var(--accent-soft); font-weight: 700; }
.error { color: var(--rec); font-size: 14px; min-height: 20px; }

/* ---------- contents ---------- */
.chapter { padding: 0; overflow: hidden; }
.chapter-head { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; width: 100%; box-sizing: border-box; }
.chapter-head .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chapter-head .name { font-size: 16px; font-weight: 700; }
.moodbar { display: flex; gap: 3px; height: 6px; }
.moodbar span { flex: 1; border-radius: 3px; max-width: 40px; }
.chapter-body { padding: 0 16px 8px; }
.chapter-tools { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 8px; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line-strong); background: transparent;
  font-size: 13px; display: inline-flex; align-items: center; gap: 6px;
}
.chip svg { width: 14px; height: 14px; }
.chip-accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.chip[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); }
.page-row { all: unset; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); width: 100%; box-sizing: border-box; }
.page-row .bar { width: 4px; height: 34px; border-radius: 2px; flex: none; }
.page-row .txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.page-row .t { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-row .t.untitled { color: var(--accent-text); }
.page-row .d { font-size: 12px; color: var(--muted); }
.page-row .len { font-size: 12px; color: var(--muted); flex: none; }
.page-row.playing .t { color: var(--accent-text); }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }

/* ---------- recorder ---------- */
.rec-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.rec-head .ch { font-size: 13px; color: var(--accent-text); }
.rec-head .pg { font-size: 20px; font-weight: 700; }
.rec-state { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--muted); font-size: 14px; }
.rec-dot { width: 10px; height: 10px; border-radius: 5px; background: var(--rec); }
.rec-dot.live { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.timer { font-size: 68px; font-weight: 300; letter-spacing: 2px; text-align: center; font-variant-numeric: tabular-nums; font-family: Vazirmatn, Manrope, sans-serif; }
.wave { width: 100%; height: 96px; display: block; }
.rec-controls { display: flex; align-items: flex-start; justify-content: center; gap: 28px; }
.rec-controls .c { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.rbtn { width: 60px; height: 60px; border-radius: 30px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; }
.rbtn svg { width: 22px; height: 22px; }
.rbtn.mark { color: var(--accent-text); }
.rbtn.stop { width: 84px; height: 84px; border-radius: 42px; background: var(--accent); border: none; }
.rbtn.stop span { width: 28px; height: 28px; border-radius: 6px; background: var(--on-accent); }
.rbtn.start { width: 84px; height: 84px; border-radius: 42px; background: var(--rec); border: none; }
.rbtn.start span { width: 30px; height: 30px; border-radius: 15px; background: #fff; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- sheets ---------- */
.overlay { position: fixed; inset: 0; background: rgba(5, 7, 10, 0.6); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet {
  width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto;
  background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 12px 22px calc(env(safe-area-inset-bottom) + 28px);
  display: flex; flex-direction: column; gap: 18px;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); align-self: center; }
.sheet h2 { margin: 0; font-size: 20px; font-weight: 700; }
.sheet .field input[type='text'], .sheet .field select { background: var(--bg); }
.moods { display: flex; gap: 10px; flex-wrap: wrap; }
.moodbtn { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: none; padding: 0; font-size: 11px; color: var(--muted); min-width: 52px; }
.moodbtn .dot { width: 44px; height: 44px; border-radius: 22px; border: 3px solid transparent; }
.moodbtn[aria-pressed='true'] .dot { border-color: var(--text); }
.moodbtn[aria-pressed='true'] { color: var(--text); font-weight: 700; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- player ---------- */
.player-title { font-size: 20px; font-weight: 700; margin: 0; }
.seek { width: 100%; accent-color: var(--accent); }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.play-row { display: flex; align-items: center; justify-content: center; gap: 22px; }
.playbtn { width: 72px; height: 72px; border-radius: 36px; background: var(--accent); color: var(--on-accent); border: none; display: flex; align-items: center; justify-content: center; }
.playbtn svg { width: 28px; height: 28px; }

/* ---------- misc ---------- */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 14px; padding: 10px 14px; font-size: 13px; }
#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translateX(-50%);
  max-width: calc(100% - 40px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px;
  font-size: 14px; z-index: 50; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
#toast.show { opacity: 1; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); }



/* ---------- brand header (as on alirezarajabi.com) ---------- */
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand .word { font-family: var(--serif); font-size: 30px; line-height: 1; font-weight: 500; letter-spacing: 0.2px; color: var(--text); direction: ltr; }
.brand .word i { color: var(--copper); font-weight: 600; }
html[data-theme='light'] .brand .word i { color: var(--copper-dark); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
html[lang='fa'] .eyebrow { letter-spacing: 0; font-size: 13px; }
.eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--copper); flex: none; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.display { font-family: var(--serif); font-size: 40px; line-height: 1.05; font-weight: 500; margin: 0; }
.display em { color: var(--copper); }
html[lang='fa'] .display { font-family: 'Afsaneh', Vazirmatn, serif; font-size: 36px; line-height: 1.6; font-weight: 400; }
.hero-title { color: var(--text); }
.hero-title em { color: var(--copper); font-style: normal; }

/* ---------- motion (restrained; off with Reduce Motion) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes coverIn { from { opacity: 0; transform: translateY(18px) rotate(-1.5deg) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes breathe { 0%, 100% { box-shadow: 0 10px 24px rgba(4, 14, 13, 0.18), 0 0 0 0 rgba(221, 167, 125, 0.35); } 50% { box-shadow: 0 10px 24px rgba(4, 14, 13, 0.18), 0 0 0 10px rgba(221, 167, 125, 0); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(224, 122, 95, 0.45); } 100% { box-shadow: 0 0 0 22px rgba(224, 122, 95, 0); } }

.screen > * { animation: rise 0.55s var(--ease) both; }
.screen > *:nth-child(2) { animation-delay: 0.05s; }
.screen > *:nth-child(3) { animation-delay: 0.1s; }
.screen > *:nth-child(4) { animation-delay: 0.15s; }
.screen > *:nth-child(5) { animation-delay: 0.2s; }
.screen > *:nth-child(n+6) { animation-delay: 0.25s; }
.cover-wrap .cover { border: 1px solid rgba(221, 167, 125, 0.22); animation: coverIn 0.8s var(--ease) 0.1s both; transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease); }
.cover-wrap button.cover:active { transform: scale(0.98) rotate(-0.5deg); }
.page-row { animation: fade 0.4s ease both; transition: background-color 0.2s; }
.page-row:active { background: var(--accent-soft); }
.overlay { animation: fade 0.25s ease both; }
.sheet { animation: sheetUp 0.38s var(--ease) both; }
.btn, .chip, .iconbtn, .rbtn, .moodbtn .dot, .pill { transition: transform 0.15s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s; }
.btn:active, .chip:active, .iconbtn:active, .rbtn:active, .pill:active { transform: scale(0.96); }
[data-act='record'].btn { animation: rise 0.55s var(--ease) 0.25s both, breathe 3.2s ease-in-out 1.2s infinite; }
.rbtn.stop { animation: ring 1.8s ease-out infinite; }
.timer { transition: color 0.3s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---------- home: today, hope line ---------- */
.today { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-sizing: border-box; width: 100%; }
.today-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.today-main { font-size: 22px; font-weight: 700; line-height: 1.3; }
html[lang='en'] .today-main { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.1; }
.today-second { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--accent-text); }
html[lang='fa'] .today-second { font-family: Vazirmatn, sans-serif; font-style: normal; font-size: 14px; }
.today-time { font-size: 34px; font-weight: 300; font-variant-numeric: tabular-nums; color: var(--text); flex: none; direction: ltr; }
.hope { all: unset; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; padding: 4px 4px 2px; font-size: 17px; line-height: 1.8; color: var(--text); }
html[lang='en'] .hope { font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.35; }
.hope-mark { font-family: var(--serif); font-size: 44px; line-height: 0.8; color: var(--copper); flex: none; }
.hope.swap span[data-hope] { animation: rise 0.5s var(--ease) both; }

/* ---------- bottom dock: record is always in reach ---------- */
.with-dock { padding-bottom: calc(env(safe-area-inset-bottom) + 120px); }
.dock {
  position: fixed; z-index: 15; left: 0; right: 0; margin: 0 auto;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  width: min(440px, calc(100% - 24px)); height: 72px; border-radius: 36px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(4, 14, 13, 0.28);
  animation: rise 0.6s var(--ease) 0.2s both;
}
.dock-item { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 8px 0; }
.dock-item svg { width: 22px; height: 22px; }
.dock-item.on { color: var(--accent-text); }
.dock-rec { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--accent-text); margin-top: -34px; }
.dock-rec-btn {
  width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--copper); color: var(--green); border: 5px solid var(--bg);
  animation: breathe 3.2s ease-in-out 1.2s infinite; transition: transform 0.15s var(--ease);
}
.dock-rec-btn svg { width: 32px; height: 32px; }
.dock-rec:active .dock-rec-btn { transform: scale(0.94); }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cal-title { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cal-month { font-size: 20px; font-weight: 700; }
html[lang='en'] .cal-month { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.cal-month2 { font-size: 12px; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-cell { all: unset; cursor: pointer; position: relative; aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; box-sizing: border-box; }
.cal-cell.empty { cursor: default; }
.cal-cell .n { font-size: 16px; font-weight: 600; line-height: 1.1; }
.cal-cell .n2 { font-size: 10px; color: var(--muted); line-height: 1.1; }
.cal-cell .dot { position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--copper); }
.cal-cell.today-cell { border: 1.5px solid var(--copper); }
.cal-cell.sel { background: var(--accent); color: var(--on-accent); }
.cal-cell.sel .n2 { color: inherit; opacity: 0.75; }
.cal-cell.sel .dot { background: var(--on-accent); }

/* ---------- opening: the journal opens and writes its first line ---------- */
.intro { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; perspective: 1600px; transition: opacity 0.6s ease; cursor: pointer; }
.intro.out { opacity: 0; pointer-events: none; }
.intro-book { position: relative; width: 250px; height: 340px; transform-style: preserve-3d; animation: coverIn 0.8s var(--ease) both; }
.intro-page {
  position: absolute; inset: 0; background: var(--cream); color: var(--green);
  border-radius: 14px 6px 6px 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 30px 28px;
}
html[dir='ltr'] .intro-page { border-radius: 6px 14px 14px 6px; }
.intro-page .eyebrow { color: var(--copper-dark); }
.intro-write { font-size: 21px; line-height: 1.9; min-height: 3.8em; }
html[lang='en'] .intro-write { font-family: var(--serif); font-style: italic; font-size: 27px; line-height: 1.3; }
.intro-write::after { content: ''; display: inline-block; width: 2px; height: 1.05em; margin-inline-start: 3px; vertical-align: -0.15em; background: var(--copper-dark); animation: blink 0.9s steps(1) infinite; }
.intro-cover { position: absolute; inset: 0; transform-origin: right center; transition: transform 1.25s var(--ease); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
html[dir='ltr'] .intro-cover { transform-origin: left center; }
.intro-cover .cover { width: 100%; height: 100%; padding: 30px 40px 24px 24px; }
html[dir='ltr'] .intro-cover .cover { padding: 30px 24px 24px 40px; }
.intro-cover .cover .t1 { font-size: 28px; }
.intro-cover .cover .t2 { font-size: 48px; }
html[lang='en'] .intro-cover .cover .t2 { font-size: 52px; }
.intro-cover .cover .frame { display: block; }
.intro.open .intro-cover { transform: rotateY(160deg); }
html[dir='ltr'] .intro.open .intro-cover { transform: rotateY(-160deg); }
.intro-skip { font-size: 12px; color: var(--muted); letter-spacing: 1px; }

/* small fixes */
.cover .spine .mood-none { background: rgba(221, 167, 125, 0.35); }
.banner .chip { white-space: nowrap; flex: none; }
#toast { bottom: calc(env(safe-area-inset-bottom) + 104px); }
