/* ==========================================================================
   FOLIO — Editorial Digital Storefront Design System
   Warm alabaster surfaces, deep charcoal ink, terracotta editorial accents,
   tabular pricing numerals, and responsive Swiss grid alignment.
   ========================================================================== */

:root {
  /* Color Tokens */
  --bg-canvas: #faf8f5;
  --bg-surface: #ffffff;
  --bg-subtle: #f3efe8;
  --bg-muted: #ebe5da;
  --bg-ink: #141413;
  --bg-ink-elevated: #1f1e1c;

  --ink-primary: #141413;
  --ink-secondary: #4c4842;
  --ink-muted: #706b63;
  --ink-inverse: #faf8f5;

  --border-subtle: #e7e1d7;
  --border-strong: #d4ccbf;

  --accent: #c8552d;
  --accent-hover: #ab4420;
  --accent-soft: #f9eae4;

  --emerald: #1f6f50;
  --emerald-hover: #185a40;
  --emerald-soft: #e5f3ec;

  --amber-soft: #fbf3e2;
  --amber-ink: #8a5a10;

  --danger: #b42318;
  --danger-soft: #fef3f2;

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Radii & Shadows */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 20, 19, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 20, 19, 0.07), 0 1px 3px rgba(20, 20, 19, 0.04);
  --shadow-lg: 0 24px 60px rgba(20, 20, 19, 0.16), 0 4px 12px rgba(20, 20, 19, 0.06);

  --container-max: 1200px;
  --transition: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Base Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
}

body.has-overlay {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.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;
}

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

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  line-height: 1.2;
  padding: 10px 18px;
  transition: background-color var(--transition), border-color var(--transition),
    color var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  font-size: 0.875rem;
  padding: 8px 14px;
}

.btn-lg {
  font-size: 1rem;
  padding: 13px 24px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-ink {
  background: var(--bg-ink);
  color: var(--ink-inverse);
}

.btn-ink:hover:not(:disabled) {
  background: #2b2a28;
}

.btn-emerald {
  background: var(--emerald);
  color: #ffffff;
}

.btn-emerald:hover:not(:disabled) {
  background: var(--emerald-hover);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--ink-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.count-badge-accent {
  background: var(--accent);
  color: #ffffff;
}

.count-badge-emerald {
  background: var(--emerald);
  color: #ffffff;
}

/* ==========================================================================
   Announcement Bar & Header
   ========================================================================== */

.announcement-bar {
  background: var(--bg-ink);
  color: #e8e3da;
  font-size: 0.84rem;
  padding: 9px 0;
}

.announcement-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  text-align: center;
}

.announcement-inner p {
  margin: 0;
}

.announcement-pill {
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.dot-sep {
  margin: 0 6px;
  opacity: 0.5;
}

.inline-code-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px dashed rgba(255, 255, 255, 0.32);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
  transition: background-color var(--transition);
}

.inline-code-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 70px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 240ms ease;
}

.brand:hover .brand-logo {
  transform: perspective(300px) rotateY(-10deg) scale(1.05);
  box-shadow: var(--shadow-md);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-ink);
  color: var(--ink-inverse);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.03em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-top: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: background-color var(--transition), color var(--transition);
}

.nav-link:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Editorial Hero
   ========================================================================== */

.hero-section {
  padding: 56px 0 64px;
  border-bottom: 1px solid var(--border-subtle);
  background: radial-gradient(circle at 82% 20%, rgba(200, 85, 45, 0.06), transparent 46%),
    var(--bg-canvas);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 48px;
  align-items: center;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-secondary);
  box-shadow: var(--shadow-sm);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 4px rgba(31, 111, 80, 0.16);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.2vw, 3.35rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 20px 0 18px;
  color: var(--ink-primary);
}

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

.hero-lead {
  font-size: 1.08rem;
  color: var(--ink-secondary);
  max-width: 54ch;
  margin: 0 0 28px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-proof-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.hero-proof-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

.check-icon {
  width: 17px;
  height: 17px;
  color: var(--emerald);
  flex-shrink: 0;
}

/* Hero Visual Showcase Stack */
.showcase-stack {
  display: grid;
  gap: 16px;
}

.showcase-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.showcase-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.showcase-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-subtle);
}

.showcase-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.format-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 19, 0.86);
  color: #ffffff;
}

.showcase-media .format-tag {
  position: absolute;
  top: 12px;
  left: 12px;
}

.format-tag-warm {
  background: var(--accent-soft);
  color: var(--accent);
}

.showcase-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}

