/* ============================================================
   Rigoberto Vito — Memoria de Seboruco
   Estética: archivo / documental · verdes de montaña sobre papel
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root{
  /* paper & ink */
  --paper:      oklch(0.966 0.010 95);
  --paper-2:    oklch(0.942 0.013 92);
  --paper-3:    oklch(0.915 0.016 90);
  --ink:        oklch(0.255 0.014 152);
  --ink-soft:   oklch(0.430 0.014 152);
  --ink-faint:  oklch(0.560 0.012 150);
  /* mountain greens */
  --forest:     oklch(0.405 0.058 156);
  --forest-deep:oklch(0.300 0.050 157);
  --moss:       oklch(0.560 0.052 150);
  --moss-pale:  oklch(0.880 0.030 145);
  /* lines */
  --line:       oklch(0.860 0.014 120);
  --line-soft:  oklch(0.905 0.012 110);

  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --mono:  'JetBrains Mono', ui-monospace, 'Courier New', monospace;

  --maxw: 1120px;
  --pad: clamp(20px, 5vw, 64px);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--paper);
  font-size: 18px;
  line-height: 1.68;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* faint paper grain */
  background-image:
    radial-gradient(oklch(0.30 0.04 150 / 0.022) 1px, transparent 1.2px);
  background-size: 4px 4px;
}

::selection{ background: var(--moss-pale); color: var(--forest-deep); }

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

/* ---------- shared layout ---------- */
.wrap{ max-width: var(--maxw); margin-inline:auto; padding-inline: var(--pad); }
.section{ padding-block: clamp(64px, 9vw, 130px); position: relative; }
.section + .section{ border-top: 1px solid var(--line); }

/* eyebrow / archival label */
.eyebrow{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--moss);
  font-weight: 500;
  display:flex; align-items:center; gap:14px;
  margin: 0 0 26px;
}
.eyebrow .num{ color: var(--forest); }
.eyebrow::after{
  content:""; flex:1; height:1px; background: var(--line);
  max-width: 120px;
}

