/* ==========================================================================
   Quolira — app.css
   Monochrome black/white UI (Apple/Uber feel), color reserved for imagery.
   Light is default; [data-theme="dark"] flips the tokens.
   ========================================================================== */

/* ----------------------------- Fonts ----------------------------------- */
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ----------------------------- Tokens ---------------------------------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Hanken Grotesk", "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", "Apple Garamond", Georgia,
    "Times New Roman", serif;

  /* Light theme */
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --bg-elev: #ffffff;
  --bg-invert: #0a0a0b;
  --text: #0a0a0b;
  --text-soft: #54545a;
  --text-mute: #8a8a90;
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.16);
  --accent: #0a0a0b;        /* buttons / emphasis */
  --accent-hover: #2a2a2e;
  --on-accent: #ffffff;
  --ring: rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.14);

  --maxw: 1200px;
  --maxw-narrow: 720px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --gap: clamp(18px, 3vw, 32px);
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-soft: #161618;
  --bg-elev: #161618;
  --bg-invert: #f5f5f7;
  --text: #f5f5f7;
  --text-soft: #a1a1a6;
  --text-mute: #6e6e73;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.20);
  --accent: #f5f5f7;
  --accent-hover: #e3e3e6;
  --on-accent: #0a0a0b;
  --ring: rgba(255, 255, 255, 0.30);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
}

/* ----------------------------- Reset ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-weight: 650; line-height: 1.15; letter-spacing: -0.02em; }
::selection { background: var(--text); color: var(--bg); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(18px, 4vw, 40px); }
.wrap-narrow { max-width: var(--maxw-narrow); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; border-radius: var(--radius-sm); transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

/* ----------------------------- Buttons --------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform 0.15s var(--ease), background-color 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-solid { background: var(--accent); color: var(--on-accent); }
.btn-solid:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ----------------------------- Eyebrow --------------------------------- */
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-mute);
}
.eyebrow-light { color: rgba(255, 255, 255, 0.85); }
a.eyebrow:hover { color: var(--text); }

/* ============================== Header ================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex; align-items: baseline; gap: 2px;
  font-size: 20px; font-weight: 700; letter-spacing: -0.03em; flex-shrink: 0;
}
.brand-mark { color: var(--text-mute); font-weight: 800; }
.brand-name { color: var(--text); }

.main-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.main-nav > a, .nav-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 12px; border-radius: 999px;
  font-size: 14.5px; font-weight: 550; color: var(--text-soft);
  transition: color 0.18s, background-color 0.18s;
}
.main-nav > a:hover, .nav-trigger:hover { color: var(--text); background: var(--bg-soft); }
.caret {
  width: 7px; height: 7px; border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-2px);
  opacity: 0.6; transition: transform 0.2s;
}
.nav-item { position: relative; }
.nav-item.open .caret { transform: rotate(-135deg) translateY(-1px); }

.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
}
.nav-item.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 14.5px; font-weight: 500;
  transition: background-color 0.15s;
}
.dropdown a:hover { background: var(--bg-soft); }
.dropdown .count {
  font-size: 12px; color: var(--text-mute); font-variant-numeric: tabular-nums;
  background: var(--bg-soft); border-radius: 999px; padding: 1px 8px;
}
.dropdown a:hover .count { background: var(--bg); }
.dropdown-empty { padding: 9px 12px; color: var(--text-mute); font-size: 13.5px; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.search-mini { position: relative; display: flex; align-items: center; }
.search-mini input {
  width: 180px; height: 38px; padding: 0 38px 0 14px;
  background: var(--bg-soft); border: 1px solid transparent; border-radius: 999px;
  font-size: 14px; transition: width 0.25s var(--ease), border-color 0.2s, background-color 0.2s;
}
.search-mini input::placeholder { color: var(--text-mute); }
.search-mini input:focus { width: 220px; outline: none; border-color: var(--border-strong); background: var(--bg); }
.search-mini button {
  position: absolute; right: 4px; width: 30px; height: 30px;
  display: grid; place-items: center; color: var(--text-mute); border-radius: 999px;
}
.search-mini button:hover { color: var(--text); }

.theme-toggle, .menu-toggle {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 999px; color: var(--text-soft);
  transition: background-color 0.18s, color 0.18s;
}
.theme-toggle:hover, .menu-toggle:hover { background: var(--bg-soft); color: var(--text); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.menu-toggle { display: none; flex-direction: column; gap: 4px; }
.menu-toggle span {
  width: 18px; height: 1.8px; background: currentColor; border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(5.8px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-5.8px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  display: none; flex-direction: column; gap: 2px;
  padding: 10px clamp(18px, 4vw, 40px) 22px;
  border-top: 1px solid var(--border); background: var(--bg);
}
.mobile-nav.open { display: flex; }
.mobile-nav > a, .mobile-nav summary {
  padding: 12px 6px; font-size: 16px; font-weight: 550;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.mobile-nav summary { list-style: none; display: flex; justify-content: space-between; align-items: center; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary::after { content: "+"; color: var(--text-mute); font-size: 20px; }
.mobile-nav details[open] summary::after { content: "−"; }
.mobile-nav details a { display: block; padding: 9px 6px 9px 18px; font-size: 15px; color: var(--text-soft); }

/* ============================== Hero =================================== */
.hero { margin-top: clamp(24px, 4vw, 44px); }
.hero-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: var(--gap); }
.hero-subs { display: grid; grid-template-rows: 1fr 1fr; gap: var(--gap); }

