/* =========================================================
   C. A. Ash — author site
   Scandinavian minimalism · light paper base · quiet cold-blue accent
   ========================================================= */

:root {
 --paper:      #14171C;   /* deep ink-blue-black base */
  --paper-2:    #1B1F26;   /* slightly lifted panel */
  --ink:        #ECE8E1;   /* warm off-white text */
  --slate:      #A9B0BA;   /* secondary text */
  --slate-soft: #6E7681;   /* tertiary / fineprint */
  --accent:     #6E93B8;   /* the cover's cold blue, brighter for dark bg */
  --accent-deep:#8FB0CE;
  --hairline:   #2A2F38;   /* quiet dividers */
  --shadow:     0 24px 60px -28px rgba(0,0,0,0.8);

  --serif: "Fraunces", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, sans-serif;

  --wrap: 1080px;
  --pad: clamp(1.25rem, 5vw, 3rem);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--pad);
   background: color-mix(in srgb, #14171C 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.wordmark {
  font-family: var(--serif); font-size: 1.35rem; font-weight: 600;
  letter-spacing: 0.02em; display: flex; align-items: baseline; gap: 0.55rem;
}
.wordmark-sub {
  font-family: var(--sans); font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--slate-soft);
  transform: translateY(-1px);
}

.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav > a {
  font-size: 0.92rem; font-weight: 500; color: var(--slate);
  position: relative; padding: 0.2rem 0;
}
.nav > a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--accent); transition: width 0.28s ease;
}
.nav > a:hover { color: var(--ink); }
.nav > a:hover::after { width: 100%; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-toggle {
  font-family: var(--sans); font-size: 0.92rem; font-weight: 500; color: var(--slate);
  background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0;
}
.dropdown-toggle:hover { color: var(--ink); }
.dropdown-toggle svg { transition: transform 0.25s ease; }
.dropdown.open .dropdown-toggle svg { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 0.7rem);
  background: var(--paper); border: 1px solid var(--hairline);
  border-radius: 2px; box-shadow: var(--shadow); min-width: 148px;
  padding: 0.4rem; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a {
  display: block; padding: 0.55rem 0.7rem; font-size: 0.9rem; color: var(--slate);
  border-radius: 2px;
}
.dropdown-menu a:hover { background: var(--paper-2); color: var(--ink); }

/* Mobile menu toggle */
.menu-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 6px; }
.menu-toggle span { width: 22px; height: 2px; background: var(--ink); transition: 0.3s; }
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav[hidden] { display: none !important; }
.mobile-nav {
  position: fixed; inset: 62px 0 auto 0; z-index: 39;
  background: var(--paper); border-bottom: 1px solid var(--hairline);
  display: flex; flex-direction: column; padding: 1rem var(--pad) 1.6rem;
  box-shadow: var(--shadow);
}
.mobile-nav a { padding: 0.85rem 0; font-size: 1.05rem; border-bottom: 1px solid var(--hairline); }
.mobile-nav-socials { display: flex; gap: 1.4rem; padding-top: 1rem; }
.mobile-nav-socials a { border: none; font-size: 0.9rem; color: var(--accent); padding: 0; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(4rem, 13vh, 9rem) var(--pad) clamp(3rem, 8vh, 5rem);
  text-align: center;
}
.hero-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--slate-soft); margin-bottom: 1.8rem;
}
.hero-tagline {
  font-size: clamp(2.6rem, 8vw, 5.3rem);
  font-weight: 400; margin: 0 0 1.6rem;
  font-optical-sizing: auto;
}
.hero-lead {
  font-size: clamp(1rem, 2.4vw, 1.18rem); color: var(--slate);
  max-width: 34ch; margin: 0 auto 2.6rem;
}
.scroll-cue {
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--slate-soft);
}
.scroll-cue svg { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(4px);} }
.scroll-cue:hover { color: var(--accent); }

/* ---------- Books ---------- */
.books { max-width: var(--wrap); margin: 0 auto; padding: clamp(2rem,6vh,4rem) var(--pad) clamp(3rem,8vh,5rem); }
.book-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); }
.book {
  display: grid; grid-template-columns: minmax(200px, 300px) 1fr;
  gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center;
}
.book-cover-btn {
  position: relative; padding: 0; border: none; background: none; cursor: pointer;
  display: block; border-radius: 3px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
}
.book-cover-btn:hover { transform: translateY(-6px); }
.book-cover { display: block; width: 100%; height: auto; user-select: none; }
.book-cover-hint {
  position: absolute; inset: auto 0 0 0; padding: 0.9rem;
  background: linear-gradient(to top, rgba(12,14,18,0.82), transparent);
  color: #fff; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0; transition: opacity 0.3s ease;
}
.book-cover-btn:hover .book-cover-hint,
.book-cover-btn:focus-visible .book-cover-hint { opacity: 1; }

