:root {
  --brand-blue: #1A5BFF;
  --brand-blue-deep: #0A38B8;
  --brand-blue-soft: #DCE8FF;

  --ink: #15151A;
  --ink-soft: #2A2A35;

  --paper: #FBF7EE;       /* warm cream */
  --paper-2: #FFFFFF;
  --paper-3: #F3EDDF;     /* deeper cream for sections */

  --muted: #6E6A60;
  --rule: #E9E0CC;        /* warm rule */

  --accent: #FFC83D;      /* sunny yellow */
  --accent-2: #FF7A59;    /* coral, used sparingly */

  --shadow-sm: 0 1px 2px rgba(20, 20, 25, 0.06);
  --shadow-md: 0 8px 24px -10px rgba(20, 20, 25, 0.18), 0 2px 6px -2px rgba(20,20,25,0.08);
  --shadow-lg: 0 30px 60px -25px rgba(20, 20, 25, 0.35), 0 12px 24px -12px rgba(20, 20, 25, 0.18);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --container: 1120px;
  --gutter: 24px;
  --nav-h: 76px;
  --radius: 18px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  position: relative;
}

/* Site-wide paper grain. SVG turbulence noise applied as a fixed overlay
   with multiply blend so it darkens both the cream and the cobalt hero. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.08  0 0 0 0 0.10  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.35;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-blue); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--brand-blue-deep); text-decoration: underline; text-underline-offset: 3px; }
button { font-family: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(36px, 8.5vw, 96px); letter-spacing: -0.025em; font-variation-settings: "opsz" 144, "SOFT" 100; }
h1 em { font-style: italic; color: var(--accent); font-variation-settings: "opsz" 144, "SOFT" 100; }
h2 { font-size: clamp(30px, 4.2vw, 48px); }
h2 em { font-style: italic; color: var(--brand-blue); }
h3 { font-size: clamp(20px, 2.4vw, 26px); }
p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* jekyll-email-munge — the plugin doesn't ship CSS, but its README requires
   these two rules to keep the spam decoy invisible and the SVG fallback
   inline-aligned. Without them, the visible link reads
   "Emailno-reply@spam.invalid us" instead of "Email us". */
.liame-decoy { display: none; }
.liame-svg   { vertical-align: middle; pointer-events: none; }

/* ==================== Nav ==================== */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 247, 238, 0.92);
  border-bottom: 1px solid var(--rule);
  height: var(--nav-h);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h);
  gap: 16px;
}
.brand-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
}
.brand-logo em { font-style: italic; color: var(--brand-blue); }
.brand-logo:hover { text-decoration: none; color: var(--brand-blue); }

.nav-toggle { display: none; }
.nav-links {
  display: flex; gap: 22px; align-items: center;
  font-size: 15px;
}
.nav-links a:not(.nav-cta):not(.lang-link) { color: var(--ink-soft); }
.nav-links a:not(.nav-cta):not(.lang-link):hover { color: var(--brand-blue); text-decoration: none; }

.nav-cta {
  background: var(--ink);
  color: var(--paper) !important;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 500;
  transition: transform 0.15s, background 0.15s;
}
.nav-cta:hover { background: var(--brand-blue); text-decoration: none; transform: translateY(-1px); }

.lang-switch {
  display: inline-flex; align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--paper-3);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.lang-link { color: var(--muted) !important; padding: 2px 6px; border-radius: 999px; }
.lang-link.is-active { color: var(--ink) !important; background: var(--paper-2); box-shadow: var(--shadow-sm); }
.lang-link:hover { text-decoration: none; color: var(--ink) !important; }
.lang-sep { color: var(--rule); }

