/* Intrascript / Gridly site styles — palette matches the Gridly game. */
:root {
  --night: #0B1021;      /* game background */
  --board: #151C32;      /* game board */
  --panel: #18223D;      /* game dialogs */
  --rule: #2B3759;       /* empty cell */
  --text: #EEF1FA;
  --muted: #A9B3CE;
  --pink: #FF4B6E;
  --blue: #00B4FF;
  --green: #10D470;
  --yellow: #FFC700;
  --purple: #A855F7;
  --orange: #FF7A1A;
  --sky: #38BDF8;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(168, 85, 247, .22), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(0, 180, 255, .18), transparent 60%),
    var(--night);
  font: 17px/1.65 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--sky); text-underline-offset: 3px; }
a:hover { color: var(--yellow); }
img, svg { max-width: 100%; }
.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 12px; top: 12px; background: var(--yellow); color: #000; padding: 8px 12px; border-radius: 8px; z-index: 10; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(11, 16, 33, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: .3px;
}
.brand:hover { color: var(--text); }
.logo { display: grid; grid-template-columns: repeat(2, 13px); gap: 3px; }
.logo span { width: 13px; height: 13px; border-radius: 4px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.35); }
.logo span:nth-child(1) { background: var(--pink); }
.logo span:nth-child(2) { background: var(--yellow); }
.logo span:nth-child(3) { background: var(--blue); }
.logo span:nth-child(4) { background: var(--green); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.nav a.link {
  display: block; padding: 7px 14px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px;
}
.nav a.link:hover { color: var(--text); background: var(--panel); }
.nav a.link[aria-current="page"] { color: #0B1021; background: var(--yellow); }

/* ---------- Layout ---------- */
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 20px 64px; }
.narrow { max-width: 780px; margin: 0 auto; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 24px 0 40px; }
.eyebrow { color: var(--yellow); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; margin: 0 0 10px; }
h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.08; margin: 0 0 16px; letter-spacing: -.5px; }
h1 .pop { background: linear-gradient(90deg, var(--pink), var(--yellow) 45%, var(--green) 70%, var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 24px; line-height: 1.25; margin: 40px 0 12px; }
h3 { font-size: 18px; margin: 0 0 6px; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 24px; max-width: 34em; }
p, li { margin: 0 0 12px; }
ul.list { padding-left: 22px; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent), var(--panel);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 28px 30px;
}
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: clamp(30px, 4.4vw, 42px); }
.meta { color: var(--muted); font-size: 14px; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.tile { border-top: 5px solid var(--c, var(--blue)); }
.tile p { color: var(--muted); margin: 0; }
.c-pink { --c: var(--pink); } .c-blue { --c: var(--blue); } .c-green { --c: var(--green); }
.c-yellow { --c: var(--yellow); } .c-purple { --c: var(--purple); } .c-orange { --c: var(--orange); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 12px 22px; border-radius: 14px; border: 0;
  font: inherit; font-weight: 800; text-decoration: none;
  color: #0B1021; background: var(--yellow);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.22), 0 8px 24px rgba(255, 199, 0, .18);
  transition: transform .08s ease;
}
.btn:hover { color: #0B1021; transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.alt { background: var(--blue); box-shadow: inset 0 -4px 0 rgba(0,0,0,.22), 0 8px 24px rgba(0,180,255,.18); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--rule); }
.btn.ghost:hover { color: var(--yellow); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.badge-note { color: var(--muted); font-size: 14px; margin-top: 12px; }

/* ---------- Decorative board ---------- */
.board {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px;
  padding: 14px; border-radius: 22px; background: var(--board);
  border: 1px solid var(--rule); box-shadow: 0 30px 60px rgba(0,0,0,.45);
  width: 100%; aspect-ratio: 1; max-width: 380px; margin-left: auto;
}
.board i { border-radius: 6px; background: #0E1324; }
.board i.b { box-shadow: inset 0 -5px 0 rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.35); }
.board i.p { background: var(--pink); } .board i.u { background: var(--blue); }
.board i.g { background: var(--green); } .board i.y { background: var(--yellow); }
.board i.v { background: var(--purple); } .board i.o { background: var(--orange); }

/* ---------- Legal text ---------- */
.legal h2 { font-size: 20px; margin: 34px 0 8px; padding-top: 4px; }
.legal h2::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--yellow)); margin-right: 10px; vertical-align: 2px; }
.legal h2:nth-of-type(6n+1) { --c: var(--pink); }
.legal h2:nth-of-type(6n+2) { --c: var(--blue); }
.legal h2:nth-of-type(6n+3) { --c: var(--green); }
.legal h2:nth-of-type(6n+4) { --c: var(--yellow); }
.legal h2:nth-of-type(6n+5) { --c: var(--purple); }
.legal h2:nth-of-type(6n+6) { --c: var(--orange); }
.legal h3 { font-size: 16px; margin: 22px 0 6px; }
.summary { border-left: 4px solid var(--green); background: rgba(16, 212, 112, .08); padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 0 0 8px; }
code { font: 14px Consolas, monospace; background: var(--night); border: 1px solid var(--rule); border-radius: 6px; padding: 1px 6px; }
table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--rule); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; border-top: 0; }
.toc { columns: 2; padding-left: 20px; color: var(--muted); font-size: 15px; }

