/* ==========================================================================
   AvoMarketData — Almanaque editorial cartográfico
   Tipografía: Fraunces (display) · Geist (sans) · JetBrains Mono (data)
   La paleta entera la inyecta _base.html desde la org del cliente.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --brand-primary: #1B3A1F;
  --brand-accent:  #C18A3A;
  --brand-ink:     #0F1411;
  --brand-paper:   #FAFAF7;
  --brand-soft:    #E8EBE5;

  --paper:    var(--brand-paper);
  --ink:      var(--brand-ink);
  --muted:    color-mix(in srgb, var(--brand-ink) 52%, var(--brand-paper));
  --rule:     color-mix(in srgb, var(--brand-ink) 14%, transparent);
  --rule-soft: color-mix(in srgb, var(--brand-ink) 6%, transparent);
  --hairline: color-mix(in srgb, var(--brand-ink) 22%, transparent);

  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'ss02', 'cv11';
  text-rendering: optimizeLegibility;
  position: relative;
  min-height: 100vh;
}

/* Grain de papel — capa fija casi invisible que da textura imprenta */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.04;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

body > * { position: relative; z-index: 2; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--brand-primary); color: var(--brand-paper); }

/* ==========================================================================
   TOPBAR — wordmark a la izquierda · dateline + nav a la derecha
   ========================================================================== */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 26px 48px 22px;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--brand-paper) 92%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand .logo {
  height: 44px;
  max-width: 200px;
  object-fit: contain;
  display: block;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.brand .logo:hover { transform: scale(1.02); }

.brand .wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.025em;
  color: var(--brand-primary);
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}
.brand .wordmark em {
  font-weight: 300;
  font-style: normal;
  color: var(--brand-accent);
}
h1 em, h2 em { font-style: normal; font-weight: 300; color: var(--brand-primary); }

.topbar nav {
  display: flex;
  gap: 26px;
  align-items: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
}

.topbar nav a {
  color: var(--ink);
  opacity: 0.72;
  position: relative;
  padding-bottom: 3px;
  transition: opacity 0.2s ease;
}
.topbar nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1px;
  background: var(--brand-accent);
  transition: right 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.topbar nav a:hover { opacity: 1; }
.topbar nav a:hover::after { right: 0; }
.topbar nav a.muted { opacity: 0.4; font-size: 12px; }
.topbar nav a.admin-link {
  background: var(--brand-ink);
  color: var(--brand-paper);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 1;
}
.topbar nav a.admin-link::after { display: none; }

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 48px 96px;
}

/* ==========================================================================
   COMPONENTES EDITORIALES — dateline, marginalia, coord, rule
   ========================================================================== */

.dateline {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.dateline::before,
.dateline::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--rule);
}
.dateline.no-rules::before,
.dateline.no-rules::after { display: none; }
.dateline strong {
  color: var(--brand-primary);
  font-weight: 500;
}

.coord {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.coord::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border: 1px solid var(--brand-accent);
  background: transparent;
  transform: rotate(45deg);
}

.section-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--brand-accent);
}

.marginalia {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.7;
}
.marginalia .figure {
  display: block;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(34px, 4.5vw, 56px);
  letter-spacing: -0.03em;
  color: var(--ink);
  text-transform: none;
  margin: 4px 0 0;
  line-height: 1;
}

.rule-v {
  width: 1px;
  background: var(--rule);
  align-self: stretch;
}

/* ==========================================================================
   AUTH (login) — almanaque centrado
   ========================================================================== */
.auth-shell {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
  padding: 64px 24px;
  position: relative;
}

/* Cartografía sutil decorativa al fondo del shell */
.auth-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 119px,
      var(--rule-soft) 119px,
      var(--rule-soft) 120px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 119px,
      var(--rule-soft) 119px,
      var(--rule-soft) 120px
    );
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: transparent;
  padding: 0;
  text-align: center;
  position: relative;
}

