/* ==========================================================================
   Make24 — make24online.com
   Design tokens and layout per the design handoff. Hard-shadow, chunky,
   high-contrast. No blur on any shadow: offsets only.
   ========================================================================== */

/* --- Self-hosted fonts (both families are variable, one file per subset) --- */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens ------------------------------------------------------------- */
:root {
  --canvas: #FFF6E9;
  --surface: #FFFDF8;
  --card: #FFFFFF;
  --ink: #17161C;
  --ink-2: #4A4653;
  --muted: #8A8496;
  --muted-dark: #A19CAF;
  --line-dark: #35323F;
  --rule: #E4D9C6;
  --track: #F0E6D6;
  --accent: #6C4EF6;
  --accent-tint: #F3EEFF;
  --accent-ink: #4A32C9;
  --coral: #FF5C39;
  --coral-shadow: #C43B1E;
  --coral-tint: #FFE9E3;
  --lime: #B8F04A;
  --success: #3F9E1F;

  --display: 'Bricolage Grotesque', 'Space Grotesk', system-ui, sans-serif;
  --ui: 'Space Grotesk', system-ui, -apple-system, sans-serif;
}

/* --- Base --------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--ui);
  background: var(--canvas);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

button { font-family: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.shell { max-width: 1240px; margin: 0 auto; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--canvas);
  border-radius: 0 0 12px 0;
  font-weight: 700;
  z-index: 10;
}
.skip-link:focus { left: 0; color: var(--canvas); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Header ------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(20px, 5vw, 64px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }

/* Four small cards in a 2x2 — the mechanic, not a numeral. */
.brand__mark {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
  width: 36px;
  height: 36px;
  padding: 9px;
  border-radius: 11px;
  background: var(--ink);
}
.brand__mark i {
  display: block;
  border-radius: 2px;
  background: var(--lime);
}
.brand__mark i:nth-child(4) { background: var(--coral); }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
  font-size: 15px;
  font-weight: 500;
}
.site-nav__link { color: var(--ink-2); }
.site-nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--canvas);
  font-weight: 700;
}
.site-nav__cta:hover { color: var(--lime); }

/* --- Hero --------------------------------------------------------------- */
.hero {
  padding: clamp(28px, 6vw, 72px) clamp(20px, 5vw, 64px) clamp(40px, 7vw, 90px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--lime);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(46px, 8vw, 88px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin: 20px 0 0;
}
.hero__title em { font-style: normal; color: var(--accent); }

.hero__lead {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 30em;
  margin: 22px 0 0;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 30px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  box-shadow: 0 6px 0 var(--coral-shadow);
}
.btn-primary:hover { color: #fff; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 16px 28px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
}
.btn-ghost:hover { color: var(--ink); background: var(--surface); }

.hero__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(14px, 2vw, 22px);
  max-width: 460px;
  justify-self: center;
  width: 100%;
}

