/* =========================================================================
   THE FIELD MANUALS — site.css
   Type:  IBM Plex Sans (UI/body) · IBM Plex Mono (technical accents)
   Color: cool near-black "ink" surfaces + warm "paper" content
   Accent: per-book hue via --hue (oklch, shared chroma/lightness)
   ========================================================================= */

:root {
  --ink:      oklch(0.17 0.012 264);
  --ink-2:    oklch(0.225 0.015 264);
  --ink-line: oklch(1 0 0 / 0.10);
  --ink-soft: oklch(1 0 0 / 0.62);

  --paper:    oklch(0.984 0.004 95);
  --paper-2:  oklch(0.965 0.006 95);
  --card:     oklch(1 0 0);
  --text:     oklch(0.22 0.012 264);
  --muted:    oklch(0.50 0.012 264);
  --line:     oklch(0.90 0.005 264);
  --line-2:   oklch(0.84 0.006 264);

  --brand-hue: 300;                                   /* PTFM purple */
  --brand:    oklch(0.55 0.17 var(--brand-hue));
  --brand-ink: oklch(0.70 0.16 var(--brand-hue));

  --star: oklch(0.74 0.15 75);

  --maxw: 1200px;
  --gap: clamp(16px, 3vw, 28px);
  --radius: 14px;
  --radius-lg: 22px;

  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.06), 0 2px 8px oklch(0 0 0 / 0.05);
  --shadow-md: 0 8px 28px oklch(0 0 0 / 0.10), 0 2px 6px oklch(0 0 0 / 0.05);
  --shadow-cover: 0 18px 40px oklch(0.17 0.012 264 / 0.30), 0 4px 12px oklch(0 0 0 / 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.05; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: oklch(0.55 0.17 var(--brand-hue) / 0.24); }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 48px); }
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: currentColor; opacity: 0.6;
}
.section { padding-block: clamp(64px, 9vw, 120px); }
.section-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(30px, 4.4vw, 48px); margin-top: 18px; }
.section-head p { color: var(--muted); margin-top: 16px; font-size: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 999px;
  font-weight: 500; font-size: 15px; letter-spacing: -0.01em;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: white; box-shadow: 0 6px 18px oklch(0.55 0.17 var(--brand-hue) / 0.35); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); background: oklch(0 0 0 / 0.03); }
.btn-onink { background: white; color: var(--ink); }
.btn-onink:hover { transform: translateY(-1px); box-shadow: 0 10px 26px oklch(0 0 0 / 0.3); }
.btn-onink-ghost { border: 1px solid var(--ink-line); color: white; }
.btn-onink-ghost:hover { border-color: oklch(1 0 0 / 0.5); background: oklch(1 0 0 / 0.06); }
.btn .arr { transition: transform .18s ease; }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: oklch(0.17 0.012 264 / 0.86);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--ink-line);
  color: white;
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -0.02em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, oklch(0.6 0.18 300), oklch(0.55 0.17 265));
  display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-weight: 600; color: white;
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.15);
}
.brand small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--ink-soft); text-transform: uppercase; font-weight: 400; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a { padding: 8px 14px; border-radius: 8px; font-size: 14.5px; color: var(--ink-soft); transition: color .15s, background .15s; }
.nav-links a:hover { color: white; background: oklch(1 0 0 / 0.06); }
.nav-cta { margin-left: 8px; }
.nav-links a.nav-cta { color: var(--ink); }
.nav-links a.nav-cta:hover { color: var(--ink); background: white; }
.nav-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--ink-line); color: white; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--ink-soft); padding-block: 64px 40px; }
.footer a:hover { color: white; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer h4 { color: white; font-size: 13px; font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; margin-bottom: 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 15px; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--ink-line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; font-family: var(--mono); color: oklch(1 0 0 / 0.45); }

/* ---------- Star rating ---------- */
.stars { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 13px; }
.stars .ico { display: inline-flex; gap: 1px; }
.stars svg { width: 15px; height: 15px; }
.stars .val { font-weight: 600; color: var(--text); }
.stars .cnt { color: var(--muted); }

/* ---------- Cover (real image + CSS spine fallback) ---------- */
.cover { position: relative; aspect-ratio: 5 / 8; border-radius: 6px 9px 9px 6px; overflow: hidden; box-shadow: var(--shadow-cover); background: var(--ink-2); }
.cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: linear-gradient(90deg, oklch(0 0 0 / 0.35), oklch(0 0 0 / 0)); pointer-events: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
/* designed fallback used when no cover / image fails */
.cover-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: 14% 12% 12%;
  background:
    radial-gradient(120% 80% at 50% 0%, oklch(0.30 0.05 var(--hue)) 0%, oklch(0.18 0.03 var(--hue)) 60%, oklch(0.14 0.02 var(--hue)) 100%);
  color: white; font-family: var(--mono);
}
.cover-fallback .fb-top { font-size: clamp(9px, 1.6cqw, 12px); letter-spacing: 0.18em; opacity: 0.7; text-transform: uppercase; }
.cover-fallback .fb-acr { font-size: clamp(26px, 9cqw, 54px); font-weight: 600; letter-spacing: -0.02em; line-height: 0.9; }
.cover-fallback .fb-title { font-size: clamp(11px, 2.4cqw, 15px); line-height: 1.25; opacity: 0.85; }
.cover-fallback .fb-rule { height: 2px; width: 32px; background: oklch(0.7 0.17 var(--hue)); margin: 8px 0; }
.cover-fallback .fb-pub { font-size: 9px; letter-spacing: 0.16em; opacity: 0.5; text-transform: uppercase; }

/* tilt/lift wrapper */
.cover-lift { transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s; }
.cover-lift:hover { transform: translateY(-6px) rotate(-0.6deg); }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