.auth-card .auth-dateline {
  margin: 0 auto 32px;
  max-width: 280px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.6;
}
.auth-card .auth-dateline .label { color: var(--brand-primary); }
.auth-card .auth-dateline .sep {
  display: block;
  width: 32px;
  height: 1px;
  background: var(--brand-accent);
  margin: 8px auto;
}

.auth-card .auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
}
.auth-card .auth-logo img {
  height: 96px;
  max-width: 360px;
  object-fit: contain;
}
.auth-card .auth-logo .wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 64px;
  letter-spacing: -0.035em;
  color: var(--brand-primary);
  line-height: 1;
}

.auth-card .org-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: 24px;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 4px;
  color: var(--ink);
}
.auth-card h1 em {
  font-weight: 300;
  color: var(--brand-primary);
}

.auth-card .auth-rule {
  width: 48px;
  height: 1px;
  background: var(--brand-accent);
  margin: 24px auto 32px;
}

.auth-card .form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 8px;
  text-align: left;
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-card input[type="email"],
.auth-card input[type="password"] {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  transition: border-color 0.22s ease;
  letter-spacing: -0.005em;
}
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus {
  outline: none;
  border-bottom-color: var(--brand-primary);
}

.auth-card button.cta,
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--brand-ink);
  color: var(--brand-paper);
  padding: 16px 24px;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  margin-top: 14px;
  transition: transform 0.2s ease, background 0.2s ease;
  position: relative;
  overflow: hidden;
}
.cta::after {
  content: '→';
  font-family: var(--font-display);
  font-size: 18px;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cta:hover { background: var(--brand-primary); }
.cta:hover::after { transform: translateX(4px); }

.auth-card .helper {
  margin-top: 28px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
  font-family: var(--font-body);
}
.auth-card .helper a {
  color: var(--brand-primary);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
}
.auth-card .helper a:hover { border-bottom-color: var(--brand-accent); }

.auth-card .auth-coord {
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-align: center;
}
.auth-card .auth-coord::before {
  content: '';
  display: block;
  width: 1px;
  height: 24px;
  background: var(--rule);
  margin: 0 auto 14px;
}

.alert {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  background: transparent;
  border-left: 2px solid #B23A2A;
  padding: 10px 14px;
  color: #8C2A1F;
  margin: 12px 0 22px;
  text-align: left;
}

/* ==========================================================================
   HOME — almanaque editorial
   ========================================================================== */
.welcome {
  margin-bottom: 0;
  padding: 24px 0 56px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.welcome-dateline {
  margin-bottom: 28px;
}

.welcome-logo {
  display: flex;
  justify-content: center;
  margin: 0 0 36px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.welcome-logo img {
  height: 120px;
  max-width: min(440px, 80%);
  object-fit: contain;
  display: block;
}
@media (max-width: 640px) {
  .welcome-logo img { height: 80px; }
}

.welcome-grid {
  display: grid;
  grid-template-columns: 1fr 1px minmax(220px, 320px);
  gap: 48px;
  align-items: end;
}

.welcome-grid .rule-v { background: var(--rule); }

.welcome h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(48px, 7vw, 84px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--ink);
}
.welcome h1 em {
  font-weight: 300;
  color: var(--brand-primary);
}

.welcome .lead {
  font-size: 16px;
  color: var(--muted);
  margin: 28px 0 0;
  max-width: 42ch;
  line-height: 1.65;
}

.welcome-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: right;
}
.welcome-side .marginalia { text-align: right; }
.welcome-side .marginalia .figure { text-align: right; }

.badge-internal {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: transparent;
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  padding: 5px 10px;
  margin-top: 22px;
}

/* Mini Tu Radar en home — volumen + ranking */
.home-radar {
  padding: 36px 0 0;
}
.home-radar .dateline { margin-bottom: 22px; }
.home-radar-cards {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.home-radar-card {
  padding: 28px 28px 32px;
  border-right: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  position: relative;
  transition: background 0.22s ease;
}
.home-radar-card:last-child { border-right: 0; }
.home-radar-card.hr-rank {
  background: var(--brand-ink);
  color: var(--brand-paper);
}
.home-radar-card.hr-cta { background: var(--brand-soft); }
.home-radar-card.hr-cta:hover { background: color-mix(in srgb, var(--brand-soft) 60%, var(--brand-paper)); }
.home-radar-card.hr-cta:hover .hr-arrow { transform: translateX(6px); }
.home-radar-card .hr-lbl {
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.home-radar-card.hr-rank .hr-lbl { color: color-mix(in srgb, var(--brand-paper) 60%, transparent); }
.home-radar-card .hr-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 4vw, 48px);
  letter-spacing: -0.03em;
  line-height: 1;
}
.home-radar-card.hr-rank .hr-val { color: var(--brand-paper); }
.home-radar-card .hr-of {
  font-size: 0.5em;
  font-weight: 400;
  color: color-mix(in srgb, var(--brand-paper) 55%, transparent);
  letter-spacing: 0;
  margin-left: 6px;
}
.home-radar-card .hr-sub {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.home-radar-card.hr-rank .hr-sub { color: color-mix(in srgb, var(--brand-paper) 70%, transparent); }
.home-radar-card .delta {
  font-weight: 600;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.home-radar-card .delta.up   { color: #15803d; background: color-mix(in srgb, #15803d 12%, transparent); }
.home-radar-card .delta.down { color: #b91c1c; background: color-mix(in srgb, #b91c1c 12%, transparent); }
.home-radar-card .delta.flat { color: var(--muted); }
.home-radar-card .hr-arrow {
  display: inline-block;
  font-family: var(--font-display);
  margin-left: 6px;
  transition: transform 0.32s cubic-bezier(0.2,0.7,0.2,1);
}
@media (max-width: 880px) {
  .home-radar-cards { grid-template-columns: 1fr; }
  .home-radar-card { border-right: 0; border-bottom: 1px solid var(--rule); }
  .home-radar-card:last-child { border-bottom: 0; }
}

.modules-section {
  padding: 48px 0 0;
}
.modules-section .dateline { margin-bottom: 32px; }

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0;
  border-top: 1px solid var(--brand-ink);
}

.module-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 36px 36px 40px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  position: relative;
  transition: background 0.32s ease, padding 0.32s ease;
  min-height: 280px;
}
.module-card:last-child { border-right: 0; }
.module-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 2px;
  background: var(--brand-accent);
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.module-card:hover { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.module-card:hover::before { width: 100%; }

.module-card .num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--brand-accent);
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.module-card .num::after {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--brand-accent);
}

.module-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  color: var(--brand-primary);
}

.module-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 38ch;
}

