:root {
  --bg: #0e0e10;
  --bg-alt: #161618;
  --card: #1c1c1f;
  --text: #eceef0;
  --text-dim: #9a9ca1;
  --accent: #e8a33d;
  --accent-dim: #8a6224;
  --line: #2c2c30;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}
a { color: var(--accent); }
img, svg { max-width: 100%; }

/* Nav */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14,14,16,0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 20px;
  overflow-x: auto;
  white-space: nowrap;
}
nav .brand {
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-right: 20px;
  padding: 16px 0;
  color: var(--accent);
  flex-shrink: 0;
  text-decoration: none;
}
nav a.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  padding: 16px 9px;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
}
nav a.nav-link:hover, nav a.nav-link.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Page hero */
header.page-hero {
  padding: 64px 20px 50px;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(232,163,61,0.14), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--line);
}
header.page-hero .inner { max-width: 780px; margin: 0 auto; }
.breadcrumb {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
header.page-hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  margin: 0 0 14px;
  font-weight: 800;
}
header.page-hero p.dek {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 680px;
  margin: 0;
}

/* Home hero */
header.hero {
  padding: 100px 20px 80px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(232,163,61,0.15), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--line);
}
header.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 18px;
}
header.hero h1 { font-size: clamp(32px, 6vw, 56px); margin: 0 0 18px; font-weight: 800; }
header.hero p { color: var(--text-dim); max-width: 620px; margin: 0 auto; font-size: 17px; }
.frame-bars { display: flex; justify-content: center; gap: 6px; margin-top: 36px; }
.frame-bars span { width: 28px; height: 4px; background: var(--accent-dim); border-radius: 2px; }
.frame-bars span:nth-child(3) { background: var(--accent); }

/* Layout */
main { max-width: 820px; margin: 0 auto; padding: 0 20px; }
main.wide { max-width: 1040px; }

article section.block { padding: 46px 0; border-bottom: 1px solid var(--line); }
article section.block:last-of-type { border-bottom: none; }
article h2 { font-size: 24px; margin: 0 0 14px; }
article h2 .num { color: var(--accent); font-size: 13px; letter-spacing: 2px; display: block; margin-bottom: 8px; font-weight: 700; text-transform: uppercase; }
article h3.sub { font-size: 18px; margin: 34px 0 6px; }
article p { font-size: 15.5px; color: var(--text); }
article p.lead { font-size: 17px; color: var(--text-dim); }
article p.sub-lead { color: var(--text-dim); font-size: 14.5px; margin: 0 0 16px; }
article ul, article ol { font-size: 15px; color: var(--text); padding-left: 22px; }
article li { margin-bottom: 6px; }
article strong { color: var(--text); }
article em.term { color: var(--accent); font-style: normal; font-weight: 600; }

/* Card grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.card h3 { margin: 12px 0 6px; font-size: 16px; }
.card h4 { margin: 0 0 6px; font-size: 15px; }
.card p { margin: 0 0 8px; color: var(--text-dim); font-size: 13.5px; }
.card p.example { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--accent); }
.card p.example b { color: var(--accent); font-weight: 600; }

/* Topic index cards on home */
.topic-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, transform .15s;
}
.topic-card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.topic-card .n { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; }
.topic-card h3 { margin: 8px 0 6px; font-size: 17px; }
.topic-card p { margin: 0; color: var(--text-dim); font-size: 13.5px; }

