/* ============================================================
   AllVlad — author site
   Design thesis: the kaleidoscope. Scattered fragments resolve
   into pattern. Dark indigo "before the turn", warm paper for
   reading, a refracted-spectrum hairline as the single signature.
   ============================================================ */

:root {
  --ink:        #16151d;   /* near-black indigo (hero ground) */
  --ink-soft:   #21202b;
  --paper:      #f6f3ec;   /* warm paper */
  --paper-dim:  #ebe6da;
  --fg:         #23222b;   /* body on paper */
  --fg-on-ink:  #efece3;   /* body on ink */
  --muted:      #6c6660;
  --muted-ink:  #a29c93;
  --line:       rgba(35,34,43,.14);
  --line-ink:   rgba(255,255,255,.12);

  /* refracted spectrum — used only as a gradient hairline / accent */
  --spectrum: linear-gradient(90deg, #7b6cf0 0%, #4f9bd6 34%, #3fb0a8 62%, #e0a44a 100%);
  --accent:   #6f62d8;      /* single solid accent for focus rings, links */
  --accent-2: #3fb0a8;

  --maxw: 68rem;
  --readw: 40rem;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Newsreader", Georgia, serif;
  --font-util:    "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r: 4px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.65;
  font-optical-sizing: auto;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 460; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- spectrum hairline: the signature ---------- */
.spectrum-rule {
  height: 2px; border: 0; margin: 0;
  background: var(--spectrum);
  opacity: .9;
}
.spectrum-seam { position: relative; }
.spectrum-seam::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--spectrum); opacity: .55;
}

/* ---------- eyebrow / utility labels ---------- */
.eyebrow {
  font-family: var(--font-util);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.eyebrow.on-ink { color: var(--muted-ink); }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.2rem; height: 64px; }
.brand {
  font-family: var(--font-display);
  font-size: 1.18rem; font-weight: 500; letter-spacing: -.01em;
  color: var(--fg); display: flex; align-items: center; gap: .55rem;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: conic-gradient(from 210deg, #7b6cf0, #4f9bd6, #3fb0a8, #e0a44a, #7b6cf0);
  box-shadow: inset 0 0 0 3px var(--paper);
}
.nav-links { margin-left: auto; display: flex; gap: 1.5rem; align-items: center; font-family: var(--font-util); font-size: .9rem; }
.nav-links a { color: var(--fg); }
.nav-links a.cta {
  background: var(--ink); color: var(--paper);
  padding: .5rem .95rem; border-radius: var(--r);
}
.nav-links a.cta:hover { text-decoration: none; background: var(--ink-soft); }
.menu-toggle { display: none; }

/* ---------- hero ---------- */
.hero {
  background: var(--ink); color: var(--fg-on-ink);
  padding: clamp(4rem, 11vw, 8rem) 0 clamp(3.5rem, 8vw, 6rem);
  position: relative; overflow: hidden;
}
.hero::after { /* faint refraction glow */
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 60vw; height: 60vw;
  background: radial-gradient(circle at 70% 30%, rgba(123,108,240,.16), transparent 60%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5rem);
  max-width: 16ch; margin: 0 0 1.2rem;
  color: var(--paper);
}
.hero .lede { max-width: 46ch; color: var(--muted-ink); font-size: 1.18rem; }
.hero-actions { margin-top: 2.2rem; display: flex; gap: .9rem; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-util); font-size: .95rem;
  padding: .72rem 1.3rem; border-radius: var(--r);
  border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, background .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--paper); color: var(--ink); }
.btn-primary.on-paper { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; opacity: .85; }
.btn-ghost:hover { opacity: 1; }

/* ---------- generic section ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 1.4rem; max-width: 22ch; }
.lead { font-size: 1.15rem; max-width: 52ch; color: var(--fg); }

/* ---------- featured book ---------- */
.featured {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.bookcover {
  aspect-ratio: 2 / 3; border-radius: 6px; position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 20% 15%, rgba(123,108,240,.5), transparent 55%),
    radial-gradient(120% 90% at 85% 80%, rgba(63,176,168,.5), transparent 55%),
    var(--ink);
  color: var(--paper); display: flex; flex-direction: column; justify-content: space-between;
  padding: 2rem; box-shadow: 0 24px 60px -30px rgba(22,21,29,.6);
}
.bookcover .kaleido {
  position: absolute; inset: 0; opacity: .3; pointer-events: none;
  background:
    conic-gradient(from 0deg at 50% 42%, rgba(255,255,255,.14), transparent 25%, rgba(255,255,255,.1) 50%, transparent 75%, rgba(255,255,255,.14));
  mix-blend-mode: screen;
}
.bookcover .cov-author { font-family: var(--font-util); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; opacity: .85; position: relative; }
.bookcover .cov-title { font-family: var(--font-display); font-size: 2rem; line-height: 1.05; position: relative; }
.bookcover .cov-foot { font-family: var(--font-util); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; opacity: .7; position: relative; }

