:root {
  --bg: #111215;
  --ink: #f3f1ea;
  --dim: rgba(243, 241, 234, 0.3);
  --soft: rgba(243, 241, 234, 0.56);
  --line: rgba(243, 241, 234, 0.1);
  --accent: #ffcf4a;
  --bad: #ff6a5a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: clamp(10px, 3vh, 30px) clamp(16px, 5vw, 48px);
}

/* --fs is the size of the text to type: it looks at the width and at the height of the window */
.tt { --fs: clamp(19px, min(5.400vw, 5.200vh), 30px); --lh: calc(var(--fs) * 1.55); width: min(640px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(10px, 3vh, 22px); }

.tt__stats { display: flex; align-items: flex-end; gap: clamp(16px, 5vw, 34px); }
.tt__stat { display: flex; flex-direction: column; gap: 2px; }
.tt__stat b { font-size: clamp(20px, 4.400vh, 26px); line-height: 1; font-weight: 700; font-stretch: 106%; letter-spacing: -0.02em; }
.tt__stat i { font-style: normal; font-size: 11.500px; font-weight: 620; color: var(--soft); }
.tt__stat--big b { --w: 520; font-size: clamp(40px, min(13vw, 11vh), 68px); line-height: 0.9; font-weight: 400; font-variation-settings: "wght" var(--w), "wdth" 106; letter-spacing: -0.03em; color: var(--accent); }
.tt__clock { position: relative; margin-left: auto; width: clamp(40px, 9vh, 52px); aspect-ratio: 1; display: grid; place-items: center; }
.tt__clock svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; }
.tt__track { stroke: var(--line); stroke-width: 3; }
.tt__arc { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 1; }
.tt__clock b { position: relative; font-size: 13px; font-weight: 700; }

.tt__pad { position: relative; height: calc(var(--lh) * 3); }
.tt__view { position: absolute; inset: 0; overflow: hidden; }
.tt__text { position: relative; font-size: var(--fs); line-height: var(--lh); font-weight: 560; font-stretch: 102%; letter-spacing: 0.005em; color: var(--dim); will-change: transform; }
.tt__text .w { display: inline-block; white-space: nowrap; }
.tt__text span span, .tt__text > span.s { display: inline-block; white-space: pre; transition: color 0.12s ease; }
.tt__text .is-ok { color: var(--ink); }
.tt__text .is-bad { color: var(--bad); }
.tt__text .s.is-bad { background: color-mix(in srgb, var(--bad) 36%, transparent); border-radius: 4px; }
.tt__caret { position: absolute; left: -1px; top: 0; width: 2.500px; height: calc(var(--fs) * 1.2); border-radius: 2px; background: var(--accent); will-change: transform, opacity; }
.tt__in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; background: none; color: transparent; caret-color: transparent; font-size: 16px; cursor: text; }
.tt__pad:has(.tt__in:focus-visible) { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 8px; border-radius: 6px; }

.tt__result { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: clamp(3px, 1vh, 8px); visibility: hidden; opacity: 0; }
.tt__verdict { font-size: clamp(22px, min(6.400vw, 5.600vh), 34px); line-height: 1.1; font-weight: 740; font-stretch: 106%; letter-spacing: -0.02em; }
.tt__detail { font-size: 13.500px; font-weight: 560; color: var(--soft); }
.tt__again { display: flex; align-items: center; gap: 8px; height: 42px; margin-top: clamp(4px, 1.400vh, 10px); padding: 0 17px 0 14px; border: 0; border-radius: 21px; background: var(--accent); color: #17140a; font: inherit; font-size: 13.500px; font-weight: 720; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.tt__again svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.800; stroke-linecap: round; stroke-linejoin: round; }
.tt__again:active { transform: scale(0.95); }
.tt__again:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

.tt__curve { display: block; width: 100%; height: clamp(30px, 9vh, 56px); overflow: visible; }
.tt__line { fill: none; stroke: var(--accent); stroke-width: 1.800; stroke-linecap: round; stroke-linejoin: round; }
.tt__fill { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.tt__say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (hover: hover) {
  .tt__again:hover { transform: scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
  .tt__text span span, .tt__again { transition: none; }
}
