/* ==========================================================================
   PROMETEO ARCHITECT CENTER — style.css
   ==========================================================================
   Design tokens
   -------------
   Color   — deep black base, elevated graphite, pure white ink, a single
             technological blue, and a sacred gold reserved for Chapter III
             and the closing signature only.
   Type    — Fraunces (display serif, used sparingly for the document's
             "constitutional" voice) + Inter (body/UI) + Space Mono
             (labels, numerals, chapter marks — the system's own metadata).
   Motion  — slow, orchestrated reveals. No scattered micro-animation.
   ========================================================================== */

:root{
  /* ---- color: dark (default) ---- */
  --bg:            #05060a;
  --bg-elevated:   #0a0c12;
  --bg-rules:      #000103;
  --surface:       #12141c;
  --surface-hover: #171a24;

  --line:          rgba(255,255,255,0.07);
  --line-strong:   rgba(255,255,255,0.16);

  --ink:           #f4f5f7;
  --ink-muted:     #9298a8;
  --ink-faint:     #5c6170;

  --blue:          #4b7dff;
  --blue-dim:      #2f5bd6;
  --blue-soft:     rgba(75,125,255,0.14);

  --gold:          #cba667;
  --gold-bright:   #e3c78d;
  --gold-soft:     rgba(203,166,103,0.14);

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'Space Mono', 'SFMono-Regular', Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-slow: 900ms;
  --dur-med:  550ms;
  --dur-fast: 260ms;

  --container: 1120px;
  color-scheme: dark;
}

[data-theme="light"]{
  --bg:            #fbfaf7;
  --bg-elevated:   #f3f2ee;
  --bg-rules:      #0b0c10;
  --surface:       #ffffff;
  --surface-hover: #f0efea;

  --line:          rgba(10,12,20,0.08);
  --line-strong:   rgba(10,12,20,0.18);

  --ink:           #14151a;
  --ink-muted:     #565c6b;
  --ink-faint:     #8a8f9c;

  --blue:          #2f5bd6;
  --blue-dim:      #24469f;
  --blue-soft:     rgba(47,91,214,0.1);

  --gold:          #a3773a;
  --gold-bright:   #8a6127;
  --gold-soft:     rgba(163,119,58,0.12);

  color-scheme: light;
}

/* ---------------------------------------------------------------------- */
/* Reset & base                                                            */
/* ---------------------------------------------------------------------- */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--dur-med) var(--ease-out), color var(--dur-med) var(--ease-out);
  overflow-x: hidden;
}

h1, h2, h3{ margin: 0; font-weight: 500; }
p{ margin: 0; }
a{ color: inherit; text-decoration: none; }
ul, ol{ margin: 0; padding: 0; list-style: none; }
button{ font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

.skip-link{
  position: absolute; left: -999px; top: 0;
  background: var(--blue); color: #fff; padding: 12px 20px; z-index: 999;
  border-radius: 0 0 6px 0;
}
.skip-link:focus{ left: 0; }

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

/* ---------------------------------------------------------------------- */
/* Nav                                                                     */
/* ---------------------------------------------------------------------- */
.site-nav{
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line);
  transition: background var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}
