/* =============================================================
   VIANA TRILHOS — Complete Design System
   Aesthetic: Xisto Atlântico — Dark Mountain Editorial
   Fonts: Fraunces + Plus Jakarta Sans + Space Mono
   ============================================================= */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Background layers — warm near-black */
  --c-bg:        #0D0A0B;
  --c-bg-rgb:    13, 10, 11;
  --c-bg-2:      #110C0D;
  --c-surface:   #1A1213;
  --c-surface-2: #221617;
  --c-surface-3: #2A1B1C;

  /* Borders */
  --c-border:    #33201F;
  --c-border-2:  #43292A;

  /* Text — warm cream */
  --c-text:       #EDE6DE;
  --c-text-muted: #9A8880;
  --c-text-dim:   #5E4848;

  /* Accents — red to match logo's red line */
  --c-red:       #D43535;    /* primary red */
  --c-red-2:     #E55050;
  --c-red-dim:   #962020;
  --c-warm:      #E89448;    /* amber — secondary */
  --c-warm-2:    #F5A85C;
  --c-gold:      #C9A030;

  /* Difficulty palette — keep semantic colors */
  --diff-easy:    #4CAF50;
  --diff-moderate: #E89448;
  --diff-hard:    #D43535;
  --diff-vhard:   #9B4DA0;

  /* Typography */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:    'Space Mono', 'Courier New', monospace;

  /* Type Scale */
  --t-xs:   0.6875rem;   /*  11px */
  --t-sm:   0.8125rem;   /*  13px */
  --t-base: 1rem;        /*  16px */
  --t-lg:   1.125rem;    /*  18px */
  --t-xl:   1.25rem;     /*  20px */
  --t-2xl:  1.5rem;      /*  24px */
  --t-3xl:  1.875rem;    /*  30px */
  --t-4xl:  2.25rem;     /*  36px */
  --t-5xl:  3rem;        /*  48px */
  --t-6xl:  3.75rem;     /*  60px */
  --t-7xl:  4.5rem;      /*  72px */
  --t-8xl:  6rem;        /*  96px */

  /* Spacing */
  --s-1:  0.25rem;
  --s-2:  0.5rem;
  --s-3:  0.75rem;
  --s-4:  1rem;
  --s-5:  1.25rem;
  --s-6:  1.5rem;
  --s-8:  2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-20: 5rem;
  --s-24: 6rem;

  /* Layout */
  --max-w:    1200px;
  --header-h: 70px;
  --radius:   6px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.5);
  --shadow:     0 4px 24px rgba(0,0,0,0.6);
  --shadow-lg:  0 12px 56px rgba(0,0,0,0.8);

  /* Transitions */
  --ease:       cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur-fast: 120ms;
  --dur:      240ms;
  --dur-slow: 400ms;

  /* Logo color for SVG */
  --logo-color: var(--c-text);

  /* PhotoSwipe lightbox theming */
  --pswp-bg: var(--c-bg);
  --pswp-icon-color: var(--c-text);
  --pswp-icon-color-secondary: var(--c-text-muted);

  /* Header scroll/opaque tokens (overridden in light mode) */
  --c-header-scrolled:   rgba(13,10,11,0.88);
  --c-header-bg-opaque:  rgba(13,10,11,0.95);
  --c-header-nav-bg:     rgba(13,10,11,0.97);
}

/* ── Light Mode — "Xisto Atlântico Daylight" ─────────────────── */
:root[data-theme="light"],
:root:has(#theme-toggle:checked) {
  --c-bg:        #F5EFE6;
  --c-bg-rgb:    245, 239, 230;
  --c-bg-2:      #EDE5D8;
  --c-surface:   #FFFFFF;
  --c-surface-2: #F2EAE0;
  --c-surface-3: #E8DDD0;
  --c-border:    rgba(80,45,35,0.14);
  --c-border-2:  rgba(80,45,35,0.22);
  --c-text:      #1C1210;
  --c-text-muted: #6B5650;
  --c-text-dim:  #9A8880;
  --c-red:       #C42C2C;
  --c-red-2:     #D43535;
  --c-red-dim:   #FAEAEA;
  --c-warm:      #B86820;
  --c-warm-2:    #C87830;
  --c-gold:      #A07818;
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.06);
  --shadow:      0 4px 24px rgba(0,0,0,0.10);
  --shadow-lg:   0 12px 56px rgba(0,0,0,0.18);
  --c-header-scrolled:  rgba(245,239,230,0.94);
  --c-header-bg-opaque: rgba(245,239,230,0.95);
  --c-header-nav-bg:    rgba(245,239,230,0.97);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: var(--header-h);
  transition: background-color 300ms ease, color 300ms ease;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: var(--c-text);
  line-height: 1.2;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
}

