:root {
  --bg: #ffffff;
  --fg: #1d1d21;
  --muted: #5d5d66;
  --accent: #a8416f;
  --accent-soft: #f6e9ef;
  --line: #e4e4e8;
  --card: #fafafb;
  --max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15151a;
    --fg: #ececf0;
    --muted: #a0a0ab;
    --accent: #e37aa6;
    --accent-soft: #2a1d25;
    --line: #2b2b33;
    --card: #1b1b21;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  font-size: 17px;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

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

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.nav .brand {
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  margin-right: auto;
}
.nav a.link {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}
.nav a.link:hover { color: var(--accent); }

/* Hero */
.hero {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
  margin: 0 0 8px;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
  margin: 0 0 16px;
}
.hero .sub {
  font-size: 19px;
  color: var(--muted);
  max-width: 680px;
  margin: 0 0 24px;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}
.facts li {
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 15px;
}
.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 11px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  margin-right: 10px;
}
.button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* Sections */
section { padding: 44px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }
h2 { font-size: 28px; margin: 0 0 16px; }
h3 { font-size: 19px; margin: 28px 0 8px; color: var(--accent); }
p { margin: 0 0 14px; }
ul { padding-left: 22px; margin: 0 0 14px; }
li { margin-bottom: 6px; }

/* Cards and grids */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 14px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: 14px; }
td.time { white-space: nowrap; color: var(--muted); width: 110px; }

/* People */
.person { margin-bottom: 18px; }
.person .name { font-weight: 700; }
.person .aff { color: var(--muted); }

.note {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: 6px;
  margin: 14px 0;
}

footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 44px;
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding-top: 40px; }
  td.time { width: auto; white-space: normal; }
}

/* Organiser names */
.names {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 20px;
  font-size: 18px;
  font-weight: 600;
}

/* Scroll reveal */
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js-reveal .reveal.in { opacity: 1; transform: none; }

