/* FlashTeq site, v3. Reads as a software company first; games are one branch.
   System fonts only, so visitors make no third-party requests. */

:root {
  --paper: #f6f8fb;
  --surface: #ffffff;
  --ink: #0d1a3a;
  --ink-2: #3a486a;
  --muted: #56647f;
  --line: #dbe1ee;
  --line-strong: #b9c3da;
  --accent: #4b3fe0;
  --accent-ink: #ffffff;
  --accent-soft: #eceafd;

  --head: Bahnschrift, "DIN Alternate", "Segoe UI Variable Display", "SF Pro Display", Roboto, system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a1022;
    --surface: #111b38;
    --ink: #eef2ff;
    --ink-2: #c3cdea;
    --muted: #92a0c4;
    --line: #1f2c52;
    --line-strong: #34457a;
    --accent: #8d84ff;
    --accent-ink: #0a1022;
    --accent-soft: #1a2248;
  }
}

* { box-sizing: border-box; }

html { background: var(--paper); scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--body);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--head); margin: 0; color: var(--ink); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); line-height: 1.15; letter-spacing: -.005em; margin-bottom: 14px; }
h3 { font-size: 1.15rem; line-height: 1.25; }
.section-lead { color: var(--ink-2); max-width: 36em; margin: 0 0 36px; font-size: 1.08rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 14px; padding-bottom: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: block; }
.brand-word { height: 15px; width: calc(15px * 232 / 34); display: block; }
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-family: var(--head); font-size: 1rem; }
.site-nav a:not(.btn):hover { color: var(--ink); text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: 6px; border: 1px solid transparent;
  font: 600 1rem/1.2 var(--head); text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { padding: 8px 14px; font-size: .95rem; }

/* Hero */
.hero { padding: 72px 0 80px; }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 56px; align-items: center;
}
h1 {
  font-size: clamp(2.4rem, 5.2vw, 3.9rem); line-height: 1.04; letter-spacing: -.015em;
  font-weight: 700; margin-bottom: 22px; max-width: 14ch;
}
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 30em; margin: 0 0 16px; }
.motto { font-size: 1rem; color: var(--muted); max-width: 34em; margin: 0 0 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Branch diagram: the company mark with the three things it makes */
.tree {
  --root: 88px; --pad: 8px; --link: 36px; --stub: 36px; --wire: var(--line-strong);
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--link);
  align-items: center;
}
.root {
  position: relative; width: var(--root); height: var(--root);
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 22px;
}
.root svg { width: 58%; height: 58%; display: block; }
.root::after {
  content: ""; position: absolute; left: 100%; top: calc(50% - 1px);
  width: var(--link); height: 2px; background: var(--wire);
}
.branches { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-rows: 1fr; }
.branches li { position: relative; padding: var(--pad) 0 var(--pad) var(--stub); display: grid; }
.branches li::before {
  content: ""; position: absolute; left: 0; top: calc(50% - 1px);
  width: var(--stub); height: 2px; background: var(--wire);
}
.branches li::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--wire);
}
.branches li:first-child::after { top: 50%; }
.branches li:last-child::after { bottom: 50%; }
.branches li:only-child::after { display: none; }

.node {
  position: relative; display: block; overflow: hidden;
  padding: 14px 16px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); text-decoration: none;
}
.node strong { display: block; font: 700 1.05rem/1.25 var(--head); }
.node span { display: block; margin-top: 3px; color: var(--muted); font-size: .92rem; line-height: 1.4; }
.node-games { background: #070b17; border-color: #223158; color: #eef2ff; }
.node-games span { color: #93a3c7; }
.node-games::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, #3fe3ff, #8f6bff);
}
a.node:hover { border-color: var(--accent); }
.node-games:hover { border-color: #3fe3ff; }

/* Sections */
section { padding: 80px 0; }
.band-paper { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* What we build: hairline grid */
.build-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong);
}
.build-grid > div {
  padding: 28px 28px 30px; background: var(--surface);
  border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.build-grid h3 { margin-bottom: 8px; }
.build-grid p { margin: 0; color: var(--ink-2); max-width: 30em; }

/* How we work: an actual sequence, so it is numbered */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.steps li { position: relative; padding-top: 30px; border-top: 2px solid var(--line-strong); counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; top: -15px; left: 0;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font: 700 .9rem/1 var(--head);
}
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--ink-2); font-size: .98rem; }

/* Games band: fixed dark so the element colours keep their meaning in both schemes */
.games {
  --g-bg: #070b17; --g-panel: #0f1730; --g-line: #223158;
  --g-ink: #eef2ff; --g-muted: #93a3c7;
  --arc: #3fe3ff; --violet: #8f6bff;
  --fire: #ff7a45; --water: #3f9bff; --wind: #6fe3a0; --light: #ffd466; --dark: #b07cff;
  --tide: #2fd3b4; --coral: #ff8a78;
  position: relative; background: var(--g-bg); color: var(--g-ink); padding: 88px 0;
}
.games::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--arc), var(--violet));
}
.games h2, .games h3 { color: var(--g-ink); }
.games .section-lead { color: var(--g-muted); margin-bottom: 40px; }
.games-layout { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 48px; align-items: center; }

