/*
 * Commentarius Design System
 * "Classical Codex" - Refined Academic Luxury
 * Where ancient wisdom meets modern precision
 */

/* ========================================
   Google Fonts Import
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Crimson+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ========================================
   Linux Libertine for Greek Characters
   ======================================== */
@font-face {
    font-family: 'Linux Libertine Greek';
    src: url('https://cdn.jsdelivr.net/gh/nicpopovic/Linux-Libertine-Web@master/LinLibertine_R.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    unicode-range: U+0370-03FF, U+1F00-1FFF;
}

@font-face {
    font-family: 'Linux Libertine Greek';
    src: url('https://cdn.jsdelivr.net/gh/nicpopovic/Linux-Libertine-Web@master/LinLibertine_RB.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    unicode-range: U+0370-03FF, U+1F00-1FFF;
}

@font-face {
    font-family: 'Linux Libertine Greek';
    src: url('https://cdn.jsdelivr.net/gh/nicpopovic/Linux-Libertine-Web@master/LinLibertine_RI.woff') format('woff');
    font-weight: normal;
    font-style: italic;
    unicode-range: U+0370-03FF, U+1F00-1FFF;
}

@font-face {
    font-family: 'Linux Libertine Greek';
    src: url('https://cdn.jsdelivr.net/gh/nicpopovic/Linux-Libertine-Web@master/LinLibertine_RBI.woff') format('woff');
    font-weight: bold;
    font-style: italic;
    unicode-range: U+0370-03FF, U+1F00-1FFF;
}

/* ========================================
   Tiro Devanagari Sanskrit for Sanskrit/Devanagari Characters
   Designed specifically for Sanskrit classical texts
   ======================================== */
@font-face {
    font-family: 'Tiro Devanagari Sanskrit';
    src: url('https://fonts.gstatic.com/s/tirodevanagarihindiregular/v5/5h1eDWMYrS0qVIRb9HrS5u-JqkL0xkvE-kFw.woff2') format('woff2'),
         url('https://fonts.googleapis.com/css2?family=Tiro+Devanagari+Sanskrit&display=swap');
    font-weight: normal;
    font-style: normal;
    unicode-range: U+0900-097F, U+A8E0-A8FF, U+1CD0-1CFF;
}

@font-face {
    font-family: 'Tiro Devanagari Sanskrit';
    src: url('https://fonts.gstatic.com/s/tirodevanagarihindiitalic/v5/5h1gDWMYrS0qVIRb9HrS5u-JqkL0xkvE-kFw.woff2') format('woff2');
    font-weight: normal;
    font-style: italic;
    unicode-range: U+0900-097F, U+A8E0-A8FF, U+1CD0-1CFF;
}

/* Noto Serif Devanagari as fallback for broader coverage */
@font-face {
    font-family: 'Noto Serif Devanagari';
    src: url('https://fonts.gstatic.com/s/notoserifdevanagari/v28/x3dYcl3IZKmUqiMk48ZHXJ5jwU-DZGRSaQ.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    unicode-range: U+0900-097F, U+A8E0-A8FF, U+1CD0-1CFF;
}

@font-face {
    font-family: 'Noto Serif Devanagari';
    src: url('https://fonts.gstatic.com/s/notoserifdevanagari/v28/x3d4cl3IZKmUqiMk48ZHXJ5jwU-DZGRSaQ4I.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    unicode-range: U+0900-097F, U+A8E0-A8FF, U+1CD0-1CFF;
}

/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
  /* Colors - Antiquarian Palette */
  --color-ink: #0d1117;
  --color-ink-rich: #1a1f26;
  --color-ink-muted: #3d4450;
  --color-ink-subtle: #5c6370;

  --color-parchment: #faf7f2;
  --color-parchment-warm: #f5f0e8;
  --color-vellum: #fffdf8;
  --color-cream: #fefcf7;

  /* Primary - Pompeii Terracotta */
  --color-terracotta: #a04030;
  --color-terracotta-light: #c25545;
  --color-terracotta-dark: #7a3025;
  --color-terracotta-muted: rgba(160, 64, 48, 0.12);

  /* Accent - Illumination Gold */
  --color-gold: #c49b2a;
  --color-gold-light: #dbb33d;
  --color-gold-dark: #9a7820;
  --color-gold-muted: rgba(196, 155, 42, 0.15);
  --color-gold-glow: rgba(196, 155, 42, 0.25);

  /* Secondary - Manuscript Olive */
  --color-olive: #4a5043;
  --color-olive-light: #5f6858;
  --color-olive-muted: rgba(74, 80, 67, 0.12);

  /* Neutrals - Warm Stone */
  --color-stone: #8b8579;
  --color-stone-light: #b5b0a6;
  --color-stone-lighter: #e0ddd6;
  --color-stone-lightest: #eceae5;

  /* Semantic */
  --color-success: #4a5043;
  --color-error: #a04030;
  --color-warning: #c49b2a;

  /* Gradients */
  --gradient-gold: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  --gradient-terracotta: linear-gradient(135deg, var(--color-terracotta) 0%, var(--color-terracotta-light) 100%);
  --gradient-ink: linear-gradient(135deg, var(--color-ink) 0%, var(--color-ink-rich) 100%);
  --gradient-parchment: linear-gradient(180deg, var(--color-parchment) 0%, var(--color-parchment-warm) 100%);
  --gradient-shimmer: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  --gradient-border-gold: linear-gradient(90deg, transparent, var(--color-gold), transparent);

  /* Typography */
  --font-display: 'Tiro Devanagari Sanskrit', 'Noto Serif Devanagari', 'Linux Libertine Greek', 'Cormorant Garamond', 'Garamond', 'Times New Roman', serif;
  --font-body: 'Tiro Devanagari Sanskrit', 'Noto Serif Devanagari', 'Linux Libertine Greek', 'Crimson Pro', 'Georgia', serif;
  --font-mono: 'Tiro Devanagari Sanskrit', 'Noto Serif Devanagari', 'Linux Libertine Greek', 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;

  /* Font Sizes - Modular Scale (1.25) */
  --text-xs: 0.64rem;
  --text-sm: 0.8rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.563rem;
  --text-3xl: 1.953rem;
  --text-4xl: 2.441rem;
  --text-5xl: 3.052rem;
  --text-6xl: 3.815rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Shadows - Layered Depth */
  --shadow-xs: 0 1px 2px rgba(13, 17, 23, 0.04);
  --shadow-sm: 0 2px 4px rgba(13, 17, 23, 0.04), 0 1px 2px rgba(13, 17, 23, 0.02);
  --shadow-md: 0 4px 16px rgba(13, 17, 23, 0.06), 0 2px 4px rgba(13, 17, 23, 0.03);
  --shadow-lg: 0 12px 32px rgba(13, 17, 23, 0.08), 0 4px 12px rgba(13, 17, 23, 0.04);
  --shadow-xl: 0 24px 48px rgba(13, 17, 23, 0.12), 0 8px 24px rgba(13, 17, 23, 0.06);
  --shadow-inner: inset 0 2px 4px rgba(13, 17, 23, 0.03);
  --shadow-glow-gold: 0 0 24px var(--color-gold-glow), 0 0 48px rgba(196, 155, 42, 0.1);
  --shadow-glow-terracotta: 0 0 20px rgba(160, 64, 48, 0.15);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --transition-fast: 150ms var(--ease-out);
  --transition-base: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);
  --transition-slower: 600ms var(--ease-out);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
  --container-2xl: 1400px;

  /* Z-index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* ========================================
   Dark Mode (Optional)
   ======================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --color-ink: #f0ebe3;
    --color-ink-rich: #e5ded3;
    --color-ink-muted: #b5aea3;
    --color-ink-subtle: #8a8378;

    --color-parchment: #0d1117;
    --color-parchment-warm: #151b22;
    --color-vellum: #1a2028;
    --color-cream: #1e252e;

    --color-stone: #6b665c;
    --color-stone-light: #4a463e;
    --color-stone-lighter: #2d2a26;
    --color-stone-lightest: #1f1c19;
  }
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-ink);
  background: var(--color-parchment);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Paper Texture Overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: -1;
}

/* ========================================
   Custom Scrollbar
   ======================================== */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-parchment-warm);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-gold) 0%, var(--color-terracotta) 100%);
  border-radius: 6px;
  border: 3px solid var(--color-parchment-warm);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--color-gold-light) 0%, var(--color-terracotta-light) 100%);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold) var(--color-parchment-warm);
}