.featured {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--bg-soft);
  isolation: isolate;
}
.featured img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.featured:hover img { transform: scale(1.04); }
.featured-lead { min-height: clamp(360px, 46vw, 520px); }
.featured-sub { min-height: clamp(170px, 21vw, 240px); }
.featured-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0) 28%, rgba(0,0,0,0.78) 100%);
}
.featured-content {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; flex-direction: column; gap: 8px;
  padding: clamp(18px, 2.4vw, 30px);
}
.featured-title {
  font-family: var(--font-serif); color: #fff; letter-spacing: -0.01em;
  line-height: 1.08; font-weight: 400;
}
.featured-lead .featured-title { font-size: clamp(28px, 3.6vw, 46px); }
.featured-sub .featured-title { font-size: clamp(19px, 1.7vw, 24px); }
.featured-sub .eyebrow { font-size: 11px; }
.featured-sub .featured-overlay { background: linear-gradient(180deg, rgba(0,0,0,0) 18%, rgba(0,0,0,0.78) 100%); }
.featured-sub:nth-child(2) .featured-content { padding-bottom: clamp(14px, 1.6vw, 20px); }
.featured-sub:nth-child(2) .featured-content,
.featured-sub:nth-child(3) .featured-content { padding: clamp(14px, 1.6vw, 20px); }
.featured-sub .featured-sub,
.featured-lead .featured-sub { color: rgba(255,255,255,0.82); font-size: 15.5px; }

/* ============================== Layout ================================= */
.layout-2col {
  display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: clamp(28px, 4vw, 56px);
  margin: clamp(40px, 6vw, 72px) 0;
}
.col-main { min-width: 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border); padding-bottom: 14px;
}
.section-title { font-size: clamp(20px, 2.4vw, 27px); letter-spacing: -0.025em; }
.section-link { font-size: 13.5px; font-weight: 600; color: var(--text-mute); }
.section-link:hover { color: var(--text); }

