/* Layout idea: a dark reading column under a cursor-reactive text ring; one blue accent, motion only where it helps. */
:root {
  --paper: #0e1520;
  --surface: #162030;
  --ink: #e8edf3;
  --muted: #9aa8ba;
  --line: #27354a;
  --accent: #7db8ee;
  --accent-ink: #0e1520;
  --accent-hover: #a3cff5;
  --header-bg: rgba(22, 32, 48, .85);
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --paper: #f7f8fa;
  --surface: #ffffff;
  --ink: #14202e;
  --muted: #556173;
  --line: #d9dee5;
  --accent: #1d4f7c;
  --accent-ink: #ffffff;
  --accent-hover: #163f63;
  --header-bg: rgba(255, 255, 255, .88);
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; }
a { color: var(--accent); }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 20; pointer-events: none; }

header.top { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: var(--header-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
header.top .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.tools { display: flex; gap: 8px; }
.tool { font: 500 13px var(--body); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px; cursor: pointer; transition: color .2s, border-color .2s; }
.tool:hover, .tool[aria-pressed="true"] { color: var(--ink); border-color: var(--accent); }
.brand { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--ink); text-decoration: none; }
nav { display: flex; gap: 22px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; padding: 4px 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
nav a:hover, nav a[aria-current="page"], nav a.on { color: var(--ink); border-bottom-color: var(--accent); }

/* Hero: a draggable text ring. It coasts, bounces off the edges, and the whole hero floods with a colour when the ring reaches a corner. */
.hero { --hero-ink: var(--ink); --hero-sub: var(--muted); position: relative; height: clamp(520px, 82vh, 780px); overflow: hidden; background: var(--paper); }
.stage { position: absolute; left: 50%; top: 50%; width: min(80vw, 440px); aspect-ratio: 1; transform: translate(-50%, -50%); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; will-change: transform; border-radius: 50%; }
.js .stage { left: 0; top: 0; transform: none; }
.stage.drag { cursor: grabbing; }
.stage:focus-visible { outline: 2px dashed var(--hero-ink); outline-offset: 8px; }
.ring-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ring-svg text { font-family: var(--body); font-size: 11px; font-weight: 500; fill: var(--hero-sub); }
.ring-svg .guide { fill: none; stroke: var(--hero-sub); stroke-opacity: .35; stroke-width: 1; }
.ring-svg .guide.dash { stroke-dasharray: 2 6; }
.ring-spin { transform-origin: 200px 200px; }
.hero h1 { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20%; font-family: var(--display); font-weight: 600; font-size: clamp(24px, 5.6vw, 38px); line-height: 1.15; text-wrap: balance; color: var(--hero-ink); pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.letter { position: absolute; left: 0; top: 0; font-family: var(--body); font-weight: 500; line-height: 1; color: var(--hero-sub); pointer-events: none; will-change: transform; transition: opacity .5s; }
.letter.out { opacity: 0; }
.burst { position: absolute; border: 2px solid var(--hero-sub); border-radius: 50%; pointer-events: none; animation: burst .26s ease-out forwards; }
@keyframes burst { from { transform: scale(1); opacity: .9; } to { transform: scale(1.3); opacity: 0; } }
.tilt.spawn { animation: spawn .4s ease-out; }
@keyframes spawn { from { transform: scale(.15); opacity: 0; } to { transform: none; opacity: 1; } }
.hint { display: none; position: absolute; left: 0; right: 0; top: 18px; text-align: center; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--hero-sub); pointer-events: none; transition: opacity .5s; }
.js .hint { display: block; }
.hint.gone { opacity: 0; }

.intro { padding: 64px 0 40px; }
.intro h1 { font-family: var(--display); font-weight: 600; font-size: clamp(36px, 7vw, 56px); line-height: 1.1; text-wrap: balance; }
.intro p { margin-top: 16px; max-width: 62ch; color: var(--muted); font-size: 19px; }

section { padding: 40px 0; border-top: 1px solid var(--line); }
section h2 { font-family: var(--display); font-weight: 600; font-size: 30px; margin-bottom: 8px; text-wrap: balance; }
section h2::after { content: ""; display: block; height: 3px; width: 48px; margin-top: 8px; background: var(--accent); border-radius: 2px; transform-origin: 0 50%; transition: transform .6s ease-out; }
.lede { color: var(--muted); max-width: 62ch; margin-bottom: 24px; }

/* Entrance: content is always visible; it only slides up a little. */
.js .reveal { transform: translateY(18px); transition: transform .6s ease-out; }
.js .reveal.in { transform: none; }
.js section h2::after { transform: scaleX(0); }
.js section.in h2::after { transform: scaleX(1); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-decoration: none; color: var(--ink); transform: perspective(800px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)); transition: transform .18s ease-out, border-color .2s, box-shadow .2s; will-change: transform; }
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s; background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .10), transparent 60%); }
.card:hover, .card:focus-visible { border-color: var(--accent); box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
.card:hover::after { opacity: 1; }
.card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 1px solid var(--line); transition: transform .4s ease-out; }
.card:hover img { transform: scale(1.04); }
.card .thumb { position: relative; overflow: hidden; }
.card .body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.card .kind { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 22px; }
.card p { font-size: 15px; color: var(--muted); }
.card .go { margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--accent); transition: transform .2s; }
.card:hover .go { transform: translateX(4px); }

.book { display: grid; grid-template-columns: 1fr; gap: 8px; max-width: 62ch; }
.book h3 { font-family: var(--display); font-weight: 600; font-size: 26px; }
.status { display: inline-block; width: fit-content; font-size: 13px; font-weight: 600; padding: 2px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: var(--surface); }

.btn { display: inline-block; margin-top: 12px; width: fit-content; padding: 11px 22px; border-radius: 4px; font-weight: 600; font-size: 15px; text-decoration: none; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); transition: background .2s, transform .15s; }
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn[aria-disabled="true"] { background: var(--surface); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { background: var(--surface); transform: none; }

.contact-form { display: grid; gap: 16px; max-width: 560px; }
.contact-form .field { display: grid; gap: 6px; }
.contact-form label { font-size: 14px; font-weight: 600; color: var(--muted); }
.contact-form input, .contact-form textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; width: 100%; }
.contact-form textarea { resize: vertical; }
.contact-form input:focus-visible, .contact-form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.contact-form .btn { margin-top: 0; cursor: pointer; font-family: inherit; }
.contact-form .btn:disabled { opacity: .6; cursor: wait; transform: none; }
.contact-form .trap { position: absolute; left: -9999px; }
.form-status { min-height: 1.5em; color: var(--muted); font-size: 15px; }
.posts { list-style: none; border-top: 1px solid var(--line); }
.posts li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.posts .date { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.posts h3 { font-family: var(--display); font-weight: 600; font-size: 22px; }
.empty { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 28px; max-width: 62ch; }
.empty h3 { font-family: var(--display); font-weight: 600; font-size: 22px; margin-bottom: 6px; }
.empty p { color: var(--muted); }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js section h2::after, .card, .card img { transition: none; }
  .js .reveal { transform: none; }
  .js section h2::after { transform: none; }
}
