.ridge-hero {
  --ridge-paper: #101b16;
  --ridge-ink: #e6f1e9;
  --ridge-muted: #a0b4a8;
  --ridge-edge: #34463d;
  --ridge-green: #a9e9c4;
  --ridge-display: var(--display, Didot, 'Songti SC', serif);
  --ridge-mono: var(--mono, 'IBM Plex Mono', Menlo, monospace);
  color: var(--ridge-ink);
}
.ridge-landscape { position: relative; min-width: 0 }
.ridge-intro { min-width: 0; margin-bottom: clamp(27px, 4vh, 46px) }
.ridge-intro :is(h1, h2) { margin: .4em 0 0; font: 600 clamp(29px, 3.1vw, 48px)/1.17 var(--ridge-display); letter-spacing: -.035em }
.ridge-intro :is(h1, h2) span, .ridge-lead span { white-space: nowrap }
.ridge-total { margin: 8px 0 0; font: 500 clamp(66px, 8.5vw, 131px)/1 var(--ridge-display); letter-spacing: -.055em; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums }
.ridge-total small { margin-left: .12em; font-size: .4em; letter-spacing: 0; color: var(--ridge-green) }
.ridge-lead { max-width: 43ch; margin: 12px 0 0; font-size: clamp(14px, 1vw, 16px); line-height: 1.6; color: var(--ridge-muted); text-wrap: pretty }

