/* ==========================================================================
   Vera Miralba — Piedrasagrada
   Paleta: verde bosque oscuro / gris piedra / dorado apagado
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Work+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg: #101d17;
  --bg-alt: #16261e;
  --bg-card: #1b2c23;
  --stone-900: #0c1611;
  --stone-700: #4a534c;
  --stone-500: #8b968b;
  --stone-300: #c7ccc3;
  --ink: #ece7dc;
  --ink-dim: #b9beb2;
  --gold: #b5945f;
  --gold-bright: #d3b381;
  --gold-dim: rgba(181, 148, 95, 0.35);
  --line: rgba(181, 148, 95, 0.22);

  --font-display: 'Fraunces', serif;
  --font-body: 'Work Sans', sans-serif;

  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  letter-spacing: 0.005em;
}

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--gold);
  font-weight: 600;
}

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

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: linear-gradient(to bottom, rgba(12, 22, 17, 0.85), transparent);
  backdrop-filter: blur(2px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  height: 34px;
  width: auto;
}

.brand span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 32px;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.88rem;
  color: var(--stone-300);
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.site-nav a:hover { color: var(--gold-bright); }

.nav-toggle {
  display: none;
}

@media (max-width: 720px) {
  .site-nav { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -2;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
}

.hero-scrim {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(9, 15, 12, 0.55) 0%, rgba(9, 15, 12, 0.15) 30%, rgba(10, 18, 14, 0.55) 68%, var(--bg) 100%),
    linear-gradient(90deg, rgba(8, 14, 11, 0.92) 0%, rgba(8, 14, 11, 0.35) 48%, rgba(8, 14, 11, 0.15) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 28px 9vh;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.hero-content .eyebrow {
  display: inline-block;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  line-height: 1.14;
  font-weight: 500;
}

.hero h1 em {
  font-style: italic;
  color: var(--gold-bright);
}

.hero-sub {
  margin-top: 22px;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--stone-300);
  max-width: 46ch;
  font-weight: 300;
}

.hero-actions {
  margin-top: 38px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  background: var(--gold);
  color: var(--stone-900);
  border: 1px solid var(--gold);
  border-radius: 2px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  box-shadow: 0 6px 24px -8px rgba(211, 179, 129, 0.5);
}

.btn:active { transform: translateY(1px); }

.link-quiet {
  font-size: 0.88rem;
  color: var(--stone-300);
  text-decoration: none;
  border-bottom: 1px solid var(--stone-700);
  padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.link-quiet:hover {
  color: var(--gold-bright);
  border-color: var(--gold-bright);
}

/* ---------- Crack divider (signature element) ---------- */

.crack-divider {
  position: relative;
  width: 100%;
  height: 46px;
  margin-top: -1px;
}

.crack-divider svg {
  width: 100%;
  height: 100%;
  display: block;
}

.crack-divider path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.1;
  opacity: 0.55;
}

.crack-divider .crack-glow {
  stroke-width: 2.5;
  opacity: 0.18;
  filter: blur(2px);
}

/* ---------- Sections generic ---------- */

section {
  position: relative;
}

.section-pad {
  padding: 108px 0;
}

@media (max-width: 720px) {
  .section-pad { padding: 76px 0; }
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  margin-top: 14px;
  font-weight: 500;
}

/* ---------- Piedrasagrada teaser ---------- */

.teaser {
  background: var(--bg-alt);
}

.teaser-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 64px;
  align-items: start;
}

@media (max-width: 860px) {
  .teaser-grid { grid-template-columns: 1fr; gap: 40px; }
}

.teaser-text p {
  font-size: 1.06rem;
  color: var(--stone-300);
  font-weight: 300;
  max-width: 60ch;
}

.teaser-text p + p { margin-top: 20px; }

.book-plaque {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--bg-card), var(--stone-900));
  padding: 30px 28px;
  position: relative;
}

.book-plaque::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.6;
}

.book-plaque .eyebrow { margin-bottom: 10px; display: block; }

.book-plaque h3 {
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
}

.book-plaque p {
  margin-top: 12px;
  color: var(--stone-500);
  font-size: 0.92rem;
}