.book-title { font-size: clamp(2rem, 5vw, 2.9rem); margin: 0 0 0.4rem; }
.book-series {
  font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.3rem;
}
.book-blurb { color: var(--slate); max-width: 46ch; margin-bottom: 1.8rem; }
.book-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans); font-size: 0.9rem; font-weight: 500; cursor: pointer;
  padding: 0.7rem 1.5rem; border-radius: 2px; border: 1px solid transparent;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
  display: inline-block;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Notify ---------- */
.notify { background: var(--paper-2); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.notify-inner { max-width: 620px; margin: 0 auto; padding: clamp(3rem,8vh,5rem) var(--pad); text-align: center; }
.notify h2 { font-size: clamp(1.8rem, 4.5vw, 2.5rem); margin: 0 0 0.9rem; }
.notify p { color: var(--slate); margin-bottom: 1.6rem; }
.notify-form { display: flex; gap: 0.7rem; max-width: 440px; margin: 0 auto; }
.notify-form input {
  flex: 1; font-family: var(--sans); font-size: 0.95rem; padding: 0.7rem 1rem;
  border: 1px solid var(--hairline); border-radius: 2px; background: var(--paper); color: var(--ink);
}
.notify-form input:focus { outline: none; border-color: var(--accent); }
.notify-fineprint { font-size: 0.78rem; color: var(--slate-soft); margin: 1rem 0 0; }

/* ---------- About ---------- */
.about-inner { max-width: 640px; margin: 0 auto; padding: clamp(3.5rem,9vh,6rem) var(--pad); text-align: center; }
.about h2 { font-size: clamp(1.8rem,4.5vw,2.5rem); margin: 0 0 1.6rem; }
.about p { color: var(--slate); font-size: 1.05rem; }
.about p:last-child { color: var(--ink); font-style: italic; font-family: var(--serif); }

/* ---------- Contact ---------- */
.contact { background: var(--paper-2); border-top: 1px solid var(--hairline); }
.contact-inner { max-width: 560px; margin: 0 auto; padding: clamp(3.5rem,9vh,6rem) var(--pad); }
.contact h2 { font-size: clamp(1.8rem,4.5vw,2.5rem); margin: 0 0 0.6rem; text-align: center; }
.contact > .contact-inner > p { color: var(--slate); text-align: center; margin-bottom: 2.2rem; }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-size: 0.82rem; font-weight: 500; margin-bottom: 0.4rem; color: var(--slate); }
.field input, .field textarea {
  width: 100%; font-family: var(--sans); font-size: 0.95rem; padding: 0.7rem 0.9rem;
  border: 1px solid var(--hairline); border-radius: 2px; background: var(--paper); color: var(--ink); resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.contact-form .btn { width: 100%; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: clamp(2.5rem,6vh,4rem) var(--pad); border-top: 1px solid var(--hairline); }
.footer-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin-bottom: 1.1rem; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.6rem; margin-bottom: 1.4rem; }
.footer-links a { font-size: 0.88rem; color: var(--slate); }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 0.78rem; color: var(--slate-soft); margin: 0; }

/* ---------- Excerpt modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: var(--pad); }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(18,20,24,0.55); backdrop-filter: blur(3px); animation: fade 0.25s ease; }
.modal-panel {
  position: relative; background: var(--paper); max-width: 640px; width: 100%;
  max-height: 86vh; border-radius: 4px; box-shadow: 0 30px 70px -30px rgba(0,0,0,0.6);
  animation: rise 0.3s cubic-bezier(.2,.7,.2,1);
}
@keyframes fade { from{opacity:0;} }
@keyframes rise { from{opacity:0; transform: translateY(14px);} }
.modal-close {
  position: absolute; top: 0.6rem; right: 0.9rem; z-index: 2;
  background: none; border: none; font-size: 1.8rem; line-height: 1; color: var(--slate);
  cursor: pointer; width: 40px; height: 40px; border-radius: 50%;
}
.modal-close:hover { color: var(--ink); background: var(--paper-2); }
.modal-scroll { overflow-y: auto; max-height: 86vh; padding: clamp(2rem,5vw,3.2rem); }
.modal-eyebrow { font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--slate-soft); margin: 0 0 0.3rem; }
.modal-title { font-size: clamp(1.8rem,5vw,2.6rem); margin: 0 0 1.8rem; }
.excerpt-body { font-family: var(--serif); font-size: 1.06rem; line-height: 1.8; color: #2b2f34; }
.excerpt-body p { margin: 0 0 1.15rem; }
.excerpt-body p:first-child::first-letter { /* optional drop-cap flourish, subtle */ }
.excerpt-foot { margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid var(--hairline); text-align: center; }
.excerpt-foot p { font-family: var(--serif); font-style: italic; color: var(--slate); margin-bottom: 1rem; }

/* Discourage casual copying of the excerpt (not real DRM, just friction) */
.excerpt-body { user-select: none; -webkit-user-select: none; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .book { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .book-cover-btn { max-width: 260px; }
  .book-blurb { margin-left: auto; margin-right: auto; }
  .book-actions { justify-content: center; }
  .notify-form { flex-direction: column; }
}
.hero {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(110,147,184,0.10), transparent 70%);
}
