/* ===========================
   EURO SUMMER 2027 — stylesheet
   =========================== */

/* DESIGN TOKENS */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem + 0.75vw,   1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem + 1.25vw,  2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem + 2.5vw,   3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem + 4vw,       5rem);
  --text-hero: clamp(4rem,     1rem + 9vw,       10rem);

  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --radius-sm:   0.375rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow:  640px;
  --content-default: 960px;
  --content-wide:    1200px;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', 'Helvetica Neue', sans-serif;
}

/* DARK MODE (default) */
:root, [data-theme="dark"] {
  --color-bg:             #0e0d0b;
  --color-surface:        #141310;
  --color-surface-2:      #1a1916;
  --color-surface-offset: #1f1e1b;
  --color-divider:        #2a2927;
  --color-border:         #333230;

  --color-text:           #e8e4dc;
  --color-text-muted:     #857f74;
  --color-text-faint:     #4a4844;
  --color-text-inverse:   #1a1816;

  --color-primary:        #c8a96e;
  --color-primary-hover:  #d9bc88;
  --color-primary-light:  rgba(200, 169, 110, 0.12);

  --shadow-sm:  0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md:  0 4px 12px oklch(0 0 0 / 0.4);
  --shadow-lg:  0 16px 40px oklch(0 0 0 / 0.5);
}

/* LIGHT MODE */
[data-theme="light"] {
  --color-bg:             #f5f3ee;
  --color-surface:        #f9f8f4;
  --color-surface-2:      #ffffff;
  --color-surface-offset: #edeae3;
  --color-divider:        #dedad2;
  --color-border:         #d0ccc3;

  --color-text:           #1c1a14;
  --color-text-muted:     #6b6760;
  --color-text-faint:     #b5b0a8;
  --color-text-inverse:   #f5f3ee;

  --color-primary:        #8c6e38;
  --color-primary-hover:  #6b5225;
  --color-primary-light:  rgba(140, 110, 56, 0.1);

  --shadow-sm:  0 1px 2px oklch(0.2 0.01 80 / 0.06);
  --shadow-md:  0 4px 12px oklch(0.2 0.01 80 / 0.1);
  --shadow-lg:  0 16px 40px oklch(0.2 0.01 80 / 0.14);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-bg:             #f5f3ee;
    --color-surface:        #f9f8f4;
    --color-surface-2:      #ffffff;
    --color-surface-offset: #edeae3;
    --color-divider:        #dedad2;
    --color-border:         #d0ccc3;
    --color-text:           #1c1a14;
    --color-text-muted:     #6b6760;
    --color-text-faint:     #b5b0a8;
    --color-text-inverse:   #f5f3ee;
    --color-primary:        #8c6e38;
    --color-primary-hover:  #6b5225;
    --color-primary-light:  rgba(140, 110, 56, 0.1);
    --shadow-sm:  0 1px 2px oklch(0.2 0.01 80 / 0.06);
    --shadow-md:  0 4px 12px oklch(0.2 0.01 80 / 0.1);
    --shadow-lg:  0 16px 40px oklch(0.2 0.01 80 / 0.14);
  }
}

/* BASE RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-16);
}
body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
ul[role="list"], ol[role="list"] { list-style: none; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.1; }
p, li { text-wrap: pretty; }
button { cursor: pointer; background: none; border: none; }
a, button, [role="button"] {
  transition: color var(--transition-interactive), background var(--transition-interactive), opacity var(--transition-interactive);
}
::selection { background: var(--color-primary-light); color: var(--color-text); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }

/* ========================
   HEADER / NAV
   ======================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
  transition: box-shadow var(--transition-interactive), transform 0.3s ease;
}
.header--scrolled { box-shadow: var(--shadow-sm); }
.header--hidden { transform: translateY(-100%); }

.nav {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav-year {
  color: var(--color-primary);
  font-style: italic;
}

.nav-links {
  display: flex;
  gap: var(--space-6);
  flex: 1;
  justify-content: center;
  list-style: none;
}
.nav-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-links a:hover { color: var(--color-text); }

.theme-toggle {
  color: var(--color-text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}
.theme-toggle:hover { color: var(--color-text); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav { padding: var(--space-3) var(--space-5); }
}

/* ========================
   HERO
   ======================== */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--space-16) var(--space-8) var(--space-12);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, color-mix(in srgb, var(--color-primary) 8%, transparent) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 30% 20%, color-mix(in srgb, #4a7fa5 6%, transparent) 0%, transparent 60%);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--color-bg) 10%, transparent) 60%,
    var(--color-bg) 100%
  );
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 900px;
  z-index: 1;
}

.hero-eyebrow {
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-5);
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-6);
}
.hero-title em {
  font-style: italic;
  color: var(--color-primary);
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  font-weight: 300;
  margin-bottom: var(--space-12);
  letter-spacing: 0.01em;
}

.hero-legs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(8px);
  max-width: 860px;
  margin: 0 auto;
}

.leg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}
.leg-flag { font-size: 1.4rem; }
.leg-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
}
.leg-dates {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.leg-divider {
  color: var(--color-primary);
  font-size: var(--text-base);
  padding: 0 var(--space-1);
  padding-bottom: var(--space-5);
  opacity: 0.6;
}

.hero-scroll-cue {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-text-faint);
  animation: bounce 2s ease-in-out infinite;
  z-index: 1;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ========================
   TIMELINE / CHAPTERS
   ======================== */
.timeline {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-16) var(--space-6);
}

