/* ============================================================
   Tornasol - Landing
   Según DESIGN.md: instrumento de medición analítica.
   Editorial, plano, grilla visible. Clash Display + Switzer.
   ============================================================ */

:root {
  --paper:   #f5f3ec;
  --ink:     #1a1813;
  --litmus:  #5d4a9c;
  --litmus-soft: #b0a2dd;
  --acid:    #c63a2f;
  --base:    #2f55c0;
  --kemeny:  #e6007e;
  --line:    #1a1813;
  --gridline: rgba(26, 24, 19, 0.07);

  --display: "Clash Display", sans-serif;
  --text:    "Switzer", sans-serif;

  --maxw: 1200px;
  --pad: 48px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  font-family: var(--text);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum";
}
a { color: inherit; text-decoration: none; }
em { font-style: italic; }
::selection { background: var(--litmus); color: var(--paper); }

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

/* ---- grilla visible: reglas verticales de fondo ---- */
.hero, .band { position: relative; }
.hero > .wrap, .band > .wrap { position: relative; z-index: 1; }
.hero::before, .band::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left:  max(var(--pad), calc(50% - var(--maxw) / 2 + var(--pad)));
  right: max(var(--pad), calc(50% - var(--maxw) / 2 + var(--pad)));
  background-image: repeating-linear-gradient(to right,
    var(--gridline) 0 1px, transparent 1px, transparent calc(100% / 6));
  z-index: 0;
  pointer-events: none;
}

/* ---- tag de atribución ---- */
.tag__ks { color: var(--kemeny); }

/* ============================================================
   NAV
   ============================================================ */
.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 0;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.masthead.is-scrolled { border-bottom: 1px solid var(--line); }
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.wordmark__mark {
  width: 9px; height: 9px;
  background: var(--litmus);
}
.masthead__nav {
  display: flex;
  gap: 30px;
  margin-left: auto;
  margin-right: 6px;
  font-size: 0.82rem;
  font-weight: 500;
}
.masthead__nav a { padding-bottom: 2px; border-bottom: 1px solid transparent; transition: border-color .2s var(--ease); }
.masthead__nav a:hover { border-color: var(--ink); }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  display: inline-block;
  font-family: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 26px;
  background: var(--litmus);
  color: var(--paper);
  border: 1px solid var(--litmus);
  transition: background .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease);
}
.btn:hover { background: var(--ink); border-color: var(--ink); }
.btn--sm { padding: 9px 16px; font-size: 0.8rem; }
.btn--lg { padding: 17px 34px; font-size: 1.05rem; }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--invert {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.btn--invert:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: 132px 0 96px; }
.hero__wrap { position: relative; }

.specbar {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.specbar span {
  padding: 11px 18px;
  border-right: 1px solid var(--line);
}
.specbar span:first-child { padding-left: 0; }
.specbar span:last-child { border-right: 0; margin-left: auto; padding-right: 0; }

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  margin-top: 52px;
}
.hero__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.ink-em { font-style: italic; font-weight: 500; }
.hero__lead {
  margin-top: 30px;
  font-size: 1.3rem;
  line-height: 1.5;
  max-width: 34ch;
}
.hero__lead + .actions, .hero__head .actions { margin-top: 32px; }

/* ---- Instrumento / figura ---- */
.figure { border-top: 1px solid var(--line); }
.figure__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0 0;
}
.figure__label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
}
.figure__id {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--litmus);
}
.gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 26px 0 20px;
}
.gauge__pole {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.gauge__pole--signal { color: var(--base); }
.gauge__pole--noise  { color: var(--acid); }
.gauge__body { display: flex; align-items: stretch; gap: 9px; }
.gauge__track {
  position: relative;
  width: 52px;
  height: 210px;
  border: 1px solid var(--line);
}
.gauge__fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 12%;
  background: var(--litmus);
  animation: gauge-fill 1.9s var(--ease) .5s forwards;
}
.gauge__needle {
  position: absolute;
  left: -9px; right: -9px;
  bottom: 12%;
  height: 3px;
  margin-bottom: -1.5px;
  background: var(--ink);
  animation: gauge-rise 1.9s var(--ease) .5s forwards;
}
.gauge__ruler {
  width: 16px;
  background: repeating-linear-gradient(to bottom,
    var(--line) 0 1px, transparent 1px, transparent 20.9px);
}
@keyframes gauge-fill { from { height: 12%; } to { height: 82%; } }
@keyframes gauge-rise { from { bottom: 12%; } to { bottom: 82%; } }
.figure__caption {
  font-size: 0.84rem;
  line-height: 1.45;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   BANDAS / SECCIONES
   ============================================================ */
.band { padding: 92px 0; border-top: 1px solid var(--line); }

.bandhead {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 34px;
}
.bandhead__label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.bandhead__ticks {
  flex: 1;
  height: 9px;
  background: repeating-linear-gradient(to right,
    var(--line) 0 1px, transparent 1px, transparent 11px);
  opacity: 0.38;
}
.band__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 18ch;
}
.band__intro {
  font-size: 1.18rem;
  max-width: 52ch;
  margin-top: 22px;
}

/* ---- Ledger: lista editorial numerada ---- */
.ledger { list-style: none; margin-top: 52px; }
.ledger__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}
.ledger__row:last-child { border-bottom: 1px solid var(--line); }
.ledger__text h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.95rem;
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin-bottom: 10px;
}
.ledger__text p { max-width: 54ch; }
.ledger__tagcol {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acid);
  text-align: right;
}
.ledger__tagcol::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--acid);
  margin-right: 7px;
  vertical-align: 1px;
}

/* ============================================================
   02 · DIAGRAMA (cómo funciona)
   ============================================================ */