h1,h2,h3{ font-weight: 500; line-height: 1.08; letter-spacing: -0.01em; margin:0; }
.section-title{
  font-size: clamp(30px, 4.6vw, 52px);
  font-weight: 500;
  color: var(--ink);
  max-width: 18ch;
  margin-bottom: 0.7em;
  text-wrap: balance;
}
.lede{
  font-size: clamp(19px, 2.1vw, 23px);
  color: var(--ink-soft);
  max-width: 60ch;
  line-height: 1.6;
}
p{ text-wrap: pretty; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.topbar{
  position: sticky; top:0; z-index: 50;
  background: oklch(0.966 0.010 95 / 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap{
  display:flex; align-items:center; justify-content:space-between;
  height: 64px;
}
.brand{
  display:flex; align-items:baseline; gap:12px;
  text-decoration:none;
}
.brand .mark{
  font-family: var(--mono); font-size: 11px; letter-spacing:0.2em;
  color: var(--moss); text-transform: uppercase;
}
.brand .nm{ font-size: 19px; font-weight:600; color: var(--ink); letter-spacing: -0.01em; }
.nav{ display:flex; gap: clamp(18px, 3vw, 40px); align-items:center; }
.nav a{
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em;
  text-decoration:none; color: var(--ink-soft);
  padding: 6px 0; position:relative; transition: color .2s;
}
.nav a:hover{ color: var(--forest); }
.nav a::after{
  content:""; position:absolute; left:0; bottom:0; height:1px; width:0;
  background: var(--forest); transition: width .25s ease;
}
.nav a:hover::after{ width:100%; }
.nav-toggle{ display:none; }

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

/* ============================================================
   HERO
   ============================================================ */
.hero{ padding-top: clamp(48px, 7vw, 96px); padding-bottom: clamp(48px, 7vw, 90px); }
.hero-grid{
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-kicker{
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--moss); margin-bottom: 28px;
  display:flex; gap:12px; align-items:center; flex-wrap:wrap;
}
.hero-kicker .dot{ width:5px; height:5px; border-radius:50%; background: var(--forest); display:inline-block; }
.hero h1{
  font-size: clamp(46px, 8.5vw, 104px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.hero h1 .last{ display:block; color: var(--forest); font-style: italic; font-weight: 400; }
.hero-role{
  font-family: var(--mono);
  font-size: clamp(13px, 1.5vw, 15px);
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  max-width: 42ch;
  line-height: 1.7;
}
.hero-quote{
  margin-top: 30px;
  font-style: italic;
  font-size: clamp(19px, 2.3vw, 25px);
  color: var(--forest-deep);
  line-height: 1.4;
  max-width: 24ch;
}

/* framed archival photo */
.portrait{
  position: relative;
  background: var(--paper-2);
  padding: 14px 14px 0;
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--paper), 0 18px 40px -28px oklch(0.30 0.05 150 / 0.5);
  transform: rotate(-1.2deg);
}
.portrait img{
  width:100%; aspect-ratio: 1/1; object-fit: cover;
  filter: grayscale(0.18) sepia(0.06) contrast(1.02);
}
.portrait .cap{
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--ink-faint); text-align:center;
  padding: 12px 6px 14px; line-height:1.5;
}
.portrait .cap b{ color: var(--ink-soft); font-weight:600; }

/* ============================================================
   SOBRE ÉL
   ============================================================ */
.bio-grid{
  display:grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(36px, 6vw, 84px);
  align-items:start;
}
.bio-facts{ position: sticky; top: 96px; }
.fact{
  padding: 16px 0; border-top: 1px solid var(--line);
  display:grid; grid-template-columns: auto 1fr; gap: 4px;
}
.fact:last-child{ border-bottom: 1px solid var(--line); }
.fact .k{
  font-family: var(--mono); font-size: 11px; letter-spacing:0.14em;
  text-transform: uppercase; color: var(--moss); grid-column:1/-1;
  margin-bottom: 4px;
}
.fact .v{ font-size: 18px; color: var(--ink); grid-column:1/-1; line-height:1.4; }
.bio-body > p{ margin: 0 0 1.2em; color: var(--ink-soft); }
.bio-body > p strong{ color: var(--ink); font-weight:600; }

/* manuscript — his own words */
.manuscript{
  margin-top: clamp(40px, 6vw, 72px);
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: clamp(28px, 5vw, 60px);
  position: relative;
}
.manuscript::before{
  content:"En sus palabras";
  position:absolute; top:0; left: clamp(28px, 5vw, 60px);
  transform: translateY(-50%);
  background: var(--paper);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--moss);
  padding: 4px 14px; border: 1px solid var(--line);
}
.manuscript .ms-body{
  columns: 2; column-gap: clamp(28px, 4vw, 52px);
  font-size: 16.5px; line-height: 1.78; color: var(--ink);
  text-align: justify; hyphens: auto;
}
.manuscript .ms-body p{ margin: 0 0 1.15em; break-inside: avoid-column; }
.manuscript .ms-body > p:first-child::first-letter{
  font-size: 3.6em; line-height: 0.78; float:left;
  font-weight: 600; color: var(--forest);
  padding: 6px 12px 0 0; font-family: var(--serif);
}
.manuscript .attrib{
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--ink-faint); margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--line); text-align: right;
}
.manuscript .attrib b{ color: var(--forest); font-weight:600; }
@media (max-width: 760px){ .manuscript .ms-body{ columns: 1; text-align:left; } }

/* ============================================================
   SEBORUCO
   ============================================================ */
.seb-intro{
  display:grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 5vw, 72px);
  align-items:end; margin-bottom: clamp(40px, 6vw, 72px);
}
.seb-intro p{ color: var(--ink-soft); margin: 0; }

