/* videobook.club – base styles
   A reading room at night: library-green walls, walnut, gilt, vellum and paper. */

@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/bodoni-moda.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/bodoni-moda-italic.woff2") format("woff2");
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/fonts/literata.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/fonts/literata-italic.woff2") format("woff2");
  font-weight: 300 600;
  font-style: italic;
  font-display: swap;
}

:root {
  /* walls and wood */
  --wall: #16201b;
  --wall-2: #1c2822;
  --wall-3: #24332c;
  --line: rgba(232, 223, 200, 0.13);
  --line-strong: rgba(232, 223, 200, 0.24);
  --walnut-900: #1a100a;
  --walnut-800: #2a1a10;
  --walnut-700: #3b2517;
  --walnut-500: #5c3b25;
  --walnut-300: #87603f;

  /* light, gilt, ink */
  --text: #e9e2cf;
  --text-soft: #c9c3b0;
  --text-muted: #9fa999;
  --gilt: #c9a55e;
  --gilt-bright: #ecd7a1;
  --gilt-deep: #8f6f34;
  --gilt-gradient: linear-gradient(176deg, #f1dfac 0%, #d2b06a 38%, #a9843f 62%, #e2c785 100%);
  --lamp: rgba(255, 200, 128, 0.16);

  /* paper surfaces */
  --paper: #eee5d1;
  --paper-2: #e5dac2;
  --paper-ink: #24201a;
  --paper-muted: #6c6353;
  --paper-line: #d3c6aa;
  --card: #eadcb7;           /* buff library card */
  --vellum: #e3d9c0;
  --vellum-ink: #57452f;

  --oxblood: #7d2229;
  --oxblood-bright: #a8363e;
  --danger: #b8463f;
  --ok: #4f7a5a;

  --font-display: "Bodoni Moda", "Bodoni 72", Didot, "Times New Roman", serif;
  --font-text: "Literata", "Iowan Old Style", Georgia, serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: 1.95rem;
  --step-4: clamp(2.4rem, 1.6rem + 3.4vw, 4.4rem);

  --radius: 3px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --shadow-deep: 0 30px 60px -24px rgba(0, 0, 0, 0.75);
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: dark;
}

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 520px at 50% -180px, rgba(255, 205, 140, 0.075), transparent 70%),
    var(--wall);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { flex: 1; }

img, svg, video { display: block; max-width: 100%; }

a { color: var(--gilt-bright); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: #fff3d0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); font-weight: 500; letter-spacing: -0.015em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p { margin: 0 0 1em; text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--gilt-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: rgba(201, 165, 94, 0.45); color: #fff; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.nums { font-variant-numeric: lining-nums tabular-nums; }

/* ——— header ——— */

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 16, 13, 0.55), rgba(10, 16, 13, 0));
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: #fff; }
.brand__hand {
  width: 40px;
  height: 25px;
  background: var(--gilt-gradient);
  -webkit-mask: url("/img/hand-right.svg") center / contain no-repeat;
  mask: url("/img/hand-right.svg") center / contain no-repeat;
  flex: none;
  transform: translateY(1px);
}
.brand__name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1;
}
.brand__name em {
  font-style: italic;
  font-weight: 400;
  color: var(--gilt);
  font-size: 0.86em;
  margin-left: 1px;
}

.site-nav ul {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  position: relative;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 1rem;
  padding: 6px 0;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--gilt);
}

@media (max-width: 560px) {
  .site-header .wrap { min-height: 64px; gap: 12px; }
  .brand__hand { width: 30px; height: 19px; }
  .brand__name { font-size: 1.3rem; }
  .site-nav ul { gap: 14px; }
  .site-nav a { font-size: 0.95rem; }
  .site-nav .nav-optional { display: none; }
}

/* ——— footer ——— */

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: var(--step--1);
}
.site-footer .wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px 40px;
  padding-block: 34px 44px;
  align-items: start;
}
.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

