:root {
  --void: #070B12;
  --void-deep: #03050A;
  --panel: #0E1720;
  --panel-soft: #121D28;
  --text: #E4EEF2;
  --text-dim: #7C93A1;
  --cyan: #3FD6EA;
  --cyan-deep: #145762;
  --amber: #E7B24C;
  --amber-dim: #8C6A2E;
  --seal: #FF5468;
  --seal-light: #FF7A8A;
  --rule: rgba(120, 214, 232, 0.14);

  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'IBM Plex Serif', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --max-width: 1180px;
  --space-section: clamp(64px, 9vw, 120px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--void);
  background-image:
    repeating-linear-gradient(0deg, rgba(63, 214, 234, 0.035) 0px, rgba(63, 214, 234, 0.035) 1px, transparent 1px, transparent 64px),
    repeating-linear-gradient(90deg, rgba(63, 214, 234, 0.035) 0px, rgba(63, 214, 234, 0.035) 1px, transparent 1px, transparent 64px);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 500;
}

h1 { font-weight: 300; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

a { color: inherit; }

.mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--cyan);
  margin: 0 0 20px;
}

.eyebrow.light { color: var(--amber); }

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Focus (box-shadow ring, cyan glow on the dark theme throughout) */
a:focus-visible, button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--void), 0 0 0 4px var(--cyan);
  border-radius: 2px;
}

/* Header */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.site-header.scrolled {
  background: var(--void);
  border-bottom-color: var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 180px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.wordmark-icon {
  height: 155px;
  width: 155px;
  display: block;
}
.wordmark-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
}
.wordmark-text em { font-style: normal; color: var(--cyan); }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 36px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.main-nav a {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.25s ease, border-color 0.25s ease;
}
.main-nav a:hover { color: var(--cyan); }

.nav-cta {
  border: 1px solid var(--cyan-deep);
  padding: 8px 16px;
  color: var(--text) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
}

/* Mobile menu always renders on a solid panel, regardless of scroll state */
.main-nav.open ul {
  display: flex;
  background: var(--panel);
}
.main-nav.open ul a { color: var(--text); }
.main-nav.open .nav-cta { border-color: var(--cyan-deep); }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 180px;
  background: linear-gradient(160deg, var(--void) 0%, var(--void-deep) 100%);
  color: var(--text);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 8%;
  left: 50%;
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(63, 214, 234, 0.14) 0%, transparent 68%);
  transform: translateX(-50%);
  pointer-events: none;
}

.hero-frame {
  position: absolute;
  inset: 200px 28px 28px 28px;
  border: 1px solid var(--cyan-deep);
  opacity: 0.55;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  animation: frame-draw 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s forwards;
}
@keyframes frame-draw { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .hero-frame { transform: none; animation: none; }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  color: var(--text);
}

.hero-lead {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  gap: 20px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  padding: 14px 28px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.btn-primary {
  background: var(--seal);
  color: var(--void-deep);
  border-color: var(--seal);
}
.btn-primary:hover { background: var(--seal-light); border-color: var(--seal-light); box-shadow: 0 0 20px -4px var(--seal); }

.hero .btn-ghost { border-color: var(--cyan-deep); color: var(--text); }
.hero .btn-ghost:hover { background: rgba(63, 214, 234, 0.1); border-color: var(--cyan); }

/* Clause sections (Visto / Considerando / Resuelve) */
.clause { padding: var(--space-section) 0; }

.clause-inner { max-width: 720px; }

.clause-text {
  font-size: 1.15rem;
  max-width: 62ch;
  color: var(--text);
}

.considerando { background: var(--panel); }
.considerando .container { max-width: var(--max-width); }
.considerando h2 { margin-bottom: 40px; }

.clauses-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.clause-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 28px;
  padding: 36px 24px;
  margin: 0 -24px;
  border-bottom: 1px solid var(--rule);
  align-items: start;
  border-radius: 6px;
  transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-out;
}
.clause-item:hover, .clause-item:focus-within {
  background: var(--panel-soft);
  box-shadow: 0 0 0 1px var(--cyan-deep), 0 8px 24px -16px rgba(63, 214, 234, 0.35);
}

