:root {
  --paper: #f7f4ea;
  --paper-2: #efeade;
  --ink: #17170f;
  --muted: #6e6d63;
  --frame: #d6d0bd;
  --line: #e2ddcd;
  --chrome: #3a382f;
  --well: #f1ede0;
  --head: #4d7c0f;
  --head-lit: #3f6a0a;
  --phos: #0d7a4a;
  --gold: #a2670a;
  --alert: #c0271a;
  --brand: #b8541c;
  --pop: 0 14px 36px #17170f21, 0 2px 6px #17170f0f;
  --grain: #17170f0e;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Segoe UI Mono",
    Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #141414;
  --paper-2: #1c1c1c;
  --ink: #eaeaea;
  --muted: #8b8b8b;
  --frame: #2b2b2b;
  --line: #303030;
  --chrome: #c4c4c4;
  --well: #0d0d0d;
  --head: #d4f31d;
  --head-lit: #e6ff5e;
  --phos: #4ee39b;
  --gold: #e8a33f;
  --alert: #f04438;
  --brand: #f0894a;
  --pop: 0 24px 60px #000000b3;
  --grain: #ffffff09;
  color-scheme: dark;
}

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

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(
    circle at 1px 1px,
    var(--grain) 1px,
    transparent 0
  );
  background-size: 4px 4px;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 20px 112px;
}

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 68px;
  flex-shrink: 0;
}

.brand {
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.brand:hover {
  opacity: 0.8;
}

.brand img {
  width: 28px;
  height: 28px;
}

nav {
  display: flex;
  margin-left: auto;
  min-width: 0;
  gap: 16px;
}

nav a {
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--muted);
  transition: color 0.15s ease;
}

nav a:hover,
nav a.is-active {
  color: var(--ink);
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.top-tools a,
#theme-toggle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}

.top-tools a:hover,
#theme-toggle:hover {
  color: var(--ink);
}

.top-tools svg {
  width: 14px;
  height: 14px;
}

.theme-icon {
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  box-shadow: inset -3px -1px 0 0 currentColor;
}

[data-theme="light"] .theme-icon {
  border-radius: 50%;
  background: currentColor;
  box-shadow: none;
}

.tape-mask {
  margin: 0 -20px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--well) 40%, transparent);
  padding: 7px 0;
  -webkit-mask-image: linear-gradient(
    90deg,
    #0000,
    #000 40px,
    #000 calc(100% - 40px),
    #0000
  );
  mask-image: linear-gradient(
    90deg,
    #0000,
    #000 40px,
    #000 calc(100% - 40px),
    #0000
  );
}

.tape {
  display: flex;
  width: max-content;
  animation: tape 42s linear infinite;
}

.tape span {
  padding: 0 22px;
  white-space: nowrap;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.tape span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 12px;
  background: var(--head);
  vertical-align: 1px;
}

@keyframes tape {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

main {
  display: flex;
  flex-grow: 1;
  align-items: center;
  justify-content: center;
  padding: 40px 0 24px;
}

.card {
  border: 1px solid var(--frame);
  border-radius: 12px;
  background: var(--paper-2);
  padding: 5px;
  box-shadow: var(--pop);
}

.card-inner {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  padding: 28px 22px 24px;
}

.kicker {
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: clamp(18px, 4.2vw, 22px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.25;
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  border-radius: 1px;
  background: var(--brand);
  animation: cursor 1.1s step-end infinite;
}

@keyframes cursor {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.lede {
  max-width: 46ch;
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--head);
  background: var(--head);
  color: var(--paper);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cta:hover {
  background: var(--head-lit);
  border-color: var(--head-lit);
}

.cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cta-compact {
  margin-top: 0;
  height: 32px;
  padding: 0 12px;
  flex-shrink: 0;
}

.check-form {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.check-form label {
  display: block;
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.row {
  display: flex;
  gap: 8px;
}

input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--ink);
  font-size: 12px;
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--frame);
}

input[type="text"]::placeholder {
  color: var(--muted);
}

.error {
  margin-top: 8px;
  font-size: 11px;
  color: var(--alert);
}

.result {
  margin-top: 18px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  background: var(--well);
}

.result .status {
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.result .status.ok {
  color: var(--phos);
}

.result .status.no {
  color: var(--alert);
}

.result .amount {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.result .hint {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

footer {
  margin-top: 96px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.foot-brand img {
  width: 22px;
  height: 22px;
}

.foot-brand span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

footer > p {
  max-width: 230px;
  margin-top: 12px;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--muted);
}

@media (max-width: 520px) {
  .row {
    flex-direction: column;
  }

  .cta-compact {
    width: 100%;
  }
}
