/* ══════════════════════════════════════════
   NITZOGAMI — Design System
   v1.0 · 2026
══════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  /* Brand */
  --ignis:   #ef4444; --ignis-dim:  rgba(239,68,68,.15);
  --umbra:   #8b5cf6; --umbra-dim:  rgba(139,92,246,.15);
  --mare:    #3b82f6; --mare-dim:   rgba(59,130,246,.15);
  --lumis:   #ec4899; --lumis-dim:  rgba(236,72,153,.15);
  --vivo:    #f59e0b; --vivo-dim:   rgba(245,158,11,.15);

  /* Base palette */
  --bg:        #060810;
  --surface:   #0d1117;
  --surface2:  #161b22;
  --border:    rgba(255,255,255,.07);
  --border2:   rgba(255,255,255,.12);
  --text:      #f1f5f9;
  --text2:     #94a3b8;
  --text3:     #64748b;
  --teal:      #0ea5a0;
  --teal2:     #2dd4bf;
  --purple:    #8b5cf6;
  --purple2:   #c084fc;

  /* Gradients */
  --grad-brand:  linear-gradient(120deg, var(--teal), var(--purple));
  --grad-dark:   linear-gradient(180deg, rgba(6,8,16,0) 0%, rgba(6,8,16,.95) 100%);

  /* Spacing scale */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem;
  --s5: 1.25rem; --s6: 1.5rem; --s8: 2rem; --s10: 2.5rem;
  --s12: 3rem; --s16: 4rem; --s20: 5rem; --s24: 6rem;

  /* Type scale */
  --text-xs: .72rem; --text-sm: .85rem; --text-base: 1rem;
  --text-lg: 1.125rem; --text-xl: 1.25rem;
  --text-2xl: 1.5rem; --text-3xl: 1.875rem;
  --text-4xl: 2.25rem; --text-5xl: 3rem; --text-6xl: 3.75rem;

  /* Radius */
  --r-sm: 6px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-full: 9999px;

  /* Shadow */
  --shadow-sm:  0 2px 8px rgba(0,0,0,.3);
  --shadow-md:  0 8px 24px rgba(0,0,0,.4);
  --shadow-lg:  0 20px 60px rgba(0,0,0,.5);
  --shadow-xl:  0 30px 80px rgba(0,0,0,.6);

  /* Transitions */
  --ease: cubic-bezier(.2,.8,.2,1);
  --dur-fast: 150ms; --dur-base: 250ms; --dur-slow: 400ms;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ── TYPOGRAPHY ── */
.serif { font-family: 'Georgia', 'Times New Roman', serif; }
h1, h2, h3, h4 { font-family: 'Georgia', serif; line-height: 1.15; }
h1 { font-size: clamp(2rem, 5vw, var(--text-6xl)); font-weight: 900; letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, var(--text-4xl)); font-weight: 800; }
h3 { font-size: clamp(1.1rem, 2vw, var(--text-2xl)); font-weight: 700; }

.label {
  font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: .15em; color: var(--teal2);
  font-family: -apple-system, sans-serif;
}

.muted { color: var(--text2); }
.gradient-text {
  background: var(--grad-brand);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── LAYOUT ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 var(--s8); }
.container-sm { max-width: 860px; margin: 0 auto; padding: 0 var(--s8); }
.section { padding: var(--s24) var(--s8); max-width: 1280px; margin: 0 auto; }

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s4) var(--s10);
  background: rgba(6,8,16,.8);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background var(--dur-base);
}
.nav-links { display: flex; align-items: center; gap: var(--s8); }
.nav-link {
  font-size: var(--text-sm); color: var(--text2);
  transition: color var(--dur-fast);
}
.nav-link:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: var(--s4); }
.nav-cart {
  position: relative; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  background: var(--surface2); border: 1px solid var(--border);
  transition: border-color var(--dur-fast);
}
.nav-cart:hover { border-color: var(--border2); }
.cart-count {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: var(--r-full);
  background: var(--teal); color: #000;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  display: none;
}
.cart-count.visible { display: flex; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: .8rem 1.8rem; border-radius: var(--r-full);
  font-size: var(--text-base); font-weight: 600;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast), opacity var(--dur-fast);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--grad-brand); color: #fff;
  box-shadow: 0 4px 20px rgba(14,165,160,.3);
}
.btn-primary:hover { box-shadow: 0 8px 30px rgba(14,165,160,.5); }

.btn-white { background: #fff; color: #000; }
.btn-white:hover { background: rgba(255,255,255,.9); }

.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border2);
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal2); }

.btn-ghost {
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.1);
}
.btn-ghost:hover { background: rgba(255,255,255,.14); }

.btn-sm { padding: .55rem 1.2rem; font-size: var(--text-sm); }
.btn-lg { padding: 1rem 2.4rem; font-size: var(--text-lg); }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease),
              box-shadow var(--dur-base),
              border-color var(--dur-base);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border2);
}

