/* =========================================================
   KEF DriveSense — stylesheet
   ========================================================= */
:root {
  --bg: #060b18;
  --bg-2: #0a1224;
  --surface: #0f1a30;
  --surface-2: #142240;
  --line: rgba(148, 178, 230, .12);
  --line-2: rgba(148, 178, 230, .22);
  --text: #e8eefb;
  --muted: #93a3bf;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --ok: #34d399;
  --warn: #f87171;
  --amber: #fbbf24;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font);
  --header-h: 72px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll, body.menu-open { overflow: hidden; }
img, video, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: #04121f; padding: 8px 14px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; white-space: nowrap;
  transition: transform .2s, background .2s, border-color .2s, box-shadow .2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121f;
  box-shadow: 0 10px 30px -10px rgba(56, 189, 248, .6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -10px rgba(56, 189, 248, .75); }
.btn-ghost { border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02); }
.btn-ghost:hover { border-color: var(--accent); background: rgba(56, 189, 248, .08); }
.btn-small { height: 36px; padding: 0 16px; font-size: .85rem; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled, body.menu-open .site-header {
  background: rgba(6, 11, 24, .78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-color: var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; }
.brand strong { font-weight: 700; color: var(--accent); }
.brand-mark { width: 30px; height: 30px; color: var(--text); }

.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: .92rem; font-weight: 500;
  transition: color .2s, background .2s;
}
.main-nav a:hover { color: var(--text); }
.main-nav a.is-current { color: var(--text); background: rgba(56, 189, 248, .1); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.lang-toggle {
  height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: .8rem; font-weight: 600; letter-spacing: .05em; color: var(--muted);
}
.lang-toggle .sep { opacity: .4; margin: 0 4px; }
.lang-toggle .is-on { color: var(--accent); }
.lang-toggle:hover { border-color: var(--accent); }

.tedu-badge {
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 14px 0 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2);
  font-size: .82rem; font-weight: 600; transition: border-color .2s;
}
.tedu-badge:hover { border-color: var(--accent); }
.tedu-logo {
  display: grid; place-items: center; height: 28px; padding: 0 8px; border-radius: 999px;
  background: #fff; color: #0b2f6b; font-family: var(--font-display); font-weight: 700; font-size: .72rem; letter-spacing: .06em;
}
.tedu-logo img { height: 22px; width: auto; }

.menu-btn { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); position: relative; }
.menu-btn span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s, top .25s; }
.menu-btn span:first-child { top: 15px; }
.menu-btn span:last-child { top: 23px; }
.menu-btn[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--header-h) + 40px) 0 80px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 75% 40%, rgba(56, 189, 248, .14), transparent 70%),
    radial-gradient(40% 40% at 15% 80%, rgba(129, 140, 248, .12), transparent 70%);
}
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .03); color: var(--muted); font-size: .82rem; font-weight: 500;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 700; margin: 22px 0 20px; letter-spacing: -.03em; }
.grad { background: linear-gradient(120deg, var(--accent) 10%, var(--accent-2) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.02rem, 1.4vw, 1.15rem); color: var(--muted); max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero-stats { display: flex; gap: 40px; margin: 48px 0 0; padding-top: 28px; border-top: 1px solid var(--line); max-width: 520px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats dt { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; }
.hero-stats dd { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }

.hero-visual { position: relative; justify-self: center; width: min(400px, 100%); }
.track { width: 100%; height: auto; overflow: visible; }
.lane-edge { stroke: rgba(232, 238, 251, .55); stroke-width: 3; }
.lane-center { stroke: var(--amber); stroke-width: 3; stroke-dasharray: 22 18; animation: lane 6s linear infinite; }
.obstacle rect:first-child { fill: var(--warn); stroke: none; }
.bbox { fill: none; stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 4 3; }
.bbox-label { fill: var(--warn); stroke: none; font: 600 10px/1 var(--font); letter-spacing: .04em; }
.obstacle .bbox, .obstacle .bbox-label { animation: detect 6s infinite; }
.car { animation: drive 6s cubic-bezier(.3, .6, .4, 1) infinite; }
.car-body { fill: #e8eefb; stroke: none; }
.car-glass { fill: #1e2f52; stroke: none; }
.wheel { fill: #0b1222; stroke: none; }
.cam { fill: var(--accent); stroke: none; }
.brake { fill: #5b1d1d; stroke: none; animation: brake 6s infinite; }
.beam { stroke: none; animation: beam 6s infinite; }

@keyframes drive { 0% { transform: translateY(40px); opacity: 0; } 8% { opacity: 1; } 50% { transform: translateY(-110px); } 80% { transform: translateY(-110px); opacity: 1; } 92%, 100% { transform: translateY(-110px); opacity: 0; } }
@keyframes lane { 0% { stroke-dashoffset: 0; } 50%, 100% { stroke-dashoffset: -160; } }
@keyframes detect { 0%, 22% { opacity: 0; } 28%, 85% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes brake { 0%, 49% { fill: #5b1d1d; } 50%, 80% { fill: #ff3b3b; filter: drop-shadow(0 0 6px #ff3b3b); } 81%, 100% { fill: #5b1d1d; } }
@keyframes beam { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }

.hud {
  position: absolute; right: -8px; bottom: 24px; min-width: 150px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(10, 18, 36, .8); border: 1px solid var(--line-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 600 .72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em;
  box-shadow: var(--shadow);
}
.hud-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; }
.hud-row span { color: var(--muted); }
.hud b { color: var(--text); font-weight: 600; }
.hud .ok { color: var(--ok); }
.hud .warn { color: var(--warn); }

/* ---------- sections ---------- */
.section { padding: clamp(80px, 11vw, 130px) 0; position: relative; }
.section-alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 52px; }
.kicker { color: var(--accent); font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 700; margin-bottom: 16px; }
.section-head p:not(.kicker) { color: var(--muted); font-size: 1.05rem; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- features ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature {
  position: relative; padding: 28px 24px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), rgba(15, 26, 48, .4));
  border: 1px solid var(--line); transition: border-color .3s, transform .3s;
}
.feature:hover { border-color: var(--line-2); transform: translateY(-4px); }
.feature:nth-child(2) { transition-delay: .06s; }
.feature:nth-child(3) { transition-delay: .12s; }
.feature:nth-child(4) { transition-delay: .18s; }
.feature-icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 22px;
  background: rgba(56, 189, 248, .1); color: var(--accent); border: 1px solid rgba(56, 189, 248, .25);
}
.feature-icon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 1.2rem; margin-bottom: 10px; }
.feature p { color: var(--muted); font-size: .95rem; }

/* ---------- architecture ---------- */
.arch { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 18px; align-items: center; }
.arch-col { display: flex; flex-direction: column; gap: 12px; }
.arch-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.node {
  padding: 18px 20px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: 4px;
}
.node b { font-family: var(--font-display); font-size: 1.05rem; }
.node small { color: var(--muted); font-size: .85rem; }
.node-accent { border-color: rgba(56, 189, 248, .5); background: linear-gradient(135deg, rgba(56, 189, 248, .14), rgba(129, 140, 248, .1)); padding: 30px 22px; }
.arch-arrow { width: 48px; height: 2px; background: linear-gradient(90deg, var(--line-2), var(--accent)); position: relative; margin-top: 24px; }
.arch-arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--accent); border-right: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.tags span { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-size: .85rem; }

/* ---------- roadmap ---------- */
.terms { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.term { padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.term:nth-child(2) { transition-delay: .08s; }
.term-head { display: flex; align-items: center; gap: 16px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.term-no { font: 700 2.2rem/1 var(--font-display); color: transparent; -webkit-text-stroke: 1px var(--accent); }
.term-head h3 { font-size: 1.2rem; }
.term-head p { color: var(--muted); font-size: .88rem; }
.term-focus { margin-left: auto; padding: 5px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--accent); background: rgba(56, 189, 248, .1); border: 1px solid rgba(56, 189, 248, .3); white-space: nowrap; }
.term:nth-child(2) .term-focus { color: #a5b4fc; background: rgba(129, 140, 248, .12); border-color: rgba(129, 140, 248, .35); }
.steps { list-style: none; margin: 0; padding: 0; }
.step { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; padding-bottom: 22px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: -2px; width: 2px; background: var(--line-2); }
.step:last-child::before { display: none; }
.step-dot { width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-2); position: relative; z-index: 1; }
.step-done .step-dot { background: var(--ok); border-color: var(--ok); }
.step-active .step-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px rgba(56, 189, 248, .18); }
.step-meta { display: flex; gap: 10px; font-size: .78rem; color: var(--muted); margin-bottom: 2px; }
.step-meta b { color: var(--accent); font-weight: 600; letter-spacing: .04em; }
.step-body p { font-weight: 500; font-size: .96rem; }
.step-status { font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.step-done .step-status { color: var(--ok); border-color: rgba(52, 211, 153, .4); }
.step-active .step-status { color: var(--accent); border-color: rgba(56, 189, 248, .4); }

/* ---------- reports ---------- */
.report-tools { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.search { position: relative; flex: 1 1 280px; max-width: 380px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; height: 44px; padding: 0 16px 0 42px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font: inherit; font-size: .95rem;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(56, 189, 248, .15); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: .85rem; font-weight: 500; color: var(--muted); transition: all .2s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-count { opacity: .6; margin-left: 4px; font-size: .78rem; }

.report-list { display: flex; flex-direction: column; gap: 12px; }
.report {
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center;
  padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s, background .2s;
}
.report:hover { border-color: var(--line-2); background: var(--surface-2); }
.report.is-pending { background: transparent; border-style: dashed; }
.report.is-clickable { cursor: pointer; }
.report.is-clickable:hover h3 { color: var(--accent); }
.report-title { text-align: left; font: inherit; color: inherit; transition: color .2s; }
.code { font: 700 .72rem/1 var(--font-display); color: var(--accent); letter-spacing: .06em; }
.report.is-pending .file-icon { opacity: .45; }
.report-main { min-width: 0; }
.report-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.report h3 { font-size: 1.08rem; font-weight: 600; margin-bottom: 4px; }
.report p { color: var(--muted); font-size: .92rem; }
.report-actions { display: flex; gap: 8px; }
.badge-soon { font-size: .78rem; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--line-2); white-space: nowrap; }

.cat { font-weight: 600; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; background: rgba(148, 178, 230, .1); color: var(--text); }
.cat-proposal { background: rgba(45, 212, 191, .14); color: #5eead4; }
.cat-specs { background: rgba(56, 189, 248, .14); color: #7dd3fc; }
.cat-analysis { background: rgba(251, 191, 36, .14); color: #fcd34d; }
.cat-backlog { background: rgba(148, 178, 230, .12); color: #cbd5e1; }
.cat-design { background: rgba(129, 140, 248, .16); color: #a5b4fc; }
.cat-presentation { background: rgba(244, 114, 182, .14); color: #f9a8d4; }
.cat-test { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
.cat-final { background: rgba(248, 113, 113, .14); color: #fca5a5; }

.file-icon {
  width: 48px; height: 58px; border-radius: 6px 14px 6px 6px; display: grid; place-items: end center; padding-bottom: 8px;
  background: linear-gradient(160deg, var(--surface-2), #1b2b4d); border: 1px solid var(--line-2);
  font: 700 .66rem/1 var(--font-display); letter-spacing: .08em; color: var(--muted);
}
.file-pdf { color: #fca5a5; border-color: rgba(248, 113, 113, .35); }
.file-docx, .file-doc { color: #93c5fd; border-color: rgba(96, 165, 250, .35); }
.file-pptx, .file-ppt { color: #fdba74; border-color: rgba(251, 146, 60, .35); }
.file-zip { color: #fcd34d; }

.empty { color: var(--muted); padding: 40px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------- media ---------- */
.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 28px; }
.tab { height: 38px; padding: 0 20px; border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--muted); transition: all .2s; }
.tab.is-active { background: var(--text); color: var(--bg); }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.video-card { text-align: left; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform .25s, border-color .25s; }
.video-card:hover { transform: translateY(-4px); border-color: var(--line-2); }
.video-thumb { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.video-thumb img, .video-thumb video { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.video-card:hover .video-thumb img, .video-card:hover .video-thumb video { transform: scale(1.04); }
.play {
  position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; transform: translate(-50%, -50%);
  border-radius: 50%; display: grid; place-items: center;
  background: rgba(6, 11, 24, .6); border: 1px solid rgba(255, 255, 255, .3); backdrop-filter: blur(6px);
  transition: background .2s;
}
.play svg { width: 22px; height: 22px; fill: #fff; stroke: none; margin-left: 3px; }
.video-card:hover .play { background: var(--accent); }
.video-info { padding: 16px 18px 20px; }
.video-info h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 4px; }
.video-info time { font-size: .8rem; color: var(--muted); }
.video-info p { color: var(--muted); font-size: .9rem; margin-top: 8px; }

.photo-grid { columns: 3 280px; column-gap: 16px; }
.photo { position: relative; display: block; width: 100%; margin-bottom: 16px; border-radius: var(--radius-sm); overflow: hidden; break-inside: avoid; border: 1px solid var(--line); }
.photo img { width: 100%; height: auto; transition: transform .5s; }
.photo:hover img { transform: scale(1.04); }
.photo-cap {
  position: absolute; inset: auto 0 0; padding: 30px 14px 12px; font-size: .85rem; text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75)); opacity: 0; transition: opacity .3s;
}
.photo:hover .photo-cap, .photo:focus-visible .photo-cap { opacity: 1; }

.video-grid.is-empty, .photo-grid.is-empty { display: block; columns: auto; }
.media-empty {
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  padding: 64px 24px; border-radius: var(--radius); border: 1px dashed var(--line-2); color: var(--muted);
}
.media-empty svg { width: 40px; height: 40px; color: var(--accent); opacity: .8; }
.media-empty p { max-width: 420px; }

/* ---------- team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.member { padding: 32px 24px; text-align: center; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.avatar {
  width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); padding: 3px;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font: 700 1.6rem/1 var(--font-display); }
.member h3 { font-size: 1.1rem; margin-bottom: 4px; }
.member p { color: var(--muted); font-size: .9rem; }
.member-advisor { background: transparent; border-style: dashed; }
.member-advisor .avatar { background: var(--line-2); }
.member-links { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.member-links a { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); color: var(--muted); }
.member-links a:hover { color: var(--accent); border-color: var(--accent); }
.member-links svg { width: 18px; height: 18px; }

.sub-head { font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 48px 0 18px; }
.faculty-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.member-faculty { background: transparent; border-style: dashed; }
.member-faculty .avatar { width: 84px; height: 84px; background: var(--line-2); }

/* ---------- footer ---------- */
.site-footer { padding: 48px 0 40px; border-top: 1px solid var(--line); }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; align-items: start; }
.footer-inner .brand { margin-bottom: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: .92rem; color: var(--muted); }
.footer-links a:hover { color: var(--accent); }
.footer-inner > .small { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 14, .82); backdrop-filter: blur(6px); animation: fade .2s; }
.modal-box {
  position: relative; width: min(720px, 100%); max-height: calc(100svh - 48px); display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  animation: pop .25s cubic-bezier(.2, .8, .3, 1.2);
}
.modal.is-wide .modal-box { width: min(1100px, 100%); }
.modal-head { display: flex; align-items: center; gap: 16px; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 1rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn:hover { background: rgba(255, 255, 255, .08); }
.icon-btn svg { width: 20px; height: 20px; }
.modal-body { overflow: auto; flex: 1; }
.pdf-frame { width: 100%; height: min(80svh, 900px); border: 0; background: #fff; }
.ratio { position: relative; aspect-ratio: 16 / 9; background: #000; }
.ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.modal-video { width: 100%; max-height: 75svh; background: #000; }
.modal-caption { padding: 14px 22px 18px; color: var(--muted); font-size: .92rem; }
.lightbox { position: relative; background: #000; display: grid; place-items: center; }
.lightbox-img { max-height: 75svh; width: auto; margin: 0 auto; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(6, 11, 24, .6); border: 1px solid rgba(255, 255, 255, .2);
}
.lb-nav:hover { background: var(--accent); color: #04121f; }
.lb-nav svg { width: 22px; height: 22px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.no-preview { padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; color: var(--muted); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .terms { grid-template-columns: 1fr; }
  .faculty-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 920px) {
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto; flex-direction: column; gap: 0; margin: 0;
    padding: 12px 16px 24px; background: rgba(6, 11, 24, .97); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .25s;
  }
  .main-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .main-nav a { padding: 14px 8px; border-radius: 8px; font-size: 1.05rem; }
  .menu-btn { display: block; }
  .header-actions { margin-left: auto; }

  .hero { min-height: auto; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero-visual { width: min(320px, 80%); order: -1; }
  .hero-visual .hud { right: -24px; }

  .arch { grid-template-columns: 1fr; }
  .arch-arrow { width: 2px; height: 32px; margin: 0 auto; background: linear-gradient(180deg, var(--line-2), var(--accent)); }
  .arch-arrow::after { right: -4px; top: auto; bottom: -1px; border: 5px solid transparent; border-top: 7px solid var(--accent); border-bottom: 0; }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .tedu-text { display: none; }
  .header-inner { gap: 12px; }
  .header-actions { gap: 8px; }
  .brand { font-size: 1rem; gap: 8px; }
  .brand-mark { width: 26px; height: 26px; }
  .lang-toggle { padding: 0 10px; }
  .hero-visual { width: min(260px, 72%); }
  .tedu-badge { padding: 0 6px; }
  .hero-stats { gap: 24px; }
  .hero-stats dt { font-size: 1.6rem; }
  .features, .team-grid { grid-template-columns: 1fr; }
  .term { padding: 22px 18px; }
  .term-head { flex-wrap: wrap; }
  .term-focus { margin-left: 0; }
  .step { grid-template-columns: auto 1fr; }
  .step-status { grid-column: 2; justify-self: start; margin-top: -8px; }
  .faculty-grid { grid-template-columns: 1fr; }
  .report { grid-template-columns: auto 1fr; padding: 18px; gap: 14px 16px; }
  .report-actions { grid-column: 1 / -1; }
  .report-actions .btn { flex: 1; }
  .video-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .modal { padding: 0; }
  .modal-box, .modal.is-wide .modal-box { width: 100%; max-height: 100svh; height: 100%; border-radius: 0; border: 0; }
  .modal-body { display: flex; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .car, .obstacle .bbox, .obstacle .bbox-label, .brake { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
