/* Shinigami landing — vanilla CSS.
   Palette mirrors the reader app so both properties feel like one product. */

:root {
  --base-dark: #0c0d10;
  --base-bg: #131418;
  --base-card: #1e2026;
  --base-card-2: #272a31;
  --base-white: #ffffff;
  --base-soft: #d4d4d8;
  --base-muted: #9ca3af;
  --primary-500: #6f39ee;
  --primary-400: #8b5cf6;
  --primary-600: #5a26d7;
  --border-soft: rgba(255, 255, 255, .08);
  --header-h: 68px;
  --wrap: 1180px;
  --radius: 16px;
}

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

html {
  background: var(--base-dark);
  scroll-behavior: smooth;
  /* Reserve the gutter so anchor jumps never shift layout width. */
  scrollbar-gutter: stable;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--base-soft);
  background: var(--base-dark);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  color: var(--base-white);
  line-height: 1.2;
  margin: 0 0 .6em;
  letter-spacing: -.02em;
}

h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 600; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}
.wrap-narrow { max-width: 800px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--primary-500);
  color: #fff;
  border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--primary-400);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary-500);
  color: #fff;
  box-shadow: 0 10px 30px -12px rgba(111, 57, 238, .9);
}
.btn-primary:hover { background: var(--primary-400); }

.btn-ghost {
  background: transparent;
  color: var(--base-white);
  border-color: var(--border-soft);
}
.btn-ghost:hover { border-color: var(--primary-400); background: rgba(139, 92, 246, .08); }

.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(12, 13, 16, .72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border-soft);
  background: rgba(12, 13, 16, .92);
}

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

.brand img { height: 30px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: .94rem;
  font-weight: 500;
}
.nav a { color: var(--base-muted); transition: color .18s ease; }
.nav a:hover { color: var(--base-white); }
.nav a.nav-cta { color: #fff; padding: 9px 18px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  background: var(--base-white);
  border-radius: 2px;
  transition: transform .22s ease, opacity .22s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 104px) 0 clamp(60px, 8vw, 96px);
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 620px;
  background:
    radial-gradient(560px 320px at 22% 34%, rgba(111, 57, 238, .34), transparent 70%),
    radial-gradient(480px 300px at 78% 20%, rgba(139, 92, 246, .2), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 6px 14px;
  border: 1px solid rgba(139, 92, 246, .35);
  border-radius: 999px;
  background: rgba(111, 57, 238, .12);
  color: var(--primary-400);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--primary-400), #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: var(--base-muted);
  max-width: 54ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--base-white);
  line-height: 1.1;
}
.hero-stats span { font-size: .84rem; color: var(--base-muted); }

/* Browser mockup — pure CSS, no image payload. */
.mock {
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: var(--base-bg);
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9);
  transform: perspective(1400px) rotateY(-7deg) rotateX(3deg);
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: var(--base-card);
  border-bottom: 1px solid var(--border-soft);
}
.mock-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: #3a3d46; }
.mock-url {
  flex: 1;
  margin-left: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--base-dark);
  color: var(--base-muted);
  font-size: .72rem;
}

.mock-body { padding: 14px; }

/* Section head — mirrors the app's "Update" heading plus its tab row. */

.mock-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.mock-section-title {
  font-size: .86rem;
  font-weight: 700;
  color: var(--base-white);
}
.mock-tabs { display: flex; gap: 6px; }
.mock-tab {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--base-card-2);
  color: var(--base-muted);
  font-size: .64rem;
  font-weight: 600;
}
.mock-tab.active { background: var(--primary-500); color: #fff; }

/* Card grid — scaled-down port of .manga-card in frontend/src/styles.css. */

.mock-grid {
  display: grid;
  /* The app uses 6 columns at full width; 4 keeps titles legible at mock size. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 10px;
}

.mock-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mock-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--base-card-2);
  background-size: cover;
  background-position: center;
}

.mock-badges {
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.mock-badge {
  height: 14px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 600;
  background: var(--danger);
  color: var(--base-white);
}
.mock-badge.soft {
  background: rgba(0, 0, 0, .65);
  color: var(--base-soft);
  backdrop-filter: blur(4px);
}

.mock-flag {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  font-size: 9px;
  line-height: 1;
  backdrop-filter: blur(4px);
}

.mock-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 7px;
  min-height: 26px;
  font-size: .68rem;
  line-height: 13px;
  font-weight: 600;
  color: var(--base-white);
}
.mock-up {
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--danger);
  color: var(--base-white);
  font-size: 7px;
  line-height: 11px;
  font-weight: 700;
  letter-spacing: .4px;
}

.mock-pill {
  height: 22px;
  margin-top: 6px;
  padding: 0 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  border-radius: 4px;
  background: var(--base-card);
  color: var(--base-soft);
  font-size: .62rem;
  white-space: nowrap;
}
/* Chapter label yields first; the timestamp is short and must stay readable. */
.mock-pill > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mock-pill > span:last-child {
  flex: none;
  color: var(--base-muted);
}

/* Loading placeholders --------------------------------------------------- */

.skeleton-text {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--base-card-2);
  position: relative;
  overflow: hidden;
}
.mock-title.skeleton-text { min-height: 0; height: 8px; width: 80%; }

/* Shimmer until real content lands. Fallback keeps shimmering on purpose —
   a frozen grey bar reads as broken, a moving one reads as loading. */
.mock:not([data-state="ready"]) .skeleton-text::after,
.mock:not([data-state="ready"]) .mock-poster::after,
.mock:not([data-state="ready"]) .mock-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.8s infinite;
}
.mock:not([data-state="ready"]) .mock-pill { position: relative; overflow: hidden; }
.mock:not([data-state="ready"]) .mock-card:nth-child(2) .mock-poster::after { animation-delay: .12s; }
.mock:not([data-state="ready"]) .mock-card:nth-child(3) .mock-poster::after { animation-delay: .24s; }
.mock:not([data-state="ready"]) .mock-card:nth-child(4) .mock-poster::after { animation-delay: .36s; }
.mock:not([data-state="ready"]) .mock-card:nth-child(5) .mock-poster::after { animation-delay: .48s; }
.mock:not([data-state="ready"]) .mock-card:nth-child(6) .mock-poster::after { animation-delay: .6s; }
.mock:not([data-state="ready"]) .mock-card:nth-child(7) .mock-poster::after { animation-delay: .72s; }
.mock:not([data-state="ready"]) .mock-card:nth-child(8) .mock-poster::after { animation-delay: .84s; }

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

