/* =========================================================
   Calderon Games — stylesheet
   Palette extracted from the studio logo:
     flame  #FF9100 / ember #E4570E / gold #FFC24D / ink #0B0A0D
   ========================================================= */

/* ---------- Fonts ---------- */
/* Bricolage Grotesque = display, Hanken Grotesk = body, JetBrains Mono = labels/badges */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, p, figure { margin: 0; }
img, picture { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

/* ---------- Color tokens ---------- */
:root {
  color-scheme: light;
  --bg: #FBF7F0;
  --bg-alt: #F2E9D8;
  --surface: #FFFFFF;
  --border: #E6D9C0;
  --text: #1B1712;
  --text-muted: #6E6257;
  --accent: #E36A0A;
  --accent-deep: #B8410A;
  --accent-gold: #C9861A;
  --accent-ink: #1B0F02;
  --focus-ring: #B8410A;
  --header-bg: rgba(251, 247, 240, 0.78);
  --shadow: 0 20px 60px -25px rgba(27, 23, 18, 0.35);

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0B0A0D;
    --bg-alt: #141116;
    --surface: #18151B;
    --border: #2C2730;
    --text: #F3EEE6;
    --text-muted: #A39AA0;
    --accent: #FF9100;
    --accent-deep: #FF7A1A;
    --accent-gold: #FFC24D;
    --accent-ink: #1B0F02;
    --focus-ring: #FFB454;
    --header-bg: rgba(11, 10, 13, 0.72);
    --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FBF7F0;
  --bg-alt: #F2E9D8;
  --surface: #FFFFFF;
  --border: #E6D9C0;
  --text: #1B1712;
  --text-muted: #6E6257;
  --accent: #E36A0A;
  --accent-deep: #B8410A;
  --accent-gold: #C9861A;
  --accent-ink: #1B0F02;
  --focus-ring: #B8410A;
  --header-bg: rgba(251, 247, 240, 0.78);
  --shadow: 0 20px 60px -25px rgba(27, 23, 18, 0.35);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0A0D;
  --bg-alt: #141116;
  --surface: #18151B;
  --border: #2C2730;
  --text: #F3EEE6;
  --text-muted: #A39AA0;
  --accent: #FF9100;
  --accent-deep: #FF7A1A;
  --accent-gold: #FFC24D;
  --accent-ink: #1B0F02;
  --focus-ring: #FFB454;
  --header-bg: rgba(11, 10, 13, 0.72);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- Accessibility helpers ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: .65rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  z-index: 100;
  transition: top .15s ease;
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 2.5px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Eyebrow label ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: .85rem;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: var(--text);
}
.brand-mark { width: 42px; height: 42px; object-fit: contain; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}
.site-nav {
  display: flex;
  gap: 2.25rem;
  margin-inline: auto;
}
.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: .95rem;
  padding-block: .25rem;
  border-bottom: 1.5px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--text); border-color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: .6rem; }

.theme-toggle {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s ease, transform .15s ease;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { grid-area: 1 / 1; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  .theme-toggle .icon-moon { display: none; }
  .theme-toggle .icon-sun { display: block; }
}
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  flex-shrink: 0;
}
.nav-toggle span {
  width: 16px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s 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); }

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: .5rem clamp(1.25rem, 4vw, 2.5rem) 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a {
  padding: .75rem 0;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.mobile-nav a:last-child { border-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.65rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .975rem;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, border-color .15s ease, color .15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent));
  color: var(--accent-ink);
  box-shadow: var(--shadow);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-2px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1.5px solid transparent;
  transition: border-color .15s ease, gap .15s ease;
}
.link-arrow:hover, .link-arrow:focus-visible { border-color: currentColor; gap: .6rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 10vw, 7rem) clamp(4.5rem, 10vw, 7.5rem);
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.15rem;
}
.hero-logo { width: clamp(150px, 22vw, 210px); height: auto; margin-bottom: .5rem; }
.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.25rem);
  line-height: 1.05;
  max-width: 16ch;
}
.hero-sub {
  max-width: 42ch;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--text-muted);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .85rem;
  margin-top: .75rem;
}

