:root {
  --red: #d2122e;
  --red-dark: #a00d22;
  --ink: #16181d;
  --muted: #5b616e;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --line: #e3e4e8;
  --radius: 14px;
  --max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1f2f4;
    --muted: #a3a8b3;
    --bg: #111317;
    --bg-alt: #1a1d23;
    --line: #2a2e36;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--red); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
p { margin: 0 0 1em; }

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 800;
}
.brand svg { width: 34px; height: 34px; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 600;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { background: var(--bg-alt); }
.nav a[aria-current="page"] { background: var(--red); color: #fff; }
.nav-toggle {
  display: none; background: none; border: 0; color: var(--ink);
  font-size: 1.6rem; cursor: pointer; padding: 4px 8px;
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; padding: 10px 20px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
}

/* Hero */
.hero {
  background:
    linear-gradient(90deg, transparent 0 38%, var(--red) 38% 62%, transparent 62%),
    #fff;
  color: #16181d;
}
.hero .wrap { padding: 90px 20px; }
.hero-card {
  background: rgba(255,255,255,.94);
  max-width: 560px; padding: 32px; border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,.12);
}
.hero-card p { color: #444a55; font-size: 1.1rem; }
.page-hero { background: var(--red); color: #fff; }
.page-hero .wrap { padding: 56px 20px 48px; }
.page-hero p { opacity: .9; max-width: 640px; font-size: 1.1rem; }

.btn {
  display: inline-block; background: var(--red); color: #fff;
  padding: 12px 22px; border-radius: 999px; border: 0;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--red-dark); }
.btn.ghost { background: transparent; color: var(--red); box-shadow: inset 0 0 0 2px var(--red); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* Sections */
section { padding: 64px 0; }
section.alt { background: var(--bg-alt); }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 680px; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
}
section.alt .card { background: var(--bg); }
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
.card .tag {
  display: inline-block; font-size: .8rem; font-weight: 700;
  color: var(--red); text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 6px;
}

.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { text-align: center; padding: 20px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.stat b { display: block; font-size: 2.4rem; color: var(--red); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .95rem; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--red); }
.timeline li { position: relative; padding: 0 0 28px 28px; }
.timeline li::before {
  content: ""; position: absolute; left: -9px; top: 6px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--red);
}
.timeline .year { font-weight: 800; color: var(--red); }

/* Form */
form { display: grid; gap: 16px; max-width: 560px; }
label { font-weight: 600; display: grid; gap: 6px; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; }
.notice {
  display: none; padding: 16px; border-radius: 10px;
  background: var(--bg-alt); border-left: 4px solid var(--red);
}
.notice.show { display: block; }

.two-col { display: grid; gap: 40px; grid-template-columns: 1.2fr 1fr; align-items: start; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { color: var(--muted); }

/* Blog */
.posts { display: grid; gap: 24px; max-width: 780px; }
.post h2 { font-size: 1.5rem; }

/* Video page */
.video-list { display: grid; gap: 24px; max-width: 760px; }
.video-card video { width: 100%; height: auto; aspect-ratio: 4 / 3; background: #000; border-radius: 8px; display: block; margin: 12px 0; }
.video-card .credit { font-size: .85rem; opacity: .75; }
.home-video { width: 100%; height: auto; aspect-ratio: 4 / 3; background: #000; border-radius: 8px; display: block; }