.showcase-kicker {
  margin: 0 0 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
}

.showcase-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
}

.showcase-price {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
}

.showcase-ebook {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: stretch;
}

.showcase-book-cover {
  background: var(--bg-subtle);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.showcase-book-cover img {
  width: 84px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: -3px 5px 12px rgba(20, 20, 19, 0.16);
}

.showcase-book-info {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.showcase-author {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-muted);
}

.showcase-book-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.showcase-link {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
}

/* ==========================================================================
   Catalog Section, Toolbar & Product Cards
   ========================================================================== */

.catalog-section {
  padding: 64px 0 76px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.section-eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.8vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-summary {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-muted);
}

/* Bundle Dynamic Callout */
.bundle-callout {
  margin-bottom: 20px;
}

.bundle-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 0.92rem;
}

.bundle-banner.is-unlocked {
  background: var(--emerald-soft);
  border-color: rgba(31, 111, 80, 0.28);
  color: #134a35;
}

.bundle-banner.is-progress {
  background: var(--amber-soft);
  border-color: rgba(138, 90, 16, 0.25);
  color: var(--amber-ink);
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.type-tabs {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.type-tab {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.type-tab:hover {
  color: var(--ink-primary);
}

.type-tab.is-active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  box-shadow: var(--shadow-sm);
}

.tab-count {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--ink-muted);
}

.type-tab.is-active .tab-count {
  background: var(--bg-ink);
  color: var(--ink-inverse);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}

.search-field {
  position: relative;
  min-width: 240px;
  flex: 0 1 320px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--ink-muted);
  pointer-events: none;
}

.search-field input,
.sort-field select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-surface);
  font-size: 0.92rem;
  transition: border-color var(--transition);
}

.search-field input {
  padding: 0 14px 0 38px;
}

.sort-field select {
  padding: 0 34px 0 12px;
  min-width: 184px;
}

.search-field input:focus,
.sort-field select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Category Pills */
.category-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.cat-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--ink-secondary);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.cat-pill:hover {
  border-color: var(--ink-primary);
  color: var(--ink-primary);
}

.cat-pill.is-active {
  background: var(--bg-ink);
  border-color: var(--bg-ink);
  color: var(--ink-inverse);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* Uniform 16:10 artwork stage so e-books & courses share crisp row alignment */
.card-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-subtle);
  overflow: hidden;
  cursor: pointer;
}

.card-stage-course img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.product-card:hover .card-stage-course img {
  transform: scale(1.03);
}

.card-stage-ebook {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: linear-gradient(145deg, #f3efe7 0%, #eae3d6 100%);
}

.book-frame {
  height: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 5px;
  box-shadow: -6px 10px 22px rgba(20, 20, 19, 0.2), -2px 0 0 rgba(255, 255, 255, 0.4) inset;
  transition: transform 280ms ease;
}

.book-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}

.card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.pill-type-ebook {
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink-primary);
  border: 1px solid rgba(20, 20, 19, 0.1);
}

.pill-type-course {
  background: rgba(20, 20, 19, 0.88);
  color: #ffffff;
}

.pill-editorial {
  background: var(--accent);
  color: #ffffff;
}

.pill-owned {
  background: var(--emerald);
  color: #ffffff;
}

.card-body {
  padding: 20px 22px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.8rem;
}

.card-category {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.card-rating {
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
  font-weight: 600;
}

.card-rating .star {
  color: #d08a18;
}

.card-title-btn {
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 600;
  line-height: 1.24;
  color: var(--ink-primary);
  transition: color var(--transition);
}

.card-title-btn:hover {
  color: var(--accent);
}

.card-author {
  margin: 0 0 10px;
  font-size: 0.86rem;
  color: var(--ink-muted);
}

.card-desc {
  margin: 0 0 16px;
  font-size: 0.91rem;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-spec-strip {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.card-footer {
  padding: 14px 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price-block {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-variant-numeric: tabular-nums;
}

.price-current {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.price-compare {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: line-through;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.empty-state {
  grid-column: 1 / -1;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 56px 24px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--ink-muted);
}

/* ==========================================================================
   How No-Login Works & Promo Strip
   ========================================================================== */

.how-section {
  padding: 72px 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.step-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px 26px;
}

.step-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.step-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.step-card p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-secondary);
}

.step-card code {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  background: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 4px;
}

.promo-strip {
  background: var(--bg-ink);
  color: var(--ink-inverse);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.promo-strip-eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #e6a68d;
}

.promo-strip h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 600;
}

.promo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.promo-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 10px 14px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  transition: background-color var(--transition), border-color var(--transition);
}

.promo-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--accent);
}