/* ---------- FAQ ---------- */
details { background: var(--panel); border: 1px solid var(--rule); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 700; }
details[open] summary { color: var(--yellow); margin-bottom: 8px; }
details p:last-child { margin-bottom: 0; }

/* ---------- Forms ---------- */
form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; font-weight: 700; font-size: 14px; margin: 0 0 6px; }
.field { margin-bottom: 18px; }
.hint { color: var(--muted); font-weight: 400; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--night); border: 2px solid var(--rule); border-radius: 12px; padding: 11px 14px;
}
textarea { min-height: 160px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips label {
  margin: 0; cursor: pointer; padding: 8px 14px; border-radius: 999px; font-weight: 700;
  background: var(--night); border: 2px solid var(--rule); color: var(--muted);
}
.chips input:checked + label { color: #0B1021; background: var(--c); border-color: var(--c); }
.chips input:focus-visible + label { outline: 2px solid var(--text); outline-offset: 2px; }
.form-status { margin-top: 14px; color: var(--green); font-weight: 600; min-height: 1.6em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); background: rgba(11,16,33,.7); }
.footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 28px 20px;
  display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 14px;
}
.footer-inner ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--yellow); }
.stripe { height: 5px; background: linear-gradient(90deg, var(--pink) 0 16.6%, var(--orange) 0 33.3%, var(--yellow) 0 50%, var(--green) 0 66.6%, var(--blue) 0 83.3%, var(--purple) 0); }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  main { padding: 28px 16px 48px; }
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .board { margin: 0 auto; max-width: 300px; }
  .card { padding: 22px 20px; }
  form .row { grid-template-columns: 1fr; gap: 0; }
  .toc { columns: 1; }
  .nav { justify-content: center; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { border-top: 1px solid var(--rule); padding: 10px 0; }
  td { border: 0; padding: 2px 0; }
  td:first-child { font-weight: 700; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }

/* ---- Languages ---- */
.lang-link { white-space: nowrap; }
.lang-banner { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 14px; background: var(--yellow); color: #111; font-weight: 700; font-size: 14px; }
.lang-banner a { color: #111; text-decoration: underline; }
.lang-banner button { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: #111; padding: 0 4px; }
.lang-list { list-style: none; padding: 0; margin: 0; columns: 3 160px; column-gap: 24px; }
.lang-list li { padding: 6px 0; break-inside: avoid; }

/* ---- Right-to-left languages (Arabic, Hebrew, Urdu) ---- */
[dir="rtl"] ul.list { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .summary { border-left: 0; border-right: 4px solid var(--green); border-radius: 12px 0 0 12px; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }
[dir="rtl"] .board { margin-left: 0; margin-right: auto; }
[dir="rtl"] .legal h2::before { margin-right: 0; margin-left: 10px; }
[dir="rtl"] .toc { padding-left: 0; padding-right: 20px; }