/* ----------------------------- Cards ----------------------------------- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(22px, 3vw, 36px);
}
.layout-2col .card-grid { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
.card { display: flex; flex-direction: column; }
.card-thumb {
  position: relative; display: block; aspect-ratio: 16 / 10;
  border-radius: var(--radius); overflow: hidden; background: var(--bg-soft);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.card:hover .card-thumb img { transform: scale(1.05); }
.badge-type {
  position: absolute; top: 10px; left: 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--text); font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 999px;
}
.card-body { padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: clamp(17px, 1.5vw, 20px); letter-spacing: -0.02em; line-height: 1.22; }
.card-title a { background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1.5px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.3s var(--ease); }
.card:hover .card-title a { background-size: 100% 1.5px; }
.card-excerpt { color: var(--text-soft); font-size: 14.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 7px; margin-top: 2px;
  font-size: 12.5px; color: var(--text-mute); font-weight: 500; }
.dot { opacity: 0.6; }

/* ----------------------------- Sidebar --------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: 34px; align-self: start; position: sticky; top: calc(var(--header-h) + 24px); }
.side-block { }
.side-title {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-mute); padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.side-social { display: flex; flex-wrap: wrap; gap: 8px; }
.side-social a {
  font-size: 13px; font-weight: 600; padding: 7px 13px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  transition: background-color 0.18s, border-color 0.18s;
}
.side-social a:hover { background: var(--bg-soft); border-color: var(--text); }
.side-list { display: flex; flex-direction: column; }
.side-list li { border-bottom: 1px solid var(--border); }
.side-list li:last-child { border-bottom: none; }
.side-list a { display: block; padding: 12px 0; font-size: 15px; font-weight: 550; line-height: 1.35; }
.side-list a:hover { color: var(--text-mute); }
.side-list time { display: block; font-size: 12px; color: var(--text-mute); font-weight: 500; margin-top: 3px; }
.side-list.ranked { counter-reset: rank; }
.side-list.ranked li { display: flex; counter-increment: rank; }
.side-list.ranked li::before {
  content: counter(rank); font-family: var(--font-serif); font-size: 26px; line-height: 1;
  color: var(--text-mute); opacity: 0.5; width: 38px; flex-shrink: 0; padding-top: 12px;
}
.side-cat { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-mute); margin-bottom: 2px; }
.side-archive li { border-bottom: 1px solid var(--border); }
.side-archive a { display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; font-size: 14.5px; font-weight: 500; }
.side-archive a:hover { color: var(--text-mute); }
.side-archive .count { font-size: 12px; color: var(--text-mute); font-variant-numeric: tabular-nums; }

/* --------------------------- Pagination -------------------------------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 48px; flex-wrap: wrap; }
.page-link {
  min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex;
  align-items: center; justify-content: center; border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 600; color: var(--text-soft);
  border: 1px solid var(--border); transition: all 0.18s;
}
.page-link:hover { border-color: var(--text); color: var(--text); }
.page-link.is-current { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.page-gap { color: var(--text-mute); padding: 0 4px; }
.load-more-wrap { display: flex; justify-content: center; margin-top: 28px; }

/* ============================ Post / Story ============================= */
.post { padding-bottom: clamp(48px, 7vw, 96px); }
.post-hero { padding: clamp(32px, 5vw, 56px) 0 clamp(20px, 3vw, 32px); }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--text-mute); margin-bottom: 18px; font-weight: 500; }
.crumbs a:hover { color: var(--text); }
.crumbs span { opacity: 0.5; }
.post-hero .eyebrow { margin-bottom: 14px; }
.post-title {
  font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.015em;
  font-size: clamp(34px, 5.4vw, 60px); line-height: 1.06; margin-top: 6px;
}
.post-subtitle { font-size: clamp(18px, 2.2vw, 23px); color: var(--text-soft);
  line-height: 1.4; margin-top: 18px; max-width: 38ch; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 22px; font-size: 13.5px; color: var(--text-mute); font-weight: 500; }
.draft-flag { background: var(--text); color: var(--bg); padding: 2px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.post-cover { margin: clamp(20px, 3vw, 32px) 0 clamp(28px, 4vw, 44px);
  border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-soft); }
.post-cover img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }

/* Prose */
.prose { font-size: 18px; line-height: 1.72; color: var(--text); }
.prose p { margin-bottom: 1.15em; }
.prose p:last-child { margin-bottom: 0; }
.prose a { text-decoration: underline; text-decoration-color: var(--border-strong);
  text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { font-weight: 680; }
.prose em { font-style: italic; }
.prose h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.01em; line-height: 1.15; margin: 1.6em 0 0.55em; }
.prose h3 { font-size: clamp(19px, 2vw, 23px); margin: 1.4em 0 0.4em; letter-spacing: -0.02em; }
.prose blockquote { border-left: 2.5px solid var(--text); padding: 4px 0 4px 22px;
  margin: 1.5em 0; font-family: var(--font-serif); font-size: 1.18em; line-height: 1.4; color: var(--text-soft); }
.post-intro { font-size: clamp(19px, 2.1vw, 22px); line-height: 1.6; color: var(--text-soft);
  margin-bottom: clamp(28px, 4vw, 44px); }
.post-intro p { margin-bottom: 0.8em; }
.post-outro { margin-top: clamp(32px, 4vw, 48px); padding-top: clamp(24px, 3vw, 32px);
  border-top: 1px solid var(--border); color: var(--text-soft); }