.promo-chip code {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffd5c5;
}

.promo-chip span {
  font-size: 0.78rem;
  color: #d6d0c6;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--bg-canvas);
  padding: 52px 0 32px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-subtle);
}

.footer-brand {
  max-width: 400px;
}

.footer-note {
  margin: 14px 0 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  gap: 56px;
}

.footer-links h4 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.footer-links a,
.footer-btn-link {
  display: block;
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 0.92rem;
  color: var(--ink-secondary);
  text-align: left;
}

.footer-links a:hover,
.footer-btn-link:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   Slide-Over Drawers (Cart & My Library)
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 20, 19, 0.48);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 180ms ease-out;
}

.drawer {
  width: 100%;
  max-width: 450px;
  height: 100%;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.drawer-wide {
  max-width: 560px;
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.drawer-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.drawer-sub {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.icon-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.drawer-footer {
  padding: 18px 24px 22px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
}

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.cart-item-title {
  margin: 0 0 3px;
  font-weight: 600;
  font-size: 0.96rem;
  line-height: 1.3;
}

.cart-item-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.cart-item-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cart-item-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.link-remove {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-decoration: underline;
}

.link-remove:hover {
  color: var(--danger);
}

/* Promo Box inside Cart */
.promo-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.promo-input-row {
  display: flex;
  gap: 8px;
}

.promo-input-row input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.promo-hint-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.mini-code-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-primary);
}

.mini-code-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.field-error {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--danger);
}

.field-success {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Totals Table */
.summary-lines {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.summary-row.is-discount {
  color: var(--emerald);
  font-weight: 500;
}

.summary-row.is-total {
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--border-strong);
  font-size: 1.08rem;
  font-weight: 700;
}

.mono-figure {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Library Cards */
.library-order-group {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.library-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.order-code-pill {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--bg-ink);
  color: var(--ink-inverse);
  padding: 4px 10px;
  border-radius: 6px;
}

.library-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin-bottom: 10px;
}

.library-item:last-child {
  margin-bottom: 0;
}

.library-item-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.library-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.progress-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--emerald);
  border-radius: var(--radius-pill);
  transition: width 260ms ease;
}

/* ==========================================================================
   Centered Modal (Product Detail, E-Book Sample Reader, Checkout, Restore)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 20, 19, 0.54);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn 180ms ease-out;
}

.modal-dialog {
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 40px);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleIn 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-dialog.is-compact {
  max-width: 540px;
}

.modal-header {
  padding: 20px 26px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-surface);
}

.modal-body {
  padding: 26px;
  overflow-y: auto;
  max-height: calc(100vh - 150px);
}

/* Product Detail Modal */
.detail-hero {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 28px;
}

.detail-cover-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.detail-cover-box.is-ebook {
  padding: 16px;
  display: flex;
  justify-content: center;
}

.detail-cover-box.is-ebook img {
  width: 186px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: -6px 10px 20px rgba(20, 20, 19, 0.2);
}

.detail-cover-box.is-course img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.detail-title {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: 1.85rem;
  line-height: 1.15;
}

.detail-sub {
  margin: 0 0 12px;
  font-size: 1.02rem;
  color: var(--ink-secondary);
}

.detail-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.spec-cell {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
}

.spec-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.spec-value {
  font-size: 0.88rem;
  font-weight: 600;
}

.detail-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}

.detail-section h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.highlight-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.highlight-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.94rem;
  color: var(--ink-secondary);
}

.toc-list {
  display: grid;
  gap: 10px;
}

.toc-row {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.toc-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-right: 8px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.review-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 16px;
}

.review-card p {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

/* E-Book Sample Reader */
.reader-paper {
  background: #fcfaf6;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 36px 40px;
  max-width: 68ch;
  margin: 0 auto;
}

.reader-chapter-kicker {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 6px;
}

.reader-paper h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin: 0 0 22px;
  line-height: 1.2;
}

.reader-paper h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 26px 0 10px;
}

.reader-paper p {
  font-size: 1.03rem;
  line-height: 1.75;
  color: #242320;
  margin: 0 0 16px;
}

.reader-upsell {
  margin-top: 28px;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-ink);
  color: var(--ink-inverse);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* Checkout Modal */
.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 28px;
  align-items: start;
}