.rune-circle { width: 100%; max-width: 300px; height: auto; display: block; justify-self: center; }
.rune-circle .ring { fill: none; stroke: var(--g-line); stroke-width: 1.5; }
.rune-circle .ring-dash { fill: none; stroke: var(--g-line); stroke-width: 1.5; stroke-dasharray: 2 9; stroke-linecap: round; }
.rune-circle .star { fill: none; stroke: var(--g-line); stroke-width: 1.2; }
.rune-circle .node-el circle { fill: var(--g-bg); stroke: var(--c); stroke-width: 2; }
.rune-circle .node-el use { color: var(--c); }

.e-fire  { --c: var(--fire); }
.e-water { --c: var(--water); }
.e-wind  { --c: var(--wind); }
.e-light { --c: var(--light); }
.e-dark  { --c: var(--dark); }

.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: start; }
.gamecard {
  position: relative; background: var(--g-panel); border: 1px solid var(--g-line);
  border-radius: 10px; padding: 26px 24px 22px; overflow: hidden;
}
.gamecard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--bar); }
.gamecard.runetower { --bar: linear-gradient(90deg, var(--arc), var(--violet)); }
.gamecard.tidepool  { --bar: linear-gradient(90deg, var(--tide), var(--coral)); }
.gamecard .top { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.gamecard .art { width: 60px; height: 60px; flex: none; display: block; }
.status { display: inline-flex; align-items: center; gap: 8px; margin: 5px 0 0; font-size: .9rem; color: var(--g-muted); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.runetower .status { --dot: var(--arc); }
.tidepool .status  { --dot: var(--tide); }
.gamecard p { margin: 0 0 14px; max-width: 34em; color: var(--g-ink); font-size: .98rem; }
.elements { list-style: none; margin: 16px 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.elements li { display: inline-flex; align-items: center; gap: 7px; font-family: var(--head); font-size: .98rem; }
.elements svg { width: 20px; height: 20px; color: var(--c); display: block; }
.gamecard .rule { color: var(--g-muted); font-size: .93rem; }
.gamecard .promise { margin: 0; padding-top: 14px; border-top: 1px solid var(--g-line); color: var(--g-muted); font-size: .93rem; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: start; }
.about-grid p { margin: 0 0 14px; color: var(--ink-2); max-width: 34em; }
.facts { margin: 0; border-top: 1px solid var(--line-strong); }
.facts div { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .95rem; }
.facts dd { margin: 0; font-weight: 600; }

/* Contact */
.contact-panel {
  background: var(--accent-soft); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 44px 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
}
.contact-panel h2 { margin-bottom: 8px; }
.contact-panel p { margin: 0; color: var(--ink-2); max-width: 30em; }
.small { color: var(--muted); font-size: .95rem; margin-top: 18px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 28px; padding-top: 22px; padding-bottom: 36px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

/* Policy page */
.prose { padding: 48px 20px 40px; }
.prose > * { max-width: 720px; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.8rem); max-width: none; margin-bottom: 8px; letter-spacing: -.01em; }
.prose h2 { font-size: 1.25rem; margin: 2.2em 0 .5em; padding-top: 1.1em; border-top: 1px solid var(--line); }
.prose h3 { font-size: 1.1rem; margin: 0 0 .4em; }
.prose p { margin: .6em 0; color: var(--ink-2); }
.prose .meta { color: var(--muted); font-size: .95rem; }
.prose .game { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 18px 20px 8px; margin: 18px 0; }

/* Tablet and phone */
@media (max-width: 860px) {
  .hero { padding: 48px 0 56px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 44px; }
  h1 { max-width: 16ch; }
  .games-layout { grid-template-columns: 1fr; gap: 36px; }
  .rune-circle { max-width: 240px; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  section { padding: 64px 0; }
  .games { padding: 64px 0; }
}

@media (max-width: 560px) {
  .site-nav .hide-sm { display: none; }
  .site-nav { gap: 14px; }
  .tree { --root: 56px; --pad: 6px; --link: 20px; --stub: 20px; }
  .root { border-radius: 15px; }
  .node { padding: 12px 14px; }
  .build-grid { grid-template-columns: 1fr; }
  .build-grid > div { padding: 22px 20px 24px; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .steps li { border-top: 0; border-left: 2px solid var(--line-strong); padding: 0 0 28px 28px; }
  .steps li:last-child { padding-bottom: 0; }
  .steps li::before { top: 0; left: -15px; }
  .contact-panel { padding: 32px 22px; }
  .facts div { grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; }
}
