/* ---------------------------------------------
   lowhorse.app home. Tokens live in /shared/tokens.css.
   --------------------------------------------- */

:root {
  /* scene geometry */
  --lm-h: clamp(150px, 31vh, 320px);
  --lm-w: calc(var(--lm-h) * 200 / 260);
  --rig-w: clamp(250px, min(82vw, 52vh), 420px);
  --rig-h: calc(var(--rig-w) * 134 / 364);
  --gap: clamp(10px, 3vh, 34px);
}

html, body { height: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* ---------- stage ---------- */

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  padding: 2vh 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  outline: none;
}

.scene {
  position: relative;
  width: 100%;
  height: calc(var(--lm-h) + var(--gap) + var(--rig-h));
  flex: none;
}

.road {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--lm-h) * 251 / 260);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 18%, var(--line) 82%, transparent);
}

.track {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--lm-h);
  transition: opacity 150ms ease, transform 150ms ease;
}
.track.out {
  opacity: 0;
  transform: translateY(10px);
}

.world {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--lm-w);
  height: var(--lm-h);
  margin-left: calc(var(--lm-w) / -2);
  transform-origin: 50% 96.5%;
  color: var(--ink);
  cursor: pointer;
  will-change: transform, opacity;
  -webkit-user-drag: none;
}
.world svg,
.world img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.world img {
  object-fit: contain;
  object-position: 50% 100%;
  mix-blend-mode: multiply;
}
.world .sign {
  position: absolute;
  width: 26%;
  height: auto;
  aspect-ratio: 64 / 60;
  right: -6%;
  bottom: 3.5%;
}
.world.is-soon .art { opacity: 0.5; }
.world .art { transition: transform 200ms ease; }
@media (hover: hover) {
  .world:hover .art { transform: translateY(-5px); }
}

:root:not([data-theme="light"]) .world img { filter: invert(1); mix-blend-mode: screen; }

.rig {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--rig-w);
  height: var(--rig-h);
  margin-left: calc(var(--rig-w) / -2);
  overflow: visible;
  will-change: transform;
  pointer-events: none;
}

/* ---------- ink classes shared by the rig and emblems ---------- */

.ink { fill: var(--ink); }
.far { fill: var(--ink-far); }
.paper { fill: var(--paper); }
.ht { fill: url(#dots); }
.ht-ink { fill: url(#dots-ink); }
.cut { fill: none; stroke: var(--paper); stroke-width: 1.3; stroke-linecap: round; }
.cut.thin { stroke-width: 0.6; }
.stroke { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.stroke.faint { stroke: var(--ink-soft); stroke-width: 1.2; }
.stroke.thin-ink { stroke: var(--ink-far); stroke-width: 1.5; }
.outlined { stroke: var(--paper); stroke-width: 1.4; }
.far-stroke { fill: none; stroke: var(--ink-far); stroke-width: 3.4; stroke-linecap: round; }
.shaft { fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; }
.shaft-edge { fill: none; stroke: var(--paper); stroke-width: 6.4; stroke-linecap: round; }
.shaft.thin { stroke-width: 1.8; }
.shaft-edge.thin { stroke-width: 4.2; }
.sign-text {
  fill: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- name plate ---------- */

.plate {
  margin-top: clamp(16px, 4vh, 44px);
  padding: 0 16px;
  text-align: center;
  min-height: 8.5em;
  margin-bottom: 12px;
}
.plate > * {
  transition: opacity 180ms ease, transform 180ms ease;
}
.plate.swap > * {
  opacity: 0;
  transform: translateY(4px);
}

.plate-num {
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.plate-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1.05;
}
.plate-name a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 94%;
  transition: background-size 220ms ease;
}
.plate-name a:hover,
.plate-name a:focus-visible { background-size: 100% 1px; }
.plate.is-soon .plate-name a { cursor: default; background-size: 0 1px; }

.plate-host[hidden] { display: none; }
.plate-host {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.plate.is-soon .pip {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--ink-soft);
}

.plate-blurb {
  min-height: 1.5em;
  margin: 10px auto 0;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.plate-blurb.nudge { animation: nudge 420ms ease; }
@keyframes nudge {
  20% { transform: translateX(-5px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}

.crumb {
  font-size: 11px;
  color: var(--ink);
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 8px 2px;
  margin-right: 10px;
  cursor: pointer;
}
.crumb:hover { border-color: var(--ink-soft); }
.crumb[hidden] { display: none; }

.plate-kids {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
}
.plate-kids:empty { display: none; }
.plate-kids a {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 10px 4px;
}
.plate-kids a:hover { border-color: var(--ink-soft); }

/* ---------- about card ---------- */

.about {
  width: min(440px, calc(100vw - 32px));
  padding: 28px 28px 24px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 60px rgba(20, 18, 11, 0.18);
}
.about::backdrop {
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  backdrop-filter: blur(2px);
}
.about[open] { animation: rise 220ms ease; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
}
.about-kicker { font-size: 11px; color: var(--ink-soft); }
.about h2 {
  margin: 10px 0 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.1;
}
.about p { margin: 0 0 12px; line-height: 1.55; color: var(--ink-soft); }
.about-links a { color: var(--ink); font-size: 12px; }
.about-close {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  color: var(--ink-soft);
  background: none;
  border: 0;
  cursor: pointer;
}

/* ---------- footer hint ---------- */

.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 16px clamp(18px, 4vh, 40px);
}
.hint {
  text-align: center;
  font-size: 11px;
  color: var(--ink-soft);
}
.hint kbd {
  font-family: inherit;
  font-size: 10px;
  padding: 2px 5px 1px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.hint .dot { margin: 0 8px; }
.hint-touch { display: none; }
.hint-back { display: none; }
.in-group .hint-back { display: inline; }
@media (hover: none) and (pointer: coarse) {
  .hint-keys { display: none; }
  .hint-touch { display: inline; }
}

/* ---------- iris, for going in ---------- */

.iris {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--iris);
  pointer-events: none;
  visibility: hidden;
}
.iris.on {
  visibility: visible;
  pointer-events: auto;
}

.noscript {
  list-style: none;
  padding: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 28px;
}
.noscript a { color: inherit; }

/* short landscape screens: tighten everything */
@media (max-height: 560px) {
  :root { --lm-h: clamp(120px, 30vh, 200px); --rig-w: clamp(200px, 44vh, 300px); }
  .plate { margin-top: 10px; min-height: 0; }
  .plate-blurb { display: none; }
}