/* Digital twin */
.twin { margin: 20px 0 28px; }
.twin-stage {
  position: relative;
  height: clamp(400px, 62vw, 580px);
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 70%, #231633 0%, #0e0e1c 55%, #07070d 100%);
  border: 1px solid #2d2540;
  box-shadow: 0 10px 40px rgba(168, 65, 111, 0.18);
  color: #ececf0;
}
.twin-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  cursor: grab; touch-action: pan-y; display: block;
}
.twin-stage canvas.grabbing { cursor: grabbing; }
.twin-stage canvas:focus-visible { outline: 2px solid #ff8cb9; outline-offset: -4px; }

.twin-hud {
  position: absolute; top: 14px; left: 16px;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #b9b9d0; pointer-events: none;
}
.twin-hud b { color: #ffd0e2; font-weight: 600; }
.hud-title { color: #ff8cb9; letter-spacing: 0.06em; margin-bottom: 2px; }
.live {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #ff5c8a; margin-right: 8px; animation: blink 1.4s infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

.twin-labels { position: absolute; inset: 0; pointer-events: none; }
.twin-node {
  position: absolute; left: 0; top: 0;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px;
  background: rgba(20, 14, 32, 0.82);
  color: #fff;
  border: 1px solid rgba(255, 140, 185, 0.7);
  border-radius: 999px;
  font: 600 14px/1 inherit;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  backdrop-filter: blur(4px);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.twin-node:hover, .twin-node:focus-visible { background: rgba(70, 30, 55, 0.95); border-color: #fff; }
.twin-node.active { background: #a8416f; border-color: #fff; box-shadow: 0 0 22px rgba(255, 140, 185, 0.65); }
.twin-node .n {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: #ff8cb9; color: #2a0f1d; font-size: 13px; font-weight: 700;
}
.twin-hint {
  position: absolute; bottom: 12px; left: 16px;
  font-size: 13px; color: #9a9ab5; pointer-events: none;
}
.twin-replay {
  position: absolute; bottom: 10px; right: 12px;
  background: transparent; color: #ffd0e2;
  border: 1px solid rgba(255, 140, 185, 0.5);
  border-radius: 8px; padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.twin-replay:hover { background: rgba(255, 140, 185, 0.15); }

.twin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.twin-tab {
  background: var(--card); color: var(--fg);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.twin-tab:hover { border-color: var(--accent); }
.twin-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.twin-panel {
  margin-top: 14px; min-height: 110px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 18px;
}
.twin-panel h3 { margin-top: 0; }
.twin-panel ul { margin-bottom: 0; }
.twin-empty { color: var(--muted); margin: 0; }

/* Without JavaScript the twin stays hidden and the topic cards carry the content. */
.twin { display: none; }
.js .twin { display: block; }

@media (max-width: 600px) {
  .twin-node .t { display: none; }
  .twin-node { padding: 5px; }
  .twin-hud { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .live { animation: none; }
}

/* Layout upgrades */
[id] { scroll-margin-top: 70px; }
.nowrap { white-space: nowrap; }

.hero {
  background:
    radial-gradient(ellipse at 85% 0%, var(--accent-soft) 0%, transparent 60%),
    var(--bg);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 48px;
  align-items: center;
}
.glance {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 8px 28px rgba(168, 65, 111, 0.1);
}
.glance h2 { font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.glance dl { margin: 0; }
.glance dl > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.glance dl > div:last-child { border-bottom: none; }
.glance dt { color: var(--muted); font-size: 14px; }
.glance dd { margin: 0; font-weight: 600; }
.glance .hot dd { color: var(--accent); }

.cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  align-items: start;
}
.cols.even { grid-template-columns: 1fr 1fr; }
.cols h2 { margin-top: 0; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px;
}
.panel h3 { margin-top: 0; }
.sticky { position: sticky; top: 80px; }
.goals { padding-left: 22px; margin: 0 0 14px; }
.goals li { margin-bottom: 10px; font-weight: 600; }
.small { font-size: 15px; color: var(--muted); }
h3.first { margin-top: 0; }
.stack { display: grid; gap: 12px; margin: 14px 0; }
.stack .card h3 { margin-bottom: 4px; }

.contact-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 24px 28px;
}
.contact-bar h2 { margin: 0 0 4px; }
.contact-bar p { margin: 0; }
.contact-bar .button { margin: 0; }

.names { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 0; }

@media (max-width: 860px) {
  .hero-grid, .cols, .cols.even { grid-template-columns: 1fr; gap: 28px; }
  .sticky { position: static; }
  .glance dl > div { grid-template-columns: 110px 1fr; }
}

/* Hero with the twin built in */
.hero {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(168, 65, 111, 0.38) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(80, 60, 180, 0.25) 0%, transparent 55%),
    #0b0b16;
  color: #ececf0;
  border-bottom: none;
  padding: 52px 0 36px;
}
.hero .eyebrow { color: #ff8cb9; }
.hero h1 { color: #fff; font-size: clamp(28px, 4.2vw, 44px); margin: 0; }
.hero-top { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: end; }
.hero .sub { color: #b9b9d0; max-width: none; margin: 0 0 20px; }
.hero .button { background: #ff8cb9; color: #2a0f1d; }
.hero .button.ghost { background: transparent; color: #ffd0e2; border: 1px solid rgba(255, 140, 185, 0.6); }
.hero .facts { margin: 26px 0 6px; }
.hero .facts li { background: rgba(255, 255, 255, 0.08); color: #ececf0; }
.hero .facts li.hot { background: #a8416f; color: #fff; font-weight: 600; }
.hero .twin { margin: 0; }
.hero .twin-stage {
  background: transparent; border: none; box-shadow: none; border-radius: 0;
  height: clamp(420px, 56vw, 600px);
}
.hero .twin-tab { background: rgba(255, 255, 255, 0.06); color: #e8e8f2; border-color: #3a3150; }
.hero .twin-tab:hover { border-color: #ff8cb9; }
.hero .twin-tab.active { background: #a8416f; border-color: #a8416f; color: #fff; }
.hero .twin-panel { background: rgba(255, 255, 255, 0.05); border-color: #3a3150; color: #ececf0; }
.hero .twin-panel h3 { color: #ff8cb9; }
.hero .twin-empty { color: #9a9ab5; }

.contact-card { background: var(--accent-soft); border-radius: 14px; padding: 22px 24px; }
.contact-card p { margin: 0 0 16px; }
.contact-card .button { margin: 0; word-break: break-all; }

@media (max-width: 860px) {
  .hero-top { grid-template-columns: 1fr; gap: 20px; }
}

/* Tighter hero so the car shows on the first screen */
.hero { padding: 30px 0 28px; }
.hero h1 { font-size: clamp(26px, 3.6vw, 40px); }
.hero-top { grid-template-columns: 1.45fr 1fr; gap: 36px; }
.hero .sub { font-size: 17px; margin-bottom: 14px; }
.hero .button { padding: 9px 18px; }
.hero .facts { margin: 18px 0 0; gap: 8px; }
.hero .facts li { font-size: 13px; padding: 4px 12px; }
.hero .twin-stage { height: clamp(400px, 50vw, 560px); margin-top: -8px; }
