/* Steamcraft — unslop pass (unslop by Damir Sokolovsky, CC BY 4.0).
   Direction: exact, quick, a little cold. World: a payment terminal seen from
   the player's side. Ink-tinted neutral ramp, one ember accent used rarely,
   figures in mono with tabular numerals.
   Type: IBM Plex Sans (interface) + IBM Plex Mono (figures, meta). */

:root {
  /* ink ramp */
  --bg: #0b0d14;
  --deep: #07080d;
  --card: #11141c;
  --raised: #1a1e28;
  --hairline: rgba(238, 240, 245, .08);
  --hairline-2: rgba(238, 240, 245, .14);

  /* three text roles */
  --text: #eef0f5;
  --text-2: #a3a9b8;
  --text-3: #7a8296;

  /* one accent, used rarely */
  --accent: #e8862b;

  /* semantics, toned into the ramp */
  --ok: #4cc38a;
  --err: #e5484d;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-sm: 6px;
  --r-ctl: 10px;
  --r-card: 16px;
  --r-panel: 20px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --t-feedback: 140ms;
  --t-enter: 320ms;

  --page: 1120px;
  --hdr: 60px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-2); text-decoration: none; }
a:hover { color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- header */

.hdr { border-bottom: 1px solid var(--hairline); }
.hdr-inner {
  height: var(--hdr);
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand svg { display: block; }
.brand-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--t-feedback) var(--ease), background var(--t-feedback) var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a.is-active { color: var(--text); background: var(--raised); }

.support {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: border-color var(--t-feedback) var(--ease), color var(--t-feedback) var(--ease);
}
.support:hover { border-color: var(--hairline-2); color: var(--text); }
.support svg { color: var(--text-3); }
.support:hover svg { color: var(--text-2); }

/* ------------------------------------------------------------------- hero */

.hero-section { position: relative; overflow: hidden; background: var(--deep); }

/* Scene layer: plain background if no image was dropped into static/img. */
.hero-scene {
  position: absolute;
  inset: 0;
  background-color: var(--deep);
  background-image: var(--hero);
  background-size: cover;
  background-position: 68% 45%;
  background-repeat: no-repeat;
  pointer-events: none;
  filter: brightness(.82);
  -webkit-mask-image: radial-gradient(150% 130% at 72% 38%, #000 42%, transparent 82%);
  mask-image: radial-gradient(150% 130% at 72% 38%, #000 42%, transparent 82%);
}

/* Keep the text readable over the scene and blend the image into the page. */
.hero-section.has-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--bg) 0%, rgba(11, 13, 20, 0) 14%),
    linear-gradient(90deg, var(--bg) 0%, rgba(11, 13, 20, .88) 36%, rgba(11, 13, 20, .44) 66%, rgba(11, 13, 20, .24) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(11, 13, 20, 0) 42%);
}

/* the panel floats over the scene, so it may carry a soft neutral shadow */
.has-scene .panel {
  box-shadow:
    inset 0 1px 0 rgba(238, 240, 245, .06),
    0 28px 70px rgba(0, 0, 0, .5);
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 64px;
  padding-top: 72px;
  padding-bottom: 88px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: 56px;
  line-height: 1.04;
  font-weight: 500;
  letter-spacing: -.03em;
}

.hero-sub {
  margin: 0 0 28px;
  max-width: 34rem;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-2);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding: 20px 0 0;
  margin: 0;
  border-top: 1px solid var(--hairline);
  list-style: none;
}
.hero-meta li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
}
.hero-meta svg { color: var(--text-3); }

/* ----------------------------------------------------------------- panel */

