  /* ---------- tokens ---------- */
  /* Dark mode (default) */
  :root, :root[data-theme="dark"] {
    --bg:        #0a0a0a;
    --bg-2:      #111111;
    --surface:   #141414;
    --surface-2: #1a1a1a;
    --line:      rgba(255,255,255,0.06);
    --line-2:    rgba(255,255,255,0.10);
    --text:      #ededed;
    --text-dim:  #8a8a8a;
    --text-mute: #5a5a5a;
    --accent:    #ff6a1a;
    --accent-soft: rgba(255,106,26,0.12);
    --accent-glow: rgba(255,106,26,0.35);
    --radius:    14px;
    --radius-lg: 22px;
  }

  /* Light mode */
  :root[data-theme="light"] {
    --bg:        #ffffff;
    --bg-2:      #fafafa;
    --surface:   #f5f5f5;
    --surface-2: #eeeeee;
    --line:      rgba(0,0,0,0.08);
    --line-2:    rgba(0,0,0,0.12);
    --text:      #1a1a1a;
    --text-dim:  #666666;
    --text-mute: #999999;
    --accent:    #ff6a1a;
    --accent-soft: rgba(255,106,26,0.08);
    --accent-glow: rgba(255,106,26,0.25);
    --radius:    14px;
    --radius-lg: 22px;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* subtle ambient orange glow at top */
  body::before {
    content: "";
    position: fixed;
    inset: -20% -20% auto -20%;
    height: 60vh;
    background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255,106,26,0.12), transparent 70%);
    pointer-events: none;
    z-index: 0;
  }

  .wrap {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
    z-index: 1;
  }

  /* ---------- header ---------- */
  header.site {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 24px;
  }

  .logo {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.01em;
    color: var(--accent);
    text-decoration: none;
  }
  .logo .dot {
    width: 8px;
    height: 8px;
    margin-left: 4px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 0 14px var(--accent-glow);
    align-self: center;
  }
  .logo .tld {
    color: var(--text-mute);
    font-weight: 500;
    margin-left: 2px;
    font-size: 14px;
  }

  nav.primary {
    display: flex;
    gap: 28px;
    align-items: center;
  }
  nav.primary a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s ease;
  }
  nav.primary a:hover { color: var(--text); }
  nav.primary a.active { color: var(--text); }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .header-cta {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-mute);
    letter-spacing: 0.02em;
  }
  .header-cta .live {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    margin-right: 6px;
    box-shadow: 0 0 8px rgba(74,222,128,0.6);
    animation: pulse 2s infinite;
    vertical-align: middle;
  }

  /* Theme toggle button */
  .theme-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-dim);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
  }

  .theme-toggle:hover {
    background: var(--line-2);
    color: var(--text);
  }

  .theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  /* Show/hide icons based on theme */
  :root[data-theme="dark"] .theme-toggle .sun-icon,
  :root:not([data-theme]) .theme-toggle .sun-icon {
    opacity: 1;
    transform: rotate(0deg);
  }

  :root[data-theme="dark"] .theme-toggle .moon-icon,
  :root:not([data-theme]) .theme-toggle .moon-icon {
    opacity: 0;
    transform: rotate(180deg);
    position: absolute;
  }

  :root[data-theme="light"] .theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
    position: absolute;
  }

  :root[data-theme="light"] .theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
  }

  /* ---------- hero intro ---------- */
  .hero-intro {
    padding: 56px 0 36px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 32px;
  }
  .hero-intro h1 {
    margin: 0;
    font-size: clamp(40px, 5.4vw, 68px);
    line-height: 1.02;
    letter-spacing: -0.035em;
    font-weight: 600;
    max-width: 14ch;
  }
  .hero-intro h1 em {
    font-style: normal;
    color: var(--accent);
  }
  .hero-intro p {
    margin: 0;
    color: var(--text-dim);
    font-size: 15px;
    max-width: 32ch;
    line-height: 1.5;
  }
  .eyebrow {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .eyebrow::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--accent);
  }

  /* ---------- featured grid ---------- */
  .featured {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
  }

  .tile {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    isolation: isolate;
  }
  .tile:hover {
    border-color: var(--line-2);
    transform: translateY(-2px);
    background: var(--surface-2);
  }
  .tile:hover .play-pill {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
  }
  .tile:hover .board {
    transform: scale(1.02);
  }

  /* big featured tile */
  .tile.featured {
    aspect-ratio: 1 / 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .tile.featured .tag {
    position: absolute;
    top: 28px;
    right: 28px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(255,106,26,0.25);
    padding: 6px 10px;
    border-radius: 999px;
  }
  .tile.featured .meta-top {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-mute);
    letter-spacing: 0.06em;
  }
  .tile.featured h2 {
    margin: 6px 0 14px;
    font-size: clamp(34px, 3.2vw, 46px);
    line-height: 1;
    letter-spacing: -0.03em;
    font-weight: 600;
  }
  .tile.featured .desc {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.55;
    max-width: 36ch;
  }
  .tile.featured .bottom {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
  }
  .tile.featured .stats {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
  }
  .tile.featured .stat .k {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  .tile.featured .stat .v {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
  }
  .tile.featured .stat .v .accent { color: var(--accent); }

  /* small tiles column */
  .small-stack {
    display: grid;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 18px;
  }
  .tile.small {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
    padding: 22px;
    gap: 18px;
    min-height: 0;
  }
  .tile.small .info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
  }
  .tile.small .num {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.1em;
  }
  .tile.small h3 {
    margin: 8px 0 0;
    font-size: 22px;
    letter-spacing: -0.02em;
    font-weight: 600;
    line-height: 1.1;
  }
  .tile.small .sub {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
  }
  .tile.small .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    gap: 10px;
  }
  .tile.small .difficulty {
    display: inline-flex;
    gap: 3px;
    align-items: center;
  }
  .tile.small .difficulty span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-mute);
  }
  .tile.small .difficulty span.on { background: var(--accent); }
  .tile.small .preview {
    width: 96px;
    height: 96px;
    align-self: center;
    flex-shrink: 0;
  }

  /* play pill */
  .play-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line-2);
    transition: all 0.2s ease;
    width: fit-content;
  }
  .play-pill svg { width: 10px; height: 10px; }

  /* coming soon variant */
  .tile.soon {
    border-style: dashed;
    border-color: rgba(255,255,255,0.08);
    background: transparent;
  }
  .tile.soon:hover {
    background: rgba(255,255,255,0.02);
    transform: none;
  }
  .tile.soon h3 { color: var(--text-dim); }
  .tile.soon .ghost-board {
    width: 96px;
    height: 96px;
    align-self: center;
    border-radius: 8px;
    border: 1px dashed rgba(255,255,255,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-mute);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 22px;
  }

  /* ---------- sudoku board art ---------- */
  .board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    aspect-ratio: 1 / 1;
    width: 100%;
    background: #0c0c0c;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s ease;
  }
  .board.large {
    width: 60%;
    max-width: 320px;
    margin: 12px auto 0;
    border-radius: 10px;
  }
  .board .cell {
    border-right: 1px solid rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 9px;
    color: var(--text-dim);
    position: relative;
  }
  .board.large .cell { font-size: 14px; }
  .board .cell:nth-child(3n) { border-right: 1px solid rgba(255,255,255,0.13); }
  .board .cell:nth-child(9n) { border-right: none; }
  /* rows 3 and 6 thicker bottom */
  .board .cell.row3 { border-bottom: 1px solid rgba(255,255,255,0.13); }
  .board .cell.last-row { border-bottom: none; }
  .board .cell.given { color: var(--text); }
  .board .cell.given.accent { color: var(--accent); }

  /* killer cages */
  .board .cell.cage {
    box-shadow: inset 0 0 0 1px rgba(255,106,26,0.0);
  }
  .board .cell.cage-tl { border-top: 1px dashed var(--accent); border-left: 1px dashed var(--accent); }
  .board .cell.cage-tr { border-top: 1px dashed var(--accent); border-right: 1px dashed var(--accent) !important; }
  .board .cell.cage-bl { border-bottom: 1px dashed var(--accent) !important; border-left: 1px dashed var(--accent); }
  .board .cell.cage-br { border-bottom: 1px dashed var(--accent) !important; border-right: 1px dashed var(--accent) !important; }
  .board .cell .sum {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 7px;
    color: var(--accent);
    font-weight: 600;
  }
  .board.large .cell .sum { font-size: 10px; top: 2px; left: 3px; }

  /* sudoku X diagonals */
  .board.x-variant {
    position: relative;
  }
  .board.x-variant::before,
  .board.x-variant::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, transparent calc(50% - 0.5px), rgba(255,106,26,0.25) calc(50% - 0.5px), rgba(255,106,26,0.25) calc(50% + 0.5px), transparent calc(50% + 0.5px));
    pointer-events: none;
  }
  .board.x-variant::after {
    background: linear-gradient(to top right, transparent calc(50% - 0.5px), rgba(255,106,26,0.25) calc(50% - 0.5px), rgba(255,106,26,0.25) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  }

  /* ---------- section heading ---------- */
  .section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin: 64px 0 22px;
  }
  .section-head h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
  }
  .section-head .count {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-mute);
  }
  .filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  .filters button {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .filters button:hover { color: var(--text); border-color: var(--line-2); }
  .filters button.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
  }

  /* ---------- catalog grid ---------- */
  .catalog {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
  .card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 14px;
    aspect-ratio: 1 / 1.05;
  }
  .card:hover {
    border-color: var(--line-2);
    background: var(--surface-2);
    transform: translateY(-2px);
  }
  .card .top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .card .top-row .new {
    color: var(--accent);
  }
  .card .preview-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
  }
  .card .preview-wrap .board {
    width: 70%;
    max-width: 140px;
  }
  .card h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
  }
  .card .card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dim);
    font-size: 12px;
  }
  .card .card-foot .arrow {
    color: var(--text-mute);
    transition: transform 0.2s ease, color 0.2s ease;
  }
  .card:hover .card-foot .arrow {
    color: var(--accent);
    transform: translateX(2px);
  }
  .card.is-soon { opacity: 0.55; pointer-events: none; }
  .card.is-soon:hover { transform: none; }

  /* ---------- footer ---------- */
  footer.site {
    margin-top: 96px;
    padding: 36px 0 48px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-mute);
    font-size: 13px;
  }
  footer.site .links { display: flex; gap: 24px; }
  footer.site a { color: var(--text-dim); text-decoration: none; }
  footer.site a:hover { color: var(--text); }
  footer.site .build {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
  }

  /* ---------- responsive ---------- */
  @media (max-width: 960px) {
    .featured { grid-template-columns: 1fr; }
    .tile.featured { aspect-ratio: 4 / 3; padding: 24px; }
    .small-stack { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr; }
    .tile.small { grid-template-columns: 1fr; }
    .tile.small .preview { width: 64px; height: 64px; }
    .tile.small .info { gap: 8px; }
    .catalog { grid-template-columns: repeat(2, 1fr); }
    .hero-intro { grid-template-columns: 1fr; }
  }
  @media (max-width: 560px) {
    .wrap { padding: 0 18px; }
    nav.primary { display: none; }
    .small-stack { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr 1fr; }
    .tile.small { grid-template-columns: 1fr auto; }
    .catalog { grid-template-columns: 1fr 1fr; gap: 10px; }
    .tile.featured { padding: 20px; }
    .tile.featured .stats { gap: 18px; }
  }