.diagram {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 56px;
}
.diagram::before {
  content: "";
  position: absolute;
  top: 31px;
  left: 0; right: 0;
  height: 1px;
  background: var(--line);
}
.stage { display: flex; flex-direction: column; }
.stage__node {
  position: relative;
  z-index: 1;
  width: 62px; height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--litmus);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.45rem;
  margin-bottom: 26px;
}
.stage--end .stage__node { background: var(--ink); }
.stage__panel {
  flex: 1;
  border: 1px solid var(--line);
  padding: 24px 22px;
}
.stage__tag {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--litmus);
  margin-bottom: 10px;
}
.stage__panel h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.4rem;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.stage__panel p { font-size: 0.99rem; }

/* ============================================================
   03 · FILOSOFÍA (sección invertida, full-bleed)
   ============================================================ */
.band--invert {
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--ink);
}
.band--invert::before {
  background-image: repeating-linear-gradient(to right,
    rgba(245, 243, 236, 0.07) 0 1px, transparent 1px, transparent calc(100% / 6));
}
.band--invert ::selection { background: var(--litmus-soft); color: var(--ink); }
.bandhead--invert .bandhead__ticks {
  background: repeating-linear-gradient(to right,
    var(--paper) 0 1px, transparent 1px, transparent 11px);
  opacity: 0.3;
}
.manifesto {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.7rem);
  line-height: 1.04;
  letter-spacing: -0.028em;
  max-width: 17ch;
}
.lit-em { color: var(--litmus-soft); font-style: italic; font-weight: 500; }
.manifesto__lead {
  font-size: 1.22rem;
  max-width: 46ch;
  margin-top: 28px;
  color: #d8d4c8;
}
.trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 64px;
  border-top: 1px solid #45413a;
}
.trio__col {
  padding: 28px 26px 4px 0;
  border-right: 1px solid #45413a;
}
.trio__col:last-child { border-right: 0; padding-right: 0; }
.trio__col h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.trio__col p { color: #c9c5ba; font-size: 0.98rem; }

/* ============================================================
   04 · RÚBRICA
   ============================================================ */
.rubric { margin-top: 48px; }
.rubric__row {
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.rubric__row:last-child { border-bottom: 1px solid var(--line); }
.rubric__row--key {
  background: var(--ink);
  color: var(--paper);
  padding: 32px;
  border-color: var(--ink);
}
.rubric__flag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--litmus-soft);
  margin-bottom: 7px;
}
.rubric__text h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.rubric__text p { max-width: 56ch; }
.rubric__row--key .rubric__text p { color: #d8d4c8; }

.flags {
  display: flex;
  gap: 16px;
  margin-top: 26px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  font-size: 1rem;
}
.flags__mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--base);
}

/* ============================================================
   SOBRE EL NOMBRE
   ============================================================ */
.origin { border-top: 1px solid var(--line); }
.origin__wrap {
  padding-top: 60px;
  padding-bottom: 60px;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 32px;
}
.origin__label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--litmus);
  padding-top: 8px;
}
.origin__text {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.7vw, 2rem);
  line-height: 1.34;
  letter-spacing: -0.015em;
  max-width: 26ch;
}
.origin__text strong { font-weight: 600; color: var(--litmus); }
.origin__text em { font-style: italic; }

/* ============================================================
   05 · CTA (full-bleed litmus)
   ============================================================ */
.band--cta {
  background: var(--litmus);
  color: var(--paper);
  border-top: 1px solid var(--litmus);
  padding-bottom: 104px;
}
.band--cta::before {
  background-image: repeating-linear-gradient(to right,
    rgba(255, 255, 255, 0.11) 0 1px, transparent 1px, transparent calc(100% / 6));
}
.band--cta .bandhead__ticks {
  background: repeating-linear-gradient(to right,
    var(--paper) 0 1px, transparent 1px, transparent 11px);
  opacity: 0.4;
}
.cta__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.3rem, 5.4vw, 4.4rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
  max-width: 16ch;
}
.cta__lead {
  font-size: 1.22rem;
  max-width: 46ch;
  margin-bottom: 36px;
  color: #ece9f6;
}
.cta__mail { font-size: 0.92rem; }
.cta__mail a { border-bottom: 1px solid var(--paper); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); }
.footer__inner {
  padding-top: 26px;
  padding-bottom: 40px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}
.wordmark--sm { font-size: 1.15rem; }
.footer__powered, .footer__copy { font-size: 0.82rem; font-weight: 500; }

/* ============================================================
   REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  :root { --pad: 28px; }
  .masthead__nav { display: none; }
  .hero { padding-top: 104px; }
  .hero__grid { grid-template-columns: 1fr; gap: 44px; }
  .figure { max-width: 340px; }
  .specbar { flex-wrap: wrap; }
  .specbar span:last-child { margin-left: 0; }
  .diagram { grid-template-columns: 1fr; gap: 0; }
  .diagram::before { top: 0; bottom: 0; left: 31px; right: auto; width: 1px; height: auto; }
  .stage { flex-direction: row; gap: 22px; padding-bottom: 22px; }
  .stage__node { margin-bottom: 0; flex: none; }
  .trio { grid-template-columns: 1fr; }
  .trio__col {
    border-right: 0;
    border-bottom: 1px solid #45413a;
    padding: 22px 0;
  }
  .trio__col:last-child { border-bottom: 0; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .ledger__row { grid-template-columns: 1fr; gap: 14px; }
  .ledger__tagcol { text-align: left; }
  .stage { flex-direction: column; gap: 18px; }
  .rubric__row--key { padding: 24px; }
  .origin__wrap { grid-template-columns: 1fr; gap: 14px; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .gauge__fill { height: 82%; animation: none; }
  .gauge__needle { bottom: 82%; animation: none; }
}
