/* =============================================
   DESIGNVAULT — styles.css
   ============================================= */

/* --- TOKENS --- */
:root {
  --font-display: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;

  --ink: #0F0F0F;
  --ink-muted: #444;
  --ink-faint: #888;
  --border: #E5E5E5;
  --surface: #FFFFFF;
  --surface-2: #F7F7F5;
  --surface-3: #EFEFEC;

  --accent: #4F46E5;
  --accent-light: #EEF2FF;
  --accent-hover: #3730A3;
  --amber: #F59E0B;
  --emerald: #10B981;
  --danger: #EF4444;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-xl: 0 24px 80px rgba(0,0,0,0.16);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --nav-h: 68px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --ink: #F0F0F0;
  --ink-muted: #AAA;
  --ink-faint: #666;
  --border: #2A2A2A;
  --surface: #111111;
  --surface-2: #181818;
  --surface-3: #222222;
  --accent-light: #1e1b4b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
}

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

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

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

/* --- NAVBAR --- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

[data-theme="dark"] .navbar { background: rgba(17,17,17,0.88); }

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 48px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-mark {
  width: 34px; height: 34px;
  background: var(--ink);
  color: var(--surface);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
  transition: background var(--transition);
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: all var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--ink);
  background: var(--surface-2);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover { background: var(--surface-3); transform: rotate(15deg); }

.theme-icon { position: absolute; transition: all 0.3s; }
.theme-icon.moon { 
opacity: 0; 
transform: translateY(20px);
color: white;
 }
[data-theme="dark"] .theme-icon.sun { opacity: 0; transform: translateY(-20px); }
[data-theme="dark"] .theme-icon.moon { opacity: 1; transform: translateY(0); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 36px; height: 36px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all var(--transition);
}

/* --- PAGES --- */
.page {
  display: none;
  min-height: 100vh;
  padding-top: var(--nav-h);
}
.page.active { display: block; }

