/* =============================================================
   Javier García Rodríguez — Editorial executive site
   Pure CSS, no framework. Variable fonts: Fraunces + Inter.
   ============================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Palette */
  --bg:           #0A0908;
  --bg-elev:     #111110;
  --ink:          #EDE9E2;
  --ink-soft:     #B6B0A6;
  --ink-mute:     #6E6A63;
  --rule:         rgba(237, 233, 226, 0.10);
  --rule-strong:  rgba(237, 233, 226, 0.22);
  --accent:       #C9A86A;
  --accent-soft:  rgba(201, 168, 106, 0.18);

  /* Type */
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Fraunces", "Times New Roman", Georgia, serif;

  /* Rhythm */
  --container: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
  --section-y: clamp(96px, 12vw, 180px);

  /* Type scale */
  --fs-eyebrow: 12px;
  --fs-body: 17px;
  --fs-lede: clamp(19px, 1.4vw, 22px);
  --fs-h2: clamp(34px, 5.2vw, 72px);
  --fs-h1: clamp(44px, 7.4vw, 112px);

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* Subtle film grain across the whole site */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 9999;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: 10px 14px; z-index: 1000; border-radius: 4px;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
  transition: transform .4s var(--ease), background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary {
  background: var(--ink);
  color: var(--bg);
}
.btn--primary:hover { background: var(--accent); color: #1a1408; }
.btn--ghost {
  border: 1px solid var(--rule-strong);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--ink); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 22px 0;
  transition: padding .35s var(--ease), background .35s var(--ease), backdrop-filter .35s var(--ease), border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding: 14px 0;
  background: rgba(10, 9, 8, .72);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom-color: var(--rule);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}

.nav__mark { display: inline-flex; align-items: center; gap: 14px; font-size: 14px; }
.mark__glyph {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  letter-spacing: .02em;
  font-size: 19px;
  font-variation-settings: "opsz" 24, "SOFT" 50;
}
.mark__divider {
  width: 1px; height: 16px; background: var(--rule-strong);
}
.mark__suffix {
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: .01em;
}

.nav__links {
  display: flex; align-items: center; gap: 28px;
  font-size: 14px;
  color: var(--ink-soft);
}
.nav__links a { position: relative; transition: color .25s var(--ease); }
.nav__links a:hover { color: var(--ink); }
.nav__links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); }

.nav__cta {
  border: 1px solid var(--rule-strong);
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--ink) !important;
}
.nav__cta::after { display: none; }
.nav__cta:hover { background: var(--ink); color: var(--bg) !important; border-color: var(--ink); }