.ridge-plot { position: relative; min-width: 0; height: clamp(270px, 35vh, 350px) }
.ridge-lines, .ridge-overlay { position: absolute; display: block; inset: 0; width: 100%; height: 100%; pointer-events: none }
.ridge-plot svg text { font: 11px var(--ridge-mono); fill: var(--ridge-muted) }
.terrain-floor { fill: #10241c; stroke: #405b4a; stroke-width: .75 }
.terrain-plinth-front { fill: #21392e; stroke: #344e3f; stroke-width: .75 }
.terrain-plinth-side { fill: #385545; stroke: #486954; stroke-width: .75 }
.terrain-grid { fill: none; stroke: #54715f; stroke-width: .7; opacity: .69 }
.terrain-roof.sunlit { fill: #547b65 }
.terrain-roof.shaded { fill: #273f34 }
.terrain-contour, .terrain-rib, .terrain-rim, .terrain-profile, .terrain-baseline, .terrain-seam { fill: none; stroke-linejoin: round }
.terrain-contour { stroke: #a8dbb9; stroke-width: .8; opacity: .77 }
.terrain-rib { stroke: #7d9f84; stroke-width: .65 }
.terrain-front { fill: #294237 }
.terrain-end { fill: #344e3e; stroke: #658a71; stroke-width: .8 }
.terrain-seam { stroke: #162f24; stroke-width: 1.15 }
.terrain-rim { stroke: #b7d7be; stroke-width: 1 }
.terrain-profile { stroke: #d8ebd8; stroke-width: 1.4 }
.terrain-rise { stroke: #9affcb; stroke-width: 2.25 }
.terrain-baseline { stroke: #6f8a77; stroke-width: .8 }
.ahead-of-cut .terrain-roof, .ahead-of-cut .terrain-end { fill-opacity: .28 }
.ahead-of-cut .terrain-front, .ahead-of-cut .terrain-stratum { opacity: .22 }
.ahead-of-cut .terrain-profile, .ahead-of-cut .terrain-contour { opacity: .55 }
.ridge-plot.is-dragging .ahead-of-cut :is(.terrain-roof, .terrain-front, .terrain-stratum, .terrain-end) { fill-opacity: 0 }
.ridge-plot.is-dragging .ahead-of-cut .terrain-profile { stroke: #8eb79f; opacity: .75 }
.ridge-plot.is-dragging .ridge-hit { cursor: grabbing }
.terrain-light-sheet { fill: url(#ridge-cut-light) }
.terrain-light-outline, .terrain-light-guide, .terrain-cut-edge { fill: none; stroke: #c6ffe2 }
.terrain-light-outline { opacity: .8; stroke-width: .85 }
.terrain-light-guide { opacity: .8; stroke-width: .8; stroke-dasharray: 2 4 }
.terrain-slice-band { stroke: #1f3b2c; stroke-width: .7 }
.terrain-cut-edge { stroke-width: 1.5 }
.terrain-glow { fill: #b9ffca; opacity: .25 }
.terrain-touchpoint { fill: #e5ffea; stroke: #92e1b5; stroke-width: 1 }
.ridge-lead span::before, .ridge-sources [data-channel] > :first-child::before { content: ''; display: inline-block; vertical-align: .08em; width: .55em; height: .55em; margin-inline: 2px 4px; background: var(--band-color) }
.ridge-lead span:nth-child(1), .ridge-sources [data-channel="claude"] { --band-color: #729677 }
.ridge-lead span:nth-child(2), .ridge-sources [data-channel="codex"] { --band-color: #8bc6b8 }
.ridge-lead span:nth-child(3), .ridge-sources [data-channel="dsh"] { --band-color: #d6ce9e }
.ridge-hero:not(.usage-ready) .ridge-prompt { visibility: hidden }
.ridge-hit { position: absolute; touch-action: pan-y pinch-zoom; cursor: grab; user-select: none; -webkit-user-select: none }
.ridge-hit:focus-visible { outline: 1px dashed var(--ridge-green); outline-offset: 3px }
.ridge-release:focus-visible, .ridge-retry:focus-visible, .ridge-story a:focus-visible { outline: 1px solid var(--ridge-green); outline-offset: 3px }
.ridge-prompt, .ridge-state, .ridge-date, .ridge-sources, .ridge-meta, .ridge-story { font: 400 11px/1.6 var(--ridge-mono); color: var(--ridge-muted) }
.ridge-prompt { position: absolute; inset: 0 2px auto 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 }
.ridge-keys { display: none }
.ridge-plot:has(.ridge-hit:focus-visible) .ridge-keys { display: inline }
.ridge-plot:has(.ridge-hit:focus-visible) .ridge-prompt span:first-child { display: none }

.ridge-reading {
  position: absolute;
  z-index: 4;
  display: grid;
  grid-template: 'date date' auto 'state amount' auto 'sources sources' auto / auto 1fr;
  align-items: baseline;
  gap: 6px 12px;
  width: max-content;
  min-width: min(206px, 100%);
  max-width: min(100%, 280px);
  padding: 12px 15px;
  border: 1px solid #526e5e;
  border-radius: 5px;
  background: #111c16;
  color: var(--ridge-ink);
  box-shadow: 0 8px 27px #0006;
  pointer-events: none;
}
.ridge-date { grid-area: date; white-space: nowrap }
.ridge-state { grid-area: state }
.ridge-value { grid-area: amount; text-align: right; font: 500 16px/1.3 var(--ridge-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.ridge-sources { grid-area: sources; display: grid; gap: 2px; padding-top: 6px; border-top: 1px solid var(--ridge-edge); font-variant-numeric: tabular-nums }
.ridge-sources > span { display: flex; justify-content: space-between; align-items: baseline; gap: 12px }
.ridge-sources > span > span:last-child { color: var(--ridge-ink); text-align: right; overflow-wrap: anywhere }
.ridge-release-heading { display: none }
.ridge-release { position: absolute; transform: translateX(-50%); min-width: 28px; height: 25px; padding: 0; border: 0; background: transparent; color: var(--ridge-green); cursor: pointer; font: 10px/1.2 var(--ridge-mono); white-space: nowrap }
.ridge-release span { position: absolute; right: calc(50% + 6px); top: 50%; transform: translateY(-50%) }
.ridge-release::after { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 3px solid transparent; border-top: 0; border-bottom: 5px solid currentColor }
.ridge-story { position: absolute; z-index: 4; right: 0; bottom: 30px; width: max-content; max-width: min(100%, 36ch); margin: 0; padding: 12px 15px; border: 1px solid var(--ridge-edge); background: var(--ridge-paper); color: var(--ridge-ink); font-size: 12px }
.ridge-story a { display: inline-block; color: var(--ridge-green); text-underline-offset: 3px }
.ridge-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 18px; padding-block: 13px; border-top: 1px solid var(--ridge-edge) }
.ridge-retry { padding: 3px 0; border: 0; background: transparent; color: var(--ridge-ink); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 4px }
.ridge-hero [hidden] { display: none !important }

@media (max-width: 759px) {
  .ridge-intro { margin-bottom: 20px }
  .ridge-total { font-size: clamp(58px, 14vw, 88px) }
  .ridge-lead { margin-top: 6px }
  .ridge-plot { height: clamp(222px, 29svh, 263px) }
  .ridge-plot:has(.ridge-release) { margin-bottom: 33px }
  .ridge-reading { padding: 10px 12px }
  .ridge-state, .ridge-date, .ridge-sources, .ridge-meta { font-size: 12px }
  .ridge-releases:not(:empty) { position: absolute; inset: calc(100% - 14px) 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 0 14px; border-top: 1px solid var(--ridge-edge) }
  .ridge-release-heading { display: inline; font: 12px/1.4 var(--ridge-mono); color: var(--ridge-muted) }
  .ridge-releases .ridge-release { position: static; display: inline-flex; align-items: center; justify-content: center; transform: none; min-width: 44px; height: 44px; padding: 0 4px; font-size: 12px }
  .ridge-release::after { display: none }
  .ridge-release span { position: static; transform: none; text-decoration: underline; text-underline-offset: 4px }
  .ridge-story { bottom: 100%; max-width: 100% }
}

/* 缺口的投影和题字共用一次淡入淡出，鼠标或触摸仍落在山脊上。 */
.ridge-thief {
  --fade-time: 220ms;
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--fade-time) ease, visibility 0s var(--fade-time);
}
.ridge-plot:is(.lost-hovered, .lost-selected):not(.studio-crossing *) .ridge-thief {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.ridge-thief canvas { display: block; image-rendering: pixelated }
.ridge-thief-caption {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: none;
  white-space: nowrap;
  padding: 3px 8px;
  box-sizing: border-box;
  text-align: center;
  text-wrap: balance;
  font: 500 clamp(13px, 1.1vw, 16px)/1.4 var(--ridge-mono);
  color: #ceffe1;
  background: rgb(4 20 12 / .88);
  text-shadow: 0 0 5px rgb(150 248 183 / .28);
}
.ridge-reading.is-lost { display: none }
@media (prefers-reduced-motion: reduce) {
  .ridge-thief { --fade-time: 100ms }
}