h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 600;
}

h1 { font-size: clamp(var(--t-4xl), 5.5vw, var(--t-7xl)); }
h2 { font-size: clamp(var(--t-3xl), 3.5vw, var(--t-5xl)); }
h3 { font-size: clamp(var(--t-xl),  2.5vw, var(--t-3xl)); }
h4 { font-size: var(--t-xl); }
h5 { font-size: var(--t-lg); }
h6 { font-size: var(--t-base); }

p {
  color: var(--c-text);
  line-height: 1.75;
  margin-bottom: var(--s-4);
}
p:last-child { margin-bottom: 0; }

a {
  color: var(--c-red);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--c-red-2); }

strong, b { font-weight: 600; }
em, i     { font-style: italic; }
small     { font-size: var(--t-sm); color: var(--c-text-muted); }

time {
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  color: var(--c-text-muted);
  letter-spacing: 0.04em;
}

img   { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }

figcaption {
  font-size: var(--t-sm);
  color: var(--c-text-muted);
  margin-top: var(--s-2);
  text-align: center;
}

ul, ol {
  padding-left: var(--s-6);
  margin-bottom: var(--s-4);
}
li { margin-bottom: var(--s-2); line-height: 1.7; }

hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: var(--s-8) 0;
}

blockquote {
  border-left: 3px solid var(--c-red);
  padding: var(--s-4) var(--s-6);
  margin: var(--s-6) 0;
  background: var(--c-surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--c-text-muted);
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--c-surface-2);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: var(--c-red);
}

pre {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--s-6);
  overflow-x: auto;
}

pre code { background: none; padding: 0; }

/* ── Layout ─────────────────────────────────────────────────── */
main { min-height: calc(100vh - var(--header-h) - 220px); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

.page-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s-12) var(--s-6);
}

.page-wrapper > h1:first-child,
.page-wrapper > section > h1:first-child {
  margin-bottom: var(--s-3);
}

.grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

@media (max-width: 768px) {
  .container { padding: 0 var(--s-4); }
  .page-wrapper { padding: var(--s-8) var(--s-4); }
}

/* ── Article ─────────────────────────────────────────────────── */
article {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
}

article + article { margin-top: var(--s-6); }

/* ── Aside ───────────────────────────────────────────────────── */
aside article {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--s-4) var(--s-6);
}

aside article p {
  font-size: var(--t-sm);
  color: var(--c-text-muted);
  margin-bottom: 0;
  text-align: justify;
}

/* ── Buttons ─────────────────────────────────────────────────── */
[role="button"],
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-6);
  font-family: var(--font-body);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  line-height: 1;
  transition: all var(--dur) var(--ease);
  background: var(--c-red);
  color: #EDE6DE;
}

[role="button"]:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--c-red-2);
  color: #EDE6DE;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,53,53,0.25);
}

[role="button"]:active,
button:active { transform: translateY(0); }

[role="button"].outline,
button.outline,
summary[role="button"] {
  background: transparent;
  color: var(--c-text);
  border: 1px solid var(--c-border);
  box-shadow: none;
}

[role="button"].outline:hover,
button.outline:hover,
summary[role="button"]:hover {
  border-color: var(--c-red);
  color: var(--c-red);
  background: rgba(212,53,53,0.06);
  transform: none;
  box-shadow: none;
}

/* ── Forms ───────────────────────────────────────────────────── */
label {
  display: block;
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--c-text-muted);
  margin-bottom: var(--s-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  display: block;
  width: 100%;
  padding: var(--s-3) var(--s-4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-2);
  border-radius: var(--radius);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.5;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  outline: none;
  margin-bottom: var(--s-5);
  appearance: none;
  -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: var(--c-red);
  box-shadow: 0 0 0 3px rgba(212,53,53,0.12);
}