/* ========================================
   Selection
   ======================================== */
::selection {
  background: var(--color-gold-muted);
  color: var(--color-ink);
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-ink);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-5xl);
  font-weight: 400;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-4xl);
  font-weight: 400;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 500;
}

h4 {
  font-size: var(--text-xl);
  font-weight: 600;
}

p {
  color: var(--color-ink-muted);
  line-height: 1.8;
}

/* Italic Latin Text Style */
.latin-text,
em {
  font-style: italic;
  color: var(--color-terracotta);
}

/* Drop Cap - Illuminated Initial */
.drop-cap::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 0.8;
  font-weight: 600;
  color: var(--color-terracotta);
  margin-right: 0.5rem;
  margin-top: 0.1rem;
}

/* Label / Eyebrow Text */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-stone);
}

/* Gradient Text */
.text-gradient {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-terracotta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

a {
  color: var(--color-terracotta);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-terracotta-light);
}

/* ========================================
   Layout
   ======================================== */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container-narrow { max-width: var(--container-md); }
.container-wide { max-width: var(--container-2xl); }

/* ========================================
   Decorative Elements
   ======================================== */

/* Classical Ornament Divider */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin: var(--space-3xl) 0;
}

.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  max-width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-stone-lighter), transparent);
}

.ornament-symbol {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-gold);
}

