/* Selfwrit: styled after bouel.com.au (paper, ink, gold, red; Cormorant, Newsreader, Plex Mono). */

@font-face { font-family: "Cormorant"; src: url(fonts/cormorant-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Cormorant"; src: url(fonts/cormorant-500-latin-ext.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Cormorant"; src: url(fonts/cormorant-500-vietnamese.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Cormorant"; src: url(fonts/cormorant-600.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Cormorant"; src: url(fonts/cormorant-600-latin-ext.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Cormorant"; src: url(fonts/cormorant-600-vietnamese.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-300.woff2) format("woff2"); font-weight: 300; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-300-latin-ext.woff2) format("woff2"); font-weight: 300; font-style: normal; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-300-vietnamese.woff2) format("woff2"); font-weight: 300; font-style: normal; font-display: swap; unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-400-latin-ext.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-400-vietnamese.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-300-italic.woff2) format("woff2"); font-weight: 300; font-style: italic; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-300-italic-latin-ext.woff2) format("woff2"); font-weight: 300; font-style: italic; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-300-italic-vietnamese.woff2) format("woff2"); font-weight: 300; font-style: italic; font-display: swap; unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Plex Mono"; src: url(fonts/plex-mono-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Plex Mono"; src: url(fonts/plex-mono-500-latin-ext.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; src: url(fonts/plex-mono-500-vietnamese.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }

:root {
  --paper: #EFE8D8; --card: #FBF6E9; --sunk: #E6DECB;
  --ink: #221C12; --body: #4A4232; --muted: #6B604B;
  --gold: #8A6A2F; --red: #A61E14; --calm: #DCE3D3; --calm-ink: #2F4030;
  --rule: rgba(34,28,18,.16); --rule-strong: rgba(34,28,18,.7);
  --focus: #2E5B8A; --shadow: 0 1px 2px rgba(34,28,18,.06), 0 8px 24px -12px rgba(34,28,18,.18);
  --serif-display: "Cormorant", "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "Plex Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17140F; --card: #211D16; --sunk: #2A251C;
    --ink: #F1EADA; --body: #D3C9B3; --muted: #A2967E;
    --gold: #D4AF6A; --red: #E8735F; --calm: #1F2A21; --calm-ink: #C9D8C4;
    --rule: rgba(241,234,218,.13); --rule-strong: rgba(241,234,218,.55);
    --focus: #8DB8E8; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #17140F; --card: #211D16; --sunk: #2A251C;
  --ink: #F1EADA; --body: #D3C9B3; --muted: #A2967E;
  --gold: #D4AF6A; --red: #E8735F; --calm: #1F2A21; --calm-ink: #C9D8C4;
  --rule: rgba(241,234,218,.13); --rule-strong: rgba(241,234,218,.55);
  --focus: #8DB8E8; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 300 18px/1.7 var(--serif); -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--red); }
p { margin: 0 0 1em; color: var(--body); }
strong { font-weight: 400; color: var(--ink); }

h1, h2, h3 { font-family: var(--serif-display); font-weight: 500; color: var(--ink); letter-spacing: -.005em; }
h1 { font-size: clamp(34px, 7vw, 46px); line-height: 1.06; margin: 6px 0 18px; }
h2 { font-size: 26px; line-height: 1.15; margin: 40px 0 8px; }
h3 { font-size: 22px; font-weight: 600; line-height: 1.2; margin: 0 0 4px; }
.eyebrow, .meta, .tag, .progress, label, .tabs, .help, .stop, button, .btn {
  font-family: var(--mono); font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
}
.eyebrow { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }
.meta { font-size: 10.5px; color: var(--muted); }
.meta a { color: var(--muted); text-decoration: none; }
.meta a:hover { color: var(--red); }

/* ---------- header and navigation ---------- */
.safety {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-strong);
  padding-top: env(safe-area-inset-top);
}
.safety .in { max-width: 1000px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; }
.brand { font-family: var(--serif-display); font-size: 28px; font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1; }
.brand:hover { color: var(--ink); }
.safety-actions { display: flex; align-items: center; gap: 14px; }
.help { font-size: 10px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.help svg { width: 14px; height: 14px; }
.help b { font-weight: 500; color: var(--ink); }
.stop {
  min-height: 38px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--red); background: transparent; color: var(--red); font-size: 11px;
}
.stop:hover { background: var(--red); color: var(--paper); }

.tabs { max-width: 1000px; margin: 0 auto; display: flex; gap: 26px; padding: 0 20px; font-size: 10.5px; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 12px 0 11px; color: var(--muted); text-decoration: none; border-bottom: 1.5px solid transparent; }
.tabs a svg { width: 16px; height: 16px; flex: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--red); }
.navwrap { border-bottom: 1px solid var(--rule); }

main { max-width: 760px; margin: 0 auto; padding: 36px 20px 96px; outline: none; }

/* ---------- surfaces ---------- */
.card {
  background: var(--card); border: 1px solid var(--rule); border-radius: 4px;
  padding: 22px 24px; margin: 0 0 14px; box-shadow: var(--shadow);
}
.card p:last-child { margin-bottom: 0; }
a.card { display: block; color: inherit; text-decoration: none; transition: transform .2s, border-color .2s; }
a.card:hover { border-color: var(--gold); transform: translateY(-2px); color: inherit; }
a.card .go { float: inline-end; color: var(--gold); font-family: var(--serif-display); font-size: 22px; line-height: 1; }
.calm { background: var(--calm); border-color: transparent; }
.calm, .calm p, .calm h1, .calm h3 { color: var(--calm-ink); }

.hero { padding: 8px 0 28px; border-bottom: 1px dashed var(--rule-strong); margin-bottom: 32px; }
.hero h1 { font-size: clamp(42px, 9vw, 64px); }
.lede { font-size: 20px; line-height: 1.65; max-width: 600px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid .card { margin: 0; display: flex; flex-direction: column; min-height: 190px; }
.numeral { font-family: var(--serif-display); font-size: 30px; color: var(--gold); line-height: 1; margin-bottom: 14px; }
.grid .card p { font-size: 16px; margin-top: auto; }
.grid .card h3 { font-size: 26px; margin-bottom: 8px; }

.list { border-top: 1px solid var(--rule); }
.list a { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 14px; align-items: baseline; padding: 18px 2px; border-bottom: 1px solid var(--rule); color: inherit; text-decoration: none; }
.list a:hover h3 { color: var(--red); }
.list .num { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.list p { grid-column: 2 / 3; margin: 4px 0 0; font-size: 16px; }
.list .arrow { color: var(--gold); font-family: var(--serif-display); font-size: 20px; }

/* ---------- controls ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 2px; cursor: pointer; text-decoration: none;
  font-size: 11px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
  transition: background .15s, color .15s;
}
button:hover, .btn:hover { background: var(--ink); color: var(--paper); }
.primary { background: var(--ink); color: var(--paper); }
.primary:hover { background: var(--red); border-color: var(--red); color: var(--paper); }
.danger { border-color: var(--red); color: var(--red); }
.danger:hover { background: var(--red); color: var(--paper); }
.quiet { border-color: var(--rule); }
button:disabled { opacity: .45; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }

label { display: block; font-size: 10.5px; color: var(--muted); margin: 20px 0 8px; }
input[type="text"], input[type="password"], input[type="search"], input[type="date"], select, textarea {
  width: 100%; font: 400 17px/1.5 var(--serif); color: var(--ink); background: var(--card);
  border: 1px solid var(--rule); border-radius: 2px; padding: 12px 14px;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
textarea { min-height: 200px; resize: vertical; line-height: 1.75; }
input[type="search"] { padding-inline-start: 42px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23887a60' stroke-width='1.8'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px 50% / 18px; }
.check { display: flex; gap: 12px; align-items: flex-start; font: 300 16px/1.6 var(--serif); letter-spacing: 0; text-transform: none; color: var(--body); }
.check input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--ink); flex: none; }

.tag { display: inline-block; font-size: 9.5px; padding: 4px 9px; border: 1px solid var(--rule-strong); border-radius: 999px; color: var(--muted); margin: 0 6px 6px 0; }
.status { border-inline-start: 2px solid var(--gold); padding-block: 2px; padding-inline: 14px 0; font-style: italic; font-size: 16px; }
.note { font-size: 15px; color: var(--muted); }
.error { color: var(--red); font-weight: 400; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 20px; }
.filters select { width: auto; flex: 1 1 160px; font-size: 15px; }
label.btn { margin: 0; color: var(--ink); }
label.btn:hover { color: var(--paper); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
label.btn:has(+ .visually-hidden:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
ul.plain { padding-inline-start: 1.1em; margin: 0 0 1em; }
ul.plain li { margin-bottom: .4em; color: var(--body); }
.options { display: grid; gap: 10px; margin: 16px 0; }
.options button { justify-content: flex-start; min-height: 54px; font-size: 12px; background: var(--card); border-color: var(--rule); }
.options button:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* ---------- framework page ---------- */
.framework h1 { font-size: clamp(38px, 8vw, 54px); }
.framework .body p:first-of-type::first-letter { font-family: var(--serif-display); float: inline-start; font-size: 3.4em; line-height: .8; padding-block-start: 6px; padding-inline-end: 10px; color: var(--gold); }
.source { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--rule); }

/* ---------- reflection ---------- */
.question { font-family: var(--serif-display); font-size: clamp(28px, 6vw, 38px); font-weight: 500; line-height: 1.18; margin: 4px 0 22px; }
.dots { display: flex; gap: 6px; margin: 0 0 14px; }
.dots i { width: 22px; height: 3px; background: var(--rule); border-radius: 2px; }
.dots i.on { background: var(--gold); }
.page { background: var(--card); border: 1px solid var(--rule); box-shadow: var(--shadow); border-radius: 2px;
  background-image: repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px); background-attachment: local; line-height: 32px; padding: 6px 16px; }

/* ---------- grounding ---------- */
.breath { width: 120px; height: 120px; margin: 10px auto 26px; border-radius: 50%; border: 1px solid var(--gold); position: relative; }
.breath::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: color-mix(in srgb, var(--gold) 22%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .breath::after { animation: breathe 10s ease-in-out infinite; }
  @keyframes breathe { 0%, 100% { transform: scale(.55); } 40% { transform: scale(1.12); } 55% { transform: scale(1.12); } }
}
.step { font-family: var(--serif-display); font-size: clamp(26px, 5.5vw, 34px); font-weight: 500; line-height: 1.3; text-align: center; min-height: 5.4em; max-width: 560px; margin: 0 auto; color: var(--ink); }
.stepnav { justify-content: center; }
.set-intro { font-style: italic; }

/* ---------- record ---------- */
.timeline { position: relative; margin-inline-start: 6px; padding-inline-start: 24px; border-inline-start: 1px solid var(--rule-strong); }
.timeline a { position: relative; display: block; padding: 4px 0 22px; color: inherit; text-decoration: none; }
.timeline a::before { content: ""; position: absolute; inset-inline-start: -29px; top: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--gold); }
.timeline a:hover h3 { color: var(--red); }
.timeline h3 { font-size: 22px; }
.empty { text-align: center; padding: 36px 24px; }

/* ---------- phones: bottom tab bar ---------- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .safety .in { padding: 10px 16px; }
  .brand { font-size: 25px; }
  .help .long { display: none; }
  .navwrap { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--rule-strong); border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .tabs { justify-content: space-around; gap: 0; padding: 0 4px; font-size: 8.5px; letter-spacing: .08em; }
  .tabs a { flex-direction: column; gap: 4px; padding: 9px 2px 8px; border-bottom: 0; border-top: 2px solid transparent; flex: 1; }
  .tabs a svg { width: 22px; height: 22px; }
  .tabs a[aria-current="page"] { border-top-color: var(--red); }
  main { padding: 26px 16px calc(110px + env(safe-area-inset-bottom)); }
  .grid { grid-template-columns: 1fr; }
  .grid .card { min-height: 0; }
  .card { padding: 18px 18px; }
}
@media (prefers-reduced-motion: reduce) { a.card { transition: none; } a.card:hover { transform: none; } }

/* ---------- languages ---------- */
[dir="rtl"] .arr, [dir="rtl"] .arrow { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] input[type="search"] { background-position: calc(100% - 14px) 50%; }

/* Scripts the bundled fonts don't cover: use good system fonts, and no letter-spacing
   (it breaks Arabic joining and looks wrong in CJK and Devanagari). */
:lang(zh) { --serif-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif; --serif: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif; }
:lang(ja) { --serif-display: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; --serif: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; }
:lang(ko) { --serif-display: "AppleMyungjo", "Noto Serif KR", "Nanum Myeongjo", serif; --serif: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; }
:lang(hi) { --serif-display: "Kohinoor Devanagari", "Noto Serif Devanagari", serif; --serif: "Kohinoor Devanagari", "Noto Sans Devanagari", sans-serif; }
:lang(ar) { --serif-display: "Geeza Pro", "Noto Naskh Arabic", "Amiri", serif; --serif: "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", sans-serif; }
:lang(zh) *, :lang(ja) *, :lang(ko) *, :lang(hi) *, :lang(ar) * { letter-spacing: 0 !important; }
:lang(zh) body, :lang(ja) body, :lang(ko) body, :lang(hi) body, :lang(ar) body { font-weight: 400; }
:lang(zh) .framework .body p:first-of-type::first-letter, :lang(ja) .framework .body p:first-of-type::first-letter,
:lang(ko) .framework .body p:first-of-type::first-letter, :lang(hi) .framework .body p:first-of-type::first-letter,
:lang(ar) .framework .body p:first-of-type::first-letter { font: inherit; float: none; padding: 0; color: inherit; }
/* English library text inside another language keeps the bundled fonts */
[lang="en"] { --serif-display: "Cormorant", "Cormorant Garamond", Garamond, serif; --serif: "Newsreader", Georgia, serif; }

/* ---------- home ---------- */
.hero.compact { padding-bottom: 20px; margin-bottom: 24px; }
.hero.compact h1 { font-size: clamp(34px, 7vw, 48px); margin-bottom: 0; }
/* Home title: two set lines, upright then a lighter gold italic, with a short gold rule between eyebrow and title. */
.title { line-height: .98; letter-spacing: -.015em; text-wrap: balance; }
.title-a, .title-b { display: block; }
.title-b { font-family: var(--serif); font-style: italic; font-weight: 300; color: var(--gold); font-size: .82em; letter-spacing: -.02em; margin-top: .08em; padding-inline-start: .9em; }
.hero .eyebrow { display: flex; align-items: center; gap: 12px; }
.hero .eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold); flex: none; }
.hero:not(.compact) .title { margin: 14px 0 24px; }
.hero.compact .title { margin-top: 10px; }
/* Scripts without a true italic here: keep them upright, just the colour and weight change. */
:lang(zh) .title-b, :lang(ja) .title-b, :lang(ko) .title-b, :lang(hi) .title-b, :lang(ar) .title-b { font-family: var(--serif-display); font-style: normal; font-weight: 400; font-size: .78em; }
:lang(zh) .title, :lang(ja) .title, :lang(ko) .title, :lang(hi) .title, :lang(ar) .title { line-height: 1.25; }
@media (max-width: 480px) { .title-b { padding-inline-start: .5em; } }
.onboard .dots { margin-bottom: 6px; }
.onboard .progress { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.now-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 14px; }
.now { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 4px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); box-shadow: var(--shadow); transition: border-color .2s, transform .2s; }
.now:first-child { background: var(--calm); border-color: transparent; }
.now:first-child, .now:first-child small { color: var(--calm-ink); }
.now:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--ink); }
.now strong { display: block; font-family: var(--serif-display); font-size: 22px; font-weight: 600; line-height: 1.15; }
.now small { display: block; font-size: 14.5px; color: var(--muted); margin-top: 2px; }
.now-icon { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; color: var(--gold); border: 1px solid currentColor; }
.now:first-child .now-icon { color: var(--calm-ink); }
.card.today { border-inline-start: 3px solid var(--gold); }
.today-q { font-family: var(--serif-display); font-size: clamp(24px, 5vw, 30px); font-weight: 500; line-height: 1.25; color: var(--ink); margin: 4px 0 12px; }
.home-foot { margin-top: 28px; text-align: center; }
@media (max-width: 640px) { .now-row { grid-template-columns: 1fr; } .now { padding: 16px; } }
@media (prefers-reduced-motion: reduce) { .now { transition: none; } .now:hover { transform: none; } }