@media (max-width: 880px) {
  .nav-toggle {
    display: flex; flex-direction: column;
    justify-content: center; gap: 5px;
    width: 44px; height: 44px;
    background: transparent; border: 0; cursor: pointer; padding: 0;
  }
  .nav-toggle-bar {
    display: block; width: 24px; height: 2px;
    background: var(--ink); border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-links {
    position: fixed;
    top: var(--nav-h); right: 0; bottom: 0; left: 0;
    background: var(--paper);
    flex-direction: column; gap: 0; padding: 28px 24px;
    transform: translateX(100%); transition: transform 0.3s ease;
    overflow-y: auto; z-index: 90;
  }
  .nav-links.is-open { transform: translateX(0); }
  .nav-links a:not(.nav-cta):not(.lang-link) {
    display: block; padding: 18px 0;
    font-size: 19px; border-bottom: 1px solid var(--rule);
  }
  .nav-links .nav-cta {
    display: inline-block;
    margin-top: 24px; padding: 14px 22px; border-radius: 999px;
  }
  .lang-switch {
    align-self: flex-start;
    margin-top: 18px;
    padding: 6px 12px;
    font-size: 14px;
  }
}

/* ==================== Hero ==================== */
.hero {
  background:
    radial-gradient(1100px 600px at -10% -20%, #4D7DFF 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, #0A38B8 0%, transparent 60%),
    var(--brand-blue);
  color: var(--paper);
  padding: 96px 0 130px;
  position: relative;
  overflow: hidden;
}

/* Torn-paper edge between hero and the cream sections beneath. Echoes the
   torn-paper motif on the book cover. */
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 38' preserveAspectRatio='none'><path d='M0,22 L40,8 L80,24 L130,6 L170,22 L220,9 L265,26 L310,11 L360,24 L410,5 L460,22 L510,10 L560,26 L615,8 L660,22 L710,12 L760,28 L810,9 L865,24 L920,6 L965,22 L1015,10 L1060,26 L1115,8 L1160,22 L1215,11 L1265,28 L1315,9 L1365,24 L1410,12 L1440,22 L1440,38 L0,38 Z' fill='%23FBF7EE'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.85);
  margin-bottom: 22px;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
}
.hero h1 { color: var(--paper); margin: 0 0 14px; }
.hero h1 em { color: var(--accent); }
.hero-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 400;
  color: rgba(255,255,255,0.92);
  margin-bottom: 36px;
  max-width: 520px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-art { position: relative; }
.hero-cover {
  display: block;
  max-width: 360px;
  margin-left: auto;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  transform: rotate(2.5deg);
  transition: transform 0.4s ease;
}
.hero-cover:hover { transform: rotate(0deg) translateY(-4px); }

@media (max-width: 760px) {
  .hero { padding: 64px 0 72px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-cover { max-width: 240px; margin: 0 auto; transform: rotate(2deg); }
  .hero-art { order: -1; }
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary { background: var(--accent); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #FFD66B; box-shadow: var(--shadow-md); color: var(--ink); }

.btn-secondary { background: rgba(255,255,255,0.12); color: var(--paper); border-color: rgba(255,255,255,0.35); }
.btn-secondary:hover { background: rgba(255,255,255,0.18); border-color: var(--paper); color: var(--paper); }

.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }

.btn-light { background: var(--paper-2); color: var(--ink); }
.btn-light:hover { background: var(--accent); color: var(--ink); }

/* ==================== Sections ==================== */
section { padding: 110px 0; }
section + section { border-top: 1px solid var(--rule); }
section h2 { max-width: 760px; }
.section-lede { color: var(--muted); max-width: 720px; font-size: 19px; }

/* ==================== Origin ==================== */
.origin-prose { max-width: 760px; }
.origin-prose p { font-size: 19px; line-height: 1.75; color: var(--ink-soft); }

/* Hand-drawn wavy underline under origin H2, in the yellow accent. */
.origin-prose h2::after {
  content: "";
  display: block;
  width: 140px; height: 14px;
  margin-top: 16px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 14' preserveAspectRatio='none'><path d='M2,9 Q14,2 28,8 T56,8 Q70,3 84,9 T112,8 Q124,3 138,7' stroke='%23FFC83D' stroke-width='4' stroke-linecap='round' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.yt-frame {
  position: relative; padding-bottom: 56.25%; height: 0;
  margin: 36px 0 14px;
  border-radius: var(--radius); overflow: hidden;
  background: var(--ink);
  box-shadow: var(--shadow-md);
}
.yt-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0;
}
.yt-caption { color: var(--muted); font-size: 14px; }

/* ==================== Authors ==================== */
.authors { background: var(--paper-3); }
.authors h2 em { color: var(--brand-blue); }
.authors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.author-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* Slight scrapbook tilt; un-tilts and lifts on hover. */
.authors-grid .author-card:nth-child(1) { transform: rotate(-0.5deg); }
.authors-grid .author-card:nth-child(2) { transform: rotate(0.4deg); }
.authors-grid .author-card:nth-child(3) { transform: rotate(-0.3deg); }
.author-card:hover { transform: rotate(0deg) translateY(-4px); box-shadow: var(--shadow-md); }
.author-photo {
  width: 104px; height: 104px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 18px;
  border: 4px solid var(--paper-3);
  box-shadow: 0 0 0 1px var(--rule);
}
.author-card h3 { margin-bottom: 8px; }
.author-card p { font-size: 15px; color: var(--ink-soft); line-height: 1.65; }
.author-links {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px; font-size: 13px;
}
.author-links a {
  display: inline-block;
  padding: 5px 12px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue-deep);
  border-radius: 999px;
  font-weight: 500;
}
.author-links a:hover { background: var(--brand-blue); color: var(--paper-2); text-decoration: none; }

@media (max-width: 880px) {
  .authors-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ==================== Order ==================== */
.order { background: var(--paper); }
.order h2 em { color: var(--accent-2); }
.order-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 36px;
}
.order-card {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  border-radius: var(--radius);
  padding: 36px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.order-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.order-card.is-primary {
  background:
    radial-gradient(800px 400px at 0% 0%, #4D7DFF 0%, transparent 60%),
    var(--brand-blue);
  color: var(--paper);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}
.order-card.is-primary h3 { color: var(--paper); }
.order-card.is-primary p { color: rgba(255,255,255,0.88); }
.order-card .btn { align-self: flex-start; margin-top: 12px; }
.order-preview {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}
.order-preview a { color: var(--brand-blue-deep); font-weight: 500; }

/* Single primary card (Gumroad). Used in EN order section. */
.order-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  background:
    radial-gradient(800px 400px at 0% 0%, #4D7DFF 0%, transparent 60%),
    var(--brand-blue);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 40px 44px;
  margin-top: 36px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.order-hero:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.order-hero h3 {
  color: var(--paper);
  margin: 0 0 8px;
  font-size: clamp(22px, 2.6vw, 30px);
}
.order-hero p {
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  max-width: 60ch;
}
.order-hero .btn { white-space: nowrap; }

/* De-emphasized Amazon line. Inline link, lower weight, lower color. */
.order-amazon {
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
}
.order-amazon a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 400;
}
.order-amazon a:hover { color: var(--ink); }

@media (max-width: 760px) {
  .order-hero { grid-template-columns: 1fr; gap: 24px; padding: 32px 28px; }
  .order-hero .btn { justify-self: start; }
}

/* ES "coming soon" notify section */
.notify { background: var(--paper); }
.notify h2 em { color: var(--brand-blue); }
.notify-lead {
  color: var(--ink-soft);
  font-size: 19px;
  max-width: 60ch;
  margin: 16px 0 28px;
}
.notify-form {
  display: flex; gap: 8px;
  background: var(--paper-2);
  padding: 8px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--rule);
  max-width: 520px;
}
.notify-form input[type="email"] {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--ink);
  padding: 14px 20px;
  font-size: 16px;
  outline: none;
  min-width: 0;
}
.notify-form input::placeholder { color: var(--muted); }
.notify-form button {
  background: var(--brand-blue);
  color: var(--paper);
  border: 0;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}
.notify-form button:hover { background: var(--brand-blue-deep); transform: translateY(-1px); }
.notify-en {
  margin-top: 28px;
  color: var(--muted);
  font-size: 14px;
}
.notify-en a {
  color: var(--brand-blue-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Hero note (ES "coming soon" callout under CTAs) */
.hero-note {
  margin-top: 22px;
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-style: italic;
}

@media (max-width: 760px) {
  .order-grid { grid-template-columns: 1fr; }
}

/* ==================== Also by John ==================== */
.also {
  background: var(--paper-3);
  position: relative;
}
/* Faint dot grid texture for the "Also by John" section. */
.also::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(21, 21, 26, 0.08) 1px, transparent 1.4px);
  background-size: 22px 22px;
  background-position: 0 0;
  opacity: 0.7;
  mask-image: linear-gradient(180deg, black 0%, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, black 0%, black 70%, transparent 100%);
}
.also .container { position: relative; z-index: 1; }
.also-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  margin-top: 28px;
}
.also-grid h3 {
  font-size: 13px;
  margin-bottom: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-body);
  font-weight: 700;
}
.book-list { list-style: none; margin: 0; padding: 0; }
.book-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.book-list li:last-child { border-bottom: 0; }
.book-list a, .book-list span { color: var(--ink); font-weight: 500; font-size: 17px; }
.book-list a:hover { color: var(--brand-blue); }
.book-list .book-sub { color: var(--muted); font-size: 13px; margin-top: 2px; font-weight: 400; }