.demo-notice {
  background: var(--amber-soft);
  border: 1px solid rgba(138, 90, 16, 0.25);
  color: var(--amber-ink);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink-primary);
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-surface);
  font-size: 0.95rem;
  transition: border-color var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input.is-invalid {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.method-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.method-tab {
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  transition: all var(--transition);
}

.method-tab.is-active {
  border-color: var(--bg-ink);
  background: var(--bg-canvas);
  box-shadow: 0 0 0 1px var(--bg-ink);
}

.method-tab strong {
  display: block;
  font-size: 0.9rem;
}

.method-tab span {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.checkout-summary-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.order-success-banner {
  background: var(--emerald-soft);
  border: 1px solid rgba(31, 111, 80, 0.3);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 22px;
}

.order-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-ink);
  color: #ffffff;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0 0;
}

.order-code-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* ==========================================================================
   Interactive Course Studio Player Overlay
   ========================================================================== */

.studio-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(14, 15, 17, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.studio-shell {
  width: 100%;
  max-width: 1240px;
  height: calc(100vh - 32px);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.studio-topbar {
  background: var(--bg-ink);
  color: var(--ink-inverse);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.studio-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.studio-course-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.studio-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

.studio-sidebar {
  background: var(--bg-canvas);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  padding: 18px;
}

.studio-progress-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.studio-module {
  margin-bottom: 18px;
}

.studio-module-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 0 8px;
}

.lesson-nav-btn {
  width: 100%;
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.86rem;
  transition: all var(--transition);
}

.lesson-nav-btn:hover {
  border-color: var(--ink-primary);
}

.lesson-nav-btn.is-active {
  background: var(--bg-ink);
  color: #ffffff;
  border-color: var(--bg-ink);
}

.lesson-nav-btn.is-locked {
  opacity: 0.72;
  background: var(--bg-subtle);
}

.lesson-nav-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.75;
  margin-top: 3px;
}

.studio-main {
  overflow-y: auto;
  padding: 32px 44px 48px;
  background: var(--bg-surface);
}

.studio-lesson-wrap {
  max-width: 740px;
  margin: 0 auto;
}

.studio-lesson-header {
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.studio-lesson-header h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin: 8px 0 10px;
  line-height: 1.2;
}

.code-block-card {
  background: #17181c;
  color: #eef1f7;
  border-radius: 10px;
  overflow: hidden;
  margin: 20px 0;
  border: 1px solid #2a2d36;
}

.code-block-head {
  padding: 8px 14px;
  background: #21232b;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #b5bccb;
  display: flex;
  justify-content: space-between;
}

.code-block-card pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
}

.callout-box {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 20px 0;
}

.callout-box strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.88rem;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.takeaways-card {
  background: var(--emerald-soft);
  border: 1px solid rgba(31, 111, 80, 0.22);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 26px 0;
}

.takeaways-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #134a35;
}

.takeaways-card ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  font-size: 0.93rem;
}

.quiz-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 28px 0;
}

.quiz-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.18rem;
}

