/* ISAC 2027 – colours from the ISAC logo: black, red and white. */
:root {
  --paper: #faf9f7;
  --card: #ffffff;
  --band: #f2f0ec;
  --ink: #16171b;
  --ink-soft: #55585f;
  --line: #e2dfd9;
  --accent: #d0021b;         /* logo red, darkened just enough for readable text (logo itself keeps #FF0000) */
  --accent-soft: #fdecee;
  --todo: #fff3a3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .06);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121317;
    --card: #1b1d22;
    --band: #17181c;
    --ink: #f3f1ed;
    --ink-soft: #b0b3ba;
    --line: #2c2f36;
    --accent: #ff4d5e;
    --accent-soft: #3a1a1f;
    --todo: #5c5214;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  --paper: #121317; --card: #1b1d22; --band: #17181c; --ink: #f3f1ed; --ink-soft: #b0b3ba;
  --line: #2c2f36; --accent: #ff4d5e; --accent-soft: #3a1a1f; --todo: #5c5214;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font);
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p, ul, ol { margin: 0 0 1em; }
.small { font-size: .9rem; color: var(--ink-soft); }
.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }
mark.todo { background: var(--todo); color: var(--ink); padding: 0 .3em; border-radius: 3px; outline: 1px dashed var(--accent); font-size: .92em; }
.tba { color: var(--ink-soft); font-style: italic; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-mark { width: 52px; height: 45px; display: block; color: var(--ink); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: -.01em; }
.brand-text small { color: var(--ink-soft); font-size: .78rem; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 4px; }
.site-nav a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; font-size: .95rem; font-weight: 550; }
.site-nav a:hover { background: var(--band); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.nav-toggle { display: none; font: inherit; font-weight: 600; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
@media (max-width: 1080px) {
  .js .nav-toggle { display: block; }
  .js .site-nav { display: none; width: 100%; padding-bottom: 12px; }
  .js .site-nav.open { display: block; }
  .js .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 10px 12px; }
}

/* Hero */
.hero { padding: 40px 0 24px; border-bottom: 1px solid var(--line); background:
  radial-gradient(1200px 400px at 85% 0%, var(--accent-soft), transparent 70%); }
.hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 5fr 7fr; } .hero { padding: 64px 0 48px; } }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--accent); margin-bottom: .6em; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); line-height: 1.02; letter-spacing: -.03em; margin-bottom: .45em; }
.accent { color: var(--accent); }
.hero-when { font-size: 1.25rem; line-height: 1.4; }
.hero-da { color: var(--ink-soft); font-style: italic; margin-top: 1.2em; }
.countdown { display: flex; gap: 10px; margin: 1.2em 0 1.4em; }
.countdown div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 84px; text-align: center; box-shadow: var(--shadow); }
.countdown span { display: block; font: 800 1.9rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.countdown small { color: var(--ink-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.countdown.done { display: none; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-block; padding: 11px 20px; border-radius: 999px; border: 2px solid var(--ink); font-weight: 650; text-decoration: none; background: transparent; }
.btn:hover { background: var(--band); color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Hero logo */
.hero-logo { display: grid; place-items: center; }
.logo-full { width: 100%; max-width: 420px; height: auto; color: var(--ink); }
@media (max-width: 899px) { .hero-logo { order: -1; } .logo-full { max-width: 240px; } }

/* Sections */
.section { padding: 48px 16px; }
@media (min-width: 700px) { .section { padding: 64px 28px; } }
.section-title { margin-bottom: .9em; }
.band { background: var(--band); border-block: 1px solid var(--line); padding: 48px 0; }
@media (min-width: 700px) { .band { padding: 64px 0; } }
.two-col { display: grid; gap: 40px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 3fr 2fr; gap: 56px; } }
.more { margin-top: 1.2em; font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card > :last-child { margin-bottom: 0; }

.days { display: grid; gap: 16px; }
@media (min-width: 800px) { .days { grid-template-columns: repeat(3, 1fr); } }
.day { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.day p:last-child { margin-bottom: 0; }
.day-name { text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: .3em; }

.news { display: grid; gap: 14px; }
.news-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.news-item time { font-size: .85rem; color: var(--ink-soft); }
.news-item h3 { margin: .2em 0 .4em; }
.news-item p { margin: 0; }

.milestones { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.milestones li { position: relative; padding: 0 0 18px 22px; display: grid; gap: 2px; }
.milestones li::before { content: ""; position: absolute; left: -8px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); }
.milestones li:last-child::before { background: var(--accent); border-color: var(--accent); }
.milestones .when { font-weight: 700; font-size: .95rem; }
.milestones .what { color: var(--ink-soft); }

.shortcuts { display: grid; gap: 14px; }
@media (min-width: 800px) { .shortcuts { grid-template-columns: repeat(3, 1fr); } }
.shortcut { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.shortcut:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--ink); }
.shortcut small { display: block; color: var(--ink-soft); font-size: .9rem; margin-top: 2px; }
.num-badge { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 800; font-size: .9rem; }

/* Inner pages */
.page-head { padding: 44px 0 32px; border-bottom: 1px solid var(--line); background: radial-gradient(900px 300px at 90% 0%, var(--accent-soft), transparent 70%); }
@media (min-width: 700px) { .page-head { padding: 64px 0 40px; } }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 46em; margin: 0; }
.prose { max-width: 46em; }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.note { color: var(--ink-soft); }

.timeline { list-style: none; margin: 0 0 2em; padding: 0; display: grid; gap: 18px; }
.timeline > li { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow); }
.timeline ul { margin: 0; padding-left: 1.2em; }
.timeline ul li + li { margin-top: .35em; }

table { border-collapse: collapse; width: 100%; }
.facts { margin-bottom: 1em; }
.facts th, .facts td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts th { font-weight: 600; padding-right: 16px; }
.table-scroll { overflow-x: auto; margin-bottom: .6em; }
.qual { min-width: 460px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.qual th, .qual td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.qual thead th { background: var(--band); font-size: .9rem; }
.qual td { font-variant-numeric: tabular-nums; }

details.card summary { cursor: pointer; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary h2 { display: inline; margin: 0; }
details.card summary::after { content: " +"; font-weight: 700; color: var(--accent); font-size: 1.4rem; }
details.card[open] summary::after { content: " –"; }
details.card[open] summary { margin-bottom: 1em; }
.prose details.card { margin-top: 2.5em; }

.faq { max-width: 50em; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 32px 16px 0; font-weight: 650; font-size: 1.08rem; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.5rem; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 18px; color: var(--ink-soft); }

.doc-list { display: grid; gap: 16px; }
@media (min-width: 700px) { .doc-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .doc-list { grid-template-columns: repeat(3, 1fr); } }
.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.doc h2 { font-size: 1.2rem; }
.doc .status { margin: auto 0 0; align-self: flex-start; font-size: .82rem; font-weight: 650; color: var(--ink-soft); background: var(--band); border-radius: 999px; padding: 3px 12px; }
.doc a.status { background: var(--ink); color: var(--paper); text-decoration: none; }

.placeholder-card { background: var(--card); border: 2px dashed var(--line); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--ink-soft); max-width: 40em; }
.judges { display: grid; gap: 20px; }
@media (min-width: 700px) { .judges { grid-template-columns: repeat(2, 1fr); } }
.judge { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.judge img { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; margin-bottom: 14px; }
.judge-country { color: var(--accent); font-weight: 650; margin-top: -.4em; }

.cards-3 { display: grid; gap: 20px; }
@media (min-width: 900px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.cards-3 .card { display: flex; flex-direction: column; margin: 0; }
.cards-3 .card > p:last-child { margin-top: auto; padding-top: 8px; }

.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.history li { display: flex; gap: 14px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.history .year { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 5.2em; }
.history li.now { color: var(--accent); font-weight: 650; }
.address { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }

/* Footer */
.site-footer { background: var(--ink); color: var(--paper); padding: 44px 0 36px; margin-top: 24px; }
.site-footer a { color: var(--paper); }
.site-footer a:hover { color: var(--accent); }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-title { font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; color: var(--accent); margin-bottom: .5em; }
.site-footer .small { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.site-footer mark.todo { color: #14213d; }

@media print {
  .site-header, .site-footer, .hero-logo, .countdown, .hero-actions { display: none; }
  body { background: #fff; color: #000; }
}

/* Photos and maps */
.photo { margin: 0 0 1.2em; }
.photo img, .card img { width: 100%; height: auto; border-radius: 8px; }
.card a:has(img) { display: block; margin-bottom: .8em; }
.photo figcaption { margin-top: .4em; }
.prose h3 { margin-top: 1.2em; }
.stay-list li + li { margin-top: .4em; }

/* Photo gallery (homepage) */
.section-intro { color: var(--ink-soft); max-width: 46em; margin-top: -.4em; }
.gallery { list-style: none; margin: 0 0 .8em; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
.gallery li.wide { grid-column: span 2; }
@media (min-width: 800px) {
  .gallery { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .gallery li.wide { grid-row: span 2; }
  .gallery li.wide img { aspect-ratio: auto; }
}
.gallery a { display: block; height: 100%; border-radius: 8px; overflow: hidden; background: var(--band); }
.gallery img { width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .3s ease; }
.gallery a:hover img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .gallery img { transition: none; } .gallery a:hover img { transform: none; } }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; overflow: visible; }
.lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.lightbox img { max-width: 94vw; max-height: 86vh; width: auto; height: auto; border-radius: 6px; }
.lightbox button { position: fixed; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font: 400 2rem/1 var(--font); cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .28); }
.lightbox .lb-close { top: 12px; right: 12px; }
.lightbox .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: fixed; bottom: 14px; left: 0; right: 0; text-align: center; color: #ddd; font-size: .9rem; margin: 0; }