/* --- HERO --- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
}

.orb1 { width: 600px; height: 600px; background: var(--accent); top: -200px; right: -100px; }
.orb2 { width: 400px; height: 400px; background: var(--amber); bottom: -100px; left: 20%; }
[data-theme="dark"] .hero-orb { opacity: 0.2; }

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, transparent 20%, black 80%);
  opacity: 0.5;
}

.hero-content { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
  animation: fadeUp 0.6s ease both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  animation: fadeUp 0.6s 0.1s ease both;
}

.hero-title em { font-style: italic; color: var(--accent); }

.hero-desc {
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 480px;
  margin-bottom: 36px;
  line-height: 1.7;
  animation: fadeUp 0.6s 0.2s ease both;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  animation: fadeUp 0.6s 0.3s ease both;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  animation: fadeUp 0.6s 0.4s ease both;
}

.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-div { width: 1px; height: 36px; background: var(--border); }

.hero-visual {
  position: relative;
  z-index: 1;
  animation: fadeUp 0.7s 0.2s ease both;
}

.mockup-window {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transform: perspective(1000px) rotateY(-6deg) rotateX(2deg);
  transition: transform 0.5s ease;
}

.mockup-window:hover { transform: perspective(1000px) rotateY(-2deg) rotateX(1deg); }

.mockup-bar {
  background: var(--surface-3);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.r { background: #FF5F57; }
.dot.y { background: #FEBC2E; }
.dot.g { background: #28C840; }

.mockup-url {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-left: 8px;
  background: var(--surface);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

.mockup-body { padding: 20px; }

.mock-nav {
  height: 36px;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.mock-hero { margin-bottom: 24px; }
.mock-line {
  height: 10px;
  background: var(--surface-3);
  border-radius: 100px;
  margin-bottom: 10px;
}

.mock-line.wide { width: 80%; }
.mock-line.med { width: 60%; }
.mock-line.short { width: 40%; }

.mock-btn-row { display: flex; gap: 8px; margin-top: 14px; }
.mock-btn { height: 28px; width: 90px; background: var(--accent); border-radius: var(--radius-sm); opacity: 0.7; }
.mock-btn.ghost { background: transparent; border: 1px solid var(--border); }

.mock-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.mock-img {
  height: 60px;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  border-radius: 6px;
  margin-bottom: 8px;
  opacity: 0.4;
}

.mock-img.alt { background: linear-gradient(135deg, var(--amber), var(--danger)); }

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary { background: var(--ink); color: var(--surface); }
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(79,70,229,0.35); }

.btn-secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-3); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--ink-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); }

.btn-danger { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA; }
.btn-danger:hover { background: var(--danger); color: white; }

/* --- FILTER BAR --- */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--ink-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.filter-btn:hover { color: var(--ink); border-color: var(--ink-muted); }
.filter-btn.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* --- SECTIONS --- */
.templates-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-header {
  margin-bottom: 40px;
  text-align: center;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.section-sub { color: var(--ink-muted); font-size: 1rem; }

/* --- CARDS --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.template-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.card-preview {
  aspect-ratio: 16/10;
  position: relative;
  overflow: hidden;
}

.card-preview-inner {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px;
  transition: transform 0.4s ease;
}

.template-card:hover .card-preview-inner { transform: scale(1.03); }

.card-meta { padding: 20px 20px 24px; }

.card-category {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.card-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.card-desc {
  font-size: 0.87rem;
  color: var(--ink-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  padding: 3px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.card-btn {
  padding: 8px 18px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition);
}

.card-btn:hover { background: var(--accent-hover); transform: translateX(2px); }

/* --- FEATURES --- */
.features-section {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 80px 24px;
}

.features-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.feature-card {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon { font-size: 2rem; margin-bottom: 20px; color: var(--accent); }
.feature-card h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; }
.feature-card p { font-size: 0.9rem; color: var(--ink-muted); line-height: 1.7; }

/* --- PAGE HERO --- */
.page-hero {
  text-align: center;
  padding: 80px 24px 48px;
  max-width: 680px;
  margin: 0 auto;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}

.page-sub { font-size: 1.05rem; color: var(--ink-muted); line-height: 1.7; }

/* --- DETAIL PAGE --- */
.detail-back {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 0;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.btn-back:hover { color: var(--ink); background: var(--surface-3); }

#detailContent {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--border);
}

.detail-preview {
  aspect-ratio: 16/10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}

.detail-cat {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.detail-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.detail-desc {
  font-size: 1rem;
  color: var(--ink-muted);
  margin-bottom: 32px;
  line-height: 1.7;
}

/* --- DESIGN SYSTEM SECTIONS --- */
.ds-content, #detailContent .ds-content { display: grid; gap: 48px; }

.ds-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.ds-heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.ds-colors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.color-swatch {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.color-swatch::before {
  content: '';
  display: block;
  height: 80px;
  background: var(--c);
}

.swatch-name { display: block; font-weight: 600; font-size: 0.85rem; padding: 10px 12px 2px; }
.swatch-val { display: block; font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-faint); padding: 0 12px 12px; }

.ds-type { display: grid; gap: 20px; }
.type-example { padding: 16px 0; border-bottom: 1px solid var(--border); }
.type-example:last-child { border-bottom: none; }

.h1-ex { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 900; letter-spacing: -0.04em; }
.h2-ex { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.03em; }
.h3-ex { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.body-ex { font-size: 1rem; color: var(--ink-muted); line-height: 1.7; }
.mono-ex { font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent); }

.ds-spacing { display: grid; gap: 16px; }
.sp-row { display: flex; align-items: center; gap: 16px; }
.sp-box { background: var(--accent); border-radius: 4px; opacity: 0.7; flex-shrink: 0; }
.sp-row span { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-muted); }

.ds-components { display: grid; gap: 40px; }
.comp-group h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 16px;
}
.comp-group.full { grid-column: 1 / -1; }
.comp-row { display: flex; gap: 12px; flex-wrap: wrap; }
.comp-col { display: flex; flex-direction: column; gap: 12px; max-width: 400px; }

.ds-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

.ds-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.demo-card {
  max-width: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
}
.demo-card-img { height: 140px; background: linear-gradient(135deg, var(--accent), var(--emerald)); opacity: 0.7; }
.demo-card-body { padding: 20px; }
.demo-card-body h4 { font-family: var(--font-display); font-weight: 700; margin-bottom: 8px; }
.demo-card-body p { font-size: 0.87rem; color: var(--ink-muted); margin-bottom: 16px; }