/* Gold Accent Line */
.accent-line {
  width: 60px;
  height: 3px;
  background: var(--gradient-gold);
  border-radius: 2px;
}

.accent-line-sm {
  width: 40px;
  height: 2px;
}

/* Border Top Accent */
.accent-border-top {
  position: relative;
}

.accent-border-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-xl);
  width: 48px;
  height: 3px;
  background: var(--gradient-gold);
  border-radius: 0 0 2px 2px;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* Primary Button - Dark Ink */
.btn-primary {
  background: var(--gradient-ink);
  color: var(--color-parchment);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Secondary Button */
.btn-secondary {
  background: var(--color-cream);
  color: var(--color-ink);
  border: 1.5px solid var(--color-stone-lighter);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--color-parchment-warm);
  border-color: var(--color-stone-light);
  transform: translateY(-1px);
}

/* Gold Accent Button */
.btn-gold {
  background: var(--gradient-gold);
  color: white;
  box-shadow: var(--shadow-md), var(--shadow-glow-gold);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 32px var(--color-gold-glow);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--color-ink-muted);
  padding: 0.75rem 1.25rem;
}

.btn-ghost:hover {
  background: var(--color-stone-lightest);
  color: var(--color-ink);
}

/* Button Sizes */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
}

.btn-lg {
  padding: 1.125rem 2.25rem;
  font-size: var(--text-lg);
}

/* ========================================
   Cards
   ======================================== */
.card {
  background: var(--color-cream);
  border: 1px solid var(--color-stone-lighter);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all var(--transition-base);
}

.card-elevated {
  box-shadow: var(--shadow-md);
  border: none;
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-stone-light);
}

/* Card with Gold Accent */
.card-accent {
  position: relative;
}

.card-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-xl);
  width: 48px;
  height: 3px;
  background: var(--gradient-gold);
  border-radius: 0 0 2px 2px;
}

/* Glass Card */
.card-glass {
  background: rgba(255, 253, 248, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(224, 221, 214, 0.6);
  box-shadow: var(--shadow-lg);
}

/* ========================================
   Forms
   ======================================== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.02em;
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--color-stone);
  margin-top: var(--space-xs);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1.125rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-ink);
  background: var(--color-cream);
  border: 1.5px solid var(--color-stone-lighter);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-inner);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 4px var(--color-gold-muted), var(--shadow-inner);
  background: var(--color-vellum);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-stone);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
}

/* Legacy form support */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 0.875rem 1.125rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-ink);
  background: var(--color-cream);
  border: 1.5px solid var(--color-stone-lighter);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-inner);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 4px var(--color-gold-muted), var(--shadow-inner);
  background: var(--color-vellum);
}

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-sm);
}

.label-hint {
  font-weight: 400;
  color: var(--color-stone);
  font-size: var(--text-sm);
  display: block;
  margin-top: var(--space-xs);
}

/* ========================================
   Navigation
   ======================================== */