input::placeholder,
textarea::placeholder { color: var(--c-text-dim); }

textarea { min-height: 150px; resize: vertical; }

div.btn { margin-top: var(--s-4); }

/* ── Tables ──────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  background: var(--c-surface-2);
}

td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  font-size: var(--t-sm);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--c-surface-2); }

/* ── Details / Summary (Histórico) ──────────────────────────── */
details {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  margin-bottom: var(--s-3);
  overflow: hidden;
}

summary {
  padding: var(--s-4) var(--s-6);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-xl);
  color: var(--c-text);
  background: var(--c-surface);
  list-style: none;
  transition: background var(--dur-fast) var(--ease);
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: var(--t-xl);
  color: var(--c-red);
  transition: transform var(--dur) var(--ease);
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

summary:hover { background: var(--c-surface-2); }

details[open] > summary::after {
  transform: rotate(45deg);
}

details[open] > summary {
  border-bottom: 1px solid var(--c-border);
}

details > div,
details > ul {
  padding: var(--s-2) 0;
  background: var(--c-bg-2);
}

details > ul {
  list-style: none;
  padding: var(--s-2) var(--s-6);
}

details > ul li {
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 0;
}

details > ul li:last-child { border-bottom: none; }

details > ul li a {
  color: var(--c-text-muted);
  font-size: var(--t-sm);
  transition: color var(--dur-fast) var(--ease);
}

details > ul li a:hover { color: var(--c-red); }

.activity-link {
  color: var(--c-text-muted);
  font-size: var(--t-sm);
  transition: color var(--dur-fast) var(--ease);
}

.activity-link:hover { color: var(--c-red); }

/* ── hgroup ──────────────────────────────────────────────────── */
hgroup { margin-bottom: var(--s-6); }
hgroup > :last-child { color: var(--c-text-muted); margin-top: var(--s-1); margin-bottom: 0; }

/* ── iframes ─────────────────────────────────────────────────── */
iframe {
  max-width: 100%;
  border: none;
  border-radius: var(--radius);
}

/* ── HEADER ──────────────────────────────────────────────────── */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 clamp(var(--s-4), 4vw, var(--s-16));
  transition: background-color var(--dur-slow) var(--ease),
              box-shadow var(--dur-slow) var(--ease),
              backdrop-filter var(--dur-slow) var(--ease);
  background: transparent;
}

#site-header.is-scrolled {
  background: var(--c-header-scrolled);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--c-border);
}

#site-header .logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: auto;
}

#site-header .logo-link svg {
  width: 140px;
  height: auto;
  display: block;
}

/* Nav desktop */
#site-header nav ul {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

#site-header nav li { margin-bottom: 0; }

#site-header nav a {
  display: block;
  padding: var(--s-2) var(--s-3);
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--c-text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  position: relative;
}

#site-header nav a::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: var(--s-3);
  right: var(--s-3);
  height: 1.5px;
  background: var(--c-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}

#site-header nav a:hover {
  color: var(--c-text);
  background: rgba(255,255,255,0.04);
}

#site-header nav a:hover::after { transform: scaleX(1); }

/* Mobile hamburger */
.nav-toggle { display: none; }

.nav-toggle-label {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: var(--s-2);
  z-index: 1001;
  flex-shrink: 0;
  margin-bottom: 0;   
}

.nav-toggle-label span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: all var(--dur) var(--ease);
}

/* Hamburger → X animation */
.nav-toggle:checked + .nav-toggle-label span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle:checked + .nav-toggle-label span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle:checked + .nav-toggle-label span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 940px) {
  #site-header { background: var(--c-header-bg-opaque); backdrop-filter: blur(12px); }
  #site-header.is-scrolled { background: var(--c-header-scrolled); }

  .nav-toggle-label { display: flex; }

  #site-header nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--c-header-nav-bg);
    backdrop-filter: blur(20px);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--dur-slow) var(--ease);
    border-bottom: 1px solid var(--c-border);
  }

  #site-header .nav-toggle:checked ~ nav {
    max-height: 400px;
  }

  #site-header nav ul {
    flex-direction: column;
    padding: var(--s-4) 0;
    gap: 0;
    align-items: stretch;
  }

  #site-header nav a {
    padding: var(--s-4) var(--s-6);
    border-radius: 0;
    border-bottom: 1px solid var(--c-border);
    font-size: var(--t-base);
  }

  #site-header nav a::after { display: none; }
  #site-header nav li:last-child a { border-bottom: none; }
}