.module-card .arrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-primary);
}
.module-card .arrow::after {
  content: '→';
  font-family: var(--font-display);
  font-size: 18px;
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.module-card:hover .arrow::after { transform: translateX(8px); }

@media (max-width: 880px) {
  .welcome-grid { grid-template-columns: 1fr; gap: 28px; }
  .welcome-grid .rule-v { display: none; }
  .welcome-side { text-align: left; }
  .welcome-side .marginalia, .welcome-side .marginalia .figure { text-align: left; }
  .module-card { border-right: 0; }
}

/* ==========================================================================
   PLACEHOLDER / NOT-FOUND / FORBIDDEN
   ========================================================================== */
.placeholder {
  padding: 64px 0;
  max-width: 640px;
}
.placeholder h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 48px;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: var(--ink);
}
.placeholder h1 em {
  color: var(--brand-primary);
}
.placeholder .lead {
  font-size: 17px;
  color: var(--muted);
  margin: 0 0 28px;
}
.placeholder ul {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  border-top: 1px solid var(--rule);
}
.placeholder ul li {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.placeholder ul li::before {
  content: counter(item, upper-roman) '.';
  counter-increment: item;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 14px;
  color: var(--brand-accent);
  letter-spacing: 0;
  min-width: 32px;
}
.placeholder ul { counter-reset: item; }

/* ==========================================================================
   ADMIN
   ========================================================================== */
.admin-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}
.admin-section h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--brand-primary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 13.5px;
}
.data-table th, .data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.data-table th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--brand-ink);
}
.data-table code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--brand-primary);
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-top: 16px;
}
.form-inline label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-inline input,
.form-inline select {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  min-width: 160px;
  border-radius: 0;
}
.form-inline input[type="color"] {
  padding: 2px;
  min-width: 50px;
  height: 40px;
}
.form-inline input[type="file"] { min-width: 240px; }
.form-inline input:focus,
.form-inline select:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.color-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  min-width: 100px;
}