.panel {
  background: linear-gradient(180deg, #12151e 0%, var(--card) 60%);
  border: 1px solid var(--hairline);
  border-radius: var(--r-panel);
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(238, 240, 245, .06);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.panel-title { font-size: 15px; font-weight: 500; }
.panel-note { font-family: var(--mono); font-size: 12px; color: var(--text-3); }

.field { margin-bottom: 16px; }
.field:last-of-type { margin-bottom: 0; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

input, select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  transition: border-color var(--t-feedback) var(--ease), background var(--t-feedback) var(--ease);
}
input::placeholder { color: var(--text-3); }
input:focus, select:focus { border-color: var(--hairline-2); outline: none; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

input.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8296' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.hint { margin: 6px 0 0; font-size: 12px; color: var(--text-3); }
.hint.is-error { color: var(--err); }
.hint.is-ok { color: var(--text-2); }

/* quick amounts */

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  height: 28px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--t-feedback) var(--ease), color var(--t-feedback) var(--ease);
}
.chip:hover { border-color: var(--hairline-2); color: var(--text); }
.chip.is-active { border-color: var(--hairline-2); color: var(--text); background: var(--raised); }

/* segmented control */

.seg { display: flex; gap: 4px; }
.seg label {
  flex: 1;
  margin: 0;
  text-align: center;
  height: 44px;
  line-height: 42px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  transition: border-color var(--t-feedback) var(--ease), color var(--t-feedback) var(--ease), background var(--t-feedback) var(--ease);
}
.seg label:hover { color: var(--text-2); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) {
  background: var(--raised);
  border-color: var(--hairline-2);
  color: var(--text);
}
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

/* receipt */

.receipt {
  position: relative;
  margin: 20px 0;
  padding: 16px;
  background: linear-gradient(180deg, #0d1018 0%, #0a0c12 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: inset 0 1px 0 rgba(238, 240, 245, .04);
}
.receipt dl { margin: 0; display: grid; gap: 10px; }
.receipt .row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.receipt dt { font-size: 13px; color: var(--text-2); }
.receipt dd {
  margin: 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--text-2);
}
.receipt dd.text { font-family: var(--sans); font-variant-numeric: normal; }
.receipt .total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  margin-top: 2px;
  border-top: 1px dashed rgba(238, 240, 245, .18);
}
.receipt .total-row span { font-size: 13px; color: var(--text-2); }
.receipt .total-row strong {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--accent);
  transition: color var(--t-feedback) var(--ease);
}
.receipt .total-row strong.is-empty { color: var(--text-3); }

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-ctl);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-feedback) var(--ease), border-color var(--t-feedback) var(--ease), transform var(--t-feedback) var(--ease);
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: default; }