/* Ambient embers — signature motion moment */
.hero-embers {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.hero-embers span {
  position: absolute;
  bottom: 6%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-gold) 0%, var(--accent) 55%, transparent 76%);
  opacity: 0;
  filter: drop-shadow(0 0 6px var(--accent));
  animation-name: ember-rise;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}
.hero-embers span:nth-child(1)  { left: 8%;  width: 5px; height: 5px; animation-duration: 7.5s; animation-delay: 0s; }
.hero-embers span:nth-child(2)  { left: 18%; width: 7px; height: 7px; animation-duration: 6.8s; animation-delay: 1.1s; }
.hero-embers span:nth-child(3)  { left: 27%; width: 4px; height: 4px; animation-duration: 8.2s; animation-delay: 2.4s; }
.hero-embers span:nth-child(4)  { left: 35%; width: 6px; height: 6px; animation-duration: 7s;   animation-delay: .6s; }
.hero-embers span:nth-child(5)  { left: 44%; width: 5px; height: 5px; animation-duration: 6.4s; animation-delay: 3.1s; }
.hero-embers span:nth-child(6)  { left: 52%; width: 8px; height: 8px; animation-duration: 7.8s; animation-delay: 1.8s; }
.hero-embers span:nth-child(7)  { left: 60%; width: 4px; height: 4px; animation-duration: 6.9s; animation-delay: .3s; }
.hero-embers span:nth-child(8)  { left: 68%; width: 6px; height: 6px; animation-duration: 7.3s; animation-delay: 2.7s; }
.hero-embers span:nth-child(9)  { left: 76%; width: 5px; height: 5px; animation-duration: 8s;   animation-delay: 1.4s; }
.hero-embers span:nth-child(10) { left: 84%; width: 7px; height: 7px; animation-duration: 6.6s; animation-delay: 3.5s; }
.hero-embers span:nth-child(11) { left: 91%; width: 4px; height: 4px; animation-duration: 7.6s; animation-delay: .9s; }
.hero-embers span:nth-child(12) { left: 50%; width: 5px; height: 5px; animation-duration: 7.1s; animation-delay: 2.1s; }

@keyframes ember-rise {
  0%   { transform: translateY(0) translateX(0) scale(.7);   opacity: 0; }
  8%   { opacity: .95; }
  50%  { transform: translateY(-160px) translateX(6px) scale(1); }
  85%  { opacity: .45; }
  100% { transform: translateY(-320px) translateX(-4px) scale(.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-embers { display: none; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 5.5rem); }
.section-alt { background: var(--bg-alt); }

.section-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
}
.section-content { max-width: 58ch; }
.section-content h2 { font-size: clamp(1.65rem, 3vw, 2.2rem); margin-bottom: 1rem; }
.section-content p { color: var(--text-muted); font-size: 1.05rem; }
.section-content .link-arrow { display: inline-flex; margin-top: 1.1rem; }

#project > .wrap > .eyebrow { display: block; margin-bottom: 1.5rem; }

/* ---------- Project card ---------- */
.project-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(2rem, 5vw, 3.25rem);
  max-width: 720px;
}
.project-card::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -15%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: .16;
  pointer-events: none;
}
.badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent-gold), var(--accent));
  padding: .4rem .8rem .4rem .65rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-ink);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.project-card h2 {
  position: relative;
  font-size: clamp(1.75rem, 3.4vw, 2.35rem);
  margin-bottom: .85rem;
}
.project-card p {
  position: relative;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 52ch;
  margin-bottom: 1.3rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.75rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-inner p { color: var(--text-muted); font-size: .9rem; }
.footer-gh {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 999px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: color .15s ease, border-color .15s ease;
}
.footer-gh:hover { color: var(--accent-deep); border-color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .section-grid { grid-template-columns: 1fr; }
}