/* ── FOOTER ──────────────────────────────────────────────────── */
footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  margin-top: var(--s-20);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s-16) var(--s-6) var(--s-12);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--s-12);
}

.footer-brand .footer-logo svg,
.footer-brand .footer-logo img {
  width: 130px;
  height: auto;
  margin-bottom: var(--s-4);
}

.footer-brand p {
  font-size: var(--t-sm);
  color: var(--c-text-muted);
  line-height: 1.7;
  max-width: 280px;
}

.footer-nav h3,
.footer-contact h3 {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin-bottom: var(--s-4);
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li { margin-bottom: var(--s-3); }

.footer-nav a,
.footer-contact a {
  font-size: var(--t-sm);
  color: var(--c-text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

.footer-nav a:hover,
.footer-contact a:hover { color: var(--c-red); }

.footer-contact p {
  font-size: var(--t-sm);
  color: var(--c-text-muted);
  margin-bottom: var(--s-3);
}

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s-6);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.footer-bottom p {
  font-size: var(--t-xs);
  color: var(--c-text-dim);
  margin: 0;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.footer-bottom a {
  font-size: var(--t-xs);
  color: var(--c-text-dim);
}

.footer-bottom a:hover { color: var(--c-text-muted); }

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--s-8);
    padding: var(--s-10) var(--s-4) var(--s-8);
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--s-4);
  }
}

/* ── DIFFICULTY BADGE ─────────────────────────────────────────── */
.diff-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px var(--s-3);
  border-radius: var(--radius-full);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.diff-badge::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.diff-easy     { color: var(--diff-easy);     background: rgba(76, 175, 80, 0.12); }
.diff-moderate { color: var(--diff-moderate);  background: rgba(232, 148, 72, 0.12); }
.diff-hard     { color: var(--diff-hard);      background: rgba(208, 80, 64, 0.12); }
.diff-vhard    { color: var(--diff-vhard);     background: rgba(155, 77, 160, 0.12); }

/* ── HOME: HERO ───────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  min-height: 520px;
  display: grid;
  grid-template-columns: 55% 45%;
}

/* Right panel: image column */
.hero-bg {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  overflow: hidden;
}

.hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

/* Soft left-edge fade: blends image into dark left panel */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--c-bg) 0%, transparent 35%);
  pointer-events: none;
}

/* Left panel: content column */
.hero-content {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 1;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 clamp(var(--s-4), 4vw, var(--s-16)) clamp(var(--s-12), 8vh, var(--s-24));
}

/* Eyebrow: label left, diff-badge right */
.hero-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  opacity: 0;
  animation: fade-in-up 0.7s var(--ease) 0.15s forwards;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-red);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.hero-label::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--c-red);
  flex-shrink: 0;
}

/* Two-column body: title left / meta+cta right */
.hero-body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--s-6) clamp(var(--s-8), 5vw, var(--s-16));
  border-top: 1px solid rgba(212, 53, 53, 0.35);
  padding-top: var(--s-6);
  opacity: 0;
  animation: fade-in-up 0.7s var(--ease) 0.4s forwards;
}

.hero h1 {
  font-size: clamp(var(--t-4xl), 4vw, var(--t-8xl));
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--c-text);
  margin-bottom: 0;
  max-width: 18ch;
}

/* Right column */
.hero-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--s-6);
  padding-bottom: var(--s-1);
}

.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--s-2);
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-sm);
  color: var(--c-text-muted);
}

.hero-meta-item svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.hero-meta-item strong {
  color: var(--c-text);
  font-weight: 500;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-8);
  background: var(--c-red);
  color: #EDE6DE;
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}

.hero-cta:hover {
  background: var(--c-red-2);
  color: #EDE6DE;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(212, 53, 53, 0.3);
}

.hero-cta svg {
  width: 16px;
  height: 16px;
  transition: transform var(--dur) var(--ease);
}

