/* =========================================================
   Relax Club — site styles
   Light mode is default. Dark mode via [data-theme="dark"].
   ========================================================= */

:root {
  --bg: #EAF1EC;
  --bg-deep: #DCE8E0;
  --surface: #FFFFFF;
  --surface-2: #F3F7F4;
  --ink: #142630;
  --ink-soft: #2C4048;
  --muted: #586A70;
  --line: #C9D8CF;
  --felt: #1F5E4C;
  --felt-2: #2A7560;
  --on-felt: #F4FBF7;
  --token: #F2B035;
  --token-ink: #3A2700;
  --focus: #3B5BDB;
  --shadow: 0 1px 0 rgba(20, 38, 48, .06), 0 8px 24px -12px rgba(20, 38, 48, .25);
  --shadow-lift: 0 2px 0 rgba(20, 38, 48, .06), 0 18px 40px -18px rgba(20, 38, 48, .38);

  /* category colors */
  --c-felt: #1F5E4C;
  --c-indigo: #4552C9;
  --c-berry: #B83A62;
  --c-amber: #B9661A;
  --c-violet: #7446B8;
  --c-teal: #13789A;

  --pattern-opacity: .38;
  --font-ui: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-read: "Source Serif 4", Georgia, "Times New Roman", serif;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1180px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0D1A18;
  --bg-deep: #091311;
  --surface: #14241F;
  --surface-2: #1A2D28;
  --ink: #E5EFE9;
  --ink-soft: #C8D7CF;
  --muted: #95AAA1;
  --line: #29403A;
  --felt: #2F8A6E;
  --felt-2: #3BA383;
  --on-felt: #F4FBF7;
  --token: #F5C35C;
  --token-ink: #2D1E00;
  --focus: #8EA4FF;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 26px -14px rgba(0, 0, 0, .7);
  --shadow-lift: 0 2px 0 rgba(0, 0, 0, .3), 0 22px 44px -18px rgba(0, 0, 0, .85);

  --c-felt: #4FC29D;
  --c-indigo: #8C97FF;
  --c-berry: #F07CA0;
  --c-amber: #F2A65A;
  --c-violet: #B996F5;
  --c-teal: #5BC6E8;
  --pattern-opacity: .26;
  color-scheme: dark;
}

.c-felt   { --cat: var(--c-felt); }
.c-indigo { --cat: var(--c-indigo); }
.c-berry  { --cat: var(--c-berry); }
.c-amber  { --cat: var(--c-amber); }
.c-violet { --cat: var(--c-violet); }
.c-teal   { --cat: var(--c-teal); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 520px at 85% -10%, color-mix(in srgb, var(--felt) 16%, transparent), transparent 70%),
    radial-gradient(900px 480px at -10% 30%, color-mix(in srgb, var(--token) 12%, transparent), transparent 70%);
  background-attachment: fixed;
  transition: background-color .25s ease, color .25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body::before {
  /* tabletop pattern: pips, suits, puzzle tabs and pawns */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--pattern-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='none' stroke='%231F5E4C' stroke-opacity='.13' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='18' y='20' width='34' height='34' rx='8'/%3E%3Cpath d='M118 30c-4-6-14-2-10 6l10 10 10-10c4-8-6-12-10-6z'/%3E%3Cpath d='M170 120h10a5 5 0 1 1 10 0h10v10a5 5 0 1 0 0 10v10h-30z'/%3E%3Cpath d='M58 150a8 8 0 1 1 10 8l6 14H52l6-14a8 8 0 0 1 0-8z'/%3E%3Crect x='150' y='185' width='22' height='30' rx='4' transform='rotate(12 161 200)'/%3E%3C/g%3E%3Cg fill='%231F5E4C' fill-opacity='.14'%3E%3Ccircle cx='28' cy='30' r='3'/%3E%3Ccircle cx='42' cy='44' r='3'/%3E%3Ccircle cx='35' cy='37' r='3'/%3E%3Ccircle cx='110' cy='112' r='2.4'/%3E%3Ccircle cx='190' cy='60' r='2.4'/%3E%3Ccircle cx='100' cy='190' r='2.4'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 220px 220px;
}
:root[data-theme="dark"] body::before { filter: invert(1) hue-rotate(180deg); }