.chapter {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--space-6);
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
  border-bottom: 1px solid var(--color-divider);
  position: relative;
}
.chapter:last-child { border-bottom: none; }

.chapter-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--space-2);
}
.chapter-num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 300;
  color: var(--color-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.chapter-line {
  flex: 1;
  width: 1px;
  background: var(--color-divider);
  margin-top: var(--space-4);
}

.chapter-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto 1fr;
  gap: var(--space-5) var(--space-8);
  align-items: start;
}

.chapter-meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.chapter-flag { font-size: 1.2rem; }
.chapter-country {
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 500;
}
.chapter-dates {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-left: auto;
}

.chapter-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 300;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 0.95;
}
.chapter-title em {
  font-style: italic;
  color: var(--color-primary);
}

.chapter-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  font-weight: 300;
  max-width: 52ch;
}

.chapter-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.detail-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-faint);
  font-weight: 500;
}
.detail-val {
  font-size: var(--text-sm);
  color: var(--color-text);
}

/* Chapter images — full-bleed right column */
.chapter-image {
  grid-row: 2 / 5;
  grid-column: 2;
  height: clamp(280px, 40vw, 480px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-lg);
}

/* gradient image fallbacks — beautiful CSS scenes */
.chapter-image--oslo {
  background:
    linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.5) 100%),
    linear-gradient(135deg, #1a3a5c 0%, #2d6a8f 30%, #e8c84a 60%, #f5a623 80%, #c44 100%);
}
.chapter-image--lofoten {
  background:
    linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.6) 100%),
    linear-gradient(160deg, #0a1628 0%, #1b3a6e 25%, #2a5298 45%, #c0392b 65%, #e8734a 80%, #1a3a6e 100%);
}
.chapter-image--monaco {
  background:
    linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.55) 100%),
    linear-gradient(125deg, #1a1a2e 0%, #16213e 20%, #0f3460 40%, #e94560 55%, #f5a623 75%, #44a8c3 100%);
}
.chapter-image--dolomites {
  background:
    linear-gradient(180deg, transparent 45%, rgba(0,0,0,0.5) 100%),
    linear-gradient(175deg, #e8d5b0 0%, #c9a87c 20%, #d4a574 35%, #e87c44 50%, #c0451e 65%, #8b3a2a 80%, #4a3020 100%);
}
.chapter-image--spain {
  background:
    linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.5) 100%),
    linear-gradient(145deg, #f5a623 0%, #e8824a 20%, #c44430 40%, #8b2a44 60%, #1a1a5e 80%, #0d0d3d 100%);
}
.chapter-image--wimbledon {
  background:
    linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.5) 100%),
    linear-gradient(160deg, #1a4a1a 0%, #2d7a2d 25%, #4aaa4a 45%, #6ac46a 60%, #f5f5f5 80%, #e8e8e8 100%);
}

/* Alternate layout: text on right, image on left */
.chapter--alt .chapter-body {
  direction: rtl;
}
.chapter--alt .chapter-body > * {
  direction: ltr;
}
.chapter--alt .chapter-meta {
  direction: ltr;
}
.chapter--alt .chapter-image {
  grid-column: 1;
  grid-row: 2 / 5;
}
.chapter--alt .chapter-title,
.chapter--alt .chapter-desc,
.chapter--alt .chapter-details {
  grid-column: 2;
}

/* Final chapter — centered */
.chapter--final .chapter-body {
  grid-template-columns: 1fr;
  direction: ltr;
}
.chapter--final .chapter-image {
  grid-column: 1;
  grid-row: auto;
  height: clamp(300px, 45vw, 500px);
}
.chapter--final .chapter-meta { grid-column: 1; }
.chapter--final .chapter-title { grid-column: 1; font-size: var(--text-3xl); }
.chapter--final .chapter-desc { grid-column: 1; max-width: 65ch; }
.chapter--final .chapter-details { grid-column: 1; }

@media (max-width: 768px) {
  .chapter { grid-template-columns: 48px 1fr; }
  .chapter-body {
    grid-template-columns: 1fr;
  }
  .chapter-image {
    grid-column: 1;
    grid-row: auto;
    height: 240px;
  }
  .chapter--alt .chapter-body { direction: ltr; }
  .chapter--alt .chapter-image { grid-column: 1; grid-row: auto; }
  .chapter-dates { display: none; }
}

/* ========================
   SUMMARY STRIP
   ======================== */
.summary {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  padding: clamp(var(--space-12), 6vw, var(--space-20)) var(--space-6);
}
.summary-inner {
  max-width: var(--content-default);
  margin: 0 auto;
  text-align: center;
}
.summary-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 300;
  color: var(--color-text);
  margin-bottom: var(--space-8);
  letter-spacing: -0.02em;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-10);
}
.sum-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: left;
}
.sum-flag { font-size: 1.4rem; flex-shrink: 0; }
.sum-item div { display: flex; flex-direction: column; gap: 2px; }
.sum-item strong { font-size: var(--text-sm); font-weight: 500; color: var(--color-text); }
.sum-item span { font-size: var(--text-xs); color: var(--color-primary); }

.summary-total {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  font-weight: 300;
}
.summary-total strong { color: var(--color-text); font-weight: 500; }

/* ========================
   FOOTER
   ======================== */
.footer {
  padding: var(--space-8) var(--space-6);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
