/* ============================================================
   INFERNO — BASE STYLES
   Shared tokens, typography, nav, footer
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,opsz,wght@0,6..96,400..900;1,6..96,400..900&family=Mrs+Saint+Delafield&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Jost:wght@400;500;600&display=swap');

:root{
  --cream: #F4EFE2;
  --cream-deep: #EAE2CE;
  --cream-deeper: #E1D7BC;
  --ink: #201C18;
  --ink-soft: #4A423A;
  --gold: #B99A5C;
  --gold-deep: #8C6F3D;
  --gold-bright: #D4B876;
  --line: rgba(185,154,92,0.35);
  --nav-scroll-bg: rgba(244,239,226,0.94);

  /* Footer stays a fixed dark charcoal in BOTH themes — it's a design accent, not a surface that flips */
  --footer-bg: #1A100A;
  --footer-text: #F4EFE2;
  --footer-text-soft: rgba(244,239,226,0.65);
  --footer-link: rgba(244,239,226,0.75);

  --font-display: 'Bodoni Moda', serif;
  --font-script: 'Mrs Saint Delafield', cursive;
  --font-body: 'Cormorant Garamond', serif;
  --font-label: 'Jost', sans-serif;

  --max-width: 1240px;
  --nav-height: 84px;
}

/* ---- DARK MODE: this is Inferno at night. Heat, not just "dark colors." ---- */
html[data-theme="dark"]{
  --cream: #150B08;
  --cream-deep: #1F120C;
  --cream-deeper: #2A180F;
  --ink: #F5E9DD;
  --ink-soft: #D6BFAE;
  --gold: #FF7A3C;
  --gold-deep: #FF5A1F;
  --gold-bright: #FFB067;
  --line: rgba(255,122,60,0.28);
  --nav-scroll-bg: rgba(18,10,8,0.92);
}

html{ transition: background 0.5s ease; }
body{ transition: background 0.5s ease, color 0.5s ease; }

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

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

body{
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper texture (light) / breathing ember bed (dark) */
body::before{
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(185,154,92,0.04), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(185,154,92,0.05), transparent 45%);
  transition: opacity 0.6s ease;
}
html[data-theme="dark"] body::before{
  opacity: 0.9;
  background-image:
    radial-gradient(circle at 50% 105%, rgba(255,90,31,0.28), transparent 60%),
    radial-gradient(circle at 15% 15%, rgba(255,122,60,0.1), transparent 40%),
    radial-gradient(circle at 85% 10%, rgba(255,60,20,0.1), transparent 40%);
  animation: ember-breathe 6s ease-in-out infinite;
}
@keyframes ember-breathe{
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

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

a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }
button{ font-family: inherit; cursor: pointer; }

