/* Tesseract Games — main site styles */

:root {
  --bg: #0b1020;
  --bg-elev: #121a30;
  --bg-card: #141d36;
  --line: #24304f;
  --text: #e9ebf2;
  --text-dim: #a3adc8;
  --text-faint: #6f7a99;
  --accent: #ef7d3c;   /* logo orange */
  --accent-hover: #f5904f;
  --blue: #4fa6ec;     /* logo blue */
  --accent-2: #f6c84b; /* logo yellow */
  --radius: 16px;
  --maxw: 1120px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 16, 32, .78);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; }

.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--text-dim); font-weight: 500; font-size: .95rem;
  padding: 8px 14px; border-radius: 999px; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--bg-card); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--bg-card); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: .95rem;
  border: 1px solid var(--line); color: var(--text); background: var(--bg-card);
  transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: #3a4a74; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 96px 0 120px; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70%; height: 140%;
  background: radial-gradient(closest-side, rgba(79, 166, 236, .22), transparent 70%);
  pointer-events: none;
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: 18px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 1.2rem; color: var(--text-dim); max-width: 34ch; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-visual { aspect-ratio: 1; width: 100%; max-width: 460px; justify-self: center; }
.hero-visual canvas { width: 100%; height: 100%; display: block; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head p { color: var(--text-dim); font-size: 1.1rem; }

/* ---------- Game card ---------- */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.game-card {
  display: flex; flex-direction: column; gap: 18px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; color: var(--text);
  transition: transform .2s, border-color .2s;
}
.game-card:hover { text-decoration: none; transform: translateY(-3px); border-color: #3a4a74; }
.game-card-media { width: calc(100% + 48px); max-width: none; margin: -24px -24px 0; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 62%; border-radius: var(--radius) var(--radius) 0 0; }
.game-card-top { display: flex; gap: 16px; align-items: center; }
.game-card-top img { width: 72px; height: 72px; border-radius: 18px; }
.game-card h3 { margin: 0 0 4px; }
.game-card .genre { color: var(--text-faint); font-size: .9rem; }
.game-card p { color: var(--text-dim); margin: 0; }
.game-card .more { color: var(--accent); font-weight: 600; font-size: .95rem; margin-top: auto; }

.badge {
  display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(246, 200, 75, .12); color: var(--accent-2);
}

.game-card.placeholder {
  align-items: center; justify-content: center; text-align: center;
  border-style: dashed; background: transparent; min-height: 220px; color: var(--text-faint);
}
.game-card.placeholder:hover { transform: none; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.about-text p { color: var(--text-dim); }
.team { display: grid; gap: 14px; }
.member {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--accent));
}
.member strong { display: block; }
.member span { color: var(--text-faint); font-size: .9rem; }

/* ---------- Contact ---------- */
.contact-box {
  background: linear-gradient(135deg, rgba(79, 166, 236, .16), rgba(239, 125, 60, .10));
  border: 1px solid var(--line); border-radius: 24px; padding: 48px; text-align: center;
}
.contact-box p { color: var(--text-dim); max-width: 48ch; margin: 0 auto 24px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--text-faint); font-size: .9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--text-dim); }

/* ---------- Legal / doc pages ---------- */
.doc { padding: 64px 0 96px; }
.doc .container { max-width: 760px; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.doc .updated { color: var(--text-faint); margin-bottom: 40px; }
.doc h2 { font-size: 1.4rem; margin-top: 2.2em; }
.doc h3 { font-size: 1.1rem; margin-top: 1.6em; }
.doc p, .doc li { color: var(--text-dim); }
.doc ul { padding-left: 1.3em; }
.doc li { margin-bottom: .4em; }
.doc strong { color: var(--text); }
.doc table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: .95rem; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--text); font-weight: 600; }
.doc td { color: var(--text-dim); }
.table-wrap { overflow-x: auto; }
.toc { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 40px; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin: .2em 0; }
.faq details { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--text); }
.faq details p { margin: 12px 0 0; }

/* ---------- 404 ---------- */
.notfound { display: grid; place-items: center; text-align: center; padding: 120px 0; }
.notfound .code {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(6rem, 20vw, 11rem); line-height: 1;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 8px;
}
.notfound p { color: var(--text-dim); margin-bottom: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { padding: 56px 0 80px; }
  .hero .container { grid-template-columns: 1fr; }
  .hero::before { inset: -10% 0 auto 0; width: 100%; height: 70%; }
  .hero-visual { max-width: 320px; order: -1; }
  .about-grid { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
  .contact-box { padding: 32px 20px; }
}
@media (max-width: 560px) {
  .nav a { padding: 8px 10px; font-size: .9rem; }
  .brand span { display: none; }
  .games-grid { grid-template-columns: 1fr; }
}