.nav-header {
  padding: var(--space-lg) 0;
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-stone-lighter);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  transition: all var(--transition-base);
}

.nav-header.scrolled {
  background: rgba(254, 252, 247, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--color-ink);
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: color var(--transition-fast);
}

.nav-logo:hover {
  color: var(--color-terracotta);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  padding: 0.625rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-ink-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0.375rem;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-gold);
  transform: translateX(-50%);
  transition: width var(--transition-fast);
  border-radius: 1px;
}

.nav-link:hover {
  color: var(--color-ink);
}

.nav-link:hover::after {
  width: 50%;
}

.nav-link.active {
  color: var(--color-ink);
  background: var(--color-parchment-warm);
}

/* ========================================
   Badges
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.3125rem 0.75rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast);
}

.badge:hover {
  transform: scale(1.05);
}

.badge-gold {
  background: var(--color-gold-muted);
  color: var(--color-gold-dark);
  border: 1px solid rgba(196, 155, 42, 0.25);
}

.badge-olive {
  background: var(--color-olive-muted);
  color: var(--color-olive);
  border: 1px solid rgba(74, 80, 67, 0.2);
}

.badge-terracotta {
  background: var(--color-terracotta-muted);
  color: var(--color-terracotta);
  border: 1px solid rgba(160, 64, 48, 0.2);
}

/* ========================================
   Alerts
   ======================================== */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  animation: slideDown 0.3s var(--ease-out);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: var(--color-olive-muted);
  color: var(--color-olive);
  border-left: 4px solid var(--color-olive);
}

.alert-error {
  background: var(--color-terracotta-muted);
  color: var(--color-terracotta);
  border-left: 4px solid var(--color-terracotta);
}

.alert-info {
  background: var(--color-gold-muted);
  color: var(--color-gold-dark);
  border-left: 4px solid var(--color-gold);
}

/* ========================================
   Progress
   ======================================== */
.progress-container {
  display: none;
  padding: var(--space-lg);
  background: var(--color-cream);
  border: 1px solid var(--color-stone-lighter);
  border-radius: var(--radius-xl);
  margin: var(--space-lg) 0;
}

.progress-container.active {
  display: block;
  animation: fadeIn 0.3s var(--ease-out);
}

.progress-bar-track,
.progress-bar-wrapper {
  width: 100%;
  height: 8px;
  background: var(--color-stone-lightest);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.progress-bar-fill,
.progress-bar {
  height: 100%;
  background: var(--gradient-gold);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease-out);
  width: 0%;
  position: relative;
}

.progress-bar-fill::after,
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-shimmer);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-text {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-stone);
  font-weight: 500;
}

/* ========================================
   Preview / Code Blocks
   ======================================== */
.preview-box {
  background: var(--color-ink);
  color: var(--color-stone-lighter);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.8;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  position: relative;
  box-shadow: var(--shadow-xl), inset 0 2px 20px rgba(0,0,0,0.2);
}

.preview-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-gold);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* ========================================
   Stats Grid
   ======================================== */
.stats-grid,
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-lg) 0;
}

.stat-item {
  background: var(--color-cream);
  border: 1px solid var(--color-stone-lighter);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-gold);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.stat-item:hover::before {
  transform: scaleX(1);
}

.stat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-value,
.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 500;
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-terracotta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--space-sm);
  display: block;
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-stone);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ========================================
   Results
   ======================================== */
.results {
  display: none;
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-stone-lighter);
  animation: fadeIn 0.4s var(--ease-out);
}

.results.active {
  display: block;
}

/* ========================================
   Error Display
   ======================================== */
.error {
  display: none;
  background: var(--color-terracotta-muted);
  color: var(--color-terracotta);
  border-left: 4px solid var(--color-terracotta);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  font-size: var(--text-base);
}

.error.active {
  display: block;
  animation: shake 0.4s var(--ease-out);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* ========================================
   Info Box / Next Step
   ======================================== */
.next-step,
.info-box,
.info-card {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-gold-muted);
  border: 1px solid rgba(196, 155, 42, 0.2);
  border-radius: var(--radius-xl);
  position: relative;
}

.next-step::before,
.info-box::before,
.info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-gold);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.next-step p,
.info-box p,
.info-card p {
  font-size: var(--text-base);
  color: var(--color-ink);
  margin-bottom: var(--space-md);
}