.hero-cta:hover svg { transform: translateX(4px); }

.hero-scroll {
  position: absolute;
  bottom: var(--s-8);
  right: clamp(var(--s-4), 2vw, var(--s-8));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  color: var(--c-text-dim);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  opacity: 0;
  animation: fade-in 1s var(--ease) 1.2s forwards;
  z-index: 2;
}

.hero-scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--c-text-dim), transparent);
  animation: scroll-pulse 2.4s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7); transform-origin: top; }
  50%       { opacity: 0.7; transform: scaleY(1);   transform-origin: top; }
}

/* ── HERO: MOBILE — revert to full-bleed (quality fine at small widths) ── */
@media (max-width: 940px) {
  .hero {
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  /* Image expands back to full-bleed */
  .hero-bg {
    grid-column: 1;
    grid-row: 1;
    position: absolute;
    inset: 0;
    overflow: hidden;
  }

  /* Restore full directional gradient for readability */
  .hero-bg::after {
    background:
      linear-gradient(to right,  rgba(var(--c-bg-rgb), 0.85) 0%, rgba(var(--c-bg-rgb), 0.3) 52%, rgba(var(--c-bg-rgb), 0.05) 100%),
      linear-gradient(to top,    rgba(var(--c-bg-rgb), 0.97) 0%, rgba(var(--c-bg-rgb), 0.55) 30%, rgba(var(--c-bg-rgb), 0.1) 65%, rgba(var(--c-bg-rgb), 0) 100%);
  }

  /* Content covers full width again */
  .hero-content {
    grid-column: 1;
    grid-row: 1;
    background: transparent;
    justify-content: flex-end;
    padding: 0 clamp(var(--s-4), 4vw, var(--s-16)) clamp(var(--s-12), 8vh, var(--s-24));
  }

  /* Restore h1 font-size for smaller screens */
  .hero h1 {
    font-size: clamp(var(--t-4xl), 6vw, var(--t-8xl));
  }
}

@media (max-width: 680px) {
  .hero-body {
    grid-template-columns: 1fr;
    gap: var(--s-5);
  }

  .hero-aside {
    align-items: flex-start;
  }

  .hero-meta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-3);
  }
}

.hero-empty {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface);
  color: var(--c-text-muted);
  font-family: var(--font-mono);
  padding: var(--s-8) clamp(var(--s-4), 4vw, var(--s-16));
  text-align: center;
}

/* ── HOME: PARTICIPATION INFO ─────────────────────────────────── */
.participation-info {
  max-width: var(--max-w);
  margin: var(--s-8) auto 0;
  padding: 0 clamp(var(--s-4), 4vw, var(--s-16));
}

/* ── HOME: STATS STRIP ───────────────────────────────────────── */
.stats-strip {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  margin-top: var(--s-8);
}

.stats-strip-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s-8) clamp(var(--s-4), 4vw, var(--s-16));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
}

.stat-item { text-align: center; }

.stat-item-value {
  font-family: var(--font-mono);
  font-size: clamp(var(--t-2xl), 3vw, var(--t-4xl));
  font-weight: 700;
  color: var(--c-red);
  line-height: 1;
  margin-bottom: var(--s-1);
}

.stat-item-label {
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}

/* ── HOME: SECTION LAYOUT ────────────────────────────────────── */
.home-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s-16) clamp(var(--s-4), 4vw, var(--s-16));
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--s-10);
  gap: var(--s-4);
}

.section-header h2 {
  font-size: clamp(var(--t-2xl), 3vw, var(--t-4xl));
}

.section-header a {
  font-size: var(--t-sm);
  color: var(--c-text-muted);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  transition: color var(--dur-fast) var(--ease);
}

.section-header a:hover { color: var(--c-red); }

.section-header a svg {
  transition: transform var(--dur) var(--ease);
}

.section-header a:hover svg { transform: translateX(3px); }

/* ── HOME: ACTIVITY CARDS ────────────────────────────────────── */
.activity-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
}

@media (max-width: 1024px) {
  .activity-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .activity-cards { grid-template-columns: 1fr; }
}

.activity-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.activity-card:hover {
  border-color: var(--c-border-2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: inherit;
}

.activity-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--c-surface-3);
}