.eyebrow{
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.rule{
  border: none;
  border-top: 1px solid var(--line);
  margin: 0 auto;
}

.rule--wide{ width: 100%; }
.rule--short{ width: 64px; border-top-width: 2px; }

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

.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 16px 32px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  position: relative;
  overflow: hidden;
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, transform 0.25s ease;
}
.btn:hover{
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 0 26px rgba(212,184,118,0.4);
  transform: translateY(-2px);
}
.btn:active{ transform: translateY(0); }
.btn--gold{
  border-color: var(--gold);
  color: var(--gold-deep);
}
.btn--gold:hover{
  background: var(--gold);
  color: var(--cream);
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(212,184,118,0.55);
}
.btn--solid{
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.btn--solid:hover{
  background: var(--gold-deep);
  border-color: var(--gold-deep);
  box-shadow: 0 0 30px rgba(212,184,118,0.5);
}

/* ---------------- NAV ---------------- */
#nav{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(244,239,226,0);
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, height 0.4s ease;
}
#nav.scrolled{
  background: var(--nav-scroll-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  height: 68px;
}
.nav-inner{
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo{
  font-family: var(--font-script);
  font-size: 34px;
  color: var(--ink);
  line-height: 1;
  transition: text-shadow 0.4s ease;
}
.nav-logo:hover{
  text-shadow: 0 0 18px rgba(212,184,118,0.6);
}
.nav-links{
  display: flex;
  gap: 40px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a{
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 4px;
}
.nav-links a::after{
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after{ transform: scaleX(1); }
.nav-links a.active{ color: var(--gold-deep); }

.nav-cta{
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 12px 22px;
  border: 1px solid var(--gold);
  color: var(--gold-deep);
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}
.nav-cta:hover{
  background: var(--gold);
  color: var(--cream);
  box-shadow: 0 0 20px rgba(212,184,118,0.45);
  transform: translateY(-1px);
}

.theme-toggle{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  margin-left: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--gold-deep);
  transition: border-color 0.3s ease, color 0.3s ease, box-shadow 0.4s ease, transform 0.3s ease;
}
.theme-toggle:hover{
  border-color: var(--gold);
  transform: scale(1.08) rotate(-6deg);
}
.theme-icon{ width: 18px; height: 18px; transition: filter 0.4s ease; }
html[data-theme="dark"] .theme-toggle{
  color: var(--gold);
  box-shadow: 0 0 16px rgba(255,90,31,0.5);
  border-color: rgba(255,122,60,0.5);
}
html[data-theme="dark"] .theme-icon{
  filter: drop-shadow(0 0 6px rgba(255,90,31,0.8));
}

.nav-burger{
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
.nav-burger span{
  width: 24px; height: 1px;
  background: var(--ink);
}

@media (max-width: 900px){
  .nav-links, .nav-cta{ display: none; }
  .nav-burger{ display: flex; }
}

/* Mobile drawer */
#mobile-drawer{
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  transform: translateY(-100%);
  transition: transform 0.4s ease;
}
#mobile-drawer.open{ transform: translateY(0); }
#mobile-drawer a{
  font-family: var(--font-display);
  font-size: 28px;
}
#mobile-drawer .close-btn{
  position: absolute;
  top: 28px; right: 28px;
  background: none; border: none;
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------------- FOOTER ---------------- */
footer{
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 80px 0 32px;
  position: relative;
  z-index: 1;
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255,122,60,0.2);
}
.footer-brand .nav-logo{ color: var(--gold-bright); }
.footer-brand p{
  margin-top: 16px;
  max-width: 32ch;
  color: var(--footer-text-soft);
  font-size: 17px;
}
.footer-col h4{
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 18px;
}
.footer-col ul{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-col a{
  color: var(--footer-link);
  font-family: var(--font-label);
  font-size: 14px;
  transition: color 0.3s ease;
}
.footer-col a:hover{ color: var(--gold-bright); }
.footer-bottom{
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--footer-text-soft);
}

@media (max-width: 800px){
  .footer-grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px){
  .footer-grid{ grid-template-columns: 1fr; }
}

/* Page loader */
#loader{
  position: fixed; inset: 0; z-index: 9999;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  overflow: hidden;
}
#loader.hidden{ opacity: 0; visibility: hidden; }

.loader-flame{
  position: relative;
  z-index: 2;
  width: 56px;
  margin: 0 auto 14px;
}
.flame-icon{
  width: 56px;
  height: 56px;
  animation: flame-flicker 1.4s ease-in-out infinite;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 0 14px rgba(212,184,118,0.65));
}
@keyframes flame-flicker{
  0%, 100% { transform: scaleY(1) scaleX(1) skewX(0deg); }
  22%      { transform: scaleY(1.06) scaleX(0.96) skewX(-1.5deg); }
  48%      { transform: scaleY(0.94) scaleX(1.04) skewX(1.5deg); }
  74%      { transform: scaleY(1.04) scaleX(0.97) skewX(-0.8deg); }
}
.loader-word{
  position: relative;
  z-index: 2;
  display: block;
  text-align: center;
  animation: word-glow 1.4s ease-in-out infinite;
}
@keyframes word-glow{
  0%, 100% { text-shadow: 0 0 12px rgba(212,184,118,0.25); }
  50%      { text-shadow: 0 0 22px rgba(212,184,118,0.55); }
}

.fire-canvas{
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

html[data-theme="dark"] .flame-icon{
  filter: drop-shadow(0 0 22px rgba(255,90,31,0.9));
}
@keyframes word-glow-dark{
  0%, 100% { text-shadow: 0 0 16px rgba(255,90,31,0.45); }
  50%      { text-shadow: 0 0 34px rgba(255,90,31,0.85); }
}
html[data-theme="dark"] .loader-word{
  animation-name: word-glow-dark;
}

/* ---- Animated "drawing" rule — opt-in via .rule--draw, grows in once revealed ---- */
.rule--draw{
  width: 0;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-visible .rule--draw{
  width: 64px;
}