.info-box h3,
.info-card h3 {
  color: var(--color-gold-dark);
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.info-box ul,
.info-card ul {
  margin: 0;
  padding-left: var(--space-lg);
  list-style: disc;
}

.info-box ul li,
.info-card ul li {
  margin-bottom: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  line-height: 1.5;
}

.info-box ul li:last-child,
.info-card ul li:last-child {
  margin-bottom: 0;
}

/* ========================================
   Note Cards
   ======================================== */
.note-card {
  background: var(--color-cream);
  border: 1px solid var(--color-stone-lighter);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: all var(--transition-base);
}

.note-card:hover {
  box-shadow: var(--shadow-md);
}

.note-card.selected {
  border-color: var(--color-olive);
  background: var(--color-olive-muted);
  box-shadow: 0 0 0 3px rgba(74, 80, 67, 0.1);
}

.note-card.skipped {
  opacity: 0.5;
  border-color: var(--color-terracotta);
  background: var(--color-terracotta-muted);
}

.note-lemma {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  font-style: italic;
  color: var(--color-terracotta);
  margin-bottom: var(--space-sm);
}

.note-content {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-ink-muted);
  margin-bottom: var(--space-md);
  white-space: pre-wrap;
}

.note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.note-action-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-keep {
  background: var(--color-olive);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-keep:hover {
  background: var(--color-olive-light);
  transform: translateY(-1px);
}

.btn-skip {
  background: var(--color-terracotta);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-skip:hover {
  background: var(--color-terracotta-light);
  transform: translateY(-1px);
}

.btn-regen {
  background: var(--gradient-gold);
  color: white;
  box-shadow: var(--shadow-sm), var(--shadow-glow-gold);
}

.btn-regen:hover {
  box-shadow: var(--shadow-md), 0 0 24px var(--color-gold-glow);
  transform: translateY(-1px);
}

/* ========================================
   Divider
   ======================================== */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-stone-lighter), transparent);
}

.divider-text {
  font-size: var(--text-xs);
  color: var(--color-stone);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
}

/* ========================================
   Notification Badge
   ======================================== */
.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-terracotta);
  color: white;
  border-radius: var(--radius-full);
  padding: 0.125rem 0.5rem;
  font-size: var(--text-xs);
  font-weight: 700;
  min-width: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  animation: popIn 0.3s var(--ease-spring);
}

@keyframes popIn {
  0% { transform: scale(0); }
  80% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ========================================
   Footer
   ======================================== */
.footer {
  padding: var(--space-3xl) 0;
  text-align: center;
  color: var(--color-stone);
  font-size: var(--text-sm);
  border-top: 1px solid var(--color-stone-lighter);
  margin-top: var(--space-4xl);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-gold);
  border-radius: 2px;
}

/* ========================================
   Legacy Header Support
   ======================================== */
.header {
  padding: var(--space-md) 0;
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-stone-lighter);
}

.logo-text {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--color-ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--color-stone);
  font-size: var(--text-base);
  margin-top: var(--space-xs);
}

/* ========================================
   API Status
   ======================================== */
.api-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
}

.api-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.9); }
}

.api-status.enabled {
  background: var(--color-olive-muted);
  color: var(--color-olive);
  border: 1px solid rgba(74, 80, 67, 0.2);
}

.api-status.enabled::before {
  background: var(--color-olive);
  box-shadow: 0 0 8px var(--color-olive);
}

.api-status.disabled {
  background: var(--color-terracotta-muted);
  color: var(--color-terracotta);
  border: 1px solid rgba(160, 64, 48, 0.2);
}

.api-status.disabled::before {
  background: var(--color-terracotta);
}

