/* =============================================================================
   SeraGame Studio — Stylesheet
   Design language: a night-mode "arcade cabinet" palette with a domino-pip
   motif running through dividers, textures, and the signature hero pattern —
   a visual thread tying together the studio's gear, polygon, and pip-based
   puzzle mechanics.
   ============================================================================= */

:root {
  /* Palette */
  --color-bg: #11131c;
  --color-bg-alt: #0b0d14;
  --color-surface: #1a1d2b;
  --color-surface-raised: #20243780;
  --color-border: #2c3047;
  --color-text: #eceef5;
  --color-text-muted: #9297ad;
  --color-gold: #f2b705;
  --color-gold-dim: #a67e10;
  --color-teal: #3fc7ab;
  --color-teal-dim: #2a8a76;
  --color-danger: #e2574c;

  /* Type */
  --font-display: 'Chakra Petch', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --max-width: 1120px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

/* -------------------------------------------------------------------------
   Reset & base
   ------------------------------------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--color-bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(242, 183, 5, 0.07) 1px, transparent 0);
  background-size: 28px 28px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.6em;
  color: var(--color-text);
}

p { margin: 0 0 1em; color: var(--color-text-muted); }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* -------------------------------------------------------------------------
   Header / Navigation
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 13, 20, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(150deg, var(--color-gold) 0%, var(--color-gold-dim) 100%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 4px;
  background:
    radial-gradient(circle at 25% 25%, var(--color-bg) 1.6px, transparent 1.7px),
    radial-gradient(circle at 75% 75%, var(--color-bg) 1.6px, transparent 1.7px);
}

.brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--color-gold);
  text-transform: uppercase;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.main-nav a:hover { color: var(--color-text); background: var(--color-surface); }

.main-nav a.is-active {
  color: var(--color-bg);
  background: var(--color-gold);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: 8px 10px;
  cursor: pointer;
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn-primary {
  background: var(--color-gold);
  color: #17140a;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(242, 183, 5, 0.45); }

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-ghost:hover { border-color: var(--color-teal); color: var(--color-teal); }

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 96px 0 80px;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

.hero-pips {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(63, 199, 171, 0.16) 2px, transparent 2.2px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 60% 60% at 75% 30%, black 10%, transparent 70%);
}

.hero .container { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-teal);
  margin-bottom: 22px;
}

.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--color-teal);
  transform: rotate(45deg);
}

.hero h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  max-width: 15ch;
  line-height: 1.12;
}

.hero .lede {
  max-width: 54ch;
  font-size: 1.08rem;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 56px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 640px;
}

.hero-stat {
  background: var(--color-surface);
  padding: 18px 20px;
}

.hero-stat .value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--color-gold);
  display: block;
}

.hero-stat .label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* -------------------------------------------------------------------------
   Section scaffolding
   ------------------------------------------------------------------------- */
.section { padding: 76px 0; }
.section-tight { padding: 56px 0; }
.section-alt { background: var(--color-bg-alt); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }

.section-head {
  max-width: 640px;
  margin-bottom: 44px;
}

.section-head .eyebrow { margin-bottom: 14px; }

.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

/* -------------------------------------------------------------------------
   Philosophy / feature list (home)
   ------------------------------------------------------------------------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.pillar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
}

.pillar-icon {
  width: 42px; height: 42px;
  color: var(--color-gold);
  margin-bottom: 18px;
}

.pillar h3 { font-size: 1.05rem; margin-bottom: 8px; }
.pillar p { margin: 0; font-size: 0.94rem; }

/* -------------------------------------------------------------------------
   App / game cards ("cartridge" style)
   ------------------------------------------------------------------------- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.app-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 26px 26px;
  transition: transform 0.16s ease, border-color 0.16s ease;
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 6px;
  border-radius: 0 0 6px 6px;
  background: var(--color-gold);
}

.app-card.accent-teal::before { background: var(--color-teal); }

.app-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-gold-dim);
}
.app-card.accent-teal:hover { border-color: var(--color-teal-dim); }

.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.app-icon {
  width: 52px; height: 52px;
  flex-shrink: 0;
  color: var(--color-gold);
  background: rgba(242, 183, 5, 0.1);
  border-radius: var(--radius-sm);
  padding: 9px;
}

.app-card.accent-teal .app-icon {
  color: var(--color-teal);
  background: rgba(63, 199, 171, 0.1);
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 100px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-available { color: #1f2e14; background: #b6e388; }
.badge-soon       { color: #2e2611; background: #f0d27a; }
.badge-dev        { color: var(--color-text); background: transparent; border-color: var(--color-border); }

.app-card h3 { font-size: 1.2rem; margin-bottom: 4px; }

.app-genre {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.app-tagline {
  font-size: 0.96rem;
  color: var(--color-text);
  font-style: italic;
  margin-bottom: 14px;
}

.app-features {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.app-features li {
  display: flex;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.app-features li::before {
  content: "";
  width: 6px; height: 6px;
  margin-top: 6px;
  border-radius: 1px;
  background: var(--color-gold);
  flex-shrink: 0;
  transform: rotate(45deg);
}

.app-card.accent-teal .app-features li::before { background: var(--color-teal); }

.app-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.store-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.store-link svg { width: 16px; height: 16px; }

.store-link.is-disabled { opacity: 0.5; cursor: default; }

/* -------------------------------------------------------------------------
   CTA banner
   ------------------------------------------------------------------------- */
.cta-banner {
  background: linear-gradient(120deg, #1c2135 0%, #171a29 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cta-banner h2 { margin-bottom: 6px; font-size: 1.5rem; }
.cta-banner p { margin: 0; max-width: 46ch; }

/* -------------------------------------------------------------------------
   Prose / policy pages
   ------------------------------------------------------------------------- */
.page-header {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--color-border);
}

.page-header .eyebrow { margin-bottom: 16px; }
.page-header h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); max-width: 22ch; }
.page-header .lede { max-width: 60ch; margin: 0; }