main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}
h1, h2, h3, h4 { font-family: var(--font-ui); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 4.2vw + 1rem, 3.9rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 1.4vw + 1rem, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.wrap.narrow { width: min(100% - 32px, 780px); }
.section { padding-block: clamp(36px, 5vw, 64px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; z-index: 100; text-decoration: none; }
.skip:focus { top: 12px; }
.lede { font-size: clamp(1.05rem, .4vw + 1rem, 1.25rem); color: var(--ink-soft); max-width: 62ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 600 1rem/1 var(--font-ui);
  padding: .9em 1.35em;
  border-radius: 999px;
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--felt); color: var(--on-felt); box-shadow: 0 4px 0 color-mix(in srgb, var(--felt) 55%, #000); }
.btn-primary:hover { background: var(--felt-2); }
.btn-quiet { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink-soft); background: var(--surface); }
.text-link { font-weight: 600; color: var(--felt); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--felt) 35%, transparent); }
:root[data-theme="dark"] .text-link { color: var(--c-felt); }
.text-link:hover { text-decoration-color: currentColor; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em; }
.bm-tile { fill: var(--felt); }
.bm-pip { fill: var(--token); }
.bm-smile { fill: none; stroke: var(--on-felt); stroke-width: 3; stroke-linecap: round; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.main-nav > a, .nav-cats > summary {
  font-weight: 600; text-decoration: none; padding: 9px 14px; border-radius: 999px; color: var(--ink-soft); cursor: pointer; list-style: none;
}
.nav-cats > summary::-webkit-details-marker { display: none; }
.nav-cats > summary::after { content: ""; display: inline-block; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); margin-left: 8px; }
.main-nav > a:hover, .nav-cats > summary:hover { background: var(--surface); color: var(--ink); }
.main-nav [aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 -3px 0 var(--token); }
.nav-cats { position: relative; }
.nav-cats-panel {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: 300px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift);
  display: grid; gap: 2px;
}
.cat-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.cat-link:hover { background: var(--surface-2); }
.cat-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--cat); background: color-mix(in srgb, var(--cat) 14%, transparent); flex: none; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.icon-btn:hover { border-color: var(--ink-soft); }
.menu-btn { display: none; }

