:root {
  color-scheme: dark;
  --ink: #071e49;
  --paper: #f7f3e8;
  --paper-2: #b5e0ea;
  --hot: #d1b06c;
  --acid: #92d05d;
  --cyan: #b5e0ea;
  --orange: #d1b06c;
  --purple: #5f8f46;
  --muted: rgba(247, 243, 232, 0.74);
  --line: rgba(181, 224, 234, 0.28);
  --shadow: 10px 10px 0 #000;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 92px;
  overflow-x: hidden;
  color: var(--paper);
  font-family: "Space Grotesk", system-ui, sans-serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 16% 8%, rgba(146, 208, 93, 0.3), transparent 28rem),
    radial-gradient(circle at 88% 16%, rgba(181, 224, 234, 0.26), transparent 26rem),
    linear-gradient(135deg, #071e49 0%, #0a1730 48%, #182d1f 100%);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 22px;
}

.hero {
  display: flex;
  align-items: center;
  min-height: clamp(300px, 44vh, 460px);
  padding: clamp(22px, 4vw, 44px);
  position: relative;
  border: 3px solid var(--paper);
  background:
    linear-gradient(115deg, rgba(146, 208, 93, 0.2), transparent 38%),
    linear-gradient(250deg, rgba(209, 176, 108, 0.2), transparent 40%),
    rgba(7, 30, 73, 0.78);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px dashed rgba(255, 247, 214, 0.32);
}

.signal-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: grid;
  grid-template-columns: 1fr 0.7fr 0.45fr 0.28fr;
  gap: 8px;
}

.signal-bar span {
  height: 10px;
  border: 2px solid #000;
  background: var(--acid);
  box-shadow: 3px 3px 0 #000;
}

.signal-bar span:nth-child(2) {
  background: var(--hot);
}

.signal-bar span:nth-child(3) {
  background: var(--cyan);
}

.signal-bar span:nth-child(4) {
  background: var(--paper);
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  padding-top: 28px;
}

.kicker {
  display: inline-flex;
  margin: 0 0 16px;
  padding: 8px 11px;
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--acid);
  border: 2px solid #000;
  box-shadow: 5px 5px 0 #000;
}

h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(3.1rem, 9vw, 7.2rem);
  line-height: 0.84;
  letter-spacing: 0;
  text-shadow: 5px 5px 0 var(--acid), 10px 10px 0 #000;
  white-space: nowrap;
}

.lede {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  line-height: 1.45;
}

.lede strong {
  color: var(--acid);
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 22px;
  margin-top: 28px;
  align-items: stretch;
}

.panel {
  border: 3px solid var(--paper);
  background: rgba(7, 30, 73, 0.78);
  box-shadow: var(--shadow);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -18px -18px 18px;
  padding: 10px 14px;
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--paper);
  border-bottom: 3px solid #000;
}

.panel-head p {
  margin: 0 0 0 auto;
}

.window-dot {
  width: 13px;
  height: 13px;
  border: 2px solid #000;
  border-radius: 999px;
}

.red {
  background: #ff4667;
}

.yellow {
  background: #ffd23f;
}

.green,
.lime {
  background: var(--acid);
}

.cyan {
  background: var(--cyan);
}

.purple {
  background: var(--purple);
}

.input-label {
  display: block;
  margin-bottom: 8px;
  color: var(--paper-2);
  font-weight: 700;
}

.input-meter-row {
  display: block;
}

.input-stack {
  min-width: 0;
}

.money-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid #000;
  box-shadow: 6px 6px 0 var(--hot);
}

.money-input span {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}

.money-input input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 800;
  background: transparent;
  border: 0;
  outline: 0;
}

.mobile-face-card,
.comparison-overview {
  display: none;
}

.helper-text,
.result-caption,
footer p,
.ad-slot small {
  color: var(--muted);
  line-height: 1.5;
}

.helper-text {
  margin: 14px 0 18px;
  font-size: 0.95rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-height: 410px;
  overflow: auto;
  padding: 2px 8px 8px 2px;
  scrollbar-color: var(--acid) rgba(255, 247, 214, 0.14);
}

.hint-button {
  min-height: 94px;
  padding: 12px;
  scroll-margin-bottom: 112px;
  text-align: left;
  color: var(--ink);
  background: var(--cyan);
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.hint-button:nth-child(2) {
  background: var(--orange);
}

.hint-button:nth-child(3n) {
  background: var(--acid);
}

.hint-button:nth-child(4n) {
  background: var(--paper-2);
}

.hint-button:nth-child(5n) {
  background: #a9d88a;
}

.hint-button:hover,
.hint-button:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 #000;
}

.hint-button span,
.hint-button strong {
  display: block;
}

.hint-button span {
  font-size: clamp(0.9rem, 1.7vw, 1.02rem);
  font-weight: 800;
}

.hint-button strong {
  margin-top: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.77rem;
}

.nominal-panel {
  display: grid;
  align-content: start;
}

.face-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 250px;
  margin-bottom: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #061633;
  background-size: 18px 18px;
  border: 3px solid var(--paper);
  overflow: hidden;
}

.face-stage::before,
.face-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 22px;
  height: 5px;
  background: var(--hot);
  box-shadow: 0 12px 0 var(--cyan), 0 24px 0 var(--acid);
  opacity: 0.7;
}

.face-stage::after {
  inset: 24px 0 auto;
  background: var(--paper);
  box-shadow: 0 12px 0 var(--purple), 0 24px 0 var(--cyan);
}

#meter-face {
  position: relative;
  z-index: 1;
  width: min(72vw, 270px);
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 42%;
  border: 3px solid #000;
  filter: saturate(1.08) contrast(1.06) drop-shadow(8px 8px 0 #000);
  transform: rotate(var(--face-tilt, -5deg)) scale(var(--face-scale, 0.95));
  transition: transform 220ms ease, filter 220ms ease;
}

