/* ============================================================
   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:      #f2ece0;   /* warm cream */
  --paper-dim:  #e6dcc9;
  --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; }

/* ---------- section divider (neutral, warm) ---------- */
.spectrum-rule {
  height: 1px; border: 0; margin: 0;
  background: rgba(60,50,40,.14);
}
.spectrum-seam { position: relative; }
.spectrum-seam::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: rgba(60,50,40,.12);
}

/* ---------- 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 var(--accent);
  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); }
.consent-flash { animation: consentFlash 1.6s ease; border-radius: 8px; }
@keyframes consentFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180,68,58,0); }
  15% { box-shadow: 0 0 0 4px rgba(180,68,58,.35); }
  50% { box-shadow: 0 0 0 4px rgba(180,68,58,.22); }
}

/* ---------- hero with author photo ---------- */
.hero-split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-split .hero-photo {
  border-radius: 10px; overflow: hidden; box-shadow: 0 24px 60px -30px rgba(0,0,0,.6);
  aspect-ratio: 3/4; max-width: 19rem; max-height: 27rem; margin-left: auto;
}
.hero-split .hero-photo img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.hero-name { font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.05; margin: 0 0 1.2rem; color: var(--paper); }
.hero-text { max-width: 44ch; color: var(--muted-ink); font-size: 1.12rem; line-height: 1.6; }
.hero-text em { color: var(--paper); font-style: italic; }
@media (max-width: 820px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-split .hero-photo { max-width: 13rem; order: -1; margin: 0 0 1rem; }
}

/* ---------- about with photo ---------- */
.about-split { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: stretch; }
.about-photo { border-radius: 10px; overflow: hidden; aspect-ratio: 3/4; max-width: 22rem; box-shadow: 0 20px 50px -28px rgba(0,0,0,.5); position: sticky; top: 5rem; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 780px) {
  .about-split { grid-template-columns: 1fr; }
  .about-photo { max-width: 12rem; position: static; }
}

/* ---------- real book cover image ---------- */
.bookcover-img { aspect-ratio: 2/3; border-radius: 6px; overflow: hidden; box-shadow: 0 24px 60px -30px rgba(22,21,29,.6); }
.bookcover-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- sample reader ---------- */
.sample-hero { background: var(--ink); color: var(--fg-on-ink); padding: clamp(2.5rem,7vw,4.5rem) 0 clamp(2rem,5vw,3rem); text-align: center; }
.sample-hero h1 { color: var(--paper); font-size: clamp(2rem,5vw,3.2rem); margin: 0 0 .6rem; }
.sample-hero p { color: var(--muted-ink); max-width: 46ch; margin-left: auto; margin-right: auto; }
.sample-hero .sample-lang { margin-left: auto; margin-right: auto; }
.sample-lang { display: inline-flex; gap: .3rem; margin-top: 1.4rem; background: rgba(255,255,255,.08); border-radius: 8px; padding: .3rem; font-family: var(--font-util); }
.sample-lang button { background: transparent; color: var(--muted-ink); border: 0; padding: .45rem .9rem; border-radius: 6px; cursor: pointer; font-size: .9rem; }
.sample-lang button.active { background: var(--paper); color: var(--ink); }
.sample-body-wrap { padding: 0 1.3rem; }
.sample-body { max-width: 40rem; margin: 3rem auto 2rem; font-size: 1.15rem; line-height: 1.75; }
.sample-chapter { margin-bottom: 3.5rem; }
.sample-chapter h2 { font-size: 1.5em; margin: 0 0 1.6rem; }
.sample-chapter p { margin: 0 0 1.1em; }
.sample-break { text-align: center; color: var(--muted); letter-spacing: .35em; margin: 2rem 0; }
.sample-cta { background: var(--paper-dim); border-radius: 10px; padding: 2rem; text-align: center; max-width: 40rem; margin: 1rem auto 4rem; }
.sample-cta h3 { font-size: 1.5rem; margin: 0 0 .6rem; }
.sample-cta p { color: var(--muted); margin: 0 0 1.4rem; }

/* ============================================================
   The shelf — books as spines leaning on a vintage radio
   ============================================================ */
.shelf-section { padding: clamp(3rem,7vw,5rem) 0; }
.shelf-eyebrow { font-family: var(--font-util); font-size:.72rem; letter-spacing:.22em; text-transform:uppercase; color: var(--muted); margin:0 0 .4rem; }
.shelf-title { font-family: var(--font-display); font-size: clamp(1.8rem,4vw,2.6rem); color: var(--fg); margin:0 0 1.8rem; }

