/* =========================================================
   Brucha Studio — stylesheet
   Colors are driven by CSS variables that main.js fills
   from config.json (theme section). Tweak fonts/spacing here.
   ========================================================= */

:root {
  /* Fallback theme values; overridden at runtime from config.json */
  --primary: #7c5cff;
  --primary-hover: #9277ff;
  --accent: #28e0c8;
  --bg: #08080d;
  --bg-alt: #0f0f18;
  --surface: #16161f;
  --surface-alt: #1d1d2a;
  --text: #ececf5;
  --text-muted: #9a9ab4;
  --border: #282838;

  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1160px;
  --header-h: 72px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Empty config fields set [hidden]; force it to win over display rules below */
[hidden] { display: none !important; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px -8px var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: #fff; transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { position: relative; width: 34px; height: 34px; flex: none; display: block; }
.brand-mark-bg,
.brand-mark-fg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Make the background shape larger than the mark it sits behind. */
.brand-mark-bg { transform: scale(1.6); }
.brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.2px;
  line-height: 1;
  white-space: nowrap;
}
.brand-wordmark .wm-strong { font-weight: 800; color: var(--text); }
.brand-wordmark .wm-light { font-weight: 400; color: var(--text-muted); margin-left: 0.34em; }
.brand--footer .brand-mark { width: 30px; height: 30px; }
.brand--footer .brand-wordmark { font-size: 1.15rem; }

.main-nav { display: flex; gap: 30px; margin-left: auto; }
.main-nav a {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color .2s ease;
  position: relative;
}
.main-nav a:hover { color: var(--text); }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--primary);
  transition: width .25s ease;
}
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 14px; }

.lang-switch { display: inline-flex; }
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 7px 30px 7px 14px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
  /* caret */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%2394a8aa' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.lang-select:hover { color: var(--text); border-color: var(--primary); }
.lang-select:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
/* dark dropdown list (native option styling is limited, but this helps most browsers) */
.lang-select option { background: var(--surface); color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  margin: 0 auto;
  background: var(--text);
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 90px) 0 96px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -20%; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 900px;
  max-width: 120vw;
  background: radial-gradient(circle at center,
    color-mix(in srgb, var(--primary) 30%, transparent) 0%,
    transparent 60%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; text-align: center; }
/* When the hero has no text (all fields blank), don't leave a huge void. */
.hero--compact { padding: calc(var(--header-h) + 44px) 0 60px; }
.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 7px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  margin: 0 0 26px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 auto 22px;
  max-width: 16ch;
  background: linear-gradient(180deg, #fff 40%, var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 auto 38px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; margin-bottom: 56px; }
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.section-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0;
}

/* ---------- Games ---------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 460px));
  justify-content: center;
  gap: 28px;
}
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 24px 50px -24px rgba(0,0,0,.8);
}
.game-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--surface-alt), var(--surface));
  overflow: hidden;
}
.game-cover img { width: 100%; height: 100%; object-fit: cover; }
.game-status {
  position: absolute;
  top: 14px; left: 14px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  color: var(--accent);
}
.game-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.game-genre {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 8px;
}
.game-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 0 12px;
}
.game-desc { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 20px; flex: 1; }
.game-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.game-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.game-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  align-self: flex-start;
  transition: gap .2s ease;
  display: inline-flex;
  gap: 6px;
}
.game-link:hover { gap: 12px; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.about-copy p { color: var(--text-muted); font-size: 1.05rem; margin: 0 0 18px; max-width: 62ch; }
.values { display: flex; flex-direction: column; gap: 18px; }
.value-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  border-left: 3px solid var(--primary);
}
.value-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 6px;
}
.value-text { color: var(--text-muted); font-size: 0.95rem; margin: 0; }

/* ---------- Contact ---------- */
.contact-inner { text-align: center; max-width: 680px; }
.contact-text { color: var(--text-muted); font-size: 1.15rem; margin: 0 auto 32px; }
/* ---------- Contact form ---------- */
.contact-form {
  max-width: 560px;
  margin: 0 auto 40px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field > span {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
.contact-form .btn { align-self: flex-start; }
.form-status {
  margin: 2px 0 0;
  font-size: 0.95rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.form-status--ok {
  color: #cfebd6;
  border-color: color-mix(in srgb, #4caf72 45%, var(--border));
  background: color-mix(in srgb, #4caf72 14%, transparent);
}
.form-status--error {
  color: #ffd5df;
  border-color: color-mix(in srgb, #d9435f 45%, var(--border));
  background: color-mix(in srgb, #d9435f 14%, transparent);
}
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.contact-follow {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 18px;
}

/* ---------- Social ---------- */
.social { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.social a {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: transform .2s ease, color .2s ease, border-color .2s ease, background .2s ease;
}
.social a:hover {
  color: #fff;
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  transform: translateY(-3px);
}
.social svg { width: 20px; height: 20px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}
.footer-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.footer-tagline { color: var(--text-muted); font-size: 0.95rem; margin: 0; }
.footer-copy { color: var(--text-muted); font-size: 0.85rem; margin: 0; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 20px;
    margin: 0;
    transform: translateY(-140%);
    transition: transform .3s ease;
    z-index: 90;
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .main-nav a::after { display: none; }
  .header-actions .btn-sm { display: none; }
  .section { padding: 72px 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
}
