/* ==========================================================
   NANOVIE STUDIO SITE · Midnight Blue Theme
   Colours, fonts and spacing come from tokens.css.
   Sections in this file, top to bottom:
     1. Base          6. Project cards     11. Project pages
     2. Layout/grid   7. Devlogs cards     12. Novel page
     3. Buttons/tags  8. About + contact   13. Devlogs list + post
     4. Header        9. Newsletter        14. Plain pages (privacy)
     5. Hero         10. Footer            15. Phone and tablet
   ========================================================== */

/* ---------- 1. Base ---------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; letter-spacing: -.01em; line-height: 1.15; }

/* Keyboard focus: always visible, in Navie Blue */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--text); color: var(--on-light); padding: 10px 16px; border-radius: var(--r-pill); font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- 2. Layout and grid ---------- */

/* Every section's content sits in this centred container */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--margin); }

/* 12 / 8 / 4 column grid (the number of columns comes from tokens.css) */
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gutter); }

/* On phones every block is full width; spans apply from desktop (section 15) */
.grid > * { grid-column: 1 / -1; }

section.s { padding-top: var(--s9); }
/* Tighter sections (Novel page): the shorter end of the 64–96 px range */
section.t { padding-top: var(--s8); }

.eyebrow {
  font: 500 12px var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue);
}

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.head h2 { font-size: 40px; font-weight: 700; margin-top: 10px; }
.head p { color: var(--body); margin-top: var(--s3); max-width: 640px; }

.muted { color: var(--muted); }

/* ---------- 3. Buttons, links, tags ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: var(--r-pill);
  font: 600 14px var(--font-body); border: 1px solid transparent; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-light { background: var(--text); color: var(--on-light); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--raised); }
/* Spark Red: only the single most important action on a screen */
.btn-spark { background: var(--spark); color: var(--on-spark); font-weight: 700; box-shadow: 0 6px 24px var(--spark-glow); }
.btn-sm { height: 40px; padding: 0 18px; }

.link { font-weight: 600; font-size: 14px; color: var(--blue); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--body);
}
.tag.hot { border-color: rgba(110, 155, 255, .5); color: var(--blue); background: rgba(110, 155, 255, .08); }

/* Arrow button in the top-right corner of a clickable card */
.arr {
  position: absolute; top: 18px; right: 20px; z-index: 1;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--raised); color: var(--text);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  transition: background .15s, border-color .15s;
}

/* Cards: the whole card is the link (stretched-link pattern) */
.card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: #33415E; }
.card:hover .arr { background: var(--blue); border-color: var(--blue); color: var(--on-light); }
/* The arrow is a real link to the same page as the card (js/site.js:
   cardArrows), so clicking it always works. It sits above the stretched link. */
a.arr { text-decoration: none; cursor: pointer; }
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 0; }
/* Anything that must stay clickable on its own sits above the stretched link */
.over { position: relative; z-index: 1; }

/* Roadmap: five stages, the current one in Spark Red */
.road { display: flex; flex-direction: column; gap: 8px; }
.road .bars, .road .lbls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.road .bars i { height: 5px; border-radius: 3px; background: #24324D; }
.road .bars i.done { background: var(--blue); }
.road .bars i.on { background: var(--spark); box-shadow: 0 0 10px var(--spark-glow); }
.road .lbls { font-size: 11px; color: var(--muted); line-height: 1.3; }
.road .lbls b { color: var(--text); font-weight: 600; }

/* ---------- 4. Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(8, 11, 20, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 34px; height: 34px; }
.brand b { font: 700 21px var(--font-head); letter-spacing: .01em; }
.site-header .btn { height: 42px; }

/* Round icon button (header LinkedIn): filled, so it's the clearest thing in the bar */
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--text); color: var(--on-light); transition: transform .15s, box-shadow .15s;
}
.icon-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(238, 241, 246, .18); }
.icon-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.back { display: inline-block; margin-top: var(--s6); font-size: 14px; font-weight: 600; color: var(--body); }
.back:hover { color: var(--text); }

