/* Adaptation simulator — device-framed visual comparisons. */

@font-face {
  font-family: "Atkinson";
  src: url("/assets/fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson";
  src: url("/assets/fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg: #040912;
  --elev: #0a1220;
  --phosphor: #5cd9ff;
  --amber: #f5b441;
  --ink: rgba(234, 242, 255, 0.94);
  --muted: rgba(150, 170, 200, 0.72);
  --line: rgba(92, 217, 255, 0.14);
  --good: #3dcea0;
  --warn: #f5b441;
  --bad: rgba(255, 120, 120, 0.75);
  --sans: "Atkinson", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1000px 500px at 0% 0%, rgba(92, 217, 255, 0.08), transparent 50%),
    radial-gradient(800px 400px at 100% 0%, rgba(245, 180, 65, 0.07), transparent 45%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 0.75rem;
  top: 0.75rem;
  z-index: 20;
  background: var(--amber);
  color: #111;
  padding: 0.5rem 0.75rem;
}

.top {
  padding: 1.35rem clamp(1rem, 3vw, 2rem) 1rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(4, 9, 18, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.crumb {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--phosphor);
  text-decoration: none;
}

.sep {
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 1.95rem);
}

.lede {
  margin: 0.55rem 0 0;
  max-width: 48rem;
  color: var(--muted);
  line-height: 1.5;
}

.picker-row {
  display: grid;
  grid-template-columns: minmax(12rem, 18rem) 1fr;
  gap: 1rem 1.5rem;
  margin-top: 1rem;
  align-items: end;
}

.picker-row label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.picker-row select {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--elev);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
}

.blurb {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
  font-size: 0.98rem;
  align-self: center;
}

.hint {
  margin: 0.85rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.stage {
  padding: 1.25rem clamp(0.75rem, 2vw, 1.5rem) 2.5rem;
}

.status {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 340px);
  gap: 1.1rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scroll-snap-type: x mandatory;
}

.card {
  scroll-snap-align: start;
  background: rgba(8, 16, 28, 0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 100%;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.card-head h2 {
  margin: 0;
  font-size: 1rem;
}

.badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge.reference {
  color: var(--phosphor);
}
.badge.exact {
  color: var(--good);
  border-color: rgba(61, 206, 160, 0.45);
}
.badge.adapted {
  color: var(--warn);
  border-color: rgba(245, 180, 65, 0.5);
}
.badge.none {
  color: var(--bad);
  border-color: rgba(255, 120, 120, 0.4);
}

/* Device frames */
.frame {
  position: relative;
  width: 100%;
  background: #000;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4), 0 12px 28px rgba(0, 0, 0, 0.35);
}

.frame.tv-16x9,
.frame.tv-overscan,
.frame.ultrawide {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
}

.frame.ultrawide {
  aspect-ratio: 21 / 9;
}

.frame.tv-overscan::after {
  content: "";
  position: absolute;
  inset: 6%;
  border: 1px dashed rgba(245, 180, 65, 0.45);
  pointer-events: none;
  z-index: 3;
}

.frame.ipad-portrait {
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  max-height: 360px;
  margin-inline: auto;
}

.frame.round {
  aspect-ratio: 1;
  width: min(70%, 220px);
  margin: 0.4rem auto;
  border-radius: 50%;
  border-width: 8px;
  border-color: #1a2433;
  box-shadow:
    0 0 0 2px rgba(92, 217, 255, 0.2),
    0 14px 30px rgba(0, 0, 0, 0.45);
}

.viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #02060c;
}

.viewport img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.viewport.contain img {
  object-fit: contain;
  background: #040912;
}

/* Live web study scaled into the frame */
.live-host {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.live-host iframe {
  border: 0;
  width: 1280px;
  height: 720px;
  transform-origin: top left;
  pointer-events: none;
}

.frame.ipad-portrait .live-host iframe {
  width: 834px;
  height: 1112px;
}

.frame.ultrawide .live-host iframe {
  width: 1680px;
  height: 720px;
}

.frame.round .live-host {
  display: none; /* round uses captures only */
}

/*
 * Two kinds of nothing, deliberately not interchangeable.
 * .constraint  — a wall. Hard diagonal hatch, red. Settled; stop asking.
 * .unexamined  — a gap. Soft dotted field, amber. Open; someone should look.
 */
.empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.45;
}

.empty .absence {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid currentcolor;
}

.empty .absence-note {
  max-width: 30ch;
  opacity: 0.85;
}

.empty.constraint {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(255, 120, 120, 0.07) 6px,
    rgba(255, 120, 120, 0.07) 12px
  );
}

.empty.constraint .absence {
  color: var(--bad);
}

.empty.unexamined {
  background:
    radial-gradient(rgba(245, 180, 65, 0.16) 1px, transparent 1px) 0 0 / 9px 9px;
}

.empty.unexamined .absence {
  color: var(--warn);
}

.badge.constraint {
  color: var(--bad);
  border-color: rgba(255, 120, 120, 0.4);
}

.badge.unexamined {
  color: var(--warn);
  border-color: rgba(245, 180, 65, 0.5);
  border-style: dashed;
}

/* Coverage strip — the tool stating its own limits up front. */
.coverage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  align-items: baseline;
  margin: 0.6rem 0 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.coverage strong {
  color: var(--ink);
  font-weight: 700;
}

.coverage .k-constraint strong {
  color: var(--bad);
}

.coverage .k-unexamined strong {
  color: var(--warn);
}

.coverage a {
  color: var(--phosphor);
}

.note {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  flex: 1;
}

.note a {
  color: var(--phosphor);
}

.note strong {
  color: var(--ink);
  font-weight: 700;
}

.card a.open {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--phosphor);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.card a.open:hover {
  text-decoration: underline;
}

.foot {
  padding: 1rem clamp(1rem, 3vw, 2rem) 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.foot a {
  color: var(--phosphor);
}

@media (max-width: 720px) {
  .picker-row {
    grid-template-columns: 1fr;
  }
  .rail {
    grid-auto-columns: minmax(260px, 88vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
