*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0C0A09;
  --bg-elevated: #1A1816;
  --bg-surface: #231F1D;
  --text: #E7E5E4;
  --text-dim: #A8A29E;
  --text-muted: #57534E;
  --amber: #D4A574;
  --amber-bright: #E8C49A;
  --amber-dim: #A07D55;
  --amber-glow: rgba(212, 165, 116, 0.25);
  --amber-glow-strong: rgba(212, 165, 116, 0.45);
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* -- Focus styles -- */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* -- Grain overlay -- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* -- Scroll reveals -- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }
.reveal-d5 { transition-delay: 0.40s; }
.reveal-d6 { transition-delay: 0.48s; }

/* -- Header -- */
.landing-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 10, 9, 0.8);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-mark svg { width: 16px; height: 16px; }

.logo-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.01em;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.header-links a:hover { color: var(--text); }

.header-cta {
  padding: 10px 22px;
  background: var(--amber);
  color: var(--bg);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
  letter-spacing: 0.01em;
}

.header-cta:hover { background: var(--amber-bright); transform: translateY(-1px); }

/* -- Hero -- */
.hero {
  position: relative;
  padding: 96px 40px 80px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, var(--amber-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-copy {
  animation: heroFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  margin-bottom: 24px;
  background: rgba(212, 165, 116, 0.1);
  border: 1px solid rgba(212, 165, 116, 0.25);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--amber-bright);
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(212, 165, 116, 0.6);
  animation: heroBadgePulse 2.2s ease-out infinite;
}

@keyframes heroBadgePulse {
  0% { box-shadow: 0 0 0 0 rgba(212, 165, 116, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(212, 165, 116, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 165, 116, 0); }
}

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

.hero h1 {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: italic;
  color: var(--amber);
}

.hero-sub {
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 420px;
  margin-bottom: 48px;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-amber {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  background: var(--amber);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-amber:hover {
  background: var(--amber-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--amber-glow);
}

.btn-amber svg { width: 16px; height: 16px; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}

.btn-outline:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.btn-outline svg { width: 15px; height: 15px; }

/* -- Hero book showcase -- */
.hero-books {
  position: relative;
  height: 460px;
  animation: heroFadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.hero-cover {
  position: absolute;
  border-radius: 0;
  overflow: hidden;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 16px 48px rgba(0, 0, 0, 0.3);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.5s ease;
}

.hero-cover:hover {
  z-index: 10;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 16px 48px rgba(0, 0, 0, 0.3),
    0 0 60px var(--amber-glow);
}

.hero-cover-1 {
  width: 190px; height: 285px;
  top: 30px; left: 5%;
  transform: rotate(-8deg);
}
.hero-cover-1:hover { transform: rotate(-3deg) scale(1.05); }

.hero-cover-2 {
  width: 200px; height: 300px;
  top: 10px; left: 38%;
  transform: rotate(2deg);
  z-index: 3;
}
.hero-cover-2:hover { transform: rotate(0deg) scale(1.05); }

.hero-cover-3 {
  width: 175px; height: 262px;
  top: 50px; right: 2%;
  transform: rotate(7deg);
}
.hero-cover-3:hover { transform: rotate(3deg) scale(1.05); }

.hero-cover-4 {
  width: 160px; height: 240px;
  bottom: 0; left: 22%;
  transform: rotate(-3deg);
  z-index: 2;
}
.hero-cover-4:hover { transform: rotate(0deg) scale(1.05); }

.hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-cover .cover-gradient {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-cover .cover-initial {
  font-family: var(--font-display);
  font-size: 52px;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  z-index: 1;
}

.cover-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: rgba(0, 0, 0, 0.18);
}

/* -- How it works -- */
.how-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 80px 40px;
}

.how-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.how-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-bottom: 48px;
  text-align: center;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.how-step {
  padding: 48px 40px;
  background: var(--bg-surface);
  text-align: center;
  position: relative;
}

.how-step:first-child { border-radius: var(--radius-xl) 0 0 var(--radius-xl); }
.how-step:last-child { border-radius: 0 var(--radius-xl) var(--radius-xl) 0; }

.how-number {
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--amber);
  opacity: 0.35;
  line-height: 1;
  margin-bottom: 20px;
}

.how-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(212, 165, 116, 0.08);
  border: 1px solid rgba(212, 165, 116, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--amber);
}

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

.how-step h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 10px;
}

.how-step p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 260px;
  margin: 0 auto;
}

/* -- Shelf sections -- */
.shelf-section {
  padding: 80px 0 80px 40px;
}

.shelf-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 32px;
  padding-right: 40px;
  max-width: 1280px;
}

.shelf-header h2 {
  font-family: var(--font-display);
  font-size: 32px;
}

.shelf-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 4px 12px;
  border: 1px solid var(--border-light);
  border-radius: 100px;
}

.shelf-browse {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--amber);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.shelf-browse:hover { color: var(--amber-bright); }
.shelf-browse svg { width: 16px; height: 16px; }

