/* FuseGrid site styles. System fonts only, no external requests, no scripts.
   Palette: the app's Day and Night skins (apps/mobile/src/features/themes/skins.ts):
   navy board panel, bevelled rainbow blocks, charcoal fuse with an ember glow. */

:root {
  color-scheme: light dark;
  --bg: #F4F7FF;          /* Day backdrop, lightened */
  --surface: #E3ECFF;
  --text: #141C42;        /* board cell navy */
  --muted: #3A4470;
  --accent: #1D2858;      /* board frame */
  --accent-text: #FFFFFF;
  --link: #2B47B8;
  --rule: #B9C8EE;
  --ember: #B85600;       /* fuse ember, darkened for text contrast on light */
  --focus: #B85600;
  --radius: 14px;
  --measure: 40rem;

  /* Fixed board colours (same in both schemes, like the app) */
  --board: #1D2858;
  --cell: #141C42;
  --cell-edge: #0C1231;
  --fuse: #2E3242;
  --fuse-light: #535A70;
  --fuse-dark: #14161F;
  --fuse-glow: #FF6A2B;
  --fuse-text: #FFB347;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1533;        /* Night backdrop bottom */
    --surface: #18224C;   /* Night board frame */
    --text: #EEF2FF;
    --muted: #C3CCEB;
    --accent: #FFB347;    /* fuse count */
    --accent-text: #141C42;
    --link: #9CC4FF;
    --rule: #2E3C78;
    --ember: #FFB347;
    --focus: #FFB347;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.1875rem;   /* 19px */
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.25;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 6vw, 2.75rem); margin: 0.2em 0 0.4em; }
h2 { font-size: 1.6rem; margin: 2em 0 0.5em; padding-top: 0.6em; border-top: 2px solid var(--rule); }
h3 { font-size: 1.3rem; margin: 1.5em 0 0.4em; }

p, ul, ol, dl, table { margin: 0 0 1em; }
li { margin-bottom: 0.4em; }

a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-text); padding: 0.6em 1em; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 64rem; margin: 0 auto; padding: 0 16px; }

/* Bevelled block: lit top/left, shaded bottom/right (the app's "bevel" block style). */
.b { display: block; border-radius: 18%; border: 0.14em solid; border-color: var(--l) var(--d) var(--d) var(--l); background: var(--f); }
.b-red    { --f: #F2453D; --l: #FF8A82; --d: #A8211B; }
.b-orange { --f: #FF8A1F; --l: #FFBC6B; --d: #B85600; }
.b-yellow { --f: #FFC928; --l: #FFE57A; --d: #B88A00; }
.b-green  { --f: #3FC65A; --l: #8AE88F; --d: #1F8530; }
.b-cyan   { --f: #26C2F0; --l: #86E0FA; --d: #0B7DA6; }
.b-blue   { --f: #3D6CF0; --l: #86A5FF; --d: #1E3BA8; }
.b-purple { --f: #A453F0; --l: #CE9BFF; --d: #6A22B0; }
.b-empty  { background: var(--cell); border-color: var(--cell-edge) var(--cell) var(--cell) var(--cell-edge); }
.b-fuse {
  --f: var(--fuse); --l: var(--fuse-light); --d: var(--fuse-dark);
  display: flex; align-items: center; justify-content: center;
  color: var(--fuse-text); font-weight: 800; font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif;
  box-shadow: 0 0 0.5em 0.08em var(--fuse-glow);
  position: relative; z-index: 1;
}

/* Header and navigation */
.site-header { background: var(--board); color: #FFFFFF; border-bottom: 4px solid transparent; border-image: linear-gradient(90deg, #F2453D, #FF8A1F, #FFC928, #3FC65A, #26C2F0, #3D6CF0, #A453F0) 1; }
.site-header .wrap-wide { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; padding-top: 0.8rem; padding-bottom: 0.8rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: #FFFFFF; text-decoration: none; font-weight: 800; font-size: 1.3rem; font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif; min-height: 44px; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 16px); grid-template-rows: repeat(2, 16px); gap: 3px; padding: 3px; background: var(--cell); border-radius: 8px; flex: none; font-size: 16px; }
.brand-mark .b { border-width: 2px; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a { color: #FFFFFF; text-decoration: none; display: inline-block; padding: 0.35rem 0; min-height: 44px; line-height: 2; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: #FFB347; text-decoration-thickness: 3px; }

main { padding: 0 0 3rem; }
main > .wrap:first-child, main > .wrap-wide:first-child { padding-top: 1.5rem; }

/* Hero */
.hero { background: var(--surface); border-bottom: 2px solid var(--rule); padding: 2.5rem 0 2rem; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 760px) { .hero-grid { grid-template-columns: 1fr auto; } }
.hero p.lede { font-size: 1.35rem; max-width: 34rem; }
.soon {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0.6rem 1.3rem; border-radius: 12px;
  background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: 1.1rem; margin: 0.5rem 0 1rem;
}

/* Decorative 8×8 board (aria-hidden) */
.board {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.18rem;
  width: min(100%, 18rem); aspect-ratio: 1; padding: 0.5rem;
  background: var(--board); border-radius: 18px; font-size: 1rem;
  box-shadow: 0 0.6rem 1.6rem rgba(13, 21, 51, 0.35);
  margin: 0 auto;
}
.board .b { border-width: 0.16rem; min-width: 0; min-height: 0; }

/* Feature blocks */
.features { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 2rem 0; padding: 0; list-style: none; }
@media (min-width: 720px) { .features { grid-template-columns: 1fr 1fr 1fr; } }
.feature { background: var(--surface); border: 2px solid var(--rule); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin: 0; }
.feature h3 { margin-top: 0.6rem; }
.feature p { margin-bottom: 0; }
.feature-icon { display: grid; grid-template-columns: repeat(3, 1.1rem); gap: 0.15rem; padding: 0.2rem; background: var(--board); border-radius: 8px; width: max-content; }
.feature-icon .b { width: 1.1rem; height: 1.1rem; border-width: 0.12rem; font-size: 0.75rem; }

.note { background: var(--surface); border-left: 6px solid var(--ember); padding: 0.9rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0; }
.placeholder { border-left-style: dashed; }

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1em; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1.5px solid var(--rule); padding: 0.5rem 0.7rem; text-align: left; vertical-align: top; }
thead th { background: var(--surface); }

/* FAQ */
details { border: 2px solid var(--rule); border-radius: var(--radius); padding: 0.6rem 1rem; margin-bottom: 0.8rem; background: var(--surface); }
summary { font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
details[open] summary { margin-bottom: 0.4rem; }

/* Footer */
.site-footer { border-top: 2px solid var(--rule); background: var(--surface); padding: 1.5rem 0 2rem; font-size: 1.125rem; }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; }
.site-footer li a { display: inline-block; min-height: 44px; line-height: 2.4; }
.site-footer p { color: var(--muted); }

/* 404 */
.lost { display: grid; grid-template-columns: repeat(3, 3.2rem); gap: 0.3rem; padding: 0.4rem; background: var(--board); border-radius: 14px; width: max-content; margin: 0.5rem 0 1rem; }
.lost .b { width: 3.2rem; height: 3.2rem; font-size: 1.6rem; border-width: 0.25rem; }

@media (prefers-reduced-motion: no-preference) {
  .b-fuse { animation: glow 2.4s ease-in-out infinite; }
  @keyframes glow { 50% { box-shadow: 0 0 0.9em 0.18em var(--fuse-glow); } }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #000; --rule: #000; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .site-header, .site-footer, .skip, .board { display: none !important; }
  a { color: #000; }
}

.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; }