/* Diagrams (shared visual language for a "camera frame") */
.diagram, .angle-diagram, .move-diagram, .light-diagram, .thirds-demo, .depth-demo, .frame-in-frame {
  width: 100%;
  aspect-ratio: 16/10;
  background: #0a0a0c;
  border: 1px solid var(--line);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.diagram { display: flex; align-items: flex-end; justify-content: center; }
.figure { background: #4a4a52; border-radius: 40% 40% 0 0; }
.figure-head { width: 22%; aspect-ratio: 1/1; background: #4a4a52; border-radius: 50%; position: absolute; left: 50%; transform: translateX(-50%); }

.shot-ecu .figure-head { width: 70%; top: -10%; }
.shot-ecu .figure { display:none; }
.shot-cu .figure-head { width: 46%; top: 4%; }
.shot-cu .figure { width: 90%; height: 46%; bottom: -20%; }
.shot-mcu .figure-head { width: 30%; top: 4%; }
.shot-mcu .figure { width: 70%; height: 60%; bottom: -8%; }
.shot-ms .figure-head { width: 18%; top: 6%; }
.shot-ms .figure { width: 46%; height: 78%; bottom: 0; }
.shot-ws .figure-head { width: 8%; top: 12%; }
.shot-ws .figure { width: 20%; height: 55%; bottom: 0; }
.shot-ews .figure-head { width: 3.5%; top: 30%; }
.shot-ews .figure { width: 8%; height: 30%; bottom: 0; }
.shot-ews::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(transparent 60%, rgba(255,255,255,0.02) 60%),
    linear-gradient(90deg, transparent 0 20%, rgba(255,255,255,0.02) 20% 21%, transparent 21%);
}
.shot-two { display:flex; align-items:flex-end; justify-content: center; gap: 14%; }
.shot-two .col { display:flex; flex-direction:column; align-items:center; }
.shot-two .figure-head { position: static; width: 34px; height: 34px; }
.shot-two .figure { width: 56px; height: 70%; position: static; }
.shot-ots { display:flex; align-items:flex-end; justify-content: flex-start; padding-left: 8%; }
.shot-ots .fg-head { width: 30%; aspect-ratio:1/1.3; background:#111; border-radius: 50% 50% 45% 45%; position:absolute; left:-6%; bottom:-14%; }
.shot-ots .figure-head { width: 20%; top: 10%; }
.shot-ots .figure { width: 40%; height: 60%; bottom: 0; }
.shot-insert { display:flex; align-items:center; justify-content:center; }
.shot-insert .obj { width: 40%; aspect-ratio: 1/1; background: #4a4a52; border-radius: 6px; }

.angle-diagram { display: flex; align-items: center; justify-content: center; }
.angle-diagram .figure-head { position: static; transform: none; width: 24px; height: 24px; }
.angle-diagram .figure { width: 46px; height: 70px; margin-top: -4px; }
.angle-eye .col { display:flex; flex-direction:column; align-items:center; }
.angle-low .col { display:flex; flex-direction:column; align-items:center; transform: scale(1.5, 1.15); transform-origin: bottom; }
.angle-high .col { display:flex; flex-direction:column; align-items:center; transform: scale(0.7,0.85) translateY(-8px); }
.angle-dutch .col { display:flex; flex-direction:column; align-items:center; transform: rotate(-14deg); }
.angle-bird .figure-head { border-radius: 50%; width: 34px; height: 34px; }
.angle-bird .figure { display:none; }
.angle-pov { color:var(--accent); font-size:30px; display:flex; align-items:center; justify-content:center; }

.move-diagram { display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--accent); }

.thirds-demo { background: linear-gradient(135deg,#1a2530,#0a0a0c 70%); }
.thirds-demo .grid-lines { position: absolute; inset: 0;
  background-image: linear-gradient(to right, rgba(255,255,255,0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.18) 1px, transparent 1px);
  background-size: 33.333% 33.333%; }
.thirds-demo .subject { position: absolute; width: 14%; aspect-ratio: 1/2.2; background: var(--accent); border-radius: 40% 40% 0 0; left: 33.333%; bottom: 0; transform: translateX(-50%); opacity: 0.85; }
.thirds-demo .horizon { position: absolute; left:0; right:0; top: 66.666%; height: 2px; background: rgba(255,255,255,0.3); }

.depth-demo { background: linear-gradient(#0a141f, #0a0a0c 75%); }
.depth-demo .layer { position: absolute; bottom: 0; border-radius: 30% 30% 0 0; }
.depth-demo .bg { width: 100%; height: 30%; background: #182230; left:0; }
.depth-demo .mid { width: 34%; height: 55%; background: #333640; left: 18%; }
.depth-demo .fg { width: 46%; height: 90%; background: #050506; left: -10%; opacity: 0.9; }

.frame-in-frame { display:flex; align-items:center; justify-content:center; }
.frame-in-frame .inner-frame { width: 55%; height: 65%; border: 10px solid #050506; display:flex; align-items:flex-end; justify-content:center; }
.frame-in-frame .figure { width: 34%; height: 60%; }
.frame-in-frame .figure-head { position: static; width: 40px; height: 40px; margin-bottom: 4px; }
.frame-in-frame .inner-frame .col { display:flex; flex-direction:column; align-items:center; }

.light-diagram { display: flex; align-items: flex-end; justify-content: center; }
.light-diagram .subject-head { width: 20%; aspect-ratio: 1/1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #6b6b74, #2c2c30); margin-bottom: 8%; }
.light-dot { position: absolute; width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 14px 4px currentColor; }
.key { color: #ffd27a; background: #ffd27a; top: 30%; left: 22%; }
.fill { color: #7ab8ff; background: #7ab8ff; top: 40%; right: 20%; opacity: 0.7; }
.back { color: #ffffff; background: #ffffff; top: 12%; left: 50%; opacity: 0.8; }

.direction-row { display:flex; justify-content:space-between; gap:8px; }
.direction-row .dpt { text-align:center; flex:1; }
.direction-row .dpt .dot { width:34px; height:34px; border-radius:50%; margin:0 auto 6px; background:#2c2c30; position:relative; }
.direction-row .dpt .dot::after { content:""; position:absolute; width:8px; height:8px; border-radius:50%; background: var(--accent); box-shadow:0 0 8px 2px var(--accent); }
.lt-front .dot::after { top:-3px; left:50%; transform:translateX(-50%); }
.lt-side .dot::after { top:50%; left:-3px; transform:translateY(-50%); }
.lt-back .dot::after { bottom:-3px; left:50%; transform:translateX(-50%); }
.lt-top .dot::after { top:-3px; left:50%; transform:translateX(-50%); box-shadow:0 0 10px 3px var(--accent); }
.lt-under .dot::after { bottom:-3px; left:50%; transform:translateX(-50%); }
.direction-row .dpt span { font-size: 11.5px; color: var(--text-dim); }

.temp-bar { height: 26px; border-radius: 6px; background: linear-gradient(90deg, #ff8a3d, #ffd27a, #fff7e8, #cfe4ff, #7ab8ff); margin: 14px 0 6px; }
.temp-labels { display:flex; justify-content:space-between; font-size: 11.5px; color: var(--text-dim); flex-wrap: wrap; gap: 6px; }

svg.diagram-svg { width: 100%; aspect-ratio: 16/11; background: #0a0a0c; border: 1px solid var(--line); border-radius: 6px; }

/* Image placeholders — swap in real photos/stills later by dropping a file
   into images/ with the exact filename shown in each placeholder. */
.img-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: #0a0a0c;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.img-frame.ar-4-3 { aspect-ratio: 4/3; }
.img-frame.ar-16-9 { aspect-ratio: 16/9; }
.img-frame.ar-185 { aspect-ratio: 1.85/1; }
.img-frame.ar-239 { aspect-ratio: 2.39/1; }
.img-frame.ar-1-1 { aspect-ratio: 1/1; }
.img-frame.ar-9-16 { aspect-ratio: 9/16; }
.img-frame img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.light-diagram img { cursor: zoom-in; }

/* Lightbox: click any loaded photo to view it at full size */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(5,5,6,0.92);
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
  padding: 28px;
  z-index: 1000;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img {
  max-width: 92vw; max-height: 84vh;
  width: auto; height: auto;
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6);
  cursor: zoom-out;
}
.lightbox-caption { color: var(--text-dim); font-size: 13px; text-align: center; max-width: 80vw; }
.lightbox-close {
  position: fixed; top: 18px; right: 22px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,0.18); }
.img-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; padding: 10px;
  box-sizing: border-box;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: repeating-linear-gradient(45deg, #0a0a0c, #0a0a0c 10px, #101013 10px, #101013 20px);
}
.img-placeholder .ph-icon { font-size: 22px; opacity: 0.45; }
.img-placeholder .ph-label { font-size: 12.5px; color: var(--text-dim); }
.img-placeholder .ph-file { font-size: 10.5px; color: var(--accent-dim); font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* Tables */
table.spec { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
table.spec th, table.spec td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.spec th { color: var(--accent); font-weight: 600; }
table.spec td.dim { color: var(--text-dim); }

.tag {
  display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent); background: rgba(232,163,61,0.1); border: 1px solid var(--accent-dim);
  padding: 3px 8px; border-radius: 20px; margin-bottom: 8px;
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

.callout {
  background: rgba(232,163,61,0.06);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 14.5px;
  color: var(--text);
  margin-top: 20px;
}
.callout b { color: var(--accent); }
.callout.quote { font-style: italic; border-color: var(--line); background: var(--card); }
.callout.quote cite { display:block; margin-top:8px; font-style: normal; font-size: 12.5px; color: var(--text-dim); }

/* Mood board / look book */
.moodboard-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.moodboard-grid .swatch {
  aspect-ratio: 4/3; border-radius: 6px; border: 1px solid var(--line);
  display:flex; align-items:flex-end; padding: 8px; position: relative; overflow: hidden;
}
.moodboard-grid .swatch span {
  font-size: 11px; color: rgba(255,255,255,0.85); background: rgba(0,0,0,0.4);
  padding: 3px 7px; border-radius: 4px; letter-spacing: 0.3px;
}

/* References */
.references {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-top: 10px;
}
.references h2 { margin-top: 0; }
.references ol { padding-left: 20px; margin: 0; }
.references li { margin-bottom: 12px; font-size: 14.5px; color: var(--text-dim); }
.references li .cite-title { color: var(--text); font-style: italic; }
.references li .cite-note { display:block; margin-top: 2px; font-size: 13px; color: var(--text-dim); }

/* Pagination */
.pagination {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 34px 0 10px; flex-wrap: wrap;
}
.pagination a {
  flex: 1; min-width: 200px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; text-decoration: none; color: var(--text);
}
.pagination a:hover { border-color: var(--accent-dim); }
.pagination .dir { display:block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); margin-bottom: 4px; }
.pagination a.next { text-align: right; }

footer {
  text-align: center;
  padding: 50px 20px 70px;
  color: var(--text-dim);
  font-size: 13px;
}
footer a { color: var(--text-dim); }

/* Quiz */
.quiz { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 20px; }
.quiz button {
  background: none; border: 1px solid var(--line); color: var(--text);
  padding: 10px 14px; border-radius: 6px; display: block; width: 100%;
  text-align: left; margin-bottom: 8px; cursor: pointer; font-size: 14px;
}
.quiz button:hover { border-color: var(--accent-dim); }
.quiz button.correct { border-color: #4caf50; background: rgba(76,175,80,0.1); }
.quiz button.wrong { border-color: #e05252; background: rgba(224,82,82,0.1); }
.quiz .feedback { margin-top: 10px; font-size: 13.5px; color: var(--text-dim); min-height: 20px; }
#quiz-score { text-align:center; font-size: 15px; margin-top: 24px; color: var(--text-dim); }
#quiz-score b { color: var(--accent); }

/* Glossary */
.glossary-list { columns: 2; column-gap: 32px; }
@media (max-width: 640px) { .glossary-list { columns: 1; } }
.glossary-item { break-inside: avoid; margin-bottom: 16px; }
.glossary-item dt { color: var(--accent); font-weight: 600; font-size: 14.5px; }
.glossary-item dd { margin: 2px 0 0; color: var(--text-dim); font-size: 13.5px; }
.glossary-jump { display:flex; flex-wrap:wrap; gap:6px; margin-bottom: 30px; }
.glossary-jump a {
  text-decoration:none; color: var(--text-dim); border:1px solid var(--line); border-radius:6px;
  padding: 4px 9px; font-size: 12.5px;
}
.glossary-jump a:hover { color: var(--accent); border-color: var(--accent-dim); }
.glossary-list h3 { color: var(--accent); font-size: 14px; letter-spacing: 1px; margin: 20px 0 8px; break-after: avoid; }