/* timeline */
.timeline{
  border-top: 1px solid var(--line);
  margin-top: clamp(36px, 5vw, 60px);
}
.tl-row{
  display:grid; grid-template-columns: 130px 1fr; gap: clamp(20px, 4vw, 56px);
  padding: 26px 0; border-bottom: 1px solid var(--line);
  align-items:baseline;
  transition: background .25s;
}
.tl-row:hover{ background: var(--paper-2); }
.tl-year{
  font-family: var(--mono); font-size: clamp(22px, 3vw, 30px);
  color: var(--forest); font-weight: 500; letter-spacing: -0.01em;
}
.tl-name{ font-size: clamp(19px, 2.2vw, 24px); font-weight:500; color: var(--ink); margin-bottom: 4px; }
.tl-desc{ color: var(--ink-soft); font-size: 16.5px; max-width: 60ch; }

/* gallery */
.gallery{
  margin-top: clamp(44px, 6vw, 72px);
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.gallery image-slot{
  width:100%; height: 240px; border: 1px solid var(--line);
  background: var(--paper-2);
}
.gallery figure{ margin:0; }
.gallery figcaption{
  font-family: var(--mono); font-size: 11px; letter-spacing:0.04em;
  color: var(--ink-faint); margin-top: 10px;
}
@media (max-width: 760px){ .gallery{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px){ .gallery{ grid-template-columns: 1fr; } }

/* gallery carousel */
.gallery-carousel{
  margin-top: clamp(44px, 6vw, 72px);
  position: relative;
}
.gc-track{
  display:flex; gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gc-track::-webkit-scrollbar{ display:none; }
.gc-item{
  margin:0;
  flex: 0 0 calc((100% - 32px) / 3);
  scroll-snap-align: start;
}
.gc-item img,
.gc-item image-slot{
  display:block; width:100%; height: 300px;
  object-fit: cover; object-position: 50% 60%;
  border: 1px solid var(--line); background: var(--paper-2);
}
.gc-item figcaption{
  font-family: var(--mono); font-size: 11.5px; letter-spacing:0.03em;
  color: var(--ink-faint); margin-top: 12px; line-height:1.5;
}
.gc-controls{ display:flex; gap: 10px; justify-content:flex-end; margin-top: 18px; }
.gc-btn{
  width: 46px; height: 46px; border: 1px solid var(--line);
  background: var(--paper-2); color: var(--forest);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.gc-btn:hover{ background: var(--forest); border-color: var(--forest); color: var(--paper); }
.gc-btn svg{ width: 20px; height: 20px; }
.gc-btn:disabled{ opacity: 0.35; cursor: not-allowed; }
.gc-btn:disabled:hover{ background: var(--paper-2); border-color: var(--line); color: var(--forest); }
@media (max-width: 900px){ .gc-item{ flex-basis: calc((100% - 16px) / 2); } }
@media (max-width: 560px){ .gc-item{ flex-basis: 100%; } .gc-item img, .gc-item image-slot{ height: 260px; } }

/* map */
.seb-map{ margin-top: clamp(44px, 6vw, 72px); }
.map-head{ margin-bottom: 22px; }
.map-label{
  font-family: var(--mono); font-size: 11px; letter-spacing:0.18em;
  text-transform: uppercase; color: var(--moss); display:block; margin-bottom: 12px;
}
.map-title{ font-size: clamp(22px, 2.8vw, 30px); font-weight:500; color: var(--ink); margin-bottom: 8px; }
.map-note{ color: var(--ink-soft); font-size: 16.5px; max-width: 62ch; margin:0; }
.map-note strong{ color: var(--ink); font-weight:600; }
.map-stats{
  display:grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  margin: 22px 0;
}
.map-stats .stat{
  background: var(--paper-2); padding: 18px 20px;
  display:flex; flex-direction:column; gap: 4px;
}
.map-stats .sv{
  font-family: var(--mono); font-size: clamp(18px, 2.4vw, 24px);
  color: var(--forest); font-weight:600; letter-spacing:-0.01em;
}
.map-stats .sk{
  font-family: var(--mono); font-size: 11px; letter-spacing:0.08em;
  text-transform: uppercase; color: var(--ink-faint); line-height:1.4;
}
@media (max-width: 680px){ .map-stats{ grid-template-columns: 1fr 1fr; } }
.map-frame{
  border: 1px solid var(--line);
  padding: 10px; background: var(--paper-2);
  box-shadow: 0 18px 40px -30px oklch(0.30 0.05 150 / 0.5);
}
.map-frame iframe{ display:block; width:100%; filter: grayscale(0.12) sepia(0.05); }
.map-cta{ margin-top: 18px; }
.map-cta svg{ width:16px; height:16px; }

/* ============================================================
   LIBROS
   ============================================================ */
.books{
  display:grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 32px);
  margin-top: clamp(36px, 5vw, 56px);
}
.book{
  display:grid; grid-template-columns: 160px 1fr; gap: clamp(20px, 3vw, 30px);
  background: var(--paper-2); border: 1px solid var(--line);
  padding: clamp(20px, 3vw, 30px);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.book:hover{
  border-color: var(--moss);
  box-shadow: 0 16px 40px -30px oklch(0.30 0.05 150 / 0.6);
}
.book .cover{
  width: 160px; height: 224px;
  background:
    repeating-linear-gradient(135deg, var(--paper-3) 0 7px, var(--paper-2) 7px 14px);
  border: 1px solid var(--line);
  display:flex; align-items:center; justify-content:center; text-align:center;
  position: relative; overflow: hidden;
}
/* Portada generada en CSS para libro 2 */
.cover-libro2{
  background: linear-gradient(160deg, #b8e8f2 0%, #72cadf 55%, #4eb0cc 100%) !important;
  flex-direction: column;
  padding: 0 !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 0 !important;
}
.cover-libro2 .cv-title{
  font-family: Georgia, serif;
  font-size: 11.5px; font-weight: bold; color: #fff;
  text-align: center; padding: 9px 6px 5px;
  line-height: 1.25;
  text-shadow: 1px 1px 0 #173344, -1px -1px 0 #173344,
               1px -1px 0 #173344, -1px 1px 0 #173344;
  letter-spacing: 0.01em; flex-shrink:0;
}
.cover-libro2 .cv-photo{
  border: 3px solid #1b3a5c;
  margin: 0 8px;
  flex: 1;
  width: calc(100% - 16px);
  background: url('assets/iglesia-montana.png') center 18% / cover no-repeat;
  min-height: 0;
}
.cover-libro2 .cv-author{
  font-family: Georgia, serif;
  font-size: 8.5px; font-style: italic; font-weight: bold;
  color: #1b3a5c; padding: 5px 4px 4px;
  text-align: center;
  border-top: 1.5px solid #1b3a5c;
  width: 100%; background: rgba(221,211,174,0.85);
  flex-shrink:0; line-height:1.4;
}
.book .cover image-slot{ width:100%; height:100%; }
.book .cover .ph{
  font-family: var(--mono); font-size: 10.5px; letter-spacing:0.1em;
  text-transform: uppercase; color: var(--ink-faint); padding: 12px;
  line-height:1.6;
}
.book .meta{ display:flex; flex-direction:column; }
.book .tag{
  font-family: var(--mono); font-size: 11px; letter-spacing:0.14em;
  text-transform: uppercase; color: var(--moss); margin-bottom: 10px;
}
.book h3{ font-size: clamp(22px, 2.6vw, 28px); font-weight:500; margin-bottom: 8px; line-height:1.15; }
.book .yr{ font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); margin-bottom: 14px; }
.book p{ color: var(--ink-soft); font-size: 16px; margin: 0 0 auto; line-height:1.6; }
.book .dl{ margin-top: 20px; display:flex; gap: 12px; align-items:center; flex-wrap:wrap; }

.btn{
  display:inline-flex; align-items:center; gap:9px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em;
  text-decoration:none; cursor:pointer;
  padding: 11px 20px; border: 1px solid var(--forest);
  color: var(--paper); background: var(--forest);
  transition: background .2s, color .2s, transform .15s;
}
.btn:hover{ background: var(--forest-deep); border-color: var(--forest-deep); transform: translateY(-1px); }
.btn svg{ width:15px; height:15px; }
.btn.ghost{ background: transparent; color: var(--forest); }
.btn.ghost:hover{ background: var(--forest); color: var(--paper); }
.btn.muted{
  border-color: var(--line); color: var(--ink-faint); background: transparent;
  cursor: not-allowed; pointer-events:none;
}
.book .note{
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: 0.02em;
}
@media (max-width: 880px){ .books{ grid-template-columns: 1fr; } }
@media (max-width: 420px){ .book{ grid-template-columns: 1fr; } .book .cover{ width:140px; height:196px; } }

/* ============================================================
   CONTACTO
   ============================================================ */
.contact-grid{
  display:grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(36px, 6vw, 84px);
  align-items:start;
}
.contact-lines{ margin-top: 8px; }
.cline{
  padding: 18px 0; border-top: 1px solid var(--line);
  display:flex; justify-content:space-between; gap: 16px; align-items:baseline;
}
.cline:last-child{ border-bottom: 1px solid var(--line); }
.cline .k{
  font-family: var(--mono); font-size: 11px; letter-spacing:0.14em;
  text-transform:uppercase; color: var(--moss);
}
.cline .v{ font-size: 17px; color: var(--ink); }
.cline .v.todo{ color: var(--ink-faint); font-style: italic; }

form.cform{ display:grid; gap: 16px; }
.field{ display:grid; gap: 7px; }
.field label{
  font-family: var(--mono); font-size: 11px; letter-spacing:0.12em;
  text-transform: uppercase; color: var(--ink-soft);
}
.field input, .field textarea{
  font-family: var(--serif); font-size: 17px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line);
  padding: 12px 14px; width:100%; resize: vertical;
  transition: border-color .2s, background .2s;
}
.field input:focus, .field textarea:focus{
  outline: none; border-color: var(--forest); background: var(--paper-2);
}
.cform .actions{ display:flex; gap: 14px; align-items:center; margin-top: 4px; }
.form-note{
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
}
@media (max-width: 760px){
  .bio-grid, .seb-intro, .contact-grid, .hero-grid{ grid-template-columns: 1fr; }
  .bio-facts{ position: static; }
  .portrait{ max-width: 380px; margin-inline:auto; transform: rotate(-1deg); }
  .tl-row{ grid-template-columns: 90px 1fr; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer{
  border-top: 1px solid var(--line);
  background: var(--forest-deep);
  color: oklch(0.92 0.02 120);
}
.footer .wrap{
  padding-block: clamp(44px, 6vw, 72px);
  display:flex; justify-content:space-between; gap: 24px; flex-wrap:wrap;
  align-items:flex-end;
}
.footer .f-name{ font-size: clamp(24px, 3.5vw, 38px); font-weight:500; color: oklch(0.97 0.012 110); letter-spacing:-0.01em; }
.footer .f-name i{ font-weight:400; color: var(--moss-pale); }
.footer .f-meta{ font-family: var(--mono); font-size: 12px; letter-spacing:0.06em; color: oklch(0.80 0.03 130); line-height:1.8; }
.footer a{ color: var(--moss-pale); text-decoration: none; }
.footer a:hover{ text-decoration: underline; }

/* admin / placeholder banner */
.todo-banner{
  background: oklch(0.92 0.05 95);
  border: 1px solid oklch(0.80 0.07 90);
  color: oklch(0.40 0.06 70);
  font-family: var(--mono); font-size: 12px; letter-spacing:0.02em;
  padding: 10px 16px; border-radius: 2px;
  display:flex; gap:10px; align-items:center; line-height:1.5;
}
.todo-banner b{ color: oklch(0.34 0.08 60); }

/* reveal on scroll */
.reveal{ opacity:0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in{ opacity:1; transform: none; }
@media (prefers-reduced-motion: reduce){ .reveal{ opacity:1; transform:none; } }
