/* ============================================================
   THE DENIRO CHECK - site styles
   ------------------------------------------------------------
   Want different colors? Change the values in :root below.
   Everything else on the site uses these.
   ============================================================ */

:root {
  --bg: #12131c;          /* page background */
  --card: #1c1e2b;        /* card background */
  --raised: #262939;      /* boxes inside the card */
  --line: #353950;        /* borders */
  --ink: #f2f3f8;         /* main text */
  --ink-soft: #a6a9c2;    /* secondary text */

  --accent: #7c5cff;      /* main buttons and highlights */
  --accent-dark: #6644f0;
  --accent-soft: rgba(124, 92, 255, .18);
  --good: #37d6a0;        /* correct / done */
  --good-soft: rgba(55, 214, 160, .16);
  --bad: #ff8fa3;         /* wrong answer text */

  --radius: 20px;
  --radius-sm: 13px;

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --max: 520px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image: radial-gradient(circle at 50% -10%, rgba(124, 92, 255, .22), transparent 55%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }

:focus-visible { outline: 3px solid var(--good); outline-offset: 3px; border-radius: 8px; }

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--ink); color: var(--bg);
  padding: 10px 14px; border-radius: 10px; z-index: 10;
  text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header { padding-top: env(safe-area-inset-top); }
.header-inner { display: flex; align-items: center; min-height: 60px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 22px 0 20px; }
.hero h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 9vw, 3rem);
  letter-spacing: .03em;
  line-height: 1.05;
}
.subtitle { margin: 0; color: var(--ink-soft); font-size: 1.1rem; }

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
@media (min-width: 560px) { .card { padding: 28px; } }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stage-label {
  margin: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: .85rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft);
}
.timer {
  margin: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  background: var(--raised); border: 1px solid var(--line);
  padding: 4px 12px; border-radius: 999px;
}
.dots { display: flex; gap: 6px; margin: 12px 0 18px; }
.dots span { flex: 1; height: 6px; border-radius: 99px; background: var(--line); }
.dots .is-now { background: var(--accent); }
.dots .is-done { background: var(--good); }

.panel h2 {
  margin: 0 0 12px;
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.35rem; line-height: 1.2;
}
.ask { display: block; margin: 0 0 12px; font-size: 1.05rem; }
.ask strong { color: var(--good); }
.sub { margin: -6px 0 12px; color: var(--ink-soft); font-size: .95rem; }

.stage-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.stage-list li { display: flex; align-items: center; gap: 12px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.stage-list strong { color: var(--ink); }
.stage-list li > span:last-child { color: var(--ink-soft); }
.num {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: #c9bcff;
  font-family: var(--font-display); font-weight: 700;
}
.fine { margin: 14px 0 0; color: var(--ink-soft); font-size: .85rem; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 20px;
  border-radius: 14px; border: 2px solid transparent;
  font: inherit; font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; letter-spacing: .06em;
  cursor: pointer;
  transition: background-color .15s, transform .1s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-ghost { background: var(--raised); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); }
.btn-big { width: 100%; min-height: 60px; font-size: 1.15rem; }
.btn-wide { width: 100%; margin-top: 12px; }

/* ---------- Feedback line ---------- */
.note { min-height: 1.5em; margin: 12px 0 0; font-weight: 700; color: var(--bad); text-align: center; }
.note.is-good { color: var(--good); }

/* ---------- Stage 1: typing ---------- */
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: line; }
.lines li { position: relative; counter-increment: line; }
.lines li::before {
  content: counter(line);
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-weight: 700; color: #7d819c; font-size: .9rem;
}
.input {
  width: 100%; min-height: 50px;
  padding: 10px 42px 10px 36px;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--raised); color: var(--ink);
  font: inherit; font-size: 16px; /* stops iPhones from zooming in */
  font-weight: 600;
}
.input::placeholder { color: #5e6280; font-weight: 500; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tick {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  display: none; place-items: center;
  background: var(--good); color: var(--bg); font-size: .8rem; font-weight: 800;
}
.lines li.is-ok .input { border-color: var(--good); background: var(--good-soft); }
.lines li.is-ok .tick { display: grid; }
.answer { padding-left: 14px; padding-right: 14px; text-align: center; font-size: 1.4rem; letter-spacing: .08em; }

/* ---------- Stage 2: shapes ---------- */
.shape-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.shape-tile {
  min-width: 0; aspect-ratio: 1; padding: 10%;
  border: 2px solid var(--line); border-radius: 12px;
  background: #f6f4ee;
  cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.shape-tile[aria-pressed="true"] {
  border-color: var(--good);
  box-shadow: 0 0 0 4px var(--good);
  transform: scale(.9);
}

/* ---------- Stage 4: mini challenges ---------- */
.big {
  display: block; margin: 4px 0 12px; text-align: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: 2.2rem; letter-spacing: .12em;
}
.code { display: flex; justify-content: center; gap: 10px; letter-spacing: 0; }
.code span { display: inline-block; }
.slider { display: flex; align-items: center; gap: 8px; }
.range { flex: 1; min-width: 0; height: 44px; accent-color: var(--accent); }
.step { min-width: 50px; min-height: 50px; padding: 0; font-size: 1.4rem; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile {
  min-height: 62px; padding: 8px;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--raised); color: var(--ink);
  font: inherit; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
  cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tile:hover { border-color: var(--accent); }
.tile.is-done { border-color: var(--good); background: var(--good-soft); color: var(--good); cursor: default; }
.tile-word { font-size: 1.15rem; text-transform: capitalize; }
.hold {
  position: relative; width: 100%; min-height: 76px;
  border: 2px solid var(--accent); border-radius: 16px;
  background: var(--accent-soft); color: #d6ccff;
  font: inherit; font-family: var(--font-display); font-weight: 700;
  font-size: 1.2rem; letter-spacing: .08em;
  overflow: hidden; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.hold-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(124, 92, 255, .55); }
.hold-label { position: relative; }

/* ---------- Finish ---------- */
.done { text-align: center; }
.done:focus { outline: none; }
.done-badge { display: grid; place-items: center; margin: 6px 0 14px; }
.done h2 { font-size: 1.5rem; letter-spacing: .04em; }
.done-time { margin: 0 0 20px; font-size: 1.2rem; color: var(--ink-soft); }
.done-time strong { color: var(--good); font-family: var(--font-display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 26px 0 calc(22px + env(safe-area-inset-bottom));
  text-align: center; color: var(--ink-soft); font-size: .9rem;
}
.site-footer p { margin: 0; }

@media (max-height: 640px) {
  .hero { padding: 8px 0 12px; }
  .hero h1 { font-size: 1.7rem; }
  .card { padding: 16px; }
  .lines { gap: 6px; }
  .input { min-height: 44px; }
  .dots { margin: 8px 0 12px; }
}