@media (max-width: 760px) {
  .also-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ==================== Footer ==================== */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 72px 0 32px;
  margin-top: 0;
}
.site-footer .brand-logo { color: var(--paper); }
.site-footer .brand-logo em { color: var(--brand-blue); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr;
  gap: 56px;
  align-items: start;
}
.footer-tagline { color: rgba(255,255,255,0.6); margin-top: 14px; max-width: 280px; }
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { color: rgba(255,255,255,0.85); }
.footer-links a:hover { color: var(--accent); text-decoration: none; }

.newsletter-title { color: var(--paper); margin-bottom: 6px; font-size: 18px; }
.newsletter-p { color: rgba(255,255,255,0.65); font-size: 14px; margin-bottom: 16px; }
.newsletter-form {
  display: flex; gap: 6px;
  background: var(--paper-2);
  padding: 6px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.newsletter-form input[type="email"] {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--ink);
  padding: 12px 18px;
  font-size: 16px;
  outline: none;
  min-width: 0;
}
.newsletter-form input::placeholder { color: var(--muted); }
.newsletter-form button {
  background: var(--accent);
  color: var(--ink);
  border: 0;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s, transform 0.15s;
}
.newsletter-form button:hover { background: #FFD66B; transform: translateY(-1px); }
.newsletter-form.is-disabled { opacity: 0.55; }
.newsletter-form.is-disabled button { cursor: not-allowed; }

.footer-bottom {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-size: 13px;
}

@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* ==================== Legal pages ==================== */
.legal {
  max-width: 760px;
  padding: 64px 0 96px;
}
.legal h1 { font-size: clamp(34px, 4.4vw, 52px); }
.legal h2 { font-size: 22px; margin-top: 40px; }
.legal h3 { font-size: 18px; margin-top: 26px; }
.legal p, .legal li { font-size: 16px; line-height: 1.75; color: var(--ink-soft); }
.legal ul { padding-left: 22px; }
.legal hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }
.legal .effective { color: var(--muted); font-size: 14px; }

/* ==================== Utility / 404 ==================== */
.utility {
  text-align: center;
  padding: 140px 0;
}
.utility h1 { font-size: clamp(48px, 8vw, 96px); }
.utility p { color: var(--muted); }

/* ==================== Mobile-only fixes ==================== */
@media (max-width: 880px) {
  input, textarea, select { font-size: 16px; }
  section { padding: 72px 0; }

  /* Touch targets — Apple HIG 44px, Google 48px. Use 48 to be safe. */
  .btn, .nav-cta { min-height: 48px; }
  .newsletter-form button { min-height: 44px; padding: 12px 20px; }

  /* Container side padding tighter on phones so 320px viewport fits. */
  .container { padding-left: 20px; padding-right: 20px; }
}