/* Quote blocks (listicle) */
.quote-list { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 48px); }
.quote-block {
  position: relative; padding: clamp(26px, 3.5vw, 40px) clamp(22px, 3vw, 38px);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-soft); overflow: hidden;
}
.quote-block::before {
  content: "\201C"; position: absolute; top: -0.18em; right: 0.12em;
  font-family: var(--font-serif); font-size: clamp(140px, 20vw, 230px);
  line-height: 1; color: var(--text); opacity: 0.05; pointer-events: none;
}
.quote-index {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px;
  padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 18px;
}
.quote-text {
  font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em;
  font-size: clamp(24px, 3.2vw, 36px); line-height: 1.22; position: relative; z-index: 1;
}
.quote-attr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-top: 16px; }
.quote-author { font-size: 14px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text); }
.quote-source { font-size: 14px; font-style: italic; color: var(--text-mute); font-family: var(--font-serif); }
.quote-comment { margin-top: 16px; font-size: 16.5px; line-height: 1.65; color: var(--text-soft); position: relative; z-index: 1; }

/* Pull quotes (story) */
.pull-quote {
  font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em;
  font-size: clamp(26px, 3.6vw, 40px); line-height: 1.18; text-align: center;
  margin: clamp(36px, 5vw, 60px) auto; max-width: 22ch; color: var(--text);
}
.pull-quote::before, .pull-quote::after { content: "\201C"; }
.pull-quote::after { content: "\201D"; }
.story-body { margin-top: clamp(20px, 3vw, 28px); }

/* Post footer: tags + share */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(32px, 4vw, 44px); }
.tag { font-size: 13px; font-weight: 600; color: var(--text-soft);
  padding: 6px 13px; border: 1px solid var(--border); border-radius: 999px; transition: all 0.18s; }
.tag:hover { border-color: var(--text); color: var(--text); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--border); }
.share-label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-mute); margin-right: 4px; }
.share a, .copy-link {
  font-size: 13.5px; font-weight: 600; padding: 8px 14px;
  border: 1px solid var(--border-strong); border-radius: 999px; transition: all 0.18s;
}
.share a:hover, .copy-link:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.copy-link.copied { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ----------------------- Affiliate product card ----------------------- */
.product-list { display: flex; flex-direction: column; gap: 18px; margin: clamp(34px, 5vw, 52px) 0; }
.product-card {
  display: flex; align-items: center; gap: clamp(18px, 3vw, 30px);
  padding: clamp(18px, 2.6vw, 28px);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-soft);
}
.product-cover {
  flex-shrink: 0; width: clamp(88px, 12vw, 124px); aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); box-shadow: var(--shadow-sm);
}
.product-cover img { width: 100%; height: 100%; object-fit: cover; }
.product-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.product-title {
  font-family: var(--font-sans); font-weight: 750; letter-spacing: -0.02em; line-height: 1.12;
  font-size: clamp(20px, 2.6vw, 30px);
}
.product-author { color: var(--text-mute); font-size: clamp(15px, 1.6vw, 17px); }
.product-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.price-now { font-weight: 750; font-size: clamp(18px, 2vw, 22px); letter-spacing: -0.01em; }
.price-old { color: var(--text-mute); text-decoration: line-through; font-size: 15px; }
.product-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 26px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 15px; letter-spacing: 0.03em; text-transform: uppercase;
  transition: transform 0.15s var(--ease), background-color 0.2s var(--ease);
}
.product-btn:hover { background: var(--accent-hover); }
.product-btn:active { transform: scale(0.97); }
.amazon-glyph { width: 26px; height: 16px; flex-shrink: 0; }
@media (max-width: 680px) {
  .product-card { flex-direction: column; align-items: stretch; text-align: center; }
  .product-cover { width: 116px; margin: 0 auto; }
  .product-info { align-items: center; }
  .product-price { justify-content: center; }
  .product-btn { justify-content: center; }
}

.related { margin-top: clamp(56px, 8vw, 96px); padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--border); }
.related .section-title { margin-bottom: 28px; }

/* ====================== Archive / Search / Page ======================== */
.archive-head { padding: clamp(36px, 6vw, 68px) 0 clamp(24px, 3vw, 36px);
  border-bottom: 1px solid var(--border); margin-bottom: clamp(32px, 4vw, 48px); }
.archive-title { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.015em;
  font-size: clamp(34px, 5.4vw, 60px); line-height: 1.05; margin: 12px 0 0; }
