/* Logical Crossing site — same palette as the game (LogicalCrossing.UI/wwwroot/logicalcrossing.css). */
:root {
  --surface: #ffffff; --card: #f4f5f9; --ink: #1d2130; --muted: #6b7285; --line: #d9dce5;
  --accent: #4f46e5; --accent-ink: #ffffff; --accent-soft: #e8e7fd;
  --check: #16a34a; --check-soft: #dcfce7; --cross: #dc2626; --cross-soft: #fee2e2;
  --hint: #d97706; --hint-soft: #fef3c7; --blue: #2563eb;
  --shadow: 0 12px 30px rgb(29 33 48 / .10); --radius: 18px;
  --page-bg:
    radial-gradient(circle at 12% 0%, var(--accent-soft) 0, transparent 42%),
    radial-gradient(circle at 100% 18%, var(--check-soft) 0, transparent 34%),
    var(--card);
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #171a29; --card: #10131f; --ink: #e8e9f0; --muted: #a3a8b8; --line: #2e3448;
    --accent: #8b85ff; --accent-ink: #10131f; --accent-soft: #26244a;
    --check: #4ade80; --check-soft: #14361f; --cross: #f87171; --cross-soft: #3d1a1a;
    --hint: #fbbf24; --hint-soft: #3a2c0c; --blue: #60a5fa;
    --shadow: 0 12px 30px rgb(0 0 0 / .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--page-bg); background-attachment: scroll; color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 820px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
mark.todo { background: var(--hint-soft); color: var(--hint); border-radius: 6px; padding: 0 4px; font-weight: 600; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 14px 22px; border-radius: 16px; font-weight: 600; font-size: 1.05rem;
  text-decoration: none; white-space: nowrap; transition: transform .12s, box-shadow .12s;
}
.btn:active { transform: translateY(1px); }
.btn-play { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px rgb(79 70 229 / .35); }
.btn-play:hover { box-shadow: 0 10px 26px rgb(79 70 229 / .45); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-sm { padding: 8px 14px; font-size: .95rem; border-radius: 12px; box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Header ── */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand svg { flex: none; border-radius: 9px; }
.brand b { color: var(--accent); font-weight: 700; }
.menu { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.menu a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 10px; }
.menu a:not(.btn):hover { background: var(--accent-soft); color: var(--accent); }
.menu a[aria-current] { color: var(--accent); background: var(--accent-soft); }
.flags { display: flex; gap: 4px; }
.top-play { flex: none; }
.flags a { display: inline-flex; padding: 5px; border-radius: 9px; border: 1.5px solid transparent; line-height: 0; opacity: .7; transition: opacity .12s; }
.flags a:hover { opacity: 1; background: var(--card); }
.flags a[aria-current] { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.flag { width: 27px; height: 18px; border-radius: 3px; box-shadow: 0 0 0 1px rgb(0 0 0 / .12); display: block; }

@media (max-width: 860px) {
  .top { position: static; }
  .top-in { gap: 8px 12px; }
  .top-play, .flags { margin-left: auto; }
  .top-play + .flags { margin-left: 0; }
  .menu { order: 3; width: 100%; margin: 0; flex-wrap: wrap; justify-content: flex-start; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .brand span { display: none; }
  .top-play { padding: 7px 12px; }
  .flags { gap: 2px; }
  .grid td { width: 25px; min-width: 25px; height: 25px; font-size: .85rem; }
  .grid th.row { padding-right: 4px; }
  .phone-screen { padding: 14px 8px; border-width: 6px; }
  .menu a:not(.btn) { padding: 6px 8px; font-size: .9rem; }
  .flags a { padding: 3px; }
  .flag { width: 22px; height: 15px; }
}

/* ── Hero ── */
.hero { padding: 56px 0 40px; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.kicker { display: inline-block; margin: 0 0 22px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .82rem; letter-spacing: .03em; }
.logo-tiles, .mini-logo {
  display: grid; grid-template-columns: repeat(3, 40px); gap: 6px; width: max-content;
  padding: 10px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 22px;
}
.logo-tiles span, .mini-logo span {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800; border: 1px solid var(--line); background: var(--surface);
  animation: pop .35s ease-out both;
}
.logo-tiles .check, .mini-logo .check { background: var(--check-soft); border-color: var(--check); color: var(--check); }
.logo-tiles .cross, .mini-logo .cross { color: var(--cross); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .logo-tiles span, .mini-logo span { animation: none; } html { scroll-behavior: auto; } }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); margin: 0; line-height: 1.05; }
h1 span { color: var(--accent); }
.tagline { margin: 12px 0 0; font-size: 1.3rem; font-weight: 600; color: var(--muted); }
.lead { margin: 18px 0 26px; font-size: 1.08rem; max-width: 560px; }
.stores { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.store {
  display: inline-flex; flex-direction: column; line-height: 1.15; padding: 8px 14px; border-radius: 12px;
  border: 1.5px dashed var(--line); color: var(--muted); background: color-mix(in srgb, var(--surface) 60%, transparent); cursor: default;
}
.store small { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.store b { font-size: 1rem; color: var(--ink); opacity: .65; }

/* Phone mock-up with a real grid of the tutorial puzzle. */
.phone { margin: 0; justify-self: center; width: 100%; max-width: 380px; }
.phone-screen {
  background: var(--surface); border-radius: 34px; padding: 18px 14px 16px;
  border: 8px solid #1d2130; box-shadow: 0 30px 60px rgb(29 33 48 / .22), 0 0 0 1px var(--line);
  transform: rotate(1.5deg);
}
.phone-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.phone-bar .back { width: 30px; height: 30px; border-radius: 10px; background: var(--card); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); }
.phone-bar div { flex: 1; text-align: center; padding-right: 30px; }
.phone-bar strong { display: block; font-size: .98rem; }
.badge { display: inline-block; margin-top: 2px; padding: 1px 9px; border-radius: 999px; background: var(--check); color: var(--surface); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.phone-clues { margin-top: 6px; background: var(--card); border-radius: 14px; padding: 10px 12px; }
.phone-clues h3 { margin: 0 0 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.phone-clues ol { margin: 0; padding-left: 1.3em; font-size: .85rem; }
.phone-clues li { margin: 2px 0; }
.phone figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 18px; }

@media (max-width: 860px) {
  .hero { padding: 36px 0 24px; }
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .phone-screen { transform: none; }
}

/* ── Sections ── */
.section { padding: 40px 0; }
.section-title { font-size: clamp(1.5rem, 3.4vw, 2rem); margin: 0 0 8px; }
.section-lead { color: var(--muted); margin: 0 0 22px; max-width: 640px; }
.section-title + :not(.section-lead) { margin-top: 22px; }

.link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.link-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.link-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.link-card .ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 800; background: var(--card); color: var(--ink); }
.link-card.accent .ico { background: var(--accent); color: var(--accent-ink); }
.link-card.check .ico { background: var(--check-soft); color: var(--check); }
.link-card .txt { display: flex; flex-direction: column; min-width: 0; }
.link-card .txt span { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.link-card .go { margin-left: auto; font-size: 1.6rem; color: var(--muted); }
@media (min-width: 1000px) {
  .link-grid.n5 { grid-template-columns: repeat(5, 1fr); }
  .link-grid.n4 { grid-template-columns: repeat(4, 1fr); }
  .link-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; }
  .link-card .go { display: none; }
}

.how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how-step { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.how-step .num { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.how-step h3 { margin: 14px 0 6px; font-size: 1.12rem; }
.how-step p { margin: 0; color: var(--muted); }

.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.level { background: var(--surface); border-radius: 16px; padding: 16px 18px; border: 1.5px solid var(--line); border-left: 6px solid var(--c); }
.level-easy { --c: var(--check); } .level-normal { --c: var(--blue); } .level-hard { --c: var(--hint); } .level-expert { --c: var(--cross); }
.level h3 { margin: 6px 0 4px; font-size: 1.1rem; }
.level p { margin: 0; color: var(--muted); font-size: .92rem; }
.stars i { font-style: normal; color: var(--line); letter-spacing: 1px; }
.stars i.on { color: var(--hint); }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature { padding: 20px; border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line); }
.feature .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--check-soft); color: var(--check); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 800; }
.feature h3 { margin: 12px 0 4px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: .94rem; }

@media (max-width: 960px) {
  .levels, .features { grid-template-columns: repeat(2, 1fr); }
  .how { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .levels, .features { grid-template-columns: 1fr; } }

/* ── Call-to-action band ── */
.band { padding: 32px 0 56px; }
.band-in {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--surface); border-radius: 28px; padding: 36px 20px; box-shadow: var(--shadow);
  background-image: radial-gradient(circle at 0% 0%, var(--accent-soft) 0, transparent 50%), radial-gradient(circle at 100% 100%, var(--check-soft) 0, transparent 45%);
}
.mini-logo { grid-template-columns: repeat(3, 26px); gap: 4px; padding: 7px; border-radius: 14px; margin-bottom: 16px; }
.mini-logo span { width: 26px; height: 26px; border-radius: 7px; font-size: .85rem; }
.band h2 { margin: 0; font-size: 1.6rem; }
.band p { margin: 6px 0 20px; color: var(--muted); }
.band .actions, .band .stores { justify-content: center; }

/* ── Footer ── */
.foot { background: var(--surface); border-top: 1px solid var(--line); padding: 36px 0 24px; }
.foot-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.foot-brand p { color: var(--muted); margin: 10px 0 0; }
.foot-col { display: flex; flex-direction: column; gap: 6px; }
.foot-col h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 4px 0 6px; }
.foot-col a { color: var(--ink); text-decoration: none; }
.foot-col a:hover { color: var(--accent); }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.foot-langs a { color: var(--muted); }
@media (max-width: 640px) { .foot-in { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* ── Article pages (tutorial, privacy, legal) ── */
.page-head { padding: 44px 0 20px; }
.page-head h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.8rem); }
.paper { background: var(--surface); border-radius: 24px; padding: 28px 32px 32px; box-shadow: var(--shadow); }
.paper > :first-child { margin-top: 0; }
.paper h2 { font-size: 1.35rem; margin: 1.8em 0 .5em; }
.paper h3 { font-size: 1.08rem; margin: 1.6em 0 .4em; }
.paper .muted:first-child { margin-top: 0; }
.paper table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.paper th, .paper td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.paper th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
@media (max-width: 560px) { .paper { padding: 20px 18px 24px; border-radius: 18px; } .page-head { padding: 28px 0 14px; } }

/* Tutorial */
.marks { display: flex; gap: 8px; }
.mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; font-weight: 800; }
.mark.x { color: var(--cross); }
.mark.v { background: var(--check-soft); color: var(--check); border-color: var(--check); }
.clue-box { background: var(--card); border-radius: 16px; padding: 14px 18px; margin: 1em 0; }
.clue-box h3 { margin: 0 0 6px; font-size: 1rem; }
.clues { padding-left: 1.4em; margin: 0; }
.clues li { margin: .25em 0; }
.step { border-top: 1px solid var(--line); margin-top: 1.4em; padding-top: .2em; }
.tuto-end { font-weight: 600; background: var(--check-soft); color: var(--ink); border-radius: 14px; padding: 12px 16px; }

/* Grids (same look as the app) */
.grid-wrap { overflow-x: auto; margin: .6em 0 1em; }
.grid { border-collapse: collapse; font-size: .75rem; margin: 0 auto; width: auto; }
.grid th, .grid td { padding: 0; border-bottom: 0; text-align: center; }
.grid th { font-weight: 600; color: var(--ink); }
.grid th.cat { color: var(--muted); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 0; }
.grid th.cat.v { width: 18px; }
.grid th.cat.v span, .grid th.col span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.grid th.col { height: 72px; vertical-align: bottom; padding-bottom: 4px; }
.grid th.row { text-align: right; padding-right: 6px; white-space: nowrap; }
.grid td { width: 30px; min-width: 30px; height: 30px; border: 1px solid var(--line); font-size: .95rem; font-weight: 700; background: var(--surface); }
.grid td.x { color: var(--cross); }
.grid td.v { background: var(--check-soft); color: var(--check); }
.grid td.f { box-shadow: inset 0 0 0 2px var(--accent); }
.grid td.end { border-right: 2px solid var(--ink); }
.grid tr.end td { border-bottom: 2px solid var(--ink); }
.grid td.void { border: 0; box-shadow: none; background: transparent; }
.grid.demo td { width: 28px; min-width: 28px; height: 28px; }
.grid.demo td.f { box-shadow: none; }

/* ── Language chooser (/) ── */
.chooser { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.chooser-in { text-align: center; padding: 32px 16px; }
.chooser-in svg { border-radius: 16px; }
.chooser-in h1 { font-size: 2.2rem; margin: 16px 0 4px; }
.lang-choices { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.lang-choice { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.lang-choice:hover { border-color: var(--accent); }

@media (max-width: 480px) {
  .grid.demo td { width: 21px; min-width: 21px; height: 22px; font-size: .78rem; }
  .grid.demo { font-size: .68rem; }
}