.nav-inner{
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.nav-mark{
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px; letter-spacing: 0.12em;
  color: var(--ink);
}
.nav-mark-glyph{ color: var(--blue); font-size: 16px; }
.nav-chapters{ display: flex; gap: 28px; }
.nav-chapters a{
  display: flex; align-items: baseline; gap: 6px;
  font-size: 12.5px; letter-spacing: 0.04em; color: var(--ink-muted);
  transition: color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.nav-chapters a span{ font-family: var(--font-mono); color: var(--gold); font-size: 11px; }
.nav-chapters a em{ font-style: normal; }
.nav-chapters a:hover{ color: var(--ink); }

.theme-toggle{
  width: 40px; height: 22px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong);
  position: relative; flex-shrink: 0;
}
.theme-toggle-dot{
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink-muted);
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
[data-theme="light"] .theme-toggle-dot{ transform: translateX(18px); background: var(--gold); }

.nav-progress{
  height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  transition: width 80ms linear;
}

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

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */
.hero{
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 120px 24px 80px;
}
.hero-canvas{
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.55;
}
.hero-blueprint{
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.5;
}
.blueprint-lines{ opacity: 0.5; }

.hero-content{
  position: relative; z-index: 2;
  max-width: 760px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
}
.hero-eyebrow{
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  animation: fade-up var(--dur-slow) var(--ease-out) 100ms forwards;
}
.hero-title{
  font-family: var(--font-display);
  font-size: clamp(52px, 10vw, 108px);
  line-height: 0.98;
  font-weight: 400;
  letter-spacing: -0.01em;
  opacity: 0;
  animation: fade-up var(--dur-slow) var(--ease-out) 260ms forwards;
}
.hero-title span{
  display: block;
  font-weight: 300;
  font-style: italic;
  background: linear-gradient(120deg, var(--ink) 40%, var(--blue) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-subtitle{
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--ink-muted);
  max-width: 560px;
  font-weight: 300;
  opacity: 0;
  animation: fade-up var(--dur-slow) var(--ease-out) 440ms forwards;
}
.hero-line{
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(15px, 2vw, 17px);
  color: var(--ink-faint);
  line-height: 1.7;
  opacity: 0;
  animation: fade-up var(--dur-slow) var(--ease-out) 600ms forwards;
}
.hero-actions{
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  margin-top: 12px;
  opacity: 0;
  animation: fade-up var(--dur-slow) var(--ease-out) 760ms forwards;
}

@keyframes fade-up{
  from{ opacity: 0; transform: translateY(18px); }
  to{ opacity: 1; transform: translateY(0); }
}

.btn{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  font-size: 14.5px; font-weight: 500;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn:hover{ transform: translateY(-1px); }
.btn-primary{ background: var(--ink); color: var(--bg); }
[data-theme="light"] .btn-primary{ background: var(--ink); color: var(--bg-elevated); }
.btn-primary:hover{ background: var(--blue); color: #fff; }
.btn-ghost{ border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover{ border-color: var(--blue); color: var(--blue); }
.btn-text{ color: var(--ink-muted); padding-left: 8px; padding-right: 8px; }
.btn-text:hover{ color: var(--gold); }
.btn-text span{ transition: transform var(--dur-fast) var(--ease-out); display: inline-block; }
.btn-text:hover span{ transform: translateX(3px); }

.hero-scroll-cue{
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  width: 1px; height: 46px;
  background: var(--line-strong);
  z-index: 2;
  overflow: hidden;
}
.hero-scroll-cue span{
  position: absolute; top: -46px; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(var(--blue), transparent);
  animation: cue-drop 2.4s var(--ease-out) infinite;
}
@keyframes cue-drop{
  0%{ top: -46px; }
  100%{ top: 46px; }
}

/* ---------------------------------------------------------------------- */
/* Chapter shell                                                           */
/* ---------------------------------------------------------------------- */
.chapter{
  position: relative;
  padding: 160px 24px;
}
.chapter-frame{
  max-width: 760px;
  margin: 0 auto;
}
.chapter-frame--wide{ max-width: 980px; }

.chapter-eyebrow{
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--blue);
  display: block; margin-bottom: 18px;
}
.chapter-eyebrow--light{ color: var(--gold); }
.chapter-title{
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 400;
  margin-bottom: 56px;
  letter-spacing: -0.01em;
}
.chapter-title--light{ color: #f5f0e6; }

/* Scroll reveal */
.reveal{
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.reveal.is-visible{ opacity: 1; transform: translateY(0); }

/* ---------------------------------------------------------------------- */
/* Capítulo I — Bienvenido                                                */
/* ---------------------------------------------------------------------- */
.welcome-grid{ display: flex; flex-direction: column; gap: 26px; }
.welcome-grid p{ font-size: 19px; color: var(--ink-muted); line-height: 1.7; }
.reveal-strong{
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 32px) !important;
  color: var(--ink) !important;
  font-weight: 400;
  line-height: 1.35 !important;
}
.welcome-list{ display: flex; flex-direction: column; gap: 6px; padding-left: 2px; }
.welcome-list li{
  font-size: 17px; color: var(--ink-faint);
  padding-left: 18px; position: relative;
}
.welcome-list li::before{
  content: '—'; position: absolute; left: 0; color: var(--blue);
}
.welcome-pillars{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 8px 0;
}
.welcome-pillars li{
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px 20px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0.03em;
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.welcome-pillars li:hover{ border-color: var(--blue-dim); transform: translateY(-2px); }
.welcome-close{
  font-size: 21px !important;
  color: var(--ink) !important;
  margin-top: 16px;
  line-height: 1.6 !important;
}
.welcome-close strong{ color: var(--blue); font-weight: 500; }

/* ---------------------------------------------------------------------- */
/* Capítulo II — Filosofía                                                */
/* ---------------------------------------------------------------------- */
.chapter-philosophy{ background: var(--bg-elevated); }
.chapter-intro{
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--ink-muted);
  margin-bottom: 48px;
}
.philosophy-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  max-width: 980px;
  margin: 0 auto;
}
.chapter-frame .philosophy-grid{ max-width: none; }
.philosophy-card{
  background: var(--bg-elevated);
  padding: 34px 28px;
  min-height: 180px;
  display: flex; flex-direction: column; gap: 14px;
  transition: background var(--dur-fast) var(--ease-out);
}
.philosophy-card:hover{ background: var(--surface-hover); }
.philosophy-card--wide{ grid-column: span 2; }
.philosophy-mark{
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 13px;
}
.philosophy-card h3{ font-size: 18px; font-weight: 500; }
.philosophy-card p{ font-size: 14.5px; color: var(--ink-muted); line-height: 1.6; }

@media (max-width: 760px){
  .philosophy-grid{ grid-template-columns: 1fr; }
  .philosophy-card--wide{ grid-column: span 1; }
}

/* ---------------------------------------------------------------------- */
/* Capítulo III — Las Reglas Sagradas                                     */
/* ---------------------------------------------------------------------- */
.chapter-rules{
  background: var(--bg-rules);
  color: #f5f0e6;
  padding-top: 180px;
  padding-bottom: 200px;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(203,166,103,0.06), transparent 60%);
}
.chapter-intro--light{ color: rgba(245,240,230,0.55); }

.tablets{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.tablet{
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(203,166,103,0.22);
  border-radius: 2px;
  padding: 30px 20px 26px;
  min-height: 190px;
  display: flex; flex-direction: column; gap: 18px;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.tablet::before{
  content:'';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 34px; height: 2px; background: var(--gold);
  opacity: 0.6;
}
.tablet:hover{
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -20px rgba(203,166,103,0.35);
}
.tablet-numeral{
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--gold);
  font-weight: 400;
}
.tablet-text{
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(245,240,230,0.86);
}

@media (max-width: 980px){
  .tablets{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px){
  .tablets{ grid-template-columns: repeat(2, 1fr); }
}

/* ---------------------------------------------------------------------- */
/* Capítulo IV — El Objetivo                                              */
/* ---------------------------------------------------------------------- */
.chapter-goal{ text-align: center; }
.goal-statement{
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.35;
  color: var(--ink-muted);
  font-weight: 300;
}
.goal-statement strong{ color: var(--ink); font-weight: 500; }
.goal-footnote{
  margin-top: 28px;
  font-size: 15px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------------- */
/* Capítulo V — El Futuro                                                 */
/* ---------------------------------------------------------------------- */
.chapter-future{ background: var(--bg-elevated); }
.timeline{
  position: relative;
  display: flex; flex-direction: column;
  margin-left: 6px;
}
.timeline::before{
  content:'';
  position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(var(--blue), var(--gold));
  opacity: 0.4;
}
.timeline-node{
  position: relative;
  padding: 16px 0 16px 34px;
  font-size: 18px;
  color: var(--ink-muted);
  border-bottom: 1px dashed var(--line);
}
.timeline-node:last-child{ border-bottom: none; }
.timeline-dot{
  position: absolute; left: 0; top: 22px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--blue);
}
.timeline-node--open{
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
  font-size: 22px;
}
.timeline-node--open .timeline-dot{ border-color: var(--gold); }
.timeline-ellipsis{ margin-left: 4px; }

/* ---------------------------------------------------------------------- */
/* Finale                                                                  */
/* ---------------------------------------------------------------------- */
.finale{
  background: var(--bg-rules);
  color: #f5f0e6;
  padding: 220px 24px;
  text-align: center;
}
.finale-inner{ max-width: 820px; margin: 0 auto; }
.finale-quote{
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(26px, 4.6vw, 46px);
  line-height: 1.5;
  color: #f5f0e6;
}
.finale-signature{
  margin-top: 64px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.rule-thin{ width: 60px; height: 1px; background: var(--gold); opacity: 0.6; margin: 14px 0; }
.signature-role{ font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em; color: var(--gold); text-transform: uppercase; }
.signature-office, .signature-system{ font-size: 13.5px; color: rgba(245,240,230,0.55); }
.signature-version{ font-family: var(--font-mono); font-size: 12px; color: rgba(245,240,230,0.4); margin-top: 4px; }

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */
.site-footer{
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 56px 24px 40px;
  text-align: center;
}
.footer-title{ font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.14em; color: var(--ink-muted); }
.footer-tagline{ margin-top: 10px; font-family: var(--font-display); font-style: italic; font-size: 17px; color: var(--ink); }
.footer-note{ margin-top: 10px; font-size: 13px; color: var(--ink-faint); max-width: 460px; margin-left: auto; margin-right: auto; }
.footer-meta{ margin-top: 22px; display: flex; gap: 10px; justify-content: center; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); }

/* ---------------------------------------------------------------------- */
/* Responsive tune-ups                                                    */
/* ---------------------------------------------------------------------- */
@media (max-width: 640px){
  .chapter{ padding: 110px 20px; }
  .finale{ padding: 140px 20px; }
  .nav-inner{ padding: 14px 18px; }
}
