/* ============================================================
   ScrappMonitor — Landing
   Editorial / Didone · monoespaciada · sans humanista
   ============================================================ */

:root {
  /* paper & ink */
  --cream:      #ede8db;
  --cream-2:    #e6e0d0;
  --line:       #cdc6b4;
  --ink:        #1b1a17;
  --ink-soft:   #4a4842;
  --ink-mute:   #8a857a;

  /* dark surface */
  --dark:       #1b1a17;
  --dark-2:     #232118;
  --dark-line:  #36342c;
  --dark-ink:   #e7e2d4;
  --dark-mute:  #9a9486;

  /* accents */
  --blue:   #3a5bc7;
  --blue-2: #4a6ad6;
  --green:  #2a9d6f;
  --red:    #d6452f;
  --amber:  #e89015;

  --maxw: 1180px;
  --gut:  clamp(20px, 5vw, 64px);
  /* container width grows on large monitors so the layout doesn't feel sparse */

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "Courier New", monospace;

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* wider canvas on large/UHD screens — keeps the hero proportionate */
@media (min-width: 1600px) { :root { --maxw: 1320px; } }
@media (min-width: 1920px) { :root { --maxw: 1460px; } }
@media (min-width: 2560px) { :root { --maxw: 1640px; } }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* subtle paper grain */
  background-image:
    radial-gradient(circle at 1px 1px, rgba(27,26,23,.022) 1px, transparent 0);
  background-size: 4px 4px;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: clamp(64px, 9vw, 130px); position: relative; }

/* ---------- typography helpers ---------- */
.display { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.section--dark .eyebrow { color: var(--dark-mute); }

.section__title {
  font-size: clamp(2rem, 5.4vw, 5.4rem);
  line-height: 1.02;
  margin: 0;
}

.accent { color: var(--blue); font-style: italic; }
.ink--pos { color: var(--green); font-weight: 600; }
.ink--neg { color: var(--red);   font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  --pad: 15px 26px;
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--mono);
  font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase;
  padding: var(--pad);
  border: 1px solid var(--ink);
  border-radius: 2px;
  transition: transform .35s var(--ease), background .3s, color .3s, border-color .3s, box-shadow .35s var(--ease);
  cursor: pointer; white-space: nowrap;
}
.btn span { transition: transform .35s var(--ease); }
.btn:hover span { transform: translateX(4px); }
.btn--solid { background: var(--ink); color: var(--cream); }
.btn--solid:hover { box-shadow: 0 12px 30px -12px rgba(27,26,23,.55); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--cream); transform: translateY(-2px); }
.btn--invert { border-color: var(--dark-ink); }
.btn--invert.btn--solid { background: var(--dark-ink); color: var(--dark); }
.btn--invert.btn--solid:hover { box-shadow: 0 14px 34px -12px rgba(0,0,0,.6); }
.btn--invert.btn--ghost { color: var(--dark-ink); }
.btn--invert.btn--ghost:hover { background: var(--dark-ink); color: var(--dark); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s, backdrop-filter .4s;
}
.nav.is-stuck {
  background: rgba(237,232,219,.78);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.nav__inner {
  max-width: var(--maxw); margin-inline: auto;
  padding: 16px var(--gut);
  display: flex; align-items: center; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand__mark { width: 38px; height: 38px; object-fit: contain; display: block; }
.brand__name { font-family: var(--serif); font-size: 1.32rem; font-weight: 500; letter-spacing: -.01em; }
.brand__name strong { font-weight: 800; }

.nav__links { margin-left: auto; display: flex; gap: 30px; }
.nav__links a {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--ink-soft); position: relative; padding: 4px 0;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--ink); transition: width .35s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }
.nav__cta { margin-left: 4px; padding: 11px 20px; }

