:root {
  --bg: #06070a;
  --surface: #0e1220;
  --surface-2: #121a2a;
  --line: rgba(255,255,255,.12);
  --text: #f3f5fb;
  --muted: #8f97a8;
  --accent: #75a7ff;
  --accent-2: #ff7fa8;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(0,0,0,.35);
  --container: min(1180px, calc(100% - 2rem));
}

body.theme-light {
  --bg: #f5f7fd;
  --surface: #ffffff;
  --surface-2: #f0f3fb;
  --line: rgba(6, 7, 10, .12);
  --text: #111723;
  --muted: #556070;
  --shadow: 0 20px 50px rgba(17, 23, 35, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #06070a 0%, #0b0f18 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(117,167,255,.12), transparent 28%), radial-gradient(circle at bottom right, rgba(255,127,168,.1), transparent 24%);
  pointer-events: none;
  z-index: -2;
}

body.is-loading::before {
  content: "";
  position: fixed;
  inset: 0;
  background: #06070a;
  z-index: 9999;
}

.page-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a.container, .container {
  width: var(--container);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(4, 6, 10, .72);
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text);
}

.brand-mark .logo-image {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a, .nav-links button {
  color: var(--muted);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: .6rem .85rem;
  border-radius: 999px;
  transition: color .25s ease, background .25s ease;
}

.nav-links a:hover, .nav-links a.active, .nav-links button:hover {
  color: var(--text);
  background: rgba(255,255,255,.06);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .9rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.btn-secondary { background: rgba(255,255,255,.06); }

.hero {
  padding: 5rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .24em;
  font-size: .8rem;
  color: var(--accent);
  margin: 0 0 .7rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 4vw, 3.8rem);
  line-height: 1.04;
  margin: 0 0 1rem;
  letter-spacing: -.02em;
}

.hero p { color: var(--muted); max-width: 62ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }

.hero-card,
.panel,
.card,
.form-card,
.article-card,
.list-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-media {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(255,255,255,.1);
}

.hero-media img, .hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section {
  padding: 2.5rem 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-head h2 { margin: 0; font-size: 1.45rem; }

.grid-3 {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card { padding: 1.1rem; overflow: hidden; }
.card img, .card video { border-radius: 16px; width: 100%; height: 220px; object-fit: cover; margin-bottom: .9rem; }
.card h3 { margin: .15rem 0 .4rem; font-size: 1.1rem; }
.card p { margin: 0 0 .8rem; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .7rem; border-radius: 999px; background: rgba(117,167,255,.14); color: #bcd3ff; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }

.footer {
  margin-top: auto;
  padding: 1.8rem 0 2.2rem;
  border-top: 1px solid rgba(255,255,255,.07);
  color: var(--muted);
}

.footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer .links { display: flex; flex-wrap: wrap; gap: 1rem; }

.form-card { padding: 1.4rem; }
label { display: grid; gap: .45rem; margin-bottom: .9rem; color: #dce3f8; }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: .9rem 1rem;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: rgba(117,167,255,.65); box-shadow: 0 0 0 3px rgba(117,167,255,.18); }

.auth-shell { padding: 4rem 0; }
.auth-card {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 6px);
}
.auth-card .field { position: relative; }
.auth-card .field .toggle { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: var(--muted); cursor: pointer; }
.auth-card .helper { display: flex; justify-content: space-between; align-items: center; gap: .8rem; font-size: .9rem; color: var(--muted); }

.devlog-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.devlog-card { padding: 0; overflow: hidden; }
.devlog-card img { height: 240px; object-fit: cover; width: 100%; }
.devlog-card .body { padding: 1rem 1.1rem 1.1rem; }

.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.filters input { max-width: 360px; }
.filters select { max-width: 220px; }

.article { padding: 3rem 0 4rem; }
.article .hero-media { min-height: 360px; }
.article-content { max-width: 860px; margin: 0 auto; }
.article-content h2, .article-content h3 { margin-top: 2rem; }
.article-content img, .article-content iframe { border-radius: 20px; margin: 1rem 0; max-width: 100%; }
.article-content pre { overflow: auto; padding: 1rem; background: rgba(255,255,255,.05); border-radius: 16px; }

.back-to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; display: none; z-index: 80; }

.notice, .cookie-banner { background: rgba(117,167,255,.12); border: 1px solid rgba(117,167,255,.24); color: #bcd3ff; padding: .95rem 1rem; border-radius: 16px; margin-bottom: 1rem; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-3, .devlog-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-nav { flex-direction: column; align-items: flex-start; }
  .nav-links { width: 100%; overflow-x: auto; padding-bottom: .2rem; }
  .hero { padding-top: 3rem; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .footer .container { flex-direction: column; }
}
