/* ============================================================
   ARCANA Game Development Suite — site styles
   Magi-tech: dark cyberpunk foundation + arcane sigil accents
   ============================================================ */

:root {
  /* base */
  --bg-0: #07080c;
  --bg-1: #0c0e15;
  --bg-2: #12151f;
  --bg-3: #1a1f2e;
  --bg-4: #242a3e;
  --bg-elev: #0f1219;

  /* hairlines */
  --line: rgba(120, 170, 220, 0.10);
  --line-2: rgba(120, 170, 220, 0.18);
  --line-3: rgba(120, 170, 220, 0.30);

  /* text */
  --text: #e8eaf0;
  --text-dim: #9aa4b8;
  --text-muted: #5d6679;
  --text-faint: #3a4254;

  /* primary accent (vault/site default) */
  --accent: #5ec4e8;
  --accent-soft: rgba(94, 196, 232, 0.14);
  --accent-edge: rgba(94, 196, 232, 0.34);
  --accent-glow: rgba(94, 196, 232, 0.40);

  /* secondary arcane glow — pinkish magenta */
  --rune: #e85ec4;
  --rune-soft: rgba(232, 94, 196, 0.14);

  /* per-app hues */
  --vault: #5ec4e8;
  --tome: #b57ee8;
  --forge: #e8a95e;
  --purse: #7ee8a9;
  --echo: #e85e7e;
  --task: #7eb8e8;

  /* type */
  --f-display: 'Barlow Condensed', 'Oswald', sans-serif;
  --f-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* layout */
  --maxw: 1240px;
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient atmosphere — subtle rune grid + vignettes that sit behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(94, 196, 232, 0.10), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(232, 94, 196, 0.06), transparent 55%),
    radial-gradient(800px 500px at 50% 120%, rgba(126, 232, 169, 0.04), transparent 55%),
    var(--bg-0);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(120, 170, 220, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 220, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  mask-image: radial-gradient(1200px 900px at 50% 20%, #000, transparent 80%);
  -webkit-mask-image: radial-gradient(1200px 900px at 50% 20%, #000, transparent 80%);
  pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.05;
  color: var(--text);
}
h1 { font-size: clamp(46px, 6vw, 84px); }
h2 { font-size: clamp(32px, 3.6vw, 52px); }
h3 { font-size: clamp(22px, 2vw, 28px); }
p { margin: 0; color: var(--text-dim); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}

.mono { font-family: var(--f-mono); }
.display { font-family: var(--f-display); letter-spacing: 0.04em; text-transform: uppercase; }

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

/* -------------- Nav -------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 8, 12, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  width: 100%;
  max-width: var(--maxw);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 15px;
  text-transform: uppercase;
  color: var(--text);
}
.nav-brand .sigil {
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
}
.nav-wordmark {
  height: 18px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(94,196,232,0.2));
  transition: filter .3s ease, transform .3s ease;
}
.nav-brand:hover .nav-wordmark {
  filter: drop-shadow(0 2px 16px rgba(94,196,232,0.45));
}
.footer-wordmark {
  height: 36px;
  width: auto;
  display: block;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 10px rgba(94,196,232,0.15));
}
.nav-touchmark {
  height: 34px;
  width: 34px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(94,196,232,0.28));
  transition: filter .3s ease, transform .3s ease;
}
.nav-brand:hover .nav-touchmark {
  filter: drop-shadow(0 2px 14px rgba(94,196,232,0.5));
  transform: translateY(-1px);
}
.nav-brand-text {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 15px;
  text-transform: uppercase;
  color: var(--text);
}
.nav-brand-sub {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.22em;
  margin-left: 4px;
}
.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.footer-touchmark {
  height: 40px;
  width: 40px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(94,196,232,0.22));
}
.footer-brand-text {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 17px;
  text-transform: uppercase;
  color: var(--text);
}
.footer-brand-sub {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.22em;
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-dim);
  border-radius: 6px;
  position: relative;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px;
  bottom: 2px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}
.nav-cta {
  margin-left: 8px;
}

/* -------------- Buttons -------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  font-family: var(--f-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.btn:hover {
  border-color: var(--accent-edge);
  background: rgba(94, 196, 232, 0.06);
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
  color: #071018;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(94,196,232,0.2), 0 8px 28px -10px var(--accent-glow);
}
.btn-primary:hover {
  background: #7ad4f2;
  border-color: #7ad4f2;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(94,196,232,0.3), 0 14px 40px -10px var(--accent-glow);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--text);
}
.btn-small { padding: 8px 14px; font-size: 12px; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* -------------- Containers -------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}
section { padding: 96px 0; position: relative; }
.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 680px;
  margin-bottom: 48px;
}
.section-head p { color: var(--text-dim); font-size: 17px; }

/* -------------- Card primitives -------------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(20, 25, 38, 0.72), rgba(12, 14, 21, 0.72));
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 28px;
  overflow: hidden;
  transition: border-color .22s var(--ease), transform .22s var(--ease);
}
.card::before {
  /* inner hairline + rune corner accents */
  content: '';
  position: absolute; inset: 6px;
  border: 1px solid rgba(120,170,220,0.04);
  border-radius: 6px;
  pointer-events: none;
}
.card.hoverable:hover {
  border-color: var(--accent-edge);
  transform: translateY(-2px);
}
.card.hoverable:hover::after {
  opacity: 1;
}
.card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s var(--ease);
  background: radial-gradient(300px 200px at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 60%);
}

/* Corner brackets — magical frame motif */
.bracketed {
  position: relative;
}
.bracketed::before,
.bracketed::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--accent);
  opacity: 0.55;
}
.bracketed::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.bracketed::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* -------------- Footer -------------- */
.footer {
  margin-top: 80px;
  border-top: 1px solid var(--line);
  padding: 60px 0 40px;
  background: linear-gradient(180deg, transparent, rgba(12,14,21,0.6));
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 40px;
}
.footer-brand {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 320px;
}
.footer-brand p { font-size: 13px; color: var(--text-muted); }
.footer-col h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-dim);
  transition: color .15s var(--ease);
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* -------------- Tags / chips -------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line-2);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
}
.chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.chip.live .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.3); }
}

/* -------------- Utility -------------- */
.hide-mobile { display: initial; }
@media (max-width: 820px) {
  .hide-mobile { display: none; }
  .nav-links { display: none; }
  section { padding: 64px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* -------------- Sigil SVG color -------------- */
.sigil svg { display: block; width: 100%; height: 100%; }
.sigil path, .sigil circle, .sigil line { stroke: var(--accent); fill: none; }

/* Pixel art crispness */
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ============ Icon morph (portal wipe to metallic) ============ */
.icon-morph {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}
.icon-morph .icon-base,
.icon-morph .icon-metal {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}
.icon-morph .icon-metal {
  position: absolute;
  inset: 0;
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 28px rgba(94,196,232,0.7));
}
.icon-morph .icon-glow-ring {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(94,196,232,0.35) 0%, rgba(94,196,232,0.08) 50%, transparent 70%);
  opacity: 0;
  transform: scale(0.35);
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.4,0,0.2,1);
}
.icon-morph.morphed .icon-metal {
  clip-path: circle(75% at 50% 50%);
}
.icon-morph.morphed .icon-glow-ring {
  opacity: 1;
  transform: scale(1.15);
}
.icon-morph .icon-base {
  transition: opacity 0.35s ease;
}
.icon-morph.morphed .icon-base {
  opacity: 0;
  filter: none;
}