.ds-navbar-demo {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.demo-logo { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.demo-nav-links { display: flex; gap: 24px; flex: 1; }
.demo-link { font-size: 0.9rem; font-weight: 500; color: var(--ink-muted); cursor: pointer; transition: color var(--transition); }
.demo-link.active, .demo-link:hover { color: var(--ink); }

#page-design-system .ds-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* --- ABOUT --- */
.about-content { max-width: 1100px; margin: 0 auto; padding: 0 24px 80px; }

.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-text h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.about-text p { color: var(--ink-muted); margin-bottom: 16px; line-height: 1.75; }

.about-list { display: flex; flex-direction: column; gap: 12px; }
.about-list li { color: var(--ink-muted); font-size: 0.95rem; }

.about-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.about-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
}

.about-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 4px;
}

.about-label {
  font-size: 0.85rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* --- FOOTER --- */
.footer { border-top: 1px solid var(--border); padding: 40px 24px; }

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-copy { color: var(--ink-faint); font-size: 0.85rem; flex: 1; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 0.85rem; color: var(--ink-faint); transition: color var(--transition); }
.footer-links a:hover { color: var(--ink); }

/* --- COPY CSS BUTTON --- */
.btn-copy-css {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: -0.01em;
}

.btn-copy-css:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-copy-css.copied { background: #ECFDF5; border-color: #10B981; color: #059669; }
[data-theme="dark"] .btn-copy-css.copied { background: #022C22; border-color: #10B981; color: #34D399; }
.copy-icon { font-size: 1rem; line-height: 1; }

/* --- ANIMATIONS --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page.active .section-header,
.page.active .filter-bar,
.page.active .cards-grid,
.page.active .features-section,
.page.active .page-hero,
.page.active .ds-section,
.page.active .about-grid {
  animation: fadeUp 0.5s ease both;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding: 60px 24px; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { order: -1; }
  .mockup-window { transform: none; max-width: 480px; margin: 0 auto; }
  .features-inner { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .about-aside { position: static; flex-direction: row; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px 16px;
    gap: 2px;
    z-index: 99;
    box-shadow: var(--shadow-md);
  }

  .nav-links.open .nav-link {
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    width: 100%;
    display: block;
  }

  .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero { padding: 40px 20px 60px; }
  .hero-title { font-size: 2.4rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }

  .cards-grid { grid-template-columns: 1fr; }
  .ds-colors { grid-template-columns: repeat(3, 1fr); }

  .detail-hero { grid-template-columns: 1fr; gap: 24px; margin-bottom: 32px; padding-bottom: 32px; }
  .detail-preview { aspect-ratio: 16/9; border-radius: var(--radius-md); }
  .detail-title { font-size: 1.8rem; }

  #detailContent { padding: 20px 16px 60px; overflow-x: hidden; }
  .detail-back { padding: 16px 16px 0; }
  .ds-content, #detailContent .ds-content { overflow-x: hidden; }
  .ds-components { overflow-x: hidden; }
  .ds-navbar-demo { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .demo-nav-links { gap: 12px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .about-aside { flex-direction: column; }
  .ds-section { padding: 20px 16px; }
  .templates-section { padding: 40px 16px; }
  .sp-box { max-width: 80px !important; max-height: 40px !important; }
}

.hidden { display: none !important; }

/* ── LIVE PREVIEW IFRAME ── */
.preview-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin-bottom: 0;
  background: var(--surface-2);
}

.preview-header {
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-dots { display: flex; gap: 6px; align-items: center; }
.pdot { width: 12px; height: 12px; border-radius: 50%; }
.pdot.r { background: #FF5F57; }
.pdot.y { background: #FEBC2E; }
.pdot.g { background: #28C840; }

.preview-url {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-align: center;
  max-width: 320px;
}

.preview-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald);
  background: rgba(16,185,129,0.1);
  padding: 3px 10px;
  border-radius: 100px;
}

.preview-iframe {
  width: 100%;
  height: 680px;
  border: none;
  display: block;
}

@media (max-width: 640px) {
  .preview-iframe { height: 520px; }
}