.archive-desc { font-size: clamp(17px, 2vw, 20px); color: var(--text-soft); margin-top: 16px; max-width: 60ch; }
.archive-count { font-size: 14px; color: var(--text-mute); font-weight: 500; margin-top: 18px; }
.empty-state { color: var(--text-mute); font-size: 17px; padding: 48px 0; text-align: center; }
.page-prose { padding: 8px 0 clamp(48px, 7vw, 96px); }
.page-prose h2 { margin-top: 1.4em; }
.page-prose code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em;
  background: var(--bg-soft); padding: 2px 7px; border-radius: 6px; }

.search-big { display: flex; gap: 10px; margin-top: 18px; max-width: 560px; }
.search-big input { flex: 1; height: 52px; padding: 0 20px; font-size: 17px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; }
.search-big input:focus { outline: none; border-color: var(--text); background: var(--bg); }
.search-big button { flex-shrink: 0; height: 52px; padding: 0 26px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; transition: background-color 0.2s; }
.search-big button:hover { background: var(--accent-hover); }

/* 404 */
.notfound { text-align: center; padding: clamp(64px, 12vw, 140px) 0; }
.notfound-code { font-family: var(--font-serif); font-size: clamp(80px, 16vw, 180px);
  line-height: 0.9; color: var(--text); opacity: 0.12; display: block; }
.notfound h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(28px, 4vw, 44px);
  margin: 8px 0 14px; }
.notfound p { color: var(--text-soft); font-size: 18px; }
.notfound-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; }

/* ============================== Footer ================================= */
.site-footer { background: var(--bg-invert); color: #f5f5f7; margin-top: clamp(48px, 8vw, 110px); }
[data-theme="dark"] .site-footer { border-top: 1px solid var(--border); }
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(32px, 6vw, 80px);
  padding-top: clamp(48px, 7vw, 80px); padding-bottom: clamp(36px, 5vw, 56px); }
[data-theme="dark"] .site-footer .brand-name,
.site-footer .brand-name { color: #f5f5f7; }
.site-footer .brand-mark { color: #6e6e73; }
.footer-brand p { color: #a1a1a6; font-size: 15px; line-height: 1.6; margin-top: 16px; max-width: 42ch; }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.footer-social a { font-size: 13px; font-weight: 600; color: #f5f5f7;
  padding: 7px 14px; border: 1px solid rgba(255,255,255,0.2); border-radius: 999px; transition: all 0.18s; }
.footer-social a:hover { background: #f5f5f7; color: #0a0a0b; border-color: #f5f5f7; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.footer-cols h4 { font-size: 12.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #6e6e73; margin-bottom: 16px; }
.footer-cols a { display: block; padding: 6px 0; font-size: 14.5px; color: #a1a1a6; transition: color 0.18s; }
.footer-cols a:hover { color: #f5f5f7; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-top: 28px; padding-bottom: 32px; border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 13px; color: #6e6e73; }
.footer-tag { font-family: var(--font-serif); font-style: italic; font-size: 15px; color: #a1a1a6; }

/* ============================ Auth (shared) ============================ */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--bg-soft); }
.auth-card { width: 100%; max-width: 380px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 40px); box-shadow: var(--shadow-md); }
.auth-card-wide { max-width: 460px; }
.auth-brand { display: flex; align-items: baseline; gap: 2px; font-size: 19px;
  font-weight: 700; letter-spacing: -0.03em; margin-bottom: 22px; }
.auth-card h1 { font-size: 26px; letter-spacing: -0.02em; }
.auth-sub { color: var(--text-soft); font-size: 15px; margin-top: 8px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.auth-card label { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px;
  font-weight: 600; color: var(--text-soft); }
.auth-card input { height: 46px; padding: 0 14px; background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 15px; transition: border-color 0.18s; }
.auth-card input:focus { outline: none; border-color: var(--text); }
.auth-error { background: color-mix(in srgb, #e5384a 12%, transparent);
  color: #c01e30; border: 1px solid color-mix(in srgb, #e5384a 30%, transparent);
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
[data-theme="dark"] .auth-error { color: #ff8a96; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.muted { color: var(--text-mute); font-weight: 400; }
.small { font-size: 13px; }

/* ============================ Responsive =============================== */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-subs { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .layout-2col { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; gap: 28px 48px;
    padding-top: 32px; border-top: 1px solid var(--border); }
  .side-block { flex: 1; min-width: 200px; }
}
@media (max-width: 860px) {
  .main-nav, .search-mini { display: none; }
  .menu-toggle { display: flex; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero-subs { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .quote-block { padding: 24px 20px; }
  .share { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