/* desktop shelf */
.shelf-stage { position:relative; }
.shelf-books-wrap { display:flex; align-items:flex-end; justify-content:center; gap:20px; }
.shelf-books { display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-end; }
/* cotoare la vedere, stivuite orizontal (teanc pe masă) */
.shelf-flat {
  width:300px; height:56px; border-radius:4px; display:flex; align-items:center;
  padding:0 18px; cursor:pointer; position:relative; margin-top:-3px;
  box-shadow:0 5px 13px rgba(40,25,10,.3), inset 0 2px 3px rgba(255,255,255,.08), inset 0 -4px 8px rgba(0,0,0,.32);
  transition: transform .2s ease, opacity .2s ease;
}
.shelf-flat:first-child { margin-top:0; }
.shelf-flat:hover { transform: translateX(6px); z-index:20; }
.shelf-flat img { display:none; }
.shelf-flat.is-soon { opacity:.9; }
.shelf-flat-ph { font-family:var(--font-display); font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.shelf-flat-soon { margin-left:auto; font-size:10px; font-family:var(--font-utility); letter-spacing:.12em; opacity:.65; }
.shelf-spine {
  width:52px; border-radius:3px 3px 0 0; transform-origin:bottom right;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  box-shadow: inset -7px 0 14px rgba(0,0,0,.35), inset 3px 0 4px rgba(255,255,255,.06);
  transition: transform .25s ease, opacity .25s ease; margin-left:-6px;
}
.shelf-spine span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--font-display); font-size:14px; letter-spacing:.02em;
  padding:12px 0; white-space:nowrap;
}
.shelf-radio { width:230px; height:auto; display:block; align-self:flex-end; margin-left:0; margin-bottom:0; position:relative; z-index:0; filter: drop-shadow(0 8px 14px rgba(60,40,20,.3)); }
.shelf-plank { height:16px; background:linear-gradient(#c9a877,#a37f52); border-radius:2px; box-shadow:0 6px 16px rgba(80,50,20,.28); margin-top:-1px; }
.shelf-plank-edge { height:7px; background:#8a6740; border-radius:0 0 3px 3px; margin:0 8px; }
.shelf-hint { text-align:center; padding:16px 0 0; font-family:var(--font-util); font-size:.8rem; color: var(--muted); }

/* book detail panel */
.shelf-panel { max-height:0; overflow:hidden; transition:max-height .4s ease; }
.shelf-panel-inner { display:flex; gap:26px; padding:30px 0 8px; align-items:flex-start; }
.shelf-cover { flex:0 0 150px; border-radius:6px; overflow:hidden; box-shadow:0 18px 44px -14px rgba(0,0,0,.5); background:var(--ink); align-self:flex-start; }
.shelf-cover img { display:block; width:100%; height:auto; object-fit:contain; image-rendering:auto; }
.shelf-cover:has(.ph) { aspect-ratio:2/3; display:flex; align-items:flex-end; }
.shelf-cover .ph { color:var(--paper); font-family:var(--font-display); font-size:17px; line-height:1.1; padding:16px; }
.shelf-detail { flex:1; min-width:0; }
.shelf-detail .meta { font-family:var(--font-util); font-size:.72rem; letter-spacing:.15em; text-transform:uppercase; color:var(--muted); margin-bottom:8px; }
.shelf-detail h3 { font-family:var(--font-display); font-size:1.7rem; color:var(--fg); margin:0 0 12px; }
.shelf-detail p { font-size:1.05rem; line-height:1.65; color:var(--fg); margin:0; }
.shelf-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:18px; }
.shelf-soon { display:inline-block; margin-top:18px; background:rgba(60,50,40,.1); color:var(--muted); padding:7px 14px; border-radius:20px; font-size:12px; font-family:var(--font-util); letter-spacing:.05em; }

/* mobile stacked books */
.shelf-mobile { display:none; }
.shelf-mobile-top { display:flex; align-items:flex-end; justify-content:center; gap:4px; }
.shelf-stack { display:flex; flex-direction:column; align-items:flex-start; }
.shelf-mobile-radio-img { width:105px; height:auto; align-self:flex-end; display:block; margin-bottom:-6px; position:relative; z-index:1; filter: drop-shadow(0 5px 9px rgba(60,40,20,.3)); }
.stack-book {
  width:min(58vw,220px); height:42px; border-radius:4px; display:flex; align-items:center;
  padding:0 12px; cursor:pointer; position:relative;
  box-shadow:0 4px 10px rgba(40,25,10,.28), inset 0 2px 3px rgba(255,255,255,.08), inset 0 -3px 6px rgba(0,0,0,.3);
  transition: transform .2s ease, opacity .2s ease;
}
.stack-book span.t { font-family:var(--font-display); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.stack-book span.s { margin-left:auto; font-size:9px; font-family:var(--font-util); letter-spacing:.05em; opacity:.6; }

@media (max-width: 760px) {
  .shelf-desktop { display:none; }
  .shelf-mobile { display:block; }
  .shelf-panel-inner { gap:14px; padding:14px 0 8px; }
  .shelf-cover { flex:0 0 96px; }
  .shelf-detail h3 { font-size:1.3rem; }
  .shelf-detail p { font-size:.95rem; }
}