.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; margin-left: auto; }
.nav__burger span { width: 24px; height: 2px; background: var(--ink); transition: transform .3s, opacity .3s; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(40px, 6vw, 80px); }
.hero__grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 70px);
  align-items: end; padding-bottom: clamp(40px, 6vw, 72px);
}
/* size the headline to its own column (container query) so it fits at any width */
.hero__lead { container-type: inline-size; }
.hero__title { font-size: clamp(2.2rem, 12cqw, 8.5rem); line-height: .96; margin: 0; }
.hero__title .accent { font-weight: 500; }

.hero__aside { display: flex; flex-direction: column; gap: 26px; }
.hero__sub { font-family: var(--serif); font-style: italic; font-size: 1.06rem; color: var(--ink-soft); margin: 0; max-width: 40ch; line-height: 1.5; }
.hero__sub em { font-style: italic; color: var(--ink); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.stats { display: flex; gap: clamp(26px, 5vw, 54px); margin: 4px 0 0; }
.stat__num { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1; font-weight: 600; margin: 0; }
.stat__num small { font-size: .5em; font-weight: 500; }
.stat__label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); margin: 8px 0 0; }

/* ---------- garden ---------- */
.garden {
  margin: 0; border: 1px solid var(--line); background: rgba(255,255,255,.28);
  border-radius: 4px; overflow: hidden;
}
.garden__caption { display: flex; gap: 0; border-bottom: 1px solid var(--line); }
.tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; padding: 10px 16px; color: var(--ink-soft); }
.tag--ghost { color: var(--ink-mute); border-left: 1px solid var(--line); }
.garden__plot { width: 100%; }
.garden__plot svg { width: 100%; height: auto; display: block; }
.garden__foot {
  display: flex; justify-content: space-between; border-top: 1px solid var(--line);
  padding: 10px 16px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-mute);
}

/* ============================================================
   ANATOMÍA
   ============================================================ */
.anatomy__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(30px, 5vw, 70px); align-items: start; }
.anatomy__intro { font-family: var(--serif); font-style: italic; color: var(--ink-soft); max-width: 34ch; margin: 22px 0 40px; font-size: 1.05rem; line-height: 1.5; }
.anatomy__list { list-style: none; margin: 0; padding: 0; }
.anatomy__item { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 20px 14px 20px 0; border-top: 1px solid var(--line); cursor: pointer; position: relative; transition: padding .3s var(--ease), background .3s var(--ease); }
.anatomy__item:last-child { border-bottom: 1px solid var(--line); }
.anatomy__item::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 2px; background: var(--blue); transform: scaleY(0); transform-origin: top; transition: transform .35s var(--ease); }
.anatomy__item.is-active::before { transform: scaleY(1); }
.anatomy__item.is-active { background: rgba(58,91,199,.05); padding-left: 14px; }
.anatomy__no { font-family: var(--mono); font-size: 12px; color: var(--ink-mute); padding-top: 4px; transition: color .3s; }
.anatomy__item.is-active .anatomy__no { color: var(--blue); }
.anatomy__item h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; margin: 0 0 5px; letter-spacing: -.005em; transition: color .3s; }
.anatomy__item.is-active h3 { color: var(--blue); }
.anatomy__item p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

.anatomy__diagram { position: sticky; top: 96px; }
.specimen { display: grid; place-items: center; padding: 20px 0; min-height: 460px; }
.specimen svg { width: 100%; max-width: 420px; height: auto; }

/* ============================================================
   FUENTES
   ============================================================ */
.sources__head { margin-bottom: clamp(34px, 5vw, 56px); }
.sources__split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; }
.sources__note { color: var(--ink-soft); max-width: 42ch; margin: 0; justify-self: end; }

.sources__grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.source {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 26px 24px 30px; min-height: 168px; display: flex; flex-direction: column;
  position: relative; transition: background .35s var(--ease);
}
.source:hover { background: rgba(255,255,255,.42); }
.source .dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 50%, transparent);
  transition: box-shadow .5s var(--ease), transform .35s var(--ease);
}
.source:hover .dot { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 18%, transparent); transform: scale(1.08); }
.source h3 { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; margin: auto 0 8px; }
.source p { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); margin: 0; }