/* ========================================
   Utilities
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-lg { font-size: var(--text-lg); }

.text-muted { color: var(--color-stone); }
.text-gold { color: var(--color-gold); }
.text-terracotta { color: var(--color-terracotta); }

.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none !important; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.grid { display: grid; }

/* Hover Effects */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow-gold);
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.animate-fade-in { animation: fadeIn 0.4s var(--ease-out); }
.animate-slide-up { animation: slideUp 0.6s var(--ease-out); }
.animate-slide-down { animation: slideDown 0.6s var(--ease-out); }
.animate-scale-in { animation: scaleIn 0.4s var(--ease-out); }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Staggered Animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Page Load Animation */
@keyframes pageReveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body > *:first-child {
  animation: pageReveal 0.7s var(--ease-out);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  :root {
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }

  .container {
    padding: 0 var(--space-md);
  }

  .nav-container {
    flex-direction: column;
    gap: var(--space-md);
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .stats-grid,
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .nav-header,
  .btn,
  .notification-badge {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  body::before {
    display: none;
  }

  .card,
  .preview-box {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ═══════════════════════════════════════
   HELP PANEL - Glassmorphic Collapsible
   Premium contextual help component
   ═══════════════════════════════════════ */

.help-panel {
    position: relative;
    background: linear-gradient(
        135deg,
        rgba(255, 253, 248, 0.92) 0%,
        rgba(250, 247, 242, 0.88) 100%
    );
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(196, 155, 42, 0.2);
    clip-path: polygon(
        12px 0, calc(100% - 12px) 0, 100% 12px,
        100% calc(100% - 12px), calc(100% - 12px) 100%,
        12px 100%, 0 calc(100% - 12px), 0 12px
    );
    margin-bottom: var(--space-xl);
    box-shadow:
        0 4px 24px rgba(26, 22, 18, 0.04),
        0 1px 2px rgba(26, 22, 18, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.help-panel:hover {
    border-color: rgba(196, 155, 42, 0.35);
    box-shadow:
        0 8px 32px rgba(26, 22, 18, 0.06),
        0 2px 4px rgba(26, 22, 18, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Gold accent bar at top */
.help-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--color-gold) 20%,
        var(--color-gold-light) 50%,
        var(--color-gold) 80%,
        transparent 100%
    );
    opacity: 0.7;
}

.help-panel-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--color-ink);
    transition: color 0.15s ease;
    text-align: left;
}

.help-panel-toggle:hover {
    color: var(--color-gold-dark);
}

.help-panel-toggle:focus {
    outline: none;
}

.help-panel-toggle:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: -2px;
}

.help-panel-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--color-gold);
    flex-shrink: 0;
}

.help-panel-toggle .chevron {
    margin-left: auto;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--color-stone);
}

.help-panel.expanded .help-panel-toggle .chevron {
    transform: rotate(180deg);
}

/* Animated expand/collapse using grid trick */
.help-panel-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.help-panel.expanded .help-panel-content {
    grid-template-rows: 1fr;
}

.help-panel-inner {
    overflow: hidden;
}

/* Individual help sections */
.help-section {
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--color-stone-lightest);
}

.help-section:first-child {
    border-top: 1px solid rgba(196, 155, 42, 0.15);
}

.help-section h4 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-ink-muted);
    margin-bottom: var(--space-md);
}

.help-section h4 svg {
    width: 16px;
    height: 16px;
    color: var(--color-terracotta);
}

.help-section p {
    color: var(--color-ink-muted);
    line-height: 1.75;
    font-size: var(--text-base);
}

.help-section ul {
    color: var(--color-ink-muted);
    line-height: 1.85;
    font-size: var(--text-base);
    padding-left: var(--space-lg);
    margin-top: var(--space-sm);
}

.help-section li {
    margin-bottom: var(--space-xs);
}

.help-section li strong {
    color: var(--color-ink);
    font-weight: 600;
}

/* Code Example Block within help panel */
.help-code-example {
    position: relative;
    background: var(--color-ink);
    border-radius: 12px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    margin-top: var(--space-md);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        0 1px 0 rgba(255, 255, 255, 0.05);
}

.help-code-label {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-stone);
    background: rgba(0, 0, 0, 0.3);
    font-family: var(--font-body);
    font-weight: 600;
}

.help-code-block {
    padding: var(--space-md) var(--space-lg);
    color: var(--color-stone-light);
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.help-code-block.output {
    background: rgba(196, 155, 42, 0.08);
    color: var(--color-gold-light);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Learn More Link at bottom */
.help-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-lg) var(--space-xl);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-gold-dark);
    text-decoration: none;
    transition: all 0.15s ease;
    border-top: 1px solid var(--color-stone-lightest);
}

.help-link:hover {
    color: var(--color-gold);
    background: rgba(196, 155, 42, 0.05);
}

.help-link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.help-link:hover svg {
    transform: translateX(4px);
}