/* -- Horizontal scroll shelf -- */
.shelf-row {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 40px;
  padding-right: 40px;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.shelf-row::-webkit-scrollbar { height: 0; display: none; }
.shelf-row { scrollbar-width: none; }

/* -- Book cards (shared) -- */
.shelf-card {
  scroll-snap-align: start;
  flex-shrink: 0;
  width: 200px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.shelf-cover {
  width: 200px;
  aspect-ratio: 2 / 3;
  border-radius: 0;
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s ease;
}

.shelf-card:hover .shelf-cover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 16px 48px rgba(0, 0, 0, 0.25),
    0 0 50px var(--amber-glow),
    0 0 100px rgba(212, 165, 116, 0.1);
}

.shelf-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shelf-cover .cover-gradient {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.shelf-cover .cover-initial {
  font-family: var(--font-display);
  font-size: 52px;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  z-index: 1;
}

/* -- Price badge -- */
.price-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  z-index: 2;
  letter-spacing: 0.01em;
}

.price-badge--free {
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.price-badge--paid {
  background: var(--amber);
  color: var(--bg);
}

.shelf-card .book-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shelf-card .book-author {
  font-size: 13px;
  color: var(--text-muted);
}

/* -- Author section -- */
.author-section {
  padding: 100px 40px;
  position: relative;
}

.author-section::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(212, 165, 116, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.author-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.author-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-bottom: 24px;
}

.author-inner h2 {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.author-inner h2 em {
  font-style: italic;
  color: var(--amber);
}

.author-sub {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-dim);
  margin-bottom: 40px;
}

.author-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 44px;
}

.author-stat {
  text-align: center;
}

.author-stat-value {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 6px;
}

.author-stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.author-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Terminal-like code snippet */
.author-code {
  margin-top: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  text-align: left;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.author-code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.author-code-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.4;
}

.author-code pre {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
  overflow-x: auto;
}

.author-code .cmd { color: var(--amber); }
.author-code .comment { color: var(--text-muted); }
.author-code .file { color: var(--text); }

/* -- Final CTA -- */
.final-cta {
  padding: 0 40px 100px;
}

.final-cta-card {
  max-width: 1280px;
  margin: 0 auto;
  background: linear-gradient(135deg, #2A2523 0%, #1F1B18 100%);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 80px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.final-cta-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 400px;
  background: radial-gradient(ellipse, var(--amber-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.3;
}

.final-cta-card > * { position: relative; z-index: 1; }

.final-cta-card h2 {
  font-family: var(--font-display);
  font-size: 44px;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.final-cta-card p {
  font-size: 17px;
  color: var(--text-dim);
  margin-bottom: 40px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.final-cta-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.final-platforms {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 32px;
  font-size: 13px;
  color: var(--text-muted);
}

.final-platforms span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.final-platforms .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* -- Footer -- */
.landing-footer {
  border-top: 1px solid var(--border);
  padding: 36px 40px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-inner a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-inner a:hover { color: var(--text); }

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-sep { color: var(--text-muted); }

/* -- Responsive -- */
@media (max-width: 960px) {
  .hero { padding: 64px 28px 80px; }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 56px;
    text-align: center;
  }
  .hero h1 { font-size: 46px; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; }
  .hero-books { height: 340px; }
  .hero-cover-1 { width: 150px; height: 225px; left: 2%; }
  .hero-cover-2 { width: 160px; height: 240px; left: 32%; }
  .hero-cover-3 { width: 140px; height: 210px; right: 0; }
  .hero-cover-4 { width: 130px; height: 195px; left: 18%; }
  .how-grid { grid-template-columns: 1fr; gap: 2px; }
  .how-step:first-child { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .how-step:last-child { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
  .author-stats { gap: 32px; }
  .shelf-section { padding-left: 28px; }
  .shelf-row { scroll-padding-left: 28px; padding-right: 28px; }
  .shelf-header { padding-right: 28px; }
}

@media (max-width: 640px) {
  .header-inner { padding: 14px 20px; }
  .header-links { gap: 16px; }
  .header-links a:not(.header-cta):not([href="/catalog"]) { display: none; }
  .hero { padding: 44px 20px 60px; }
  .hero h1 { font-size: 34px; }
  .hero-sub { font-size: 16px; }
  .hero-books { height: 260px; }
  .hero-cover-1 { width: 110px; height: 165px; top: 10px; left: 0; }
  .hero-cover-2 { width: 125px; height: 188px; top: 0; left: 28%; }
  .hero-cover-3 { width: 110px; height: 165px; top: 20px; right: 0; }
  .hero-cover-4 { display: none; }
  .how-section { padding: 56px 20px; }
  .how-step { padding: 36px 28px; }
  .shelf-section { padding: 56px 0 56px 20px; }
  .shelf-row { scroll-padding-left: 20px; padding-right: 20px; gap: 20px; }
  .shelf-card { width: 160px; }
  .shelf-cover { width: 160px; }
  .shelf-cover .cover-initial { font-size: 40px; }
  .shelf-header { padding-right: 20px; }
  .shelf-header h2 { font-size: 26px; }
  .author-section { padding: 64px 20px; }
  .author-inner h2 { font-size: 32px; }
  .author-stats { gap: 24px; }
  .author-stat-value { font-size: 28px; }
  .author-code { padding: 18px 20px; }
  .final-cta { padding: 0 20px 64px; }
  .final-cta-card { padding: 48px 24px; border-radius: 20px; }
  .final-cta-card h2 { font-size: 30px; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
  .landing-footer { padding: 28px 20px; }
}