.prose {
  max-width: 760px;
}

.prose h2 {
  font-size: 1.3rem;
  margin-top: 2.4em;
  padding-top: 0.2em;
}
.prose h2:first-child { margin-top: 0; }

.prose h3 { font-size: 1.05rem; margin-top: 1.6em; color: var(--color-text); }

.prose p, .prose li { color: var(--color-text-muted); font-size: 0.98rem; }

.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.5em; }

.prose a { color: var(--color-teal); border-bottom: 1px solid rgba(63,199,171,0.4); }
.prose a:hover { color: var(--color-gold); border-color: rgba(242,183,5,0.5); }

.info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-teal);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 28px 0;
  font-size: 0.92rem;
}

.info-card strong { color: var(--color-text); }

.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 40px;
}

.toc h2 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-top: 0;
  margin-bottom: 12px;
}

.toc ol {
  margin: 0;
  padding-left: 1.2em;
  columns: 2;
  gap: 24px;
}

.toc a { color: var(--color-text-muted); font-size: 0.9rem; }
.toc a:hover { color: var(--color-gold); }

.meta-line {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   Contact page
   ------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
}

.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.form-row { margin-bottom: 20px; }

.form-row label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text);
}

.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  border-color: var(--color-gold);
  outline: none;
}

.form-hint { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 6px; }

.form-error { color: var(--color-danger); font-size: 0.82rem; margin-top: 6px; }

.contact-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

.contact-info-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.contact-info-list .icon-wrap {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgba(242, 183, 5, 0.1);
  color: var(--color-gold);
  padding: 8px;
}

.contact-info-list strong { display: block; color: var(--color-text); font-size: 0.92rem; }
.contact-info-list span, .contact-info-list a { font-size: 0.9rem; }

.alert {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 0.92rem;
  border: 1px solid transparent;
}

.alert-success {
  background: rgba(63, 199, 171, 0.12);
  border-color: rgba(63, 199, 171, 0.4);
  color: #bdf3e6;
}

.alert-error {
  background: rgba(226, 87, 76, 0.12);
  border-color: rgba(226, 87, 76, 0.4);
  color: #ffcfc9;
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  padding: 48px 0 32px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand p { max-width: 38ch; font-size: 0.9rem; }

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { font-size: 0.9rem; color: var(--color-text-muted); }
.footer-col a:hover { color: var(--color-gold); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.footer-bottom .pip-divider {
  display: flex;
  gap: 5px;
}

.footer-bottom .pip-divider span {
  width: 4px; height: 4px;
  border-radius: 1px;
  background: var(--color-gold-dim);
  transform: rotate(45deg);
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 880px) {
  .pillars { grid-template-columns: 1fr; }
  .apps-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
}

@media (max-width: 760px) {
  .main-nav { position: fixed; inset: 76px 0 0 0; background: var(--color-bg); padding: 20px 24px; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease; }
  .main-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav ul { flex-direction: column; gap: 6px; }
  .main-nav a { display: block; padding: 14px 16px; font-size: 1rem; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .cta-banner { flex-direction: column; align-items: flex-start; }
}