/* ═══════════════════════════════════════
   TUTORIAL PAGE STYLES
   Cinematic onboarding experience
   ═══════════════════════════════════════ */

/* Tutorial Hero Section */
.tutorial-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-4xl) var(--space-xl);
    overflow: hidden;
    background: linear-gradient(
        135deg,
        var(--color-parchment) 0%,
        var(--color-parchment-warm) 30%,
        var(--color-ink) 100%
    );
}

.tutorial-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 80% 60% at 50% 30%,
        rgba(196, 155, 42, 0.15) 0%,
        transparent 50%
    );
    pointer-events: none;
}

/* Animated grain overlay */
.tutorial-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    animation: grainShift 8s steps(10) infinite;
}

@keyframes grainShift {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-2%, -2%); }
    20% { transform: translate(2%, 2%); }
    30% { transform: translate(-1%, 1%); }
    40% { transform: translate(1%, -1%); }
    50% { transform: translate(-2%, 2%); }
    60% { transform: translate(2%, -2%); }
    70% { transform: translate(-1%, -1%); }
    80% { transform: translate(1%, 1%); }
    90% { transform: translate(0%, -2%); }
}

.tutorial-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.tutorial-hero-title {
    font-family: var(--font-display);
    font-size: var(--text-6xl);
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--color-ink);
    margin-bottom: var(--space-lg);
    text-transform: uppercase;
    animation: fadeInUp 0.8s ease both;
}

.tutorial-hero-subtitle {
    font-family: var(--font-body);
    font-size: var(--text-xl);
    font-weight: 300;
    color: var(--color-ink-muted);
    margin-bottom: var(--space-3xl);
    animation: fadeInUp 0.8s 0.2s ease both;
}

.tutorial-scroll-indicator {
    position: absolute;
    bottom: var(--space-3xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-stone);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    animation: fadeInUp 0.8s 0.6s ease both;
}

.tutorial-scroll-indicator svg {
    width: 24px;
    height: 24px;
    animation: bounceDown 2s ease-in-out infinite;
}

@keyframes bounceDown {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(8px); }
    60% { transform: translateY(4px); }
}

/* Horizontal Scroll Workflow Section */
.tutorial-workflow {
    padding: var(--space-5xl) 0;
    background: var(--color-parchment);
    overflow: hidden;
}

.tutorial-workflow-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 500;
    text-align: center;
    color: var(--color-ink);
    margin-bottom: var(--space-3xl);
    padding: 0 var(--space-xl);
}

.tutorial-workflow-track {
    display: flex;
    gap: var(--space-xl);
    padding: var(--space-xl);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tutorial-workflow-track::-webkit-scrollbar {
    display: none;
}

/* Workflow Step Card */
.workflow-card {
    flex: 0 0 320px;
    scroll-snap-align: center;
    background: linear-gradient(
        135deg,
        rgba(255, 253, 248, 0.95) 0%,
        rgba(255, 255, 255, 0.9) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(196, 155, 42, 0.15);
    clip-path: polygon(
        12px 0, calc(100% - 12px) 0, 100% 12px,
        100% calc(100% - 12px), calc(100% - 12px) 100%,
        12px 100%, 0 calc(100% - 12px), 0 12px
    );
    padding: var(--space-2xl);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.workflow-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(26, 22, 18, 0.1),
        0 0 0 1px rgba(196, 155, 42, 0.3),
        0 0 60px rgba(196, 155, 42, 0.1);
}

.workflow-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 3px;
    background: var(--gradient-gold);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.workflow-card:hover::before {
    opacity: 1;
}

.workflow-card-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gradient-gold);
    color: var(--color-ink);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    border-radius: 50%;
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-md), 0 0 20px rgba(196, 155, 42, 0.2);
}

.workflow-card-icon {
    width: 48px;
    height: 48px;
    color: var(--color-terracotta);
    margin-bottom: var(--space-md);
}

.workflow-card-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-ink);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.workflow-card-desc {
    font-size: var(--text-base);
    color: var(--color-ink-muted);
    line-height: 1.7;
}

/* Tools Grid Section */
.tutorial-tools {
    padding: var(--space-5xl) var(--space-xl);
    background: var(--color-parchment-warm);
}

.tutorial-tools-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 500;
    text-align: center;
    color: var(--color-ink);
    margin-bottom: var(--space-3xl);
}