.footer-note {
  max-width: 34rem;
  margin: 10px 0 0;
  color: var(--text-muted);
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.footer-brand .brand__hand { width: 28px; height: 18px; }

@media (max-width: 720px) {
  .site-footer .wrap { grid-template-columns: 1fr; }
}

/* ——— buttons ——— */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-border: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { --btn-border: rgba(232, 223, 200, 0.45); color: var(--btn-fg); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.btn--gilt {
  --btn-bg: var(--gilt-gradient);
  --btn-fg: #241a0c;
  --btn-border: #b8924b;
  background: var(--gilt-gradient);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 248, 220, .55), 0 6px 16px -8px rgba(0, 0, 0, .8);
}
.btn--gilt:hover { --btn-border: #e9cf8e; filter: brightness(1.05); }

.btn--quiet { --btn-border: transparent; padding-inline: 10px; color: var(--text-soft); }
.btn--quiet:hover { --btn-border: var(--line); color: var(--text); }

/* buttons on paper */
.on-paper .btn { --btn-fg: var(--paper-ink); --btn-border: rgba(36, 32, 26, .28); }
.on-paper .btn:hover { --btn-border: rgba(36, 32, 26, .6); }
.on-paper .btn--primary, .btn--primary {
  --btn-bg: var(--oxblood);
  --btn-fg: #fbf3e4;
  --btn-border: var(--oxblood);
  font-weight: 600;
}
.on-paper .btn--primary:hover, .btn--primary:hover { --btn-bg: var(--oxblood-bright); --btn-border: var(--oxblood-bright); }
.on-paper :focus-visible { outline-color: var(--oxblood); }
.on-paper .btn--quiet { --btn-border: transparent; color: var(--paper-muted); }

/* ——— pill toggles (filters, sorting) ——— */

.filters { display: flex; flex-wrap: wrap; gap: 4px; }
.filter {
  min-height: 38px;
  padding: 6px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: .95rem;
  cursor: pointer;
}
.filter:hover { color: var(--text); }
.filter[aria-pressed="true"] { color: var(--text); border-color: var(--line-strong); background: rgba(232, 223, 200, .06); }


/* ——— paper surfaces ——— */

.paper {
  color-scheme: light;
  position: relative;
  background-color: var(--paper);
  background-image: url("/img/paper-grain.svg"), url("/img/paper-fibres.svg");
  color: var(--paper-ink);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 18px 40px -22px rgba(0, 0, 0, .85);
}
.paper a:not(.btn) { color: var(--oxblood); }
.paper a:not(.btn):hover { color: var(--oxblood-bright); }

/* ——— forms ——— */

.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label, .field legend { font-weight: 500; }
.field .hint { font-size: var(--step--1); color: var(--paper-muted); margin: 0; }
.field .error { font-size: var(--step--1); color: var(--danger); margin: 0; }

input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="number"], input[type="password"], textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(36, 32, 26, .28);
  border-radius: var(--radius);
  background: rgba(255, 252, 244, .72);
  color: var(--paper-ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 1px;
  border-color: transparent;
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }

.check {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
  line-height: 1.45;
}
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--oxblood); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.notice {
  padding: 12px 16px;
  border-left: 3px solid var(--gilt);
  background: rgba(201, 165, 94, .1);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.paper .notice { background: rgba(125, 34, 41, .07); border-left-color: var(--oxblood); }
.notice--error { border-left-color: var(--danger); }

/* ——— page intro ——— */

.page-head { padding-block: clamp(36px, 6vw, 72px) 24px; }
.page-head p.lede { max-width: 38rem; font-size: var(--step-1); color: var(--text-soft); line-height: 1.55; }

.prose { max-width: 40rem; }
.prose h2 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translate(-50%, 20px);
  opacity: 0;
  max-width: min(92vw, 520px);
  padding: 12px 18px;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px -10px rgba(0, 0, 0, .8);
  transition: opacity .2s, transform .2s var(--ease);
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

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