.featured-body h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 1rem; }
.featured-body .meta { font-family: var(--font-util); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.2rem; }
.featured-body p { max-width: 52ch; }
.featured-actions { margin-top: 1.8rem; display: flex; gap: .8rem; flex-wrap: wrap; }

/* ---------- editions row ---------- */
.editions { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.2rem; margin-top: 1.6rem; }
.edition {
  border: 1px solid var(--line); border-radius: 6px; padding: 1.4rem 1.5rem;
  background: color-mix(in srgb, var(--paper-dim) 40%, transparent);
}
.edition h3 { font-size: 1.25rem; margin-bottom: .3rem; }
.edition .lang { font-family: var(--font-util); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.edition .actions { margin-top: 1rem; display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---------- book grid (store) ---------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 2rem; }
.book-card { display: flex; flex-direction: column; gap: 1rem; }
.book-card .bookcover { aspect-ratio: 2/3; }
.book-card h3 { font-size: 1.3rem; }
.book-card .card-meta { font-family: var(--font-util); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- about ---------- */
.prose { max-width: var(--readw); }
.prose p { margin: 0 0 1.2em; }
.prose p:first-of-type { font-size: 1.2rem; }

/* ---------- forms ---------- */
.form { max-width: 34rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-family: var(--font-util); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
.field input, .field textarea, .field select {
  width: 100%; font-family: var(--font-body); font-size: 1rem;
  padding: .7rem .85rem; border: 1px solid var(--line); border-radius: var(--r);
  background: #fff; color: var(--fg);
}
.field textarea { min-height: 8rem; resize: vertical; }
.form-message { font-family: var(--font-util); font-size: .9rem; margin-top: .6rem; min-height: 1.2em; }
.form-message[data-state="error"] { color: #b4443a; }
.form-message[data-state="ok"] { color: var(--accent-2); }
.hint { font-size: .9rem; color: var(--muted); margin-top: .4rem; }

/* ---------- callout ---------- */
.callout {
  border: 1px solid var(--line); border-left: 3px solid transparent;
  border-image: var(--spectrum) 1; padding: 1.2rem 1.4rem; border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--paper-dim) 35%, transparent);
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink); color: var(--muted-ink);
  padding: 3rem 0 2.4rem; margin-top: 4rem; font-size: .92rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: baseline; }
.site-footer a { color: var(--fg-on-ink); }
.site-footer .foot-brand { font-family: var(--font-display); font-size: 1.15rem; color: var(--paper); }
.site-footer .foot-links { display: flex; gap: 1.5rem; margin-left: auto; font-family: var(--font-util); font-size: .88rem; }
.site-footer .copyright { width: 100%; opacity: .6; font-family: var(--font-util); font-size: .78rem; letter-spacing: .05em; padding-top: 1.4rem; margin-top: .6rem; border-top: 1px solid var(--line-ink); }

/* ---------- responsive ---------- */
@media (max-width: 780px) {
  .featured { grid-template-columns: 1fr; }
  .featured .bookcover { max-width: 18rem; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: .5rem 1.5rem 1.2rem; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .7rem 0; }
  .nav-links a.cta { text-align: center; margin-top: .5rem; }
  .menu-toggle {
    display: inline-flex; margin-left: auto; background: transparent; border: 1px solid var(--line);
    border-radius: var(--r); padding: .5rem .7rem; cursor: pointer; font-family: var(--font-util); font-size: .85rem; color: var(--fg);
  }
}

/* ---------- pricing + checkout consent ---------- */
.price { font-family: var(--font-util); margin: .3rem 0 1rem; }
.price-now { font-size: 1.5rem; color: var(--fg); font-weight: 500; }
.price-was { color: var(--muted); text-decoration: line-through; margin-left: .5rem; font-size: 1rem; }
.consent { display: flex; gap: .7rem; align-items: flex-start; cursor: pointer; font-size: .95rem; }
.consent input { margin-top: .28rem; width: 1.05rem; height: 1.05rem; flex: 0 0 auto; accent-color: var(--accent); }
[data-consent-hint] { margin: .6rem 0 0; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.checkout-status { font-family: var(--font-util); font-size: .9rem; margin-top: 1rem; min-height: 1.2em; }
.checkout-status[data-state="error"] { color: #b4443a; }
.checkout-status[data-state="ok"] { color: var(--accent-2); }