.tutorial-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
}

/* Tool Card */
.tool-card {
    background: var(--color-cream);
    border: 1px solid var(--color-stone-lighter);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-gold);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-gold-muted);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.tool-card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gold-muted);
    border-radius: var(--radius-md);
    color: var(--color-gold-dark);
    flex-shrink: 0;
}

.tool-card-icon svg {
    width: 24px;
    height: 24px;
}

.tool-card-info h3 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-ink);
    margin-bottom: var(--space-xs);
}

.tool-card-info p {
    font-size: var(--text-sm);
    color: var(--color-ink-muted);
}

.tool-card-preview {
    background: var(--color-ink);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin: var(--space-md) 0;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-stone-light);
    line-height: 1.6;
    overflow: hidden;
}

.tool-card-preview .input {
    color: var(--color-stone);
    margin-bottom: var(--space-xs);
}

.tool-card-preview .output {
    color: var(--color-gold-light);
}

.tool-card-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: 600;
    color: var(--color-gold-dark);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all 0.2s ease;
}

.tool-card-cta:hover {
    color: var(--color-gold);
    gap: var(--space-sm);
}

.tool-card-cta svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.tool-card-cta:hover svg {
    transform: translateX(4px);
}

/* Pro Tips Section */
.tutorial-tips {
    padding: var(--space-5xl) var(--space-xl);
    background: var(--color-parchment);
}

.tutorial-tips-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 500;
    text-align: center;
    color: var(--color-ink);
    margin-bottom: var(--space-3xl);
}

.tutorial-tips-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Tip Accordion */
.tip-item {
    background: var(--color-cream);
    border: 1px solid var(--color-stone-lighter);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    overflow: hidden;
    transition: all 0.25s ease;
}

.tip-item:hover {
    border-color: var(--color-gold-muted);
}

.tip-item.expanded {
    box-shadow: var(--shadow-md);
}

.tip-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    cursor: pointer;
    transition: background 0.2s ease;
}

.tip-header:hover {
    background: rgba(196, 155, 42, 0.05);
}

.tip-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-terracotta-muted);
    border-radius: var(--radius-sm);
    color: var(--color-terracotta);
    flex-shrink: 0;
}

.tip-icon svg {
    width: 18px;
    height: 18px;
}

.tip-title {
    flex: 1;
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-ink);
}

.tip-chevron {
    color: var(--color-stone);
    transition: transform 0.3s ease;
}

.tip-chevron svg {
    width: 20px;
    height: 20px;
}

.tip-item.expanded .tip-chevron {
    transform: rotate(180deg);
}

.tip-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.tip-item.expanded .tip-content {
    grid-template-rows: 1fr;
}

.tip-content-inner {
    overflow: hidden;
    padding: 0 var(--space-lg) var(--space-lg) var(--space-lg);
    color: var(--color-ink-muted);
    font-size: var(--text-base);
    line-height: 1.75;
}

.tip-content-inner p {
    margin-bottom: var(--space-md);
}

.tip-content-inner code {
    background: var(--color-stone-lightest);
    padding: 0.125em 0.375em;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--color-terracotta);
}

/* CTA Footer Section */
.tutorial-cta {
    padding: var(--space-5xl) var(--space-xl);
    background: var(--color-ink);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tutorial-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-gold);
}

.tutorial-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 60% 50% at 50% 100%,
        rgba(196, 155, 42, 0.1) 0%,
        transparent 50%
    );
    pointer-events: none;
}

.tutorial-cta-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}

.tutorial-cta-title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 400;
    color: var(--color-parchment);
    margin-bottom: var(--space-lg);
}

.tutorial-cta-desc {
    font-size: var(--text-lg);
    color: var(--color-stone);
    margin-bottom: var(--space-2xl);
}

.tutorial-cta-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive adjustments for tutorial */
@media (max-width: 768px) {
    .tutorial-hero-title {
        font-size: var(--text-4xl);
        letter-spacing: 0.1em;
    }

    .tutorial-hero-subtitle {
        font-size: var(--text-lg);
    }

    .workflow-card {
        flex: 0 0 280px;
        padding: var(--space-xl);
    }

    .tutorial-tools-grid {
        grid-template-columns: 1fr;
    }

    .tutorial-cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}