.hero-card {
  aspect-ratio: 1 / 1.18;
  border-radius: 26px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(56px, 9vw, 92px);
  border: 3px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  animation: floaty 6s ease-in-out infinite;
}
.hero-card--coral { background: var(--coral); color: #fff; }
.hero-card--accent { background: var(--accent); color: #fff; }
.hero-card:nth-child(1) { animation-delay: 0s; }
.hero-card:nth-child(2) { animation-delay: .8s; }
.hero-card:nth-child(3) { animation-delay: 1.6s; }
.hero-card:nth-child(4) { animation-delay: 2.4s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}

/* --- How it works ------------------------------------------------------- */
.how {
  background: var(--ink);
  color: var(--canvas);
  padding: clamp(48px, 8vw, 96px) clamp(20px, 5vw, 64px);
}
.how__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.how__sub { color: var(--muted-dark); font-size: 18px; margin: 0 0 44px; }
.how__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.step {
  border: 2px solid var(--line-dark);
  border-radius: 22px;
  padding: 28px;
}
.step__num {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}
.step:nth-child(1) .step__num { color: var(--lime); }
.step:nth-child(2) .step__num { color: var(--coral); }
.step:nth-child(3) .step__num { color: var(--accent); }
.step__title { font-size: 20px; font-weight: 700; margin: 14px 0 8px; }
.step__body { color: var(--muted-dark); line-height: 1.55; font-size: 15px; }

/* --- Game --------------------------------------------------------------- */
.play { padding: clamp(40px, 7vw, 88px) clamp(16px, 5vw, 64px) 40px; }
.play__inner { max-width: 820px; margin: 0 auto; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.levels {
  display: flex;
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: var(--track);
}
.level {
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: 999px;
  background: transparent;
  color: #6B6579;
}
.level[aria-pressed="true"] { background: var(--ink); color: var(--canvas); }

.toolbar__right { display: flex; align-items: center; gap: 12px; }

.timer {
  font-variant-numeric: tabular-nums;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
  min-width: 84px;
  text-align: right;
  color: var(--ink);
}
.timer.is-solved { color: var(--success); }

.btn-outline {
  border: 2px solid var(--ink);
  background: var(--canvas);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
}

.board {
  border: 3px solid var(--ink);
  border-radius: 32px;
  background: var(--card);
  box-shadow: 10px 10px 0 var(--ink);
  padding: clamp(20px, 4vw, 38px);
}

.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 34px;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}
.status.is-good { color: var(--success); }
.status.is-bad { color: var(--coral-shadow); }

.tiles,
.operators {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 2vw, 16px);
}
.operators { margin-top: clamp(10px, 2vw, 16px); }

.tile {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 800;
  aspect-ratio: 1 / 1.1;
  border-radius: 20px;
  display: grid;
  place-items: center;
  padding: 4px;
  background: var(--surface);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  font-size: clamp(34px, 7vw, 54px);
  transition: transform .14s ease, box-shadow .14s ease,
    background-color .14s ease, color .14s ease, border-color .14s ease;
  animation: pop .25s ease both;
}
.tile--med { font-size: clamp(26px, 5vw, 38px); }
.tile--small { font-size: clamp(20px, 4vw, 30px); }
.tile[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}
.tiles.is-solved .tile { background: var(--lime); }
.tile.is-empty {
  opacity: 0;
  visibility: hidden;
  box-shadow: none;
  border-color: transparent;
  background: transparent;
  animation: none;
}

@keyframes pop {
  0% { transform: scale(.7); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.op {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, 5vw, 34px);
  height: clamp(56px, 10vw, 70px);
  border-radius: 18px;
  border: 3px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform .14s ease, box-shadow .14s ease,
    background-color .14s ease, color .14s ease;
}
.op[aria-pressed="true"] {
  background: var(--ink);
  color: var(--lime);
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 2px dashed var(--rule);
}
.control {
  flex: 1 1 auto;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
}
.control:disabled { opacity: .4; cursor: default; }
.control--hint { background: var(--accent-tint); color: var(--accent-ink); }
.control--solution { background: var(--coral-tint); color: var(--coral-shadow); }

.hint {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}
.hint[hidden] { display: none; }

.typing { margin-top: 22px; padding-top: 20px; border-top: 2px dashed var(--rule); }
.typing__toggle {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}
.typing__toggle:hover { color: var(--coral); }
.typing__row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.typing__row[hidden] { display: none; }
.typing__input {
  flex: 1 1 220px;
  font-family: var(--ui);
  font-size: 17px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  min-width: 0;
}
.typing__submit {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 26px;
  border-radius: 16px;
  border: 0;
  background: var(--ink);
  color: var(--canvas);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(16px, 5vw, 48px);
  margin-top: 30px;
}
.stat { text-align: center; }
.stat__value {
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.02em;
}
.stat__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  padding: 40px 24px 56px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.site-footer p { margin: 0; }
.site-footer__links { margin-top: 10px; }
.site-footer__links a,
.site-footer__links button {
  color: var(--muted);
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer__links a:hover,
.site-footer__links button:hover { color: var(--coral); }

/* --- Solver -------------------------------------------------------------- */
.nowrap { white-space: nowrap; }

.solver {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) clamp(16px, 5vw, 64px) 24px;
}
.solver__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(38px, 7vw, 66px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 16px 0 0;
}
.solver__lead {
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.55;
  color: var(--ink-2);
  margin: 16px 0 28px;
  text-wrap: pretty;
}

.solver__inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 2vw, 16px);
}
.solver__input {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1.1;
  border-radius: 20px;
  border: 3px solid var(--ink);
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 6vw, 46px);
  text-align: center;
  color: var(--ink);
  padding: 0;
  outline: none;
  -moz-appearance: textfield;
}
.solver__input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 5px 5px 0 var(--accent);
}

.solver__go {
  width: 100%;
  margin-top: clamp(12px, 2vw, 18px);
  padding: 16px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--coral-shadow);
}
.solver__go:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--coral-shadow); }

.solver__result {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 2px dashed var(--rule);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
}
.solver__result.is-good { color: var(--success); }
.solver__result.is-bad { color: var(--coral-shadow); }

.solutions {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.solution {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 2px solid var(--rule);
}
.solution__n {
  flex: 0 0 auto;
  min-width: 26px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.solution__expr {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(15px, 2.4vw, 19px);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.solver__more { margin-top: 12px; width: 100%; flex: none; }

.solver__notes { margin-top: 40px; }
.solver__notes h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.solver__notes p { line-height: 1.65; color: var(--ink-2); margin: 0 0 12px; }

/* --- Article pages (privacy) -------------------------------------------- */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) clamp(16px, 5vw, 64px) 24px;
}
.article__card {
  border: 3px solid var(--ink);
  border-radius: 32px;
  background: var(--card);
  box-shadow: 10px 10px 0 var(--ink);
  padding: clamp(24px, 5vw, 44px);
}
.article h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 14px 0 0;
}
.article__lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 18px 0 0;
  text-wrap: pretty;
}
.article h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.02em;
  margin: 34px 0 10px;
}
.article p { line-height: 1.65; color: var(--ink-2); margin: 0 0 12px; }
.article__rule { border: 0; border-top: 2px dashed var(--rule); margin: 30px 0 0; }

/* --- 404 ----------------------------------------------------------------- */
.notfound {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) clamp(20px, 5vw, 64px) 64px;
  text-align: center;
}
.notfound h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(56px, 12vw, 110px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin: 0;
}
.notfound p { color: var(--ink-2); font-size: 18px; margin: 16px 0 32px; }

/* --- Motion preferences -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero-card { animation: none; }
  .tile { animation: none; transition: none; }
  .op { transition: none; }
}