.nav__toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  position: relative;
}
.nav__toggle span {
  position: absolute; left: 10px; right: 10px; height: 1px;
  background: var(--ink);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav__toggle span:nth-child(1) { top: 16px; }
.nav__toggle span:nth-child(2) { top: 23px; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(140px, 18vh, 200px);
  padding-bottom: clamp(60px, 8vw, 100px);
  position: relative;
  border-bottom: 1px solid var(--rule);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 350;
  font-size: var(--fs-h1);
  line-height: .98;
  letter-spacing: -0.025em;
  margin: 24px 0 28px;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.hero__title em {
  font-style: italic;
  font-weight: 350;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 100;
}
.hero__title em:last-of-type { color: var(--accent); }

.hero__lede {
  max-width: 52ch;
  font-size: var(--fs-lede);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 36px;
}

.hero__actions {
  display: flex; flex-wrap: wrap; gap: 12px;
}

.hero__media {
  position: relative;
  margin: 0;
}
.hero__frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
}
.hero__frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.02);
  transform: scale(1.02);
  transition: transform 8s linear;
}
.hero:hover .hero__frame img { transform: scale(1.06); }
.hero__grain {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(10,9,8,.6) 100%);
  pointer-events: none;
}
.hero__caption {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.caption__index { font-family: var(--serif); font-style: italic; letter-spacing: 0; font-size: 16px; text-transform: none; color: var(--ink-soft); }

/* Ticker */
.hero__ticker {
  margin-top: clamp(80px, 12vw, 140px);
  overflow: hidden;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
  white-space: nowrap;
}
.ticker__track {
  display: inline-flex;
  gap: 28px;
  animation: ticker 60s linear infinite;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 350;
  font-size: clamp(22px, 3.4vw, 40px);
  color: var(--ink-mute);
  font-variation-settings: "opsz" 144;
}
.ticker__track span:nth-child(odd) { color: var(--ink); }
.ticker__track span:nth-child(even) { color: var(--accent); }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Sections (shared) ---------- */
.section {
  padding-block: var(--section-y);
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.section__grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: clamp(40px, 8vw, 120px);
  align-items: start;
}

.section__head { position: sticky; top: 100px; }
.section__head--wide { position: static; margin-bottom: clamp(48px, 6vw, 80px); max-width: 720px; }
.section__head--center { position: static; text-align: center; margin: 0 auto clamp(48px, 6vw, 72px); max-width: 720px; }
.section__head--center .eyebrow { justify-content: center; }

.section__index {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  color: var(--ink-mute);
  margin-bottom: 14px;
}

.section__title {
  font-family: var(--serif);
  font-weight: 340;
  font-size: var(--fs-h2);
  line-height: 1.02;
  letter-spacing: -0.022em;
  margin: 18px 0 0;
  font-variation-settings: "opsz" 144;
}
.section__sub {
  margin-top: 18px;
  color: var(--ink-soft);
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.6;
}

.section__body { max-width: 64ch; }
.section__body p { margin: 0 0 22px; color: var(--ink-soft); }
.section__body p:last-child { margin-bottom: 0; }
.section__body .lede {
  font-size: var(--fs-lede);
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 28px;
}

/* Facts */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.facts li { display: flex; flex-direction: column; gap: 6px; }
.facts span {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.facts em {
  font-style: normal;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ---------- Capacidades ---------- */
.cap__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.cap {
  background: var(--bg);
  padding: clamp(28px, 3vw, 44px);
  display: flex; flex-direction: column;
  gap: 14px;
  min-height: 280px;
  position: relative;
  transition: background .4s var(--ease);
}
.cap:hover { background: var(--bg-elev); }
.cap__num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: .04em;
}
.cap h3 {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(22px, 1.8vw, 28px);
  line-height: 1.12;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 48;
}
.cap p {
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0;
}

/* ---------- Timeline ---------- */
.timeline {
  display: flex; flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.t-item {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: clamp(20px, 4vw, 60px);
  padding: 36px 0;
  border-bottom: 1px solid var(--rule);
  transition: background .4s var(--ease);
}
.t-item:hover { background: linear-gradient(90deg, transparent, rgba(237,233,226,0.015) 50%, transparent); }
.t-year {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 350;
  font-size: 18px;
  color: var(--accent);
  padding-top: 4px;
}
.t-body h3 {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.15;
  margin: 0 0 6px;
  letter-spacing: -0.012em;
  font-variation-settings: "opsz" 48;
}
.t-org {
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 14px;
}
.t-body p:not(.t-org) {
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0;
}

/* ---------- Tags (especialización) ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 880px;
  margin: 0 auto;
}
.tags li {
  padding: 12px 22px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-soft);
  transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
  cursor: default;
}
.tags li:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ---------- Visión ---------- */
.essay p {
  font-size: var(--fs-lede);
  line-height: 1.55;
  color: var(--ink-soft);
}
.essay p:first-child { color: var(--ink); }
.essay blockquote {
  margin: 36px 0;
  padding: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 350;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.015em;
  border-left: 1px solid var(--accent);
  padding-left: 28px;
  font-variation-settings: "opsz" 144;
}

/* ---------- Contacto ---------- */
.section--contacto { border-bottom: 1px solid var(--rule); }
.contacto__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(40px, 8vw, 120px);
  align-items: center;
}
.contacto__channels {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--rule);
}
.channel {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
  transition: padding .4s var(--ease), color .3s var(--ease);
}
.channel:hover { padding-left: 12px; }
.channel__label {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.channel__value {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 350;
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variation-settings: "opsz" 48;
}
.channel__arrow {
  font-size: 22px;
  color: var(--ink-mute);
  transition: color .3s var(--ease), transform .3s var(--ease);
}
.channel:hover .channel__arrow { color: var(--accent); transform: translateX(4px); }

/* ---------- Footer ---------- */
.footer {
  padding: 36px 0 44px;
  border-top: 1px solid var(--rule);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer__mark { display: inline-flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-soft); }
.footer__rule { width: 1px; height: 14px; background: var(--rule-strong); }
.footer__meta {
  margin: 0;
  display: inline-flex; gap: 10px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ---------- Reveal animations ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* =============================================================
   Responsive
   ============================================================= */

@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
  .hero__media { order: -1; max-width: 460px; }
  .section__grid { grid-template-columns: 1fr; gap: 40px; }
  .section__head { position: static; }
  .cap__grid { grid-template-columns: repeat(2, 1fr); }
  .contacto__grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  :root { --fs-body: 16px; }
  .mark__suffix, .mark__divider { display: none; }
  .nav__links { display: none; position: fixed; inset: 0; top: 0; padding: 100px 32px 32px; background: var(--bg); flex-direction: column; align-items: flex-start; gap: 24px; font-size: 22px; }
  .nav__links a { font-family: var(--serif); font-style: italic; font-weight: 350; color: var(--ink); }
  .nav__links a::after { display: none; }
  .nav__links .nav__cta { font-family: var(--sans); font-style: normal; font-size: 14px; }
  .nav.is-open .nav__links { display: flex; }
  .nav__toggle { display: block; }

  .hero { padding-top: 120px; }
  .hero__title { font-size: clamp(38px, 11vw, 64px); }
  .hero__media { max-width: 100%; }

  .cap__grid { grid-template-columns: 1fr; }
  .cap { min-height: auto; }

  .t-item { grid-template-columns: 1fr; gap: 8px; padding: 28px 0; }

  .facts { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  .channel { grid-template-columns: 1fr auto; row-gap: 4px; }
  .channel__label { grid-column: 1; }
  .channel__arrow { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .hero__title em:last-of-type { display: inline; }
  .facts { grid-template-columns: 1fr 1fr; }
}