#face-badge {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 7px 9px;
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--paper);
  border: 2px solid #000;
  box-shadow: 4px 4px 0 #000;
}

.conversion-card {
  margin-top: 18px;
  scroll-margin-bottom: 112px;
  padding: 16px;
  color: var(--ink);
  background: var(--acid);
  border: 3px solid #000;
  box-shadow: 6px 6px 0 var(--purple);
}

.conversion-card p {
  margin: 0 0 8px;
  font-weight: 800;
}

.conversion-card strong {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(2rem, 7vw, 4.25rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.conversion-card span {
  display: block;
  margin-top: 10px;
  font-weight: 700;
}

.nominal-meter {
  display: grid;
  gap: 10px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
}

.meter-label span,
.meter-scale span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.meter-label strong {
  color: var(--acid);
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1rem, 2vw, 1.2rem);
  overflow-wrap: anywhere;
  text-align: right;
}

.meter-track {
  height: 34px;
  overflow: hidden;
  background: #07070a;
  border: 3px solid var(--paper);
}

.meter-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: repeating-linear-gradient(
    135deg,
    var(--hot) 0 12px,
    var(--acid) 12px 24px,
    var(--cyan) 24px 36px
  );
  transition: width 240ms ease;
}

.meter-scale {
  display: flex;
  justify-content: space-between;
}

.result-caption {
  margin: 18px 0 0;
}

.sticky-ad {
  position: sticky;
  z-index: 10;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: min(760px, calc(100% - 24px));
  min-height: 114px;
  margin: 22px auto 12px;
  padding: 10px 14px;
  color: var(--paper);
  background:
    repeating-linear-gradient(45deg, rgba(255, 247, 214, 0.08) 0 10px, transparent 10px 20px),
    rgba(7, 30, 73, 0.94);
  border: 3px solid var(--paper);
  box-shadow: 7px 7px 0 #000;
}

.sticky-ad-close {
  position: absolute;
  top: -13px;
  right: -13px;
  display: grid;
  place-items: center;
  width: 30px;
  aspect-ratio: 1;
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  background: var(--acid);
  border: 3px solid #000;
  border-radius: 999px;
  box-shadow: 4px 4px 0 #000;
}

.sticky-ad-unit {
  display: grid;
  place-items: center;
  width: min(728px, 100%);
  min-height: 90px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}

.sticky-ad-unit iframe,
.sticky-ad-unit ins {
  max-width: 100% !important;
}

.sticky-ad-unit iframe {
  display: block;
  width: 100% !important;
}

.ticker {
  margin-top: 28px;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid #000;
  box-shadow: var(--shadow);
}

.ticker div {
  display: flex;
  width: max-content;
  animation: marquee 18s linear infinite;
}

.ticker span {
  padding: 12px 24px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  white-space: nowrap;
}

footer {
  padding: 22px 0 0;
}

footer p {
  max-width: 820px;
  margin: 0;
  font-size: 0.9rem;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 980px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 360px;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .hero {
    min-height: 430px;
    padding: 20px;
    box-shadow: 6px 6px 0 #000;
  }

  .hero-copy {
    padding-top: 44px;
  }

  h1 {
    font-size: clamp(1.85rem, 9.2vw, 2.75rem);
    text-shadow: 2px 2px 0 var(--hot), 4px 4px 0 #000;
    white-space: nowrap;
  }

  .calculator-grid {
    gap: 16px;
    margin-top: 18px;
  }

  .panel,
  .ticker {
    box-shadow: 6px 6px 0 #000;
  }

  .quick-actions {
    grid-template-columns: 1fr;
    max-height: 288px;
    overscroll-behavior: contain;
  }

  .input-meter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 10px;
    align-items: end;
  }

  .mobile-face-card {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 118px;
    padding: 8px;
    background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
      #061633;
    background-size: 14px 14px;
    border: 3px solid var(--paper);
    box-shadow: 5px 5px 0 #000;
  }

  #meter-face-mobile {
    width: 92px;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center 42%;
    border: 2px solid #000;
    filter: saturate(1.08) contrast(1.06) drop-shadow(4px 4px 0 #000);
    transform: rotate(var(--face-tilt, -5deg)) scale(var(--face-scale, 0.95));
    transition: transform 220ms ease;
  }

  #face-badge-mobile {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    padding: 5px 4px;
    color: var(--ink);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.52rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    background: var(--paper);
    border: 2px solid #000;
  }

  .comparison-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    background: rgba(255, 247, 214, 0.08);
    border: 2px solid var(--line);
  }

  .comparison-overview div {
    min-width: 0;
  }

  .comparison-overview span {
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .comparison-overview strong {
    display: block;
    margin-top: 5px;
    color: var(--acid);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.86rem;
    overflow-wrap: anywhere;
  }

  .comparison-overview p {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .nominal-panel {
    display: none;
  }

  .meter-label {
    display: grid;
  }

  .meter-label strong {
    text-align: left;
  }

  .face-stage {
    min-height: 220px;
  }

  .sticky-ad {
    width: min(100% - 16px, 728px);
    min-height: 108px;
    padding: 8px;
  }

  .sticky-ad-unit {
    width: 100%;
    min-height: 90px;
  }

  .sticky-ad-close {
    top: -11px;
    right: -7px;
    width: 28px;
  }
}

@media (max-width: 390px) {
  .input-meter-row {
    grid-template-columns: minmax(0, 1fr) 98px;
  }

  .mobile-face-card {
    min-height: 106px;
  }

  #meter-face-mobile {
    width: 76px;
  }

  #face-badge-mobile {
    font-size: 0.46rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