/* theme toggle */
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 12px 5px 5px; cursor: pointer; font: 600 .9rem var(--font-ui); }
.tt-track { position: relative; width: 52px; height: 30px; border-radius: 999px; background: color-mix(in srgb, var(--token) 35%, var(--surface-2)); transition: background-color .25s; }
.tt-thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); display: grid; place-items: center; transition: transform .25s cubic-bezier(.3,1.4,.5,1); color: #B87500; }
.tt-thumb > span { position: absolute; display: grid; place-items: center; transition: opacity .2s; }
.tt-moon { opacity: 0; }
:root[data-theme="dark"] .tt-track { background: color-mix(in srgb, var(--felt) 60%, #000); }
:root[data-theme="dark"] .tt-thumb { transform: translateX(22px); color: #C9D4FF; background: #23362F; }
:root[data-theme="dark"] .tt-sun { opacity: 0; }
:root[data-theme="dark"] .tt-moon { opacity: 1; }

/* ---------- Hero + board ---------- */
.hero { padding-block: clamp(40px, 6vw, 84px) clamp(24px, 4vw, 48px); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { max-width: 13ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 18px;
  padding: 26px;
  border-radius: 28px;
  background:
    radial-gradient(120% 90% at 30% 20%, color-mix(in srgb, #fff 10%, transparent), transparent 60%),
    var(--felt);
  box-shadow: inset 0 0 0 6px color-mix(in srgb, #000 14%, var(--felt)), inset 0 0 0 9px color-mix(in srgb, var(--token) 70%, var(--felt)), var(--shadow-lift);
}
.board-track { position: absolute; inset: 26px; width: calc(100% - 52px); height: calc(100% - 52px); pointer-events: none; }
.board-track path { fill: none; stroke: color-mix(in srgb, var(--token) 85%, #fff); stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .85; }
.tile {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  min-height: 150px; padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  border-top: 10px solid var(--cat);
  box-shadow: 0 3px 0 color-mix(in srgb, #000 22%, var(--felt));
  transition: transform .18s ease, box-shadow .18s ease;
}
.tile:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 10px 0 color-mix(in srgb, #000 22%, var(--felt)); }
.tile-ico { color: var(--cat); }
.tile-name { font-weight: 700; font-size: 1.05rem; line-height: 1.15; }
.tile-count { font-size: .85rem; color: var(--muted); }
.t1 { grid-area: 1 / 1; } .t2 { grid-area: 1 / 2; } .t3 { grid-area: 1 / 3; }
.t4 { grid-area: 2 / 3; } .t5 { grid-area: 2 / 2; } .t6 { grid-area: 2 / 1; }
.board-die {
  position: absolute; z-index: 2; right: -14px; bottom: -18px;
  width: 64px; height: 64px; border-radius: 16px; background: #FFFDF6; transform: rotate(14deg);
  box-shadow: 0 6px 0 #D8CDB2, 0 16px 26px -10px rgba(0,0,0,.45);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 10px;
}
.board-die i { width: 10px; height: 10px; border-radius: 50%; background: #1B2B33; place-self: center; }
.board-die i:nth-child(1) { grid-area: 1/1; } .board-die i:nth-child(2) { grid-area: 1/3; } .board-die i:nth-child(3) { grid-area: 2/2; } .board-die i:nth-child(4) { grid-area: 3/1; } .board-die i:nth-child(5) { grid-area: 3/3; }

/* ---------- Sections and cards ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.shelf-title { display: flex; gap: 14px; align-items: center; }
.shelf-title p { margin: 4px 0 0; color: var(--muted); }
.shelf-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #fff; background: var(--cat); box-shadow: 0 4px 0 color-mix(in srgb, var(--cat) 60%, #000); flex: none; }
:root[data-theme="dark"] .shelf-ico { color: #0D1A18; }
.cat-shelf { border-top: 1px solid var(--line); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.035); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title { font-size: 1.2rem; margin: 0; line-height: 1.22; }
.card-title a { text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .25s; }
.card-title a:hover { background-size: 100% 2px; }
.card-excerpt { margin: 0; color: var(--muted); font-size: .97rem; }
.card-meta { margin: auto 0 0; display: flex; gap: 14px; font-size: .85rem; color: var(--muted); }
.chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; text-decoration: none; color: var(--cat); padding: 4px 10px 4px 8px; border-radius: 999px; background: color-mix(in srgb, var(--cat) 12%, transparent); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--cat); transform: rotate(45deg); }

.lead-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 26px; align-items: start; }
.card-lead .card-title { font-size: clamp(1.4rem, 1vw + 1rem, 1.85rem); }
.card-lead .card-excerpt { font-size: 1.05rem; }
.latest-list { display: grid; gap: 14px; align-content: start; }
.card-row { flex-direction: row; border-radius: var(--radius); }
.card-row .card-media { flex: 0 0 38%; aspect-ratio: auto; min-height: 112px; }
.card-row .card-body { padding: 12px 16px; gap: 6px; }
.card-row .card-title { font-size: 1.02rem; }
.card-row .card-excerpt { display: none; }

.promise-inner { background: var(--ink); color: var(--bg); border-radius: 28px; padding: clamp(28px, 4vw, 52px); }
:root[data-theme="dark"] .promise-inner { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.promise-inner h2 { color: inherit; }
.promise-inner h3 { color: var(--token); }
.promise-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 18px; }
.promise-cols p { margin: 0; opacity: .85; }

/* ---------- Listing page ---------- */
.page-hero { padding-block: clamp(30px, 5vw, 56px) 12px; }
.page-hero h1 { font-size: clamp(2rem, 3vw + 1rem, 3.2rem); margin-bottom: .25em; }
.page-hero-row { display: flex; gap: 18px; align-items: center; }
.page-hero-ico { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 22px; color: #fff; background: var(--cat); box-shadow: 0 5px 0 color-mix(in srgb, var(--cat) 60%, #000); flex: none; }
:root[data-theme="dark"] .page-hero-ico { color: #0D1A18; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 18px; max-width: 640px; margin-top: 22px; box-shadow: var(--shadow); }
.search-ico { color: var(--muted); display: grid; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); padding: 10px 4px; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.cat-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pill { --cat: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .92rem; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); }
.pill:hover { border-color: var(--cat); }
.pill.is-on { background: var(--cat); border-color: var(--cat); color: #fff; }
:root[data-theme="dark"] .pill.is-on { color: #0D1A18; }
.result-note { color: var(--muted); }
.empty { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius-lg); }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 40px; color: var(--muted); }

/* ---------- Single post ---------- */
.post-head { padding-top: clamp(28px, 4vw, 52px); }
.post-title { max-width: 24ch; }
.post-meta { max-width: 900px; }
.post-title { font-size: clamp(2rem, 2.6vw + 1.1rem, 3.3rem); }
.post-dek { font-family: var(--font-read); font-size: clamp(1.1rem, .5vw + 1rem, 1.3rem); color: var(--ink-soft); max-width: 60ch; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: .92rem; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.post-meta .rt { display: inline-flex; align-items: center; gap: 6px; }
.byline a { color: var(--ink); font-weight: 600; }
.post-hero { margin-top: 28px; margin-bottom: 0; }
.post-hero img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lift); aspect-ratio: 16/9; object-fit: cover; }
.post-hero figcaption, .prose figcaption { font-size: .88rem; color: var(--muted); margin-top: 10px; padding-left: 12px; border-left: 3px solid var(--cat, var(--token)); }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding-block: 40px 20px; }
.post-main { max-width: 740px; }
.toc { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--cat, var(--felt)); border-radius: var(--radius); padding: 16px 22px; margin-bottom: 32px; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ol { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }

.prose { font-family: var(--font-read); font-size: 1.14rem; line-height: 1.72; color: var(--ink); }
.prose > * { max-width: 68ch; }
.prose h2 { font-size: clamp(1.45rem, 1vw + 1rem, 1.85rem); margin: 1.8em 0 .55em; scroll-margin-top: 92px; }
.prose h3 { font-size: 1.25rem; margin: 1.5em 0 .4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--cat, var(--felt)); font-weight: 700; }
.prose a { color: var(--felt); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
:root[data-theme="dark"] .prose a { color: var(--c-felt); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose blockquote { margin: 1.6em 0; padding: 18px 24px; background: var(--surface); border-radius: var(--radius); border-left: 5px solid var(--token); font-style: italic; }
.prose blockquote p:last-child { margin: 0; }
.prose figure { margin: 1.8em 0; max-width: 100%; }
.prose figure img { border-radius: var(--radius); }
.prose img { border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: .95rem; margin: 1.5em 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.prose th, .prose td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }
.prose .tip { font-family: var(--font-ui); font-size: 1rem; background: color-mix(in srgb, var(--token) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--token) 45%, transparent); border-radius: var(--radius); padding: 16px 20px; }
.prose .tip strong { color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose iframe { max-width: 100%; border: 0; border-radius: var(--radius); }

.author-box { display: flex; gap: 16px; margin-top: 44px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.author-box .brand-mark { flex: none; }
.author-box p { margin: 0; color: var(--muted); font-size: .97rem; }
.author-box .author-name { color: var(--ink); font-weight: 700; margin-bottom: 4px; font-size: 1.05rem; }
.post-side { position: relative; }
.side-box { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.side-h { font-size: 1rem; margin-bottom: 10px; }
.side-cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-cats a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: .95rem; }
.side-cats a:hover, .side-cats a.is-on { background: var(--surface-2); }
.related { border-top: 1px solid var(--line); }

/* ---------- Static pages + forms ---------- */
.static .prose h2:first-child { margin-top: 0; }
.contact-form { display: grid; gap: 16px; margin: 28px 0 36px; padding: clamp(20px, 3vw, 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.field input, .field textarea, .field select { font: 400 1rem var(--font-ui); color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; width: 100%; }
.field input:focus, .field textarea:focus { border-color: var(--felt); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--felt) 25%, transparent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-note { font-size: .9rem; color: var(--muted); margin: 0; }
.contact-form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 14px 18px; border-radius: var(--radius); margin-top: 20px; font-weight: 600; }
.notice-ok { background: color-mix(in srgb, var(--c-felt) 16%, var(--surface)); border: 1px solid var(--c-felt); }
.notice-err { background: color-mix(in srgb, var(--c-berry) 14%, var(--surface)); border: 1px solid var(--c-berry); }

.notfound { text-align: center; display: grid; justify-items: center; }
.notfound .search { width: 100%; }
.nf-dice { display: grid; grid-template-columns: repeat(2, 14px); gap: 14px; padding: 22px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lift); transform: rotate(-10deg); margin-bottom: 26px; }
.nf-dice span { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; background: var(--felt); color: var(--on-felt); }
:root[data-theme="dark"] .site-footer { background: #0A1513; border-top: 1px solid var(--line); }
.site-footer .bm-tile { fill: var(--on-felt); }
.site-footer .bm-smile { stroke: var(--felt); }
:root[data-theme="dark"] .site-footer .bm-smile { stroke: #0A1513; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; padding-block: 52px 32px; }
.footer-about p { margin-top: 14px; opacity: .85; max-width: 38ch; }
.footer-h { font-size: 1rem; color: var(--token); margin-bottom: 12px; }
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-list a { text-decoration: none; opacity: .88; }
.footer-list a:hover { opacity: 1; text-decoration: underline; }
.footer-base { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-block: 20px 28px; border-top: 1px solid rgba(255,255,255,.18); font-size: .86rem; opacity: .8; }
.footer-base p { margin: 0; }

/* ---------- Cookie bar ---------- */
.cookie-bar { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; max-width: 760px; margin-inline: auto; display: flex; gap: 18px; align-items: center; padding: 16px 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lift); }
.cookie-bar[hidden] { display: none; }
.cookie-bar p { margin: 0; font-size: .92rem; }
.cookie-actions { display: flex; gap: 8px; flex: none; }
.cookie-actions .btn { padding: .7em 1.05em; font-size: .9rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: 18ch; }
  .post-layout { grid-template-columns: 1fr; }
  .post-side { display: none; }
  .lead-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-grid; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; display: none; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px 18px; box-shadow: var(--shadow-lift);
  }
  .main-nav.is-open { display: flex; }
  .nav-cats-panel { position: static; transform: none; width: auto; box-shadow: none; border: 0; padding: 0 0 0 8px; }
  .theme-toggle .tt-label { display: none; }
  .theme-toggle { padding: 5px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .promise-cols { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .board { grid-template-columns: 1fr 1fr; grid-template-rows: none; padding: 18px; gap: 12px; }
  .board-track { display: none; }
  .t1, .t2, .t3, .t4, .t5, .t6 { grid-area: auto; }
  .tile { min-height: 120px; padding: 12px; }
  .board-die { width: 48px; height: 48px; padding: 7px; right: -6px; bottom: -14px; }
  .board-die i { width: 8px; height: 8px; }
  .grid-3 { grid-template-columns: 1fr; }
  .card-row .card-media { flex-basis: 36%; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cookie-bar { flex-direction: column; align-items: stretch; }
  .search .btn { padding: .8em 1em; }
  .prose { font-size: 1.07rem; }
  .brand-name { font-size: 1.2rem; }
  .header-row { gap: 12px; }
}

.table-scroll { overflow-x: auto; margin: 1.5em 0; max-width: 100%; }
.table-scroll table { margin: 0; min-width: 520px; }