/* ---------- 5. Home hero ---------- */

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero .art {
  position: absolute; inset: 0;
  background: url(../images/banner.jpg) center / cover no-repeat;
  transform: translateX(25%) scaleX(-1);
}
/* The art fades into Night on the left so the text stays readable */
.hero .fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(8, 11, 20, .98) 28%, rgba(8, 11, 20, .85) 39%, rgba(8, 11, 20, .2) 58%, rgba(8, 11, 20, 0) 75%),
    linear-gradient(0deg, var(--bg) 0%, rgba(8, 11, 20, 0) 30%);
}
.hero .wrap { position: relative; padding-top: 120px; padding-bottom: 120px; }
.hero .copy { display: flex; flex-direction: column; gap: 20px; }
.hero h1 { font-size: 76px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.hero h1 span {
  background: linear-gradient(90deg, #FFFFFF 0%, #DCE6FF 60%, #9DB9FF 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { font-size: 17px; line-height: 1.7; color: var(--body); }
.hero p i { color: var(--text); }

/* The brand's spark: a small glowing dot */
.spark {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--spark); box-shadow: 0 0 12px 3px var(--spark-glow);
  margin-right: 10px; vertical-align: middle;
}

/* ---------- 6. Project cards (home + "Also in Project Navie") ---------- */

.mind { display: grid; grid-template-columns: 1fr; }
.mind .img { min-height: 260px; background: url(../images/prologue-01.jpg) center 20% / cover; }
.mind .body { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.mind h3 { font-size: 32px; font-weight: 700; }
.mind p { font-size: 14.5px; line-height: 1.7; color: var(--body); }

.small { display: flex; gap: 20px; padding: 22px; }
.cover {
  width: 104px; height: 136px; flex-shrink: 0; border-radius: var(--r-input);
  background-size: cover; background-position: center; border: 1px solid var(--line);
}
.small .b { flex: 1; display: flex; flex-direction: column; gap: 9px; min-width: 0; padding-right: 36px; }
/* Small cards: labels a little smaller. On desktop all four fit on one
   line next to the arrow; on narrower screens they wrap. */
.small .tags { gap: 4px; }
.small .tag { font-size: 10px; letter-spacing: .04em; padding: 3px 6px; white-space: nowrap; }
/* The label line on the Novel card ("Web serial · New chapter every two
   weeks") matches the tags: small mono text, on one line on desktop */
.small .meta { font-size: 10px; letter-spacing: .04em; line-height: 1.6; }
@media (min-width: 1024px) { .small .tags, .small .meta { flex-wrap: nowrap; white-space: nowrap; } }
.small h3 { font-size: 21px; font-weight: 700; }
.small p { font-size: 13.5px; line-height: 1.55; color: var(--body); }
.small .btn { align-self: flex-end; margin-top: auto; }

/* ---------- 7. Devlogs cards ---------- */

.post { padding: var(--s5); display: flex; flex-direction: column; gap: 12px; }
.post .thumb { margin: calc(var(--s5) * -1) calc(var(--s5) * -1) 4px; aspect-ratio: 16 / 9; background: var(--raised) center / cover; }
.post .thumb.blank { display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 60%, rgba(110, 155, 255, .18), transparent 60%), linear-gradient(160deg, #16203A, #0C1220); }
.post .thumb.blank img { width: 56px; opacity: .8; }
.meta { font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.meta b { color: var(--blue); font-weight: 500; }
.post h3 { font-size: 19px; font-weight: 600; line-height: 1.3; }
.post p { font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.post .more { margin-top: auto; font-size: 13px; font-weight: 600; }
.empty-note { color: var(--muted); padding: var(--s6); text-align: center; border: 1px dashed var(--line); border-radius: var(--r-card); }
/* "More devlogs are on the way": fills the rest of a row that has one
   post (or the whole row when there's none) */
.more-note { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.more-note b { color: var(--text); font-weight: 600; font-size: 15px; }
.more-note span { font-size: 13.5px; line-height: 1.6; }
.more-note a { color: var(--blue); font-weight: 600; white-space: nowrap; }
.more-note a:hover { text-decoration: underline; }
@media (min-width: 600px) and (max-width: 1023px) { .grid > .card + .more-note { grid-column: span 4; } }
@media (min-width: 1024px) { .grid > .card + .more-note { grid-column: span 8; } }

/* ---------- 8. About + contact form ---------- */

.about { margin-top: var(--s9); background: var(--bg2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 80px 0; }
.bio { display: flex; gap: var(--s5); align-items: flex-start; }
.photo {
  width: 168px; height: 216px; flex-shrink: 0; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(160deg, #1B2740, #0E1424) center / cover;
}
.bio .t { display: flex; flex-direction: column; gap: 10px; }
.bio h3 { font-size: 22px; }
.role { font-size: 13px; color: var(--blue); font-weight: 500; }
.bio p { font-size: 14px; line-height: 1.7; color: var(--body); }
.bio .links { display: flex; gap: 18px; font-size: 13px; font-weight: 600; }
.bio .links a:hover { color: var(--blue); }

.form-card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px;
}
.form-card h3 { font-size: 20px; }
.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--body); }
.req { color: var(--spark); }
.row2 { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* Inputs: the Field colour keeps borders visible (WCAG 3:1) */
.input {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--bg); color: var(--text); font: 400 15px var(--font-body);
  border: 1px solid var(--field); border-radius: var(--r-input);
}
textarea.input { height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(110, 155, 255, .25); }
.form-card .btn { align-self: flex-end; }

.form-status { font-size: 13px; min-height: 1.2em; color: var(--body); }
.form-status.ok { color: #5BD69A; }
/* Errors: a panel with a Spark Red edge, so they're hard to miss */
.form-status.err {
  color: var(--text); background: var(--card); border-left: 3px solid var(--spark);
  border-radius: 0 var(--r-input) var(--r-input) 0; padding: 10px 12px; line-height: 1.5;
}
.form-status a { color: var(--text); font-weight: 600; white-space: nowrap; }

/* ---------- 9. Newsletter band ---------- */

.news { position: relative; overflow: hidden; padding: 72px 0; margin-top: var(--s9); }
.news::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 240px at 80% 50%, rgba(110, 155, 255, .20), transparent 70%),
    radial-gradient(500px 220px at 8% 40%, rgba(255, 90, 95, .14), transparent 70%);
}
.about + .news { margin-top: 0; }
.news .wrap { position: relative; }
.news .l { display: flex; flex-direction: column; gap: 12px; }
.news h2 { font-size: 34px; }
.news .l p { color: var(--muted); font-size: 14.5px; }
.news form { display: flex; flex-direction: column; gap: 10px; }
.news label { font-size: 13px; font-weight: 500; color: var(--body); }
.sub { display: flex; gap: 8px; }
.sub .input { height: 48px; border-radius: var(--r-pill); padding: 0 18px; }
.sub .btn { height: 48px; }
.tick { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.tick input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue); flex-shrink: 0; }
.tick a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 10. Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 36px 0 28px; }
.site-footer .top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.site-footer .brand b { font-size: 18px; }
.site-footer .brand img { width: 28px; height: 28px; }
.follow { display: flex; align-items: center; gap: 10px; font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
/* Footer icons: outlined, so they're quieter than the header's button */
.follow a {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--body);
}
.follow a:hover { color: var(--text); border-color: var(--field); }
.follow svg { width: 18px; height: 18px; }
.site-footer .bottom { padding-top: 18px; font-size: 12.5px; color: var(--muted); }
.site-footer .bottom a { color: var(--body); }
.site-footer .bottom a:hover { color: var(--text); }

/* ---------- 11. Project pages (Mind, Spark) ---------- */

.p-hero { padding-top: var(--s5); }
.p-hero .media {
  position: relative; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 16 / 10; background: var(--card) center / cover;
}
.p-hero .media .label {
  position: absolute; left: 16px; bottom: 16px; padding: 8px 14px; border-radius: var(--r-pill);
  background: rgba(8, 11, 20, .72); backdrop-filter: blur(6px); font-size: 12.5px; color: var(--body);
}
.p-hero .info { display: flex; flex-direction: column; gap: var(--s4); }
.p-hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -.02em; }
.p-hero p { color: var(--body); line-height: 1.7; }

.world { padding: var(--s5); display: flex; flex-direction: column; gap: 10px; }
.world .num { font: 500 12px var(--font-mono); color: var(--blue); }
.world h3 { font-size: 20px; }
.world p { font-size: 14px; color: var(--body); }

.char { display: flex; flex-direction: column; }
.char .pic { aspect-ratio: 4 / 5; background: var(--raised) center / cover; position: relative; }
.char .pic.blank { display: flex; align-items: center; justify-content: center; font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: linear-gradient(160deg, #1B2740, #0E1424); }
.char .t { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 4px; }
.char h3 { font-size: 20px; }
.char p { font-size: 13.5px; color: var(--muted); }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 600; font-size: 15.5px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 22px var(--font-body); color: var(--blue); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 22px 20px; color: var(--body); font-size: 14.5px; line-height: 1.7; }

/* ---------- 12. Novel page ---------- */

.n-hero { padding-top: var(--s5); align-items: start; }
.book {
  aspect-ratio: 3 / 4; border-radius: 12px; border: 1px solid var(--line); background: url(../images/banner.jpg) 62% center / cover;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5); position: relative; overflow: hidden;
}
.book::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 11, 20, 0) 45%, rgba(8, 11, 20, .9) 100%); }
.book span { position: absolute; left: 18px; right: 18px; bottom: 18px; z-index: 1; font: 700 20px var(--font-head); line-height: 1.15; }
.book span small { display: block; font: 500 10px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
.n-hero .info { display: flex; flex-direction: column; gap: var(--s4); }
.n-hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -.02em; }
.n-hero .by { font-size: 14px; color: var(--muted); }
.n-hero p { color: var(--body); line-height: 1.7; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions small { font-size: 12.5px; color: var(--muted); }

.facts { margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.facts div { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 13.5px; }
.facts dd { margin: 0; font-weight: 600; font-size: 14px; text-align: right; }

.chapters { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.chapters li { border-bottom: 1px solid var(--line); }
.chapters li:last-child { border-bottom: 0; }
/* No chapter out yet */
.chapters li.empty { padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.chapters li.empty span { font-size: 13.5px; color: var(--muted); }
.chapters a { display: grid; grid-template-columns: 136px 1fr auto; gap: 16px; align-items: center; padding: 16px 22px; transition: background .15s; }
.chapters a:hover { background: var(--raised); }
.chapters .k { font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.chapters .k.new { color: var(--spark); }
.chapters b { font-weight: 600; }
.chapters .d { font-size: 13px; color: var(--muted); }

/* ---------- 13. Devlogs list + post ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--s5); }
.chip {
  height: 36px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: transparent; color: var(--body); font: 500 13.5px var(--font-body); cursor: pointer;
}
.chip:hover { background: var(--raised); color: var(--text); }
.chip[aria-pressed="true"] { background: rgba(110, 155, 255, .12); border-color: rgba(110, 155, 255, .55); color: var(--blue); }

.featured { display: grid; grid-template-columns: 1fr; margin-bottom: var(--gutter); }
.featured .thumb { aspect-ratio: 16 / 9; background: var(--raised) center / cover; }
.featured .t { padding: var(--s5); display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.featured.no-img { grid-template-columns: 1fr !important; }
.featured.no-img .t { max-width: 720px; }
.featured h3 { font-size: 28px; }
.featured p { color: var(--body); }

.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: var(--s6); }
.pager button {
  min-width: 40px; height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: transparent; color: var(--body); font: 500 14px var(--font-body); cursor: pointer;
}
.pager button[aria-current="page"] { background: var(--text); color: var(--on-light); border-color: var(--text); }
.pager button:disabled { opacity: .4; cursor: default; }

/* Reading column: 672 px of text + padding (same as the novel's chapters) */
.article { max-width: 720px; margin: 0 auto; padding: 0 var(--margin); }
.article .top { padding-top: var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.article h1 { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.article .standfirst { font-size: 18px; line-height: 1.6; color: var(--body); }
/* Date and reading time under the standfirst (no author name on devlogs) */
.byline { font-size: 13.5px; color: var(--muted); margin: 0; }
.hero-img { max-width: 720px; margin: var(--s6) auto 0; padding: 0 var(--margin); }
.hero-img div { aspect-ratio: 16 / 9; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--card) center / cover; }

.prose { padding-top: var(--s6); font-size: 17px; line-height: 1.8; color: var(--body); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 26px; color: var(--text); margin-top: 1.8em; }
.prose h3 { font-size: 20px; color: var(--text); margin-top: 1.6em; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--blue); font: 600 21px/1.5 var(--font-head); color: var(--text); }
.prose figure { margin: 1.8em 0; }
.prose figure img { border-radius: 12px; border: 1px solid var(--line); width: 100%; }
.prose figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }
.prose pre { background: #050810; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; font: 13.5px/1.6 var(--font-mono); color: #CFE0FF; }
.prose code { font-family: var(--font-mono); font-size: .9em; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.prevnext { display: grid; grid-template-columns: 1fr; gap: var(--gutter); margin-top: var(--s6); }
.prevnext a { padding: 18px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); display: flex; flex-direction: column; gap: 6px; }
.prevnext a:hover { border-color: #33415E; }
.prevnext span { font-size: 12.5px; color: var(--muted); }
.prevnext b { font-weight: 600; }
.prevnext .next { text-align: right; }

/* ---------- 14. Plain pages (privacy policy) ---------- */

.plain h1 { font-size: 40px; font-weight: 800; margin-top: var(--s4); }
.plain .updated { color: var(--muted); font-size: 13.5px; margin-top: var(--s3); }

/* ---------- 15. Tablet and desktop ---------- */

@media (min-width: 600px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .mind .img { min-height: 340px; }
  .featured { grid-template-columns: repeat(2, 1fr); }
  .prevnext { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
  .facts div:nth-child(odd) { border-right: 1px solid var(--line); }
  /* tablet spans (8 columns) */
  .t-4 { grid-column: span 4; }
}

@media (min-width: 1024px) {
  /* desktop spans (12 columns), named by how many columns they take */
  .grid > .c-3 { grid-column: span 3; }
  .grid > .c-4 { grid-column: span 4; }
  .grid > .c-5 { grid-column: span 5; }
  .grid > .c-6 { grid-column: span 6; }
  .grid > .c-7 { grid-column: span 7; }
  .grid > .c-9 { grid-column: span 9; }
  .grid > .c-6-right { grid-column: 7 / span 6; }

  .hero .copy { grid-column: 1 / span 7; max-width: 560px; }
  .mind { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .mind .img { grid-column: span 7; min-height: 420px; }
  .mind .body { grid-column: span 5; padding: 32px 32px 30px; }
  .featured { grid-template-columns: 7fr 5fr; }
  .featured .t { padding: 32px; }
  .p-hero h1, .n-hero h1 { font-size: 52px; }
  .article h1 { font-size: 44px; }
  /* facts: one row, label above value */
  .facts { display: flex; }
  .facts div { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: flex-start; gap: 6px; border-bottom: 0; border-right: 1px solid var(--line); }
  .facts div:last-child { border-right: 0; }
  .facts dd { text-align: left; }
  /* Novel header: the cover fills the column, so its bottom lines up with the buttons */
  .n-hero { align-items: stretch; }
  .n-hero .book-col { display: flex; }
  .n-hero .book { aspect-ratio: auto; width: 100%; min-height: 320px; }
  .n-hero .actions { margin-top: auto; }
}

/* Tablet: two cards side by side (8 columns → 4 + 4) */
@media (min-width: 600px) and (max-width: 1023px) {
  .grid > .c-4, .grid > .c-6, .grid > .c-3 { grid-column: span 4; }
  .grid > .c-3.book-col { grid-column: span 3; }
  .grid > .c-9 { grid-column: span 5; }
}

/* Phones */
@media (max-width: 599px) {
  body { font-size: 15px; }
  section.s { padding-top: var(--s7); }
  section.t { padding-top: var(--s7); }
  .head { flex-wrap: wrap; margin-bottom: var(--s4); }
  .head h2 { font-size: 30px; }
  .hero .art { background-position: left center; opacity: .55; }
  .hero .fade { background: linear-gradient(0deg, var(--bg) 0%, rgba(8, 11, 20, .55) 60%, rgba(8, 11, 20, .35) 100%); }
  .hero .wrap { padding-top: 72px; padding-bottom: 56px; }
  .hero h1 { font-size: 48px; }
  .hero p { font-size: 15.5px; }
  .site-header .wrap { height: 60px; }
  .brand b { font-size: 19px; }
  .site-header .btn { height: 38px; padding: 0 14px; font-size: 13px; }
  .small { padding: 16px; gap: 14px; }
  .cover { width: 72px; height: 96px; }
  .small h3 { font-size: 18px; }
  .small .b { padding-right: 30px; }
  .arr { top: 14px; right: 14px; }
  .about { padding: 56px 0; margin-top: var(--s7); }
  .bio { flex-direction: column; }
  .photo { width: 120px; height: 154px; }
  .news { padding: 56px 0; margin-top: var(--s7); }
  .news h2 { font-size: 28px; }
  .sub { flex-direction: column; }
  .site-footer .top { flex-direction: column; align-items: flex-start; gap: 16px; }
  .p-hero h1, .n-hero h1, .article h1, .plain h1 { font-size: 34px; }
  .book { max-width: 220px; }
  .chapters a { grid-template-columns: 1fr auto; }
  .chapters .k { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Keep the portrait above the copy when two columns no longer fit. */
@media (max-width: 1023px) {
  .hero .art {
    inset: 0 0 auto;
    height: 320px;
    background-position: 42% center;
    transform: scaleX(-1);
    opacity: 1;
  }
  .hero .fade {
    inset: 0 0 auto;
    height: 322px;
    background: linear-gradient(0deg, var(--bg) 0%, rgba(8, 11, 20, .12) 38%, rgba(8, 11, 20, 0) 70%);
  }
  .hero .wrap { padding-top: 340px; padding-bottom: 64px; }
  .hero .copy { grid-column: 1 / -1; max-width: 620px; }
}

/* ---------- Copy protection (see js/site.js) ----------
   Text and images can't be selected or dragged out; form fields can.
   Printing shows a short notice instead of the page. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; user-drag: none; }
.print-notice { display: none; }
@media print {
  body:not([data-allow-copy]) > *:not(.print-notice) { display: none !important; }
  body:not([data-allow-copy]) > .print-notice { display: block; padding: 40px; font-size: 18px; color: #000; }
}
/* Pages left open (data-allow-copy on <body>, e.g. the privacy policy) */
body[data-allow-copy] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