.creatures-list {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.creatures-list span {
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  color: var(--stone-300);
  border: 1px solid var(--stone-700);
  padding: 6px 12px;
  border-radius: 999px;
}

/* ---------- Sobre Vera ---------- */

.about {
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 72px;
  align-items: center;
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

.about-portrait {
  position: relative;
}

.about-portrait .frame {
  border: 1px solid var(--line);
  padding: 18px;
  background: var(--bg-card);
}

.about-portrait img {
  width: 100%;
  filter: saturate(0.92);
}

.about-text .eyebrow { margin-bottom: 14px; display: block; }

.about-text h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-style: italic;
  font-weight: 500;
  margin-bottom: 22px;
}

.about-text p {
  color: var(--stone-300);
  font-weight: 300;
  font-size: 1.02rem;
  max-width: 62ch;
}

.about-text p + p { margin-top: 18px; }

.about-text .lede {
  color: var(--ink);
  font-size: 1.08rem;
}

/* ---------- Contacto ---------- */

.contact {
  background: var(--bg-alt);
}

.contact-card {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  border: 1px solid var(--line);
  background: radial-gradient(120% 140% at 50% -10%, rgba(181, 148, 95, 0.08), transparent 60%), var(--bg-card);
  padding: 56px 44px;
}

@media (max-width: 560px) {
  .contact-card { padding: 40px 24px; }
}

.contact-card .eyebrow { display: block; margin-bottom: 16px; }

.contact-card h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-style: italic;
}

.contact-card p.contact-sub {
  margin-top: 16px;
  color: var(--stone-300);
  font-weight: 300;
}

.contact-form {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.contact-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-form label {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--stone-500);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--stone-900);
  border: 1px solid var(--stone-700);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  border-radius: 2px;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--stone-500); }

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--gold);
}

.contact-form .btn {
  align-self: flex-start;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .contact-form .btn { align-self: stretch; }
}

.contact-privacy {
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--stone-500);
  max-width: 42ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--stone-900);
  padding: 40px 0;
  text-align: center;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--stone-700);
  margin: 4px 0;
}

.footer-social {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 18px;
}

.footer-social a {
  font-size: 0.78rem;
  color: var(--stone-500);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-social a:hover {
  color: var(--gold-bright);
  border-color: var(--gold-bright);
}

/* ---------- Relato gratis (home teaser) ---------- */

.story-teaser {
  background: var(--bg);
}

.story-teaser-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 72px;
  align-items: center;
}

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

.story-cover {
  position: relative;
}

.story-cover .frame {
  border: 1px solid var(--line);
  padding: 14px;
  background: var(--bg-card);
}

.story-cover img {
  width: 100%;
}

.story-teaser-text .eyebrow { margin-bottom: 14px; display: block; }

.story-teaser-text h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-style: italic;
  font-weight: 500;
  margin-bottom: 16px;
}

.story-teaser-text p {
  color: var(--stone-300);
  font-weight: 300;
  font-size: 1.02rem;
  max-width: 52ch;
}

.story-teaser-actions {
  margin-top: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* Prose column shared by the home prologue excerpt and the full story page */

.story-prose {
  max-width: 640px;
  margin: 56px auto 0;
}

.story-prose p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--stone-300);
  font-weight: 300;
}

.story-prose p + p {
  margin-top: 20px;
}

.story-prose p.opening::first-letter {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 3.4em;
  line-height: 0.78;
  float: left;
  padding: 0.04em 0.08em 0 0;
  color: var(--gold-bright);
  font-weight: 500;
}

/* ---------- Full story page ---------- */

.story-hero {
  padding: 168px 0 80px;
}

.story-hero-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  align-items: center;
}

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

.story-hero-cover .frame {
  border: 1px solid var(--line);
  padding: 14px;
  background: var(--bg-card);
}

.story-hero-cover img {
  width: 100%;
}

.story-hero-text .kicker {
  display: block;
  margin-bottom: 18px;
}

.story-hero-text h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.18;
}

.story-hero-text .byline {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--stone-500);
  letter-spacing: 0.02em;
}

.story-hero-text .dek {
  margin-top: 22px;
  font-size: 1.04rem;
  color: var(--stone-300);
  font-weight: 300;
  max-width: 48ch;
}

.story-hero-actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--stone-500);
  text-decoration: none;
}

.back-link:hover { color: var(--gold-bright); }

/* Chapter marks */

.chapter-mark {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 64px 0 36px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.chapter-mark::before,
.chapter-mark::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.chapter-mark span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.chapter-mark--label span {
  font-family: var(--font-body);
  font-style: normal;
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--gold);
}

.story-section:first-of-type .chapter-mark {
  margin-top: 0;
}

/* CTA band after the full story */

.story-cta-band {
  background: var(--bg-alt);
}

.story-cta-band .wrap {
  text-align: center;
  max-width: 620px;
}

.story-cta-band h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-style: italic;
}

.story-cta-band p {
  margin-top: 16px;
  color: var(--stone-300);
  font-weight: 300;
}

.story-cta-band .story-hero-actions {
  justify-content: center;
  margin-top: 30px;
}

.story-cta-band .creatures-list {
  justify-content: center;
  margin-top: 34px;
}

/* Amazon link — hidden until a real link is configured in script.js */

.amazon-link { display: none; }
.amazon-link.is-active { display: inline-flex; }

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