.btn-primary { width: 100%; height: 48px; background: var(--text); color: var(--bg); }
.btn-primary:hover { background: #dde1ea; }

.btn-quiet {
  background: transparent;
  border-color: var(--hairline);
  color: var(--text);
}
.btn-quiet:hover { border-color: var(--hairline-2); }

.panel-foot {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

/* ---------------------------------------------------------------- sections */

.section {
  padding-top: 80px;
  padding-bottom: 80px;
}
.section + .section { border-top: 1px solid var(--hairline); }

.section-title {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.01em;
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { display: flex; gap: 14px; }
.step-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  padding-top: 2px;
}
.step h3 { margin: 0 0 6px; font-size: 15px; font-weight: 500; }
.step p { margin: 0; font-size: 14px; color: var(--text-2); }

/* reviews */

.reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.review { margin: 0; }
.review p { margin: 0 0 12px; font-size: 15px; color: var(--text); }
.review footer {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
}

/* faq */

.faq { border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { color: var(--text-3); transition: transform var(--t-feedback) var(--ease); flex: none; }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq details p { margin: 0 0 16px; max-width: 60ch; font-size: 14px; color: var(--text-2); }

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

.foot { border-top: 1px solid var(--hairline); padding: 28px 0; margin-top: 8px; }
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-3);
}
.foot-name { color: var(--text-2); font-weight: 500; }

/* ------------------------------------------------------------- status page */

.narrow { max-width: 520px; }
.page-title { margin: 0; font-size: 28px; font-weight: 500; letter-spacing: -.02em; }

.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.status-line { display: flex; align-items: center; gap: 10px; }
.status-line strong { font-size: 15px; font-weight: 500; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.created { background: var(--accent); animation: live 1.6s var(--ease) infinite; }
.dot.paid { background: var(--ok); }
.dot.issued { background: var(--ok); }
@keyframes live { 50% { opacity: .3; } }

.qr-plate {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border-radius: var(--r-card);
}
.qr-plate canvas, .qr-plate img { display: block; }

.qr-block { text-align: center; }

.stack { display: grid; gap: 16px; }

/* ------------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(7, 8, 13, .72);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade var(--t-enter) var(--ease);
}
@keyframes fade { from { opacity: 0; } }

.modal {
  position: relative;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-panel);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  animation: rise var(--t-enter) var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.modal h3 { margin: 0 0 6px; font-size: 16px; font-weight: 500; }
.modal p { margin: 0 0 20px; font-size: 14px; color: var(--text-2); }
.modal .total-line {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}
.modal .total-line span { font-size: 13px; color: var(--text-2); }
.modal .total-line strong {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 24px; font-weight: 500; color: var(--accent);
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: var(--r-sm);
  color: var(--text-3); cursor: pointer;
  transition: color var(--t-feedback) var(--ease);
}
.modal-close:hover { color: var(--text); }

.spinner {
  width: 40px; height: 40px; margin: 4px 0 20px;
  border: 2px solid var(--hairline);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal-error { color: var(--err) !important; }

.modal-status {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-size: 13px; color: var(--text-2);
}

/* ------------------------------------------------------- detail: stamp */

.stamp {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ok);
  border: 1.5px solid currentColor;
  border-radius: 4px;
  padding: 4px 9px;
  transform: rotate(-8deg) scale(.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 220ms var(--ease);
}
.stamp.is-visible { opacity: .92; transform: rotate(-8deg) scale(1); }

.modal-stamp {
  width: max-content;
  margin: 2px auto 18px;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ok);
  border: 2px solid currentColor;
  border-radius: 6px;
  padding: 8px 16px;
  transform: rotate(-6deg) scale(.9);
  opacity: 0;
  transition: opacity 200ms var(--ease), transform 220ms var(--ease);
}
.modal-stamp.is-visible { opacity: 1; transform: rotate(-6deg) scale(1); }
.modal.is-paid .qr-block { display: none; }
.is-settled .qr-block { display: none; }

/* -------------------------------------------------........... entrance */

@media (prefers-reduced-motion: no-preference) {
  .hero > div > * { animation: enter 420ms var(--ease) both; }
  .hero > div > :nth-child(1) { animation-delay: 40ms; }
  .hero > div > :nth-child(2) { animation-delay: 90ms; }
  .hero > div > :nth-child(3) { animation-delay: 140ms; }
  .hero > .panel { animation: enter 480ms var(--ease) both; animation-delay: 180ms; }
}

@keyframes enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dot.created { animation: none; }
  .stamp, .modal-stamp { transition: none; }
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .hero {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-top: 24px;
    padding-bottom: 56px;
  }
  /* the top-up form comes first so it is fully visible on entry */
  .hero .panel { order: -1; }
  .hero h1 { font-size: 28px; margin-bottom: 8px; }
  .hero-sub { font-size: 16px; margin-bottom: 20px; }
  .steps, .reviews { grid-template-columns: 1fr; gap: 20px; }
  .section { padding-top: 56px; padding-bottom: 56px; }

  /* no scene on phones */
  .hero-scene,
  .hero-section.has-scene::after { display: none; }
  .has-scene .panel { box-shadow: inset 0 1px 0 rgba(238, 240, 245, .06); }
}

@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .hdr-inner { gap: 12px; }
  .nav { display: none; }
  .support span { display: none; }
  .support { padding: 0 10px; }
  .panel { padding: 20px; }
  .field-row { grid-template-columns: 1fr; }
  .receipt .total-row strong { font-size: 24px; }
  .qr-only-desktop { display: none; }
}