.quiz-options {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.quiz-opt-btn {
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.92rem;
  transition: all var(--transition);
}

.quiz-opt-btn:hover {
  border-color: var(--ink-primary);
}

.quiz-opt-btn.is-correct {
  background: var(--emerald-soft);
  border-color: var(--emerald);
  color: #134a35;
  font-weight: 600;
}

.quiz-opt-btn.is-wrong {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.studio-locked-panel {
  background: var(--bg-canvas);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  text-align: center;
  margin-top: 24px;
}

.studio-lesson-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   Toast Notifications & Keyframes
   ========================================================================== */

.toast-region {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(calc(100vw - 32px), 440px);
  pointer-events: none;
}

.toast {
  background: var(--bg-ink);
  color: #ffffff;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast.is-success {
  border-left: 4px solid #35b982;
}

.toast.is-error {
  border-left: 4px solid #f06558;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1040px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .main-nav {
    display: none;
  }
}

@media (max-width: 820px) {
  .steps-grid,
  .checkout-grid,
  .detail-hero,
  .review-grid,
  .studio-layout {
    grid-template-columns: 1fr;
  }

  .studio-sidebar {
    max-height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .studio-main {
    padding: 22px 20px 36px;
  }

  .reader-paper {
    padding: 24px 20px;
  }
}

@media (max-width: 620px) {
  .container {
    padding: 0 16px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .header-actions .btn-ghost span {
    display: none;
  }

  .toolbar-controls {
    width: 100%;
    justify-content: stretch;
  }

  .search-field,
  .sort-field {
    flex: 1 1 100%;
    min-width: 0;
  }

  .showcase-ebook {
    grid-template-columns: 1fr;
  }

  .form-row-2,
  .method-tabs {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   3D Interactive Stage, Tilt Sheen, Hardcover Depth & Motion System
   ========================================================================== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 150;
  background: linear-gradient(90deg, var(--accent) 0%, #e07a3f 55%, var(--emerald) 100%);
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
}

.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-3d-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

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

/* 3D Hero Showcase Floating & Depth */
.showcase-stack {
  perspective: 1200px;
}

.showcase-course {
  animation: float3dA 6.4s ease-in-out infinite;
}

.showcase-ebook {
  animation: float3dB 7.2s ease-in-out infinite;
}

.showcase-course.is-tilting,
.showcase-ebook.is-tilting {
  animation-play-state: paused;
}

@keyframes float3dA {
  0%, 100% {
    transform: perspective(1000px) translateY(0px) rotateX(0.6deg) rotateY(-1.2deg);
  }
  50% {
    transform: perspective(1000px) translateY(-7px) rotateX(-0.8deg) rotateY(1.2deg);
  }
}

@keyframes float3dB {
  0%, 100% {
    transform: perspective(1000px) translateY(0px) rotateX(-0.5deg) rotateY(1deg);
  }
  50% {
    transform: perspective(1000px) translateY(-6px) rotateX(0.8deg) rotateY(-1deg);
  }
}

/* Interactive 3D Tilt + Cursor Specular Sheen */
[data-tilt-3d] {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 260ms ease,
    border-color 220ms ease;
}

[data-tilt-3d]::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    340px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(255, 255, 255, 0.38) 0%,
    rgba(200, 85, 45, 0.08) 42%,
    transparent 74%
  );
  transition: opacity 220ms ease;
  z-index: 4;
}

[data-tilt-3d].is-tilting {
  transition: transform 90ms linear, box-shadow 220ms ease, border-color 220ms ease;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px) scale3d(1.012, 1.012, 1.012) !important;
  box-shadow: 0 22px 44px rgba(20, 20, 19, 0.14), 0 4px 12px rgba(200, 85, 45, 0.08);
}

[data-tilt-3d].is-tilting::after {
  opacity: 1;
}

/* Real 3D Hardcover E-Book with Spine & Paper Page Thickness */
.card-stage-ebook {
  perspective: 900px;
}

.book-frame,
.book-3d-mini {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(-10deg) rotateX(2deg);
  transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 380ms ease;
}

.book-3d-mini {
  width: 84px;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
}

.book-3d-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: -5px 8px 16px rgba(20, 20, 19, 0.22);
}

.book-frame::before,
.book-3d-mini::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 10px;
  background: linear-gradient(90deg, rgba(20, 20, 19, 0.34), rgba(255, 255, 255, 0.22) 45%, rgba(20, 20, 19, 0.08) 70%, transparent);
  pointer-events: none;
  z-index: 2;
  border-radius: 4px 0 0 4px;
}

.book-frame::after,
.book-3d-mini::after {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  right: -7px;
  width: 7px;
  background: repeating-linear-gradient(
    90deg,
    #f8f4ec 0px,
    #f8f4ec 1.5px,
    #d9d0c1 1.5px,
    #d9d0c1 2.5px
  );
  border-radius: 0 3px 3px 0;
  transform: skewY(-6deg);
  box-shadow: 2px 3px 8px rgba(20, 20, 19, 0.16);
  pointer-events: none;
}

.product-card:hover .book-frame,
.showcase-ebook:hover .book-3d-mini {
  transform: rotateY(-22deg) rotateX(4deg) translateY(-4px) scale(1.04);
  box-shadow: -14px 18px 30px rgba(20, 20, 19, 0.26);
}

/* Primary Button Sheen Sweep & Cart Bounce */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 65%;
  height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.26), transparent);
  transition: left 520ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.btn-primary:hover::before {
  left: 140%;
}

.btn.is-popping {
  animation: cartPop 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cartPop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.13) rotate(-3deg);
  }
  70% {
    transform: scale(0.96) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

/* Staggered Scroll Reveal */
[data-reveal] {
  opacity: 0;
  transform: perspective(900px) translateY(22px) rotateX(4deg);
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* Hero Copy Entrance Stagger */
.hero-copy > * {
  animation: heroRise 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-copy > *:nth-child(2) { animation-delay: 80ms; }
.hero-copy > *:nth-child(3) { animation-delay: 150ms; }
.hero-copy > *:nth-child(4) { animation-delay: 220ms; }
.hero-copy > *:nth-child(5) { animation-delay: 290ms; }

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

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

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-3d-canvas {
    display: none !important;
  }
}