.activity-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--dur-slow) var(--ease);
}

.activity-card:hover .activity-card-image img {
  transform: scale(1.04);
}

.activity-card-body {
  padding: var(--s-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.activity-card-date {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--c-warm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--s-2);
}

.activity-card h3 {
  font-size: var(--t-xl);
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: var(--s-3);
  line-height: 1.3;
  flex: 1;
  transition: color var(--dur-fast) var(--ease);
}

.activity-card:hover h3 { color: var(--c-red); }

.activity-card-location {
  font-size: var(--t-sm);
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: auto;
  padding-top: var(--s-3);
}

/* ── STAT CARD (statistics pages) ───────────────────────────── */
.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
  text-align: center;
}

.stat-card h2 {
  font-family: var(--font-body);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--s-3);
}

.stat-number {
  font-family: var(--font-mono);
  font-size: var(--t-4xl);
  font-weight: 700;
  color: var(--c-red);
  margin: 0;
  line-height: 1;
}

/* Chart container */
.chart-container {
  width: 100%;
  height: 300px;
  margin: var(--s-8) 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--s-4);
}

.activity-list { overflow-x: auto; margin: var(--s-8) 0; }
.no-data-message { margin: var(--s-8) 0; text-align: center; color: var(--c-text-muted); }

/* ── Page content body (prose areas) ────────────────────────── */
.page-content-body {
  line-height: 1.8;
  max-width: 72ch;
}

.page-content-body h2,
.page-content-body h3 {
  margin-top: var(--s-8);
  margin-bottom: var(--s-4);
}

.page-content-body p { margin-bottom: var(--s-4); }

/* ── Activity page header block ──────────────────────────────── */
.activity-page-header {
  margin-bottom: var(--s-8);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--c-border);
}

.activity-page-header time {
  display: block;
  margin-bottom: var(--s-3);
}

.activity-page-header h1 {
  margin-bottom: var(--s-4);
}

/* ── History page list ───────────────────────────────────────── */
.historico-list {
  margin-top: var(--s-6);
}

/* ── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .animate-in {
    animation: fade-in-up 0.5s var(--ease) both;
  }
  .animate-in:nth-child(1) { animation-delay: 0ms; }
  .animate-in:nth-child(2) { animation-delay: 80ms; }
  .animate-in:nth-child(3) { animation-delay: 160ms; }
  .animate-in:nth-child(4) { animation-delay: 240ms; }
  .animate-in:nth-child(5) { animation-delay: 320ms; }
  .animate-in:nth-child(6) { animation-delay: 400ms; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow, .hero-body, .hero-scroll {
    animation: none;
    opacity: 1;
  }
}

/* ── THEME TOGGLE ─────────────────────────────────────────────── */
.theme-toggle-wrapper {
  display: flex;
  align-items: center;
}

#site-header .theme-toggle-wrapper {
  flex-shrink: 0;
  margin-left: var(--s-4);
}

/* Visually hidden but accessible */
.theme-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.theme-toggle-label {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;

}

.toggle-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: var(--c-surface-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--c-border-2);
  transition: background 240ms ease, border-color 240ms ease;
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--c-text-muted);
  transition: transform 240ms ease, background 240ms ease;
}

/* Checked = light mode: thumb slides right, track warms up */
.theme-toggle-input:checked + .theme-toggle-label .toggle-track {
  background: var(--c-warm);
  border-color: var(--c-warm);
}

.theme-toggle-input:checked + .theme-toggle-label .toggle-thumb {
  transform: translateX(20px);
  background: #fff;
}

.toggle-icon {
  flex-shrink: 0;
  transition: color 240ms ease;
}

.toggle-icon--moon { color: var(--c-text-muted); }
.toggle-icon--sun  { color: var(--c-text-dim); }

.theme-toggle-input:checked + .theme-toggle-label .toggle-icon--moon {
  color: var(--c-text-dim);
}

.theme-toggle-input:checked + .theme-toggle-label .toggle-icon--sun {
  color: var(--c-warm);
}

@media (prefers-reduced-motion: reduce) {
  .toggle-track,
  .toggle-thumb,
  .toggle-icon { transition: none; }
}