.clause-num {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--amber);
  transition: color 0.15s ease-in-out;
}
.clause-item:hover .clause-num { color: var(--cyan); }

.clause-item h3 { font-size: 1.25rem; margin-bottom: 0.35em; }
.clause-item p { color: var(--text-dim); margin: 0; }

/* Dark band (Antecedentes) — deepest tone on the page, framed to read as a distinct band */
.dark-band {
  background: var(--void-deep);
  color: var(--text);
  padding: var(--space-section) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.band-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: center;
}

.band-photo img {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: block;
}

.band-photo-name {
  margin: 16px 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.band-inner { max-width: 640px; }

blockquote {
  margin: 0 0 28px;
  padding-left: 24px;
  border-left: 2px solid var(--cyan);
}
blockquote p {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 300;
  font-size: 1.4rem;
  color: var(--text);
  margin: 0;
}

.band-text { color: var(--text-dim); font-size: 1.05rem; }

/* Resuelve / contact */
.resolve-inner .article-num {
  font-family: var(--font-mono);
  color: var(--seal);
  font-weight: 700;
  margin-right: 4px;
}
.resolve-inner .btn { margin-top: 12px; }

/* Notifíquese / interactive timeline */
.notify { background: var(--panel); }

.timeline {
  --fill: 4%;
  margin: 48px 0 32px;
}

.timeline-track {
  position: relative;
  height: 2px;
  background: var(--rule);
  margin: 0 0 28px;
}

.timeline-fill {
  position: absolute;
  top: 0; left: 0; height: 100%;
  width: var(--fill);
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  transition: width 0.5s ease-out;
}

.timeline-cursor {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--seal);
  box-shadow: 0 0 6px var(--seal);
  transform: translate(-50%, -50%);
  animation: timeline-travel 7s linear infinite;
}
@keyframes timeline-travel {
  0%   { left: 0%;   opacity: 0; }
  6%   { opacity: 1; }
  94%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .timeline-cursor { animation: none; left: var(--fill); opacity: 1; }
}

.timeline-nodes {
  display: flex;
  gap: 12px;
}

.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--amber);
  background: var(--panel);
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, transform 0.2s ease-out;
}
.timeline-node:hover .node-dot { border-color: var(--cyan); }
.timeline-node.is-active .node-dot {
  background: var(--seal);
  border-color: var(--seal);
  transform: scale(1.2);
}
.timeline-node.is-active .node-label { color: var(--text); font-weight: 700; }

.timeline-node-open {
  margin-left: auto;
  text-align: right;
}
.timeline-node-open .node-dot { border-style: dashed; }

.timeline-panel {
  border-left: 2px solid var(--cyan);
  padding-left: 20px;
  min-height: 76px;
  display: flex;
  align-items: center;
}
.timeline-panel p { margin: 0; font-size: 1.05rem; color: var(--text); }
.timeline-panel strong { font-family: var(--font-display); font-weight: 500; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 1.1rem;
}
.footer-links a {
  text-decoration: none;
  color: var(--seal);
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--cyan); }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav ul {
    display: none;
    position: absolute;
    top: 110px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 32px;
    border-bottom: 1px solid var(--rule);
    gap: 18px;
  }
  .clause-item { grid-template-columns: 40px 1fr; gap: 16px; }
  .hero h1 { font-size: 1.9rem; }

  .header-inner { height: 110px; }
  .wordmark-icon { height: 88px; width: 88px; }
  .hero { padding-top: 110px; }
  .hero-frame { inset: 130px 16px 16px 16px; }

  .band-grid { grid-template-columns: 1fr; gap: 32px; }
  .band-photo { max-width: 220px; margin: 0 auto; }

  .timeline-nodes { flex-wrap: wrap; row-gap: 20px; }
  .timeline-node-open { margin-left: 0; text-align: center; }
}