/* ---------- about page (static, no tab bar) ---------- */
a.stop { display: inline-flex; align-items: center; text-decoration: none; }
.about-page main { padding-bottom: 64px; }
.about section { margin-top: 8px; }
.about .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.about .two .card { margin: 0; }
.about .checks { list-style: none; padding: 0; margin: 0 0 1em; }
.about .checks li { position: relative; padding-inline-start: 28px; margin-bottom: 12px; color: var(--body); }
.about .checks li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .55em; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--gold); }
.about .calm { margin-top: 36px; }
.about .calm h2 { margin-top: 0; }
.about .calm a { color: var(--calm-ink); font-weight: 400; }
.about-foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--rule); text-align: center; }
.about-foot .row { justify-content: center; }
@media (max-width: 640px) { .about .two { grid-template-columns: 1fr; } .about-page .help { display: none; } }

/* About link in the top bar: desktop only; on phones it lives at the top of Settings */
.top-about { font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.top-about:hover, .top-about[aria-current] { color: var(--ink); }
:lang(zh) .top-about, :lang(ja) .top-about, :lang(ko) .top-about, :lang(hi) .top-about, :lang(ar) .top-about { font-size: 12px; }
.settings-about { margin: -6px 0 8px; }
.settings-about a { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 640px) { .top-about { display: none; } }

/* Sharing an entry for research */
.share-card { margin-top: 36px; border-style: dashed; }
.share-names { margin: 10px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.chip { min-height: 36px; padding: 4px 12px; font-size: 11px; border-radius: 999px; background: var(--card); border-color: var(--rule-strong); text-transform: none; letter-spacing: .02em; }
.chip:hover { background: var(--ink); color: var(--paper); }
label.tick { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0; font-family: var(--serif); font-weight: 300; font-size: 17px; letter-spacing: 0; text-transform: none; color: var(--body); line-height: 1.5; cursor: pointer; }
label.tick input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--gold); }
details { margin: 22px 0 8px; }
summary { cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.share-preview { white-space: pre-wrap; word-break: break-word; font: 12px/1.6 var(--mono); background: var(--sunk); padding: 14px; border-radius: 4px; max-height: 360px; overflow: auto; color: var(--body); }
