:root {
  --orange: #ff6428;
  --black: #080808;
  --panel: #151515;
  --panel-2: #1c1c1c;
  --white: #f8f8f5;
  --muted: #aaa;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--white);
  background: var(--black);
}

* { box-sizing: border-box; }
html { background: var(--black); }
body { margin: 0; min-width: 320px; background: var(--black); color: var(--white); }
button, input { font: inherit; }
button { color: inherit; }

.site-header {
  min-height: 110px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 22px clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-columns: 90px 1fr 90px;
  align-items: center;
  gap: 20px;
}

.brand {
  width: 64px;
  height: 64px;
  padding: 0;
  justify-self: start;
  border: 5px solid var(--orange);
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.brand span { font-size: 13px; line-height: .88; font-weight: 950; letter-spacing: -.25px; }
.main-nav { display: flex; justify-content: center; gap: 8px; }
.nav-button, .language-button {
  border: 1px solid #383838;
  border-radius: 999px;
  background: #111;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
}
.nav-button:hover, .language-button:hover, .nav-button.is-active { border-color: var(--orange); color: var(--orange); }
.language-button { justify-self: end; min-width: 54px; }

main { max-width: 1500px; margin: 0 auto; padding: 20px clamp(20px, 4vw, 64px) 64px; }
.view { display: none; }
.view.is-active { display: block; }

.triangle-layout {
  display: grid;
  grid-template-columns: minmax(420px, .88fr) minmax(540px, 1.25fr);
  gap: clamp(40px, 6vw, 100px);
  align-items: start;
}

.triangle-wrap { position: relative; width: 100%; max-width: 590px; margin: 0 auto; user-select: none; touch-action: none; }
.triangle-svg { display: block; width: 100%; height: auto; overflow: visible; }
.triangle-line { fill: none; stroke: var(--orange); stroke-width: 37; stroke-linecap: round; stroke-linejoin: round; }
.hit-line { fill: none; stroke: transparent; stroke-width: 76; cursor: pointer; }
.edge-label, .endpoint { fill: var(--orange); font-weight: 900; letter-spacing: .06em; pointer-events: none; }
.edge-label { fill: var(--orange); font-size: 17px; text-anchor: middle; dominant-baseline: central; letter-spacing: 0; }
.endpoint { fill: var(--orange); font-size: 30px; text-anchor: middle; dominant-baseline: central; letter-spacing: 0; }
.knob { cursor: grab; outline: none; }
.knob:active { cursor: grabbing; }
.knob circle { fill: var(--panel); stroke: var(--orange); stroke-width: 9; }
.knob text { fill: var(--white); font-size: 22px; font-weight: 950; pointer-events: none; }
.knob[data-knob="iso"] text { font-size: 14px; }
.knob:focus-visible circle { stroke: var(--white); }
.balance-mark circle { fill: var(--panel); stroke: var(--orange); stroke-width: 5; }
.balance-mark text { fill: var(--orange); font-size: 24px; font-weight: 950; }

.aperture-help, .small-help {
  border: 3px solid #aaa;
  border-radius: 50%;
  background: #111;
  color: #ddd;
  font-weight: 900;
  cursor: pointer;
}
.aperture-help { position: absolute; right: 1%; top: 24%; width: 42px; height: 42px; font-size: 23px; }
.small-help { width: 30px; height: 30px; }

.photo-stage, .lesson-photo {
  position: relative;
  overflow: hidden;
  background: #111;
  border: 7px solid var(--orange);
  border-radius: 18px;
}
.photo-stage { aspect-ratio: 16 / 9; }
.photo-layer, .lesson-photo img, .grain-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo-layer, .lesson-photo img { object-fit: cover; }
.grain-layer { pointer-events: none; }
.exposure-state {
  position: absolute;
  top: 16px;
  right: 16px;
  border: 1px solid #666;
  border-radius: 13px;
  background: rgba(8, 8, 8, .82);
  padding: 10px 16px;
  font-weight: 950;
  letter-spacing: .07em;
}

.section-caption, .explanation-panel { margin-top: 30px; text-align: center; }
.section-caption h1, .explanation-panel h2, .lessons-heading h1, .lesson-card h2 { margin: 0 0 7px; color: var(--orange); font-size: clamp(1rem, 1.7vw, 1.35rem); letter-spacing: .02em; }
.section-caption p, .explanation-panel p { max-width: 620px; margin: 0 auto; line-height: 1.45; }
.explanation-panel { min-height: 120px; }

.lessons-heading { max-width: 760px; margin: 0 auto 34px; text-align: center; }
.lessons-heading p { margin: 0; color: #ccc; font-size: 1.05rem; }
.lesson-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.lesson-card { overflow: hidden; border: 1px solid #2d2d2d; border-radius: 22px; background: var(--panel); }
.lesson-photo { aspect-ratio: 4 / 3; border: 0; border-bottom: 4px solid var(--orange); border-radius: 0; }
.lesson-photo-blend img[data-effect-image] { opacity: .5; }
.lesson-body { padding: 24px; }
.lesson-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lesson-card h2 { font-size: 1.25rem; }
.lesson-card input[type="range"] { width: 100%; accent-color: var(--orange); cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; margin-top: 5px; color: #aaa; font-size: .82rem; font-weight: 800; }
.lesson-card p { min-height: 88px; margin: 18px 0 0; line-height: 1.45; }

footer { max-width: 1500px; margin: 0 auto; padding: 24px clamp(20px, 4vw, 64px); border-top: 1px solid #222; display: flex; justify-content: space-between; color: #888; font-size: .85rem; }

.help-dialog { max-width: 590px; border: 2px solid var(--orange); border-radius: 22px; background: var(--panel); color: var(--white); padding: 32px; }
.help-dialog::backdrop { background: rgba(0,0,0,.8); }
.help-dialog h2 { margin-top: 0; padding-right: 32px; color: var(--orange); }
.help-dialog p { line-height: 1.55; }
.help-dialog strong { color: var(--orange); }
.dialog-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; font-size: 34px; cursor: pointer; }

@media (max-width: 1040px) {
  .triangle-layout { grid-template-columns: 1fr; }
  .photo-column { display: grid; grid-template-columns: 1.2fr .8fr; gap: 25px; align-items: start; }
  .explanation-panel { margin-top: 0; text-align: left; }
  .lesson-grid { grid-template-columns: 1fr; max-width: 760px; margin: 0 auto; }
  .lesson-card { display: grid; grid-template-columns: 1.15fr .85fr; }
  .lesson-photo { height: 100%; min-height: 300px; border-bottom: 0; border-right: 4px solid var(--orange); }
}

@media (max-width: 700px) {
  .site-header { grid-template-columns: 68px 1fr 58px; padding: 16px; gap: 8px; }
  .brand { width: 58px; height: 58px; }
  .main-nav { overflow-x: auto; justify-content: flex-start; }
  .nav-button { white-space: nowrap; padding: 9px 13px; font-size: .82rem; }
  .language-button { padding: 9px 12px; }
  main { padding: 12px 12px 50px; }
  .triangle-wrap { max-width: 520px; }
  .triangle-svg .edge-label { font-size: 15px; }
  .photo-column { display: block; }
  .explanation-panel { margin-top: 24px; text-align: center; }
  .lesson-card { display: block; }
  .lesson-photo { min-height: 0; border-right: 0; border-bottom: 4px solid var(--orange); }
  footer { margin: 0 12px; padding: 20px 0; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: no-preference) {
  .photo-layer, .lesson-photo img[data-effect-image] { transition: opacity .14s linear; }
  .view.is-active { animation: reveal .22s ease-out; }
  @keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
}

/* Safari needs the prefixed property on SVG descendants as well. */
.triangle-wrap, .triangle-wrap * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
html.triangle-dragging, html.triangle-dragging * {
  -webkit-user-select: none !important;
  user-select: none !important;
  cursor: grabbing !important;
}
.value-bubble { pointer-events: none; }
.value-connector, .value-handle, .value-rim { fill: #fff; }
.value-handle-inner { fill: var(--black); }
.value-bubble text { fill: var(--orange); font-size: 23px; font-weight: 900; }
.value-bubble text.is-long { font-size: 19px; }

/* Shared rows keep both desktop captions at exactly the same height. */
@media (min-width: 1041px) {
  .triangle-layout { row-gap: 30px; }
  .triangle-column, .photo-column { display: contents; }
  .triangle-wrap { grid-column: 1; grid-row: 1; }
  .photo-stage { grid-column: 2; grid-row: 1; align-self: end; width: 100%; }
  .section-caption { grid-column: 1; grid-row: 2; margin-top: 0; }
  .explanation-panel { grid-column: 2; grid-row: 2; margin-top: 0; }
}

.value-bubble .value-handle-label { fill: #fff; font-size: 22px; font-weight: 950; }
.value-bubble .value-handle-label.is-iso { font-size: 17px; }
footer a, .about-button { color: inherit; text-decoration: none; }
.about-button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.footer-project { display: flex; gap: 10px; align-items: center; }
footer a:focus-visible, .about-button:focus-visible { outline: 2px solid var(--orange); outline-offset: 5px; }

/* Permanent outer scale landmarks, matching the reference sketch. */
.axis-landmarks { pointer-events: none; color: #9d3914; }
.axis-landmarks.is-active { color: var(--orange); }
.axis-landmarks text {
  fill: currentColor;
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

.axis-landmarks line { stroke: currentColor; stroke-width: 3px; }