/* ============================================================
   CAPACIDADES + PANEL (dark)
   ============================================================ */
.section--dark { background: var(--dark); color: var(--dark-ink); }
.section--dark .section__title { color: var(--dark-ink); }

.caps__head { margin-bottom: clamp(30px, 4vw, 48px); }
.caps__split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; }
.caps__note { color: var(--dark-mute); max-width: 40ch; margin: 0; justify-self: end; }

.caps__grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--dark-line); border-left: 1px solid var(--dark-line); }
.cap {
  border-right: 1px solid var(--dark-line); border-bottom: 1px solid var(--dark-line);
  padding: 34px clamp(24px, 3vw, 44px) 40px; position: relative;
  transition: background .4s var(--ease);
}
.cap:hover { background: var(--dark-2); }
.cap__no { position: absolute; top: 34px; right: clamp(24px,3vw,44px); font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--dark-mute); }
.cap__icon { display: inline-grid; place-items: center; color: var(--c); margin-bottom: 18px; transition: transform .4s var(--ease); }
.cap:hover .cap__icon { transform: translateY(-3px) scale(1.06); }
.cap h3 { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; margin: 0 0 12px; }
.cap p { color: var(--dark-mute); margin: 0; max-width: 46ch; font-size: .97rem; }

/* panel / cta */
.panel { text-align: center; border-top: 1px solid var(--dark-line); }
.panel__inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.panel__title { font-size: clamp(2.4rem, 6.5vw, 6rem); line-height: 1; margin: 4px 0; }
.panel__title .accent { color: var(--blue-2); }
.panel__note { color: var(--dark-mute); max-width: 44ch; margin: 0; }
.panel__actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--dark); color: var(--dark-mute); padding-block: 28px; border-top: 1px solid var(--dark-line); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.brand--foot { gap: 9px; }
.brand--foot .brand__mark { width: 30px; height: 30px; filter: grayscale(1) brightness(2.4); opacity: .9; }
.brand--foot .brand__name { color: var(--dark-ink); font-size: 1.1rem; }
.footer__meta { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; margin: 0; }
.footer__by a { color: var(--dark-ink); border-bottom: 1px solid var(--dark-line); }
.footer__by a:hover { border-color: var(--dark-ink); }

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* garden: elaborate sequential grow handled in JS */
.g-head { will-change: transform, opacity; }

/* anatomy spotlight */
.specimen .sp-part { transition: opacity .32s var(--ease), filter .32s var(--ease); }
.specimen .sp-anno { transition: opacity .32s var(--ease); }
.specimen .sp-hit { cursor: pointer; }
.specimen.has-spot .sp-part { opacity: .1; filter: blur(2px); }
.specimen.has-spot .sp-part.is-spot { opacity: 1; filter: none; }
.specimen.has-spot .sp-anno { opacity: .08; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: flex; }
  .nav.is-open .nav__links {
    display: flex; flex-direction: column; gap: 18px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    padding: 24px var(--gut); margin: 0;
  }
  .hero__grid { grid-template-columns: 1fr; align-items: start; gap: 30px; }
  /* single-column: size the headline to the viewport (not the now-full-width column) */
  .hero__title { font-size: clamp(2.3rem, 8.4vw, 5.2rem); }
  .anatomy__grid { grid-template-columns: 1fr; }
  .anatomy__diagram { position: static; order: -1; }
  .specimen { min-height: 0; }
  .specimen svg { max-width: 320px; }
  .sources__split, .caps__split { grid-template-columns: 1fr; gap: 18px; }
  .sources__note, .caps__note { justify-self: start; }
  .sources__grid { grid-template-columns: 1fr 1fr; }
  .caps__grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .sources__grid { grid-template-columns: 1fr; }
  .stats { flex-wrap: wrap; gap: 22px 34px; }
  .hero__actions .btn, .panel__actions .btn { flex: 1 1 auto; justify-content: center; }
  .garden__foot { font-size: 9px; }
}