.branding-preview {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.branding-preview img { max-height: 80px; }

.link-btn {
  background: none;
  border: 0;
  color: #B23A2A;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.link-btn:hover { text-decoration: underline; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  padding: 56px 48px 48px;
  border-top: 1px solid var(--rule);
  margin-top: 96px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer .stamp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.footer .stamp::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--brand-accent);
  transform: rotate(45deg);
}

/* ==========================================================================
   PAGE LOAD MOTION — line draw + staggered reveal
   ========================================================================== */
@keyframes amd-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes amd-rule-x {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); transform-origin: left; }
}
@keyframes amd-rule-y {
  from { transform: scaleY(0); transform-origin: top; }
  to   { transform: scaleY(1); transform-origin: top; }
}

.welcome-dateline,
.welcome h1,
.welcome .lead,
.welcome-side > *,
.modules-section .dateline,
.modules-grid .module-card,
.auth-card > *,
.placeholder > * {
  animation: amd-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

.welcome-dateline { animation-delay: 0.05s; }
.welcome h1 { animation-delay: 0.18s; }
.welcome .lead { animation-delay: 0.30s; }
.welcome-side > *:nth-child(1) { animation-delay: 0.36s; }
.welcome-side > *:nth-child(2) { animation-delay: 0.44s; }
.modules-section .dateline { animation-delay: 0.50s; }
.modules-grid .module-card:nth-child(1) { animation-delay: 0.58s; }
.modules-grid .module-card:nth-child(2) { animation-delay: 0.68s; }
.modules-grid .module-card:nth-child(3) { animation-delay: 0.78s; }

.auth-card > *:nth-child(1) { animation-delay: 0.10s; }
.auth-card > *:nth-child(2) { animation-delay: 0.20s; }
.auth-card > *:nth-child(3) { animation-delay: 0.30s; }
.auth-card > *:nth-child(4) { animation-delay: 0.40s; }
.auth-card > *:nth-child(5) { animation-delay: 0.50s; }
.auth-card > *:nth-child(6) { animation-delay: 0.60s; }
.auth-card > *:nth-child(7) { animation-delay: 0.70s; }
.auth-card > *:nth-child(8) { animation-delay: 0.80s; }

.welcome-grid .rule-v {
  animation: amd-rule-y 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.55s backwards;
}
.auth-card .auth-rule {
  animation: amd-rule-x 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.55s backwards;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 920px) {
  .topbar { padding: 18px 24px; gap: 18px; }
  .brand .logo { height: 38px; }
  main { padding: 32px 24px 64px; }
  .welcome { padding: 16px 0 40px; }
  .footer { padding: 40px 24px 32px; }
}

@media (max-width: 640px) {
  .topbar { grid-template-columns: 1fr; gap: 14px; }
  .topbar nav { gap: 18px; flex-wrap: wrap; }
  .auth-card .auth-logo img { height: 64px; }
  .auth-card .auth-logo .wordmark { font-size: 44px; }
  .auth-card h1 { font-size: 30px; }
  .welcome h1 { font-size: 44px; }
  .module-card { padding: 28px 24px 32px; min-height: auto; }
}