/* ── BADGES / CHIPS ── */
.chip {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: .25rem .75rem; border-radius: var(--r-full);
  font-size: var(--text-xs); font-family: -apple-system, sans-serif;
  letter-spacing: .06em;
}
.chip-teal  { background: rgba(14,165,160,.12); border: 1px solid rgba(14,165,160,.25); color: var(--teal2); }
.chip-gold  { background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.25); color: #fbbf24; }
.chip-muted { background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--text2); }

/* ── DIVIDERS ── */
hr { border: none; border-top: 1px solid var(--border); }
.divider { border-top: 1px solid var(--border); }

/* ── FORMS ── */
.input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text); padding: .85rem 1.2rem;
  border-radius: var(--r-full); font-size: var(--text-base);
  outline: none; transition: border-color var(--dur-fast);
}
.input:focus { border-color: var(--teal); }
.input::placeholder { color: var(--text3); }

/* ── EMOTION COLORS ── */
.emotion-ignis { --emotion: var(--ignis); --emotion-dim: var(--ignis-dim); }
.emotion-umbra { --emotion: var(--umbra); --emotion-dim: var(--umbra-dim); }
.emotion-mare  { --emotion: var(--mare);  --emotion-dim: var(--mare-dim);  }
.emotion-lumis { --emotion: var(--lumis); --emotion-dim: var(--lumis-dim); }
.emotion-vivo  { --emotion: var(--vivo);  --emotion-dim: var(--vivo-dim);  }

/* ── BOOK MOCKUP ── */
.book-mockup-wrap { position: relative; display: inline-block; }
.book-mockup-3d {
  border-radius: 2px 8px 8px 2px;
  overflow: visible;
  transform: perspective(900px) rotateY(-18deg);
  transform-style: preserve-3d;
  display: block;
  position: relative;
}
.book-mockup-3d::before { /* Spine */
  content: '';
  position: absolute; top: 2px; bottom: 2px; left: -20px; width: 20px;
  background: linear-gradient(to right, #111, #333, #1a1a1a);
  transform: rotateY(90deg); transform-origin: right center;
  border-radius: 2px 0 0 2px;
}
.book-mockup-3d::after { /* Pages */
  content: '';
  position: absolute; top: 3px; bottom: 3px; right: -7px; width: 7px;
  background: repeating-linear-gradient(to bottom, #e8e4dc 0, #e8e4dc 1px, #d4cfc5 1px, #d4cfc5 2px);
  border-radius: 0 3px 3px 0;
}
.book-mockup-3d img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  border-radius: 2px 8px 8px 2px;
}
.book-gloss {
  position: absolute; inset: 0; border-radius: 2px 8px 8px 2px;
  background: linear-gradient(120deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,.04) 35%, transparent 55%);
  pointer-events: none;
}

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--s12) var(--s8);
  background: var(--surface);
}
.footer-grid {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s8);
}
.footer-logo img { height: 48px; }
.footer-tagline { color: var(--text2); font-size: var(--text-sm); margin-top: var(--s3); max-width: 260px; }
.footer-col h4 { font-size: var(--text-sm); font-weight: 700; margin-bottom: var(--s4); }
.footer-col ul { display: flex; flex-direction: column; gap: var(--s3); }
.footer-col a { font-size: var(--text-sm); color: var(--text2); transition: color var(--dur-fast); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1280px; margin: var(--s8) auto 0;
  padding-top: var(--s6); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s4);
  font-size: var(--text-sm); color: var(--text3);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.animate-fade-up { animation: fadeUp .6s var(--ease) both; }
.animate-fade-in { animation: fadeIn .6s ease both; }
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].visible { opacity: 1; transform: translateY(0); }

/* ── SKELETON LOADER ── */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface) 50%, var(--surface2) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-md);
}

/* ── OVERLAY / MODAL ── */
.overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base);
}
.overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--s8);
  max-width: 560px; width: calc(100% - var(--s8));
  max-height: 90vh; overflow-y: auto;
  transform: scale(.95); transition: transform var(--dur-base) var(--ease);
}
.overlay.open .modal { transform: scale(1); }

/* ── TOAST ── */
.toast-stack {
  position: fixed; bottom: var(--s6); right: var(--s6); z-index: 3000;
  display: flex; flex-direction: column; gap: var(--s3);
}
.toast {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--r-lg); padding: var(--s4) var(--s6);
  font-size: var(--text-sm); display: flex; align-items: center; gap: var(--s3);
  box-shadow: var(--shadow-lg);
  animation: fadeUp .3s var(--ease) both;
}
.toast.success { border-color: rgba(34,197,94,.3); }
.toast.error   { border-color: rgba(239,68,68,.3); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .container, .section { padding: 0 var(--s6); }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: var(--s16) var(--s4); }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* ── UTILITY ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aspect-book { aspect-ratio: 2/3; }
.aspect-video { aspect-ratio: 16/9; }