/* ---------- Sections ---------- */

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--base-bg); border-block: 1px solid var(--border-soft); }

.section-head {
  max-width: 640px;
  margin: 0 auto clamp(34px, 5vw, 56px);
  text-align: center;
}
.section-head p { color: var(--base-muted); margin: 0; }

/* ---------- Feature cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.card {
  padding: 26px 24px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--base-card);
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, .4);
  background: var(--base-card-2);
}
.card p { color: var(--base-muted); font-size: .93rem; margin: 0; }
.card strong { color: var(--base-soft); }

.card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: rgba(111, 57, 238, .16);
  color: var(--primary-400);
}
.card-icon svg { width: 22px; height: 22px; }

/* ---------- Perks ---------- */

.perks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px 40px;
}

.perk { display: flex; gap: 18px; }
.perk-num {
  flex: none;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-400);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.perk p { color: var(--base-muted); font-size: .93rem; margin: 0; }

/* ---------- Steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 30px 24px 26px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--base-card);
}
.step-num {
  position: absolute;
  top: -18px;
  left: 24px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-500);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 24px -12px rgba(111, 57, 238, 1);
}
.step p { color: var(--base-muted); font-size: .93rem; margin: 0; }

/* ---------- FAQ ---------- */

.faq { display: grid; gap: 12px; }

.faq-item {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--base-card);
  overflow: hidden;
}
.faq-item.open { border-color: rgba(139, 92, 246, .4); }

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
  background: transparent;
  border: 0;
  color: var(--base-white);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.faq-q .chev {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--base-muted);
  transition: transform .22s ease, color .22s ease;
}
.faq-item.open .chev { transform: rotate(180deg); color: var(--primary-400); }

/* Height animated in JS. Scoped to .js so answers stay readable when the
   script never runs — otherwise every panel is a dead 0px box. */
.js .faq-a {
  height: 0;
  overflow: hidden;
  transition: height .26s ease;
}
.faq-a p {
  padding: 0 20px 18px;
  margin: 0;
  color: var(--base-muted);
  font-size: .93rem;
}
.faq-a strong { color: var(--base-soft); }

/* ---------- CTA ---------- */

.cta {
  padding: clamp(60px, 8vw, 96px) 0;
  background:
    radial-gradient(620px 300px at 50% 0%, rgba(111, 57, 238, .28), transparent 70%),
    var(--base-dark);
  text-align: center;
}
.cta-inner p { color: var(--base-muted); margin-bottom: 28px; }

/* ---------- Footer ---------- */

.site-footer {
  padding: 48px 0 28px;
  background: var(--base-bg);
  border-top: 1px solid var(--border-soft);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 28px;
}
.footer-brand img { height: 28px; width: auto; margin-bottom: 12px; }
.footer-brand p { color: var(--base-muted); font-size: .9rem; max-width: 34ch; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-content: start;
  font-size: .92rem;
}
.footer-links a { color: var(--base-muted); transition: color .18s ease; }
.footer-links a:hover { color: var(--base-white); }

.footer-bottom {
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
  color: var(--base-muted);
  font-size: .82rem;
}

/* ---------- Reveal on scroll ---------- */

/* Scoped to .js so content stays readable when JavaScript never runs. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 940px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 520px; }
  .mock { transform: none; }
  .lead { max-width: none; }
}

@media (max-width: 760px) {
  /* The whole drawer treatment depends on JS to reopen it. Without JS the nav
     stays a plain wrapped row under the logo — cramped, but reachable. */
  .js .nav-toggle { display: flex; }

  .js .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 22px;
    background: var(--base-bg);
    border-bottom: 1px solid var(--border-soft);
    display: none;
  }
  .js .nav.open { display: flex; }

  html:not(.js) .nav { gap: 8px 16px; flex-wrap: wrap; font-size: .85rem; }

  .js .nav a {
    padding: 13px 4px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--base-soft);
  }
  .js .nav a.nav-cta {
    margin-top: 14px;
    border-bottom: 0;
    text-align: center;
    padding: 13px 18px;
  }

  /* 4 columns squeeze posters under ~80px on phones — titles stop being read. */
  .mock-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mock-card:nth-child(n + 7) { display: none; }

  .hero-stats { gap: 14px 28px; }
  .hero-stats strong { font-size: 1.45rem; }
  .btn-lg { padding: 13px 22px; }
  .hero-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
