/*
  MangaDeck public web system
  - one responsive shell for marketing, legal, support, and technical pages
  - crawlable RU/EN pages plus inline locale support for dynamic card views
  - warm light and graphite dark themes built around the existing MangaDeck mark
*/

:root {
  color-scheme: dark;
  --page-bg: #0b0d11;
  --page-bg-soft: #101319;
  --text: #f4f1ec;
  --muted: #a9a9ad;
  --muted-strong: #c9c6c0;
  --card: rgba(20, 23, 29, 0.92);
  --card-strong: #191d25;
  --card-soft: rgba(28, 33, 42, 0.74);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #cf434c;
  --accent-strong: #ed5660;
  --accent-soft: rgba(210, 71, 80, 0.14);
  --accent-ink: #ffffff;
  --success: #75bf93;
  --danger: #ef777d;
  --link: #f0a4a9;
  --link-hover: #ffffff;
  --nav-bg: rgba(11, 13, 17, 0.88);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 14px 42px rgba(0, 0, 0, 0.24);
  --focus: rgba(237, 86, 96, 0.48);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --content: 1240px;
}

html[data-theme="light"] {
  color-scheme: light;
  --page-bg: #f1ece3;
  --page-bg-soft: #ebe3d8;
  --text: #201e1b;
  --muted: #6d665f;
  --muted-strong: #4e4842;
  --card: rgba(255, 252, 247, 0.94);
  --card-strong: #fffdf9;
  --card-soft: rgba(244, 237, 227, 0.86);
  --border: rgba(51, 42, 34, 0.13);
  --border-strong: rgba(51, 42, 34, 0.23);
  --accent: #b7353f;
  --accent-strong: #9e2731;
  --accent-soft: rgba(183, 53, 63, 0.10);
  --accent-ink: #ffffff;
  --success: #27744d;
  --danger: #aa3039;
  --link: #9e2731;
  --link-hover: #541117;
  --nav-bg: rgba(245, 240, 232, 0.90);
  --shadow: 0 24px 70px rgba(68, 52, 38, 0.14);
  --shadow-soft: 0 12px 34px rgba(68, 52, 38, 0.10);
  --focus: rgba(183, 53, 63, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--page-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  color: var(--text);
  background: var(--page-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  background: linear-gradient(148deg, transparent 20%, rgba(255,255,255,.018) 20%, rgba(255,255,255,.018) 27%, transparent 27%),
    linear-gradient(148deg, transparent 74%, rgba(255,255,255,.018) 74%, rgba(255,255,255,.018) 82%, transparent 82%), var(--page-bg);
}
body::after { background: none; }
html[data-theme="light"] body::before {
  background: linear-gradient(148deg, transparent 20%, rgba(69,66,80,.014) 20%, rgba(69,66,80,.014) 27%, transparent 27%),
    linear-gradient(148deg, transparent 74%, rgba(69,66,80,.014) 74%, rgba(69,66,80,.014) 82%, transparent 82%), var(--page-bg);
}

body > * {
  position: relative;
  z-index: 1;
}

#page-content {
  flex: 1 0 auto;
}

[data-lang] {
  display: none;
}

html[lang="ru"] [data-lang="ru"],
html[lang="en"] [data-lang="en"] {
  display: revert;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--link-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--accent-ink);
  background: var(--accent);
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(100%, var(--content));
  margin-inline: auto;
  padding-inline: clamp(18px, 3.2vw, 44px);
}

.container--bleed,
.container--content {
  width: min(100%, 1360px);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(135%);
}

.nav-inner {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 18px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand > div,
.brand > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.brand-title,
.brand > span strong {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.brand-subtitle,
.brand > span small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.nav-links,
.nav-controls,
.locale-switch {
  display: flex;
  align-items: center;
}

.nav-links {
  justify-content: center;
  gap: 5px;
}

.nav-link {
  padding: 9px 13px;
  border-radius: 11px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--card-soft);
  transform: translateY(-1px);
}

.nav-link--primary {
  color: var(--accent-ink);
  background: var(--accent);
}

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

.nav-controls {
  justify-self: end;
  gap: 8px;
}

.locale-switch {
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-soft);
}

.locale-switch__button {
  min-width: 38px;
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
}

.locale-switch__button.is-selected,
.locale-switch__button[aria-pressed="true"],
.locale-switch__button[aria-current="page"] {
  color: var(--accent-ink);
  background: var(--accent);
}

.icon-btn {
  width: 40px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--card-soft);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: var(--card-strong);
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.icon-theme.is-sun {
  background: url("/assets/svg/sun.svg") center / contain no-repeat;
}

.icon-theme.is-moon {
  background: url("/assets/svg/moon.svg") center / contain no-repeat;
}

html[data-theme="dark"] .icon-theme.is-sun {
  filter: brightness(0) invert(1);
}

main {
  padding-block: clamp(34px, 5vw, 76px);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  color: var(--text);
}

h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

p {
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.68;
}

ul,
ol {
  margin: 14px 0 18px;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.65;
}

li {
  margin: 8px 0;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.section-kicker,
.feature-index {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  margin-bottom: 24px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted-strong);
  background: var(--card-soft);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.button,
.store-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  color: var(--text);
  background: var(--card-strong);
  box-shadow: none;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button:hover,
.store-button:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.button--primary,
.store-button--primary {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent);
}

.button--primary:hover,
.store-button--primary:hover {
  color: var(--accent-ink);
  background: var(--accent-strong);
}

.button--ghost {
  background: var(--card-soft);
}

.store-button--disabled {
  color: var(--muted);
  border-style: dashed;
  background: var(--card-soft);
  box-shadow: none;
  cursor: default;
}

.store-button--disabled:hover {
  color: var(--muted);
  border-color: var(--border-strong);
  transform: none;
}

.actions,
.cta-stack,
.card-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.landing-main {
  display: grid;
  gap: 18px;
}

.landing-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  align-items: stretch;
  gap: clamp(26px, 5vw, 70px);
  overflow: hidden;
  padding: clamp(26px, 5.4vw, 72px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, var(--card), rgba(22, 25, 32, 0.78)),
    var(--card);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .landing-hero {
  background:
    linear-gradient(145deg, var(--card), rgba(247, 240, 230, 0.78)),
    var(--card);
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.hero-copy {
  min-width: 0;
  align-self: center;
}

.landing-hero h1 {
  max-width: 12ch;
  font-size: clamp(48px, 6.4vw, 88px);
  line-height: 0.92;
}

.landing-hero #pageLead {
  max-width: 62ch;
  margin-top: 26px;
  color: var(--muted-strong);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.62;
}

.cta-stack--hero {
  max-width: 600px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 30px;
}

.hero-meta {
  max-width: 66ch;
  margin: 14px 0 0;
  font-size: 12px;
}

.product-mark {
  min-width: 0;
  margin: 0;
  display: grid;
  align-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card-strong);
  box-shadow: var(--shadow-soft);
}

.product-mark__image {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: clamp(28px, 5vw, 68px);
  background:
    radial-gradient(circle at 50% 50%, var(--accent-soft), transparent 62%);
}

.product-mark__image img {
  width: min(100%, 290px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 26px 36px rgba(0, 0, 0, 0.32));
}

.product-mark figcaption {
  padding: 20px 22px 22px;
  border-top: 1px solid var(--border);
}

.product-mark__label {
  color: var(--text);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 950;
  letter-spacing: -0.05em;
}

.product-mark__label > span {
  color: var(--accent-strong);
}

.product-mark__sequence {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.11em;
}

.product-mark__sequence i {
  width: 12px;
  height: 1px;
  background: var(--border-strong);
}

.product-mark figcaption p {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.feature-card {
  min-width: 0;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.5vw, 30px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.feature-card .feature-index {
  margin-bottom: auto;
  padding-bottom: 44px;
}

.feature-card h2 {
  font-size: clamp(22px, 2vw, 29px);
}

.feature-card p {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.58;
}

.landing-editorial-section {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: clamp(30px, 6vw, 84px);
  align-items: center;
  padding: clamp(30px, 6vw, 74px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.landing-editorial-copy h2,
.landing-trust-section h2 {
  margin-top: 10px;
  font-size: clamp(36px, 5vw, 66px);
  line-height: 0.98;
}

.landing-editorial-copy p {
  max-width: 62ch;
  margin: 22px 0 26px;
  font-size: 17px;
}

.editorial-stack {
  display: grid;
  gap: 10px;
}

.editorial-stack > div {
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--card-strong);
}

.editorial-stack strong {
  font-size: 16px;
}

.editorial-stack span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.landing-trust-section {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(300px, 1.08fr);
  gap: clamp(28px, 6vw, 82px);
  align-items: center;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(210, 71, 80, 0.30);
  border-radius: var(--radius-xl);
  background: var(--accent-soft);
}

.landing-trust-section h2 {
  font-size: clamp(30px, 4.1vw, 52px);
}

.landing-trust-section p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 17px;
}

.card-links {
  justify-content: flex-end;
  margin-top: clamp(22px, 4vw, 36px);
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.card-links a {
  color: var(--muted);
}

.page-intro {
  max-width: 980px;
  margin-bottom: clamp(32px, 5vw, 58px);
}

.page-intro h1 {
  max-width: 100%;
  hyphens: auto;
  margin-top: 12px;
}

.page-intro__lead {
  max-width: 72ch;
  margin-top: 22px;
  color: var(--muted-strong);
  font-size: clamp(17px, 1.8vw, 21px);
}

.document-version {
  display: inline-flex;
  margin-top: 2px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card-soft);
}

.document-layout {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(18px, 3vw, 38px);
}

.document-index {
  position: sticky;
  top: 96px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.document-index__label {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.document-index nav {
  display: grid;
  gap: 3px;
}

.document-index nav a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 7px;
  border-radius: 9px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.35;
  text-decoration: none;
}

.document-index nav a:hover {
  color: var(--text);
  background: var(--card-soft);
}

.document-index nav a > span:first-child {
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.document-index__support {
  min-height: 42px;
  display: grid;
  place-items: center;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: var(--card-strong);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.legal-document {
  min-width: 0;
  padding: clamp(22px, 4vw, 48px);
}

.document-section {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 18px;
  padding: 30px 0;
  scroll-margin-top: 110px;
}

.document-section:first-child {
  padding-top: 0;
}

.document-section + .document-section {
  border-top: 1px solid var(--border);
}

.document-section__number {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.document-section__content h2 {
  font-size: clamp(22px, 2.3vw, 30px);
}

.document-section__content p,
.document-section__content ul,
.document-section__content ol {
  max-width: 74ch;
  margin-bottom: 0;
}

.support-page {
  display: grid;
  gap: 18px;
}

.support-page .page-intro {
  margin-bottom: 18px;
}

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

.support-grid .card {
  min-width: 0;
  padding: clamp(24px, 4vw, 42px);
}

.support-grid h2 {
  margin-top: 32px;
}

.support-email {
  display: inline-block;
  max-width: 100%;
  margin: 14px 0;
  color: var(--text);
  font-size: clamp(18px, 2.6vw, 30px);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.resource-section {
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.resource-section h2 {
  margin: 9px 0 24px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.resource-grid a {
  min-width: 0;
  min-height: 152px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--card-strong);
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

.resource-grid a:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.resource-grid a > span:first-child {
  margin-bottom: auto;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
}

.resource-grid strong {
  margin-top: 20px;
  font-size: 14px;
}

.resource-grid small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}

.technical-page {
  min-height: min(72vh, 760px);
  display: grid;
  place-items: center;
}

.technical-card {
  width: min(100%, 820px);
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 6vw, 64px);
  box-shadow: var(--shadow);
}

.technical-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent);
}

.technical-code {
  margin-bottom: 28px;
  color: var(--accent-strong);
  font-size: clamp(62px, 12vw, 124px);
  font-weight: 950;
  line-height: 0.82;
  letter-spacing: -0.08em;
}

.technical-card h1 {
  max-width: 13ch;
  margin-top: 10px;
  font-size: clamp(38px, 6vw, 64px);
}

.technical-lead {
  max-width: 62ch;
  margin-top: 20px;
  color: var(--muted-strong);
  font-size: 17px;
}

.technical-card .actions {
  margin-top: 26px;
}

.destination-block {
  margin-top: 28px;
}

.destination-block h2 {
  margin-bottom: 14px;
  font-size: 22px;
}

.status {
  margin-top: 24px;
  padding: 15px 16px;
  border: 1px solid rgba(210, 71, 80, 0.34);
  border-radius: var(--radius-md);
  color: var(--muted-strong);
  background: var(--accent-soft);
}

.status.ok {
  border-color: color-mix(in srgb, var(--success) 52%, var(--border));
  background: color-mix(in srgb, var(--success) 10%, var(--card-strong));
}

.status.err {
  border-color: color-mix(in srgb, var(--danger) 54%, var(--border));
}

.status--quiet {
  border-color: var(--border);
  background: var(--card-soft);
}

.status-detail {
  margin-top: 7px;
  line-height: 1.55;
}

.domain-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  max-width: 100%;
  padding: 8px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  background: var(--card-strong);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.mono-block {
  margin: 12px 0 0;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--muted-strong);
  background: var(--card-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

.card--narrow {
  width: min(100%, 760px);
  margin-inline: auto;
  padding: clamp(24px, 5vw, 48px);
}

.centered-placeholder {
  margin-top: 7vh;
  text-align: center;
}

.placeholder-logo {
  width: clamp(92px, 22vw, 144px);
  height: auto;
  margin-bottom: 18px;
  border-radius: 24px;
}

.footer {
  flex: 0 0 auto;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--page-bg) 82%, transparent);
  backdrop-filter: blur(16px);
}

.footer-inner {
  min-height: 230px;
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(0, 1.9fr);
  gap: clamp(32px, 6vw, 90px);
  align-items: start;
  padding-block: 44px;
}

.footer-brand__title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.footer-brand p {
  max-width: 36ch;
  margin: 10px 0 24px;
  font-size: 13px;
}

.footer-copyright {
  color: var(--muted);
  font-size: 12px;
}

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

.footer-columns > div {
  display: grid;
  align-content: start;
  gap: 9px;
}

.footer-columns strong {
  margin-bottom: 5px;
  color: var(--text);
  font-size: 12px;
}

.footer-columns a,
.footer-links a,
.footer-status {
  color: var(--muted);
  font-size: 12px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
}

/* Public-card renderer shares this stylesheet. */
.public-story-main {
  display: grid;
  gap: clamp(24px, 4vw, 52px);
  padding-bottom: clamp(52px, 8vw, 104px);
}

.public-story-hero {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(380px, 0.92fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: center;
}

.public-story-copy {
  min-width: 0;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid var(--border);
  border-radius: clamp(24px, 3vw, 36px);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.public-story-copy h1 {
  max-width: 16ch;
  margin-top: 18px;
  font-size: clamp(42px, 5.6vw, 78px);
  line-height: 0.96;
}

.public-story-copy > p {
  max-width: 62ch;
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.7;
}

.public-story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.public-story-meta span {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--page-bg);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.direct-share-note {
  margin-top: 20px;
  padding-left: 13px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.public-story-poster {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: clamp(24px, 3vw, 36px);
  background: var(--card-strong);
  box-shadow: var(--shadow);
}

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

.public-reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.public-reader-layout--empty {
  grid-template-columns: 1fr;
}

.public-story-library {
  display: grid;
  grid-template-columns: minmax(160px, 0.24fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.public-story-library .story-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 360px));
}

.public-story-library .story-select {
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
}

.public-story-library .story-select img {
  height: 112px;
}

.public-story-section {
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.public-story-section h2 {
  margin: 8px 0 22px;
}

.reader-shell {
  min-width: 0;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.story-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-strong);
  transition: border-color 150ms ease, transform 150ms ease;
}

.story-card:hover,
.story-card.is-selected {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.story-select {
  width: 100%;
  display: grid;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.story-select img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--page-bg);
}

.story-select > span {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.story-select strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-select small {
  color: var(--muted);
}

.reader-toolbar {
  position: sticky;
  top: var(--reader-nav-height, 74px);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 11px clamp(16px, 3vw, 28px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.reader-toolbar > div {
  display: grid;
  gap: 4px;
}

.reader-toolbar .reader-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reader-position,
.reader-pdf-link {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--page-bg);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.reader-pdf-link:hover {
  color: var(--text);
  border-color: var(--accent);
}

.pdf-reader {
  width: 100%;
  min-height: 72vh;
  display: grid;
  position: relative;
  gap: 12px;
  margin-top: 14px;
  background: transparent;
}

.pdf-reader[hidden],
.reader-placeholder[hidden] {
  display: none;
}

.pdf-reader__progress {
  position: sticky;
  top: calc(var(--reader-nav-height, 74px) + var(--reader-toolbar-height, 66px) + 2px);
  z-index: 5;
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 75%, transparent);
}

.pdf-reader__progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease-out;
}

.pdf-reader__status {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.pdf-reader__retry {
  min-height: 32px;
  padding: 6px 13px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--text);
  background: var(--accent-soft);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pdf-reader__retry:hover {
  background: color-mix(in srgb, var(--accent) 22%, var(--card-strong));
}

.pdf-reader__pages {
  width: min(100%, 900px);
  display: grid;
  justify-self: center;
  gap: clamp(6px, 1vw, 12px);
}

.pdf-reader__page {
  width: 100%;
  position: relative;
  display: grid;
  place-items: center;
  margin: 0;
  overflow: hidden;
  background: #111214;
}

.pdf-reader__page::before {
  content: '';
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: reader-page-spin 900ms linear infinite;
}

.pdf-reader__page canvas,
.pdf-reader__page img {
  width: 100%;
  height: auto;
  position: absolute;
  inset: 0;
  display: block;
  background: #ffffff;
}

.pdf-reader__page figcaption {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(0, 0, 0, 0.56);
  font-size: 10px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.pdf-reader__page:hover figcaption,
.pdf-reader__page.has-error figcaption {
  opacity: 1;
}

.pdf-reader__page.is-rendered::before {
  display: none;
}

.reader-end {
  padding: 46px 20px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes reader-page-spin {
  to { transform: rotate(360deg); }
}

.reader-placeholder {
  min-height: clamp(280px, 46vh, 520px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: clamp(32px, 7vw, 80px);
  border: 1px dashed var(--border-strong);
  border-radius: clamp(24px, 3vw, 36px);
  color: var(--muted);
  background: linear-gradient(145deg, var(--card), var(--page-bg));
  text-align: center;
}

.reader-placeholder strong {
  color: var(--text);
  font-size: clamp(24px, 4vw, 42px);
}

.reader-placeholder > span:not(.reader-placeholder__mark) {
  max-width: 560px;
  line-height: 1.6;
}

.reader-placeholder__mark {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: var(--card-strong);
  font-size: 30px;
}

.reader-placeholder .button {
  margin-top: 8px;
}

.app-card-handoff {
  min-height: 100vh;
  background: var(--page-bg);
}

.app-card-handoff__main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.app-card-handoff__card {
  width: min(100%, 620px);
  display: grid;
  justify-items: start;
  gap: 18px;
  padding: clamp(28px, 6vw, 56px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
}

.app-card-handoff__card > img {
  border-radius: 18px;
}

.app-card-handoff__card h1,
.app-card-handoff__card p {
  margin: 0;
}

.app-card-handoff__card p {
  color: var(--muted);
  line-height: 1.6;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.contact-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--card-strong);
  text-decoration: none;
}

.contact-card:hover {
  color: var(--text);
  border-color: var(--accent);
}

.contact-card span {
  color: var(--muted);
  font-size: 12px;
}

.contact-card strong {
  overflow-wrap: anywhere;
}

.empty-story-state {
  min-height: 160px;
  display: grid;
  gap: 8px;
  place-content: center;
  padding: 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.empty-story-state strong {
  color: var(--text);
  font-size: 20px;
}

@media (max-width: 1100px) {
  .nav-inner {
    grid-template-columns: minmax(180px, 1fr) auto auto;
  }

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

  .feature-card {
    min-height: 230px;
  }

  .resource-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .landing-hero,
  .landing-editorial-section,
  .landing-trust-section,
  .public-story-hero {
    grid-template-columns: 1fr;
  }

  .public-reader-layout {
    grid-template-columns: 1fr;
  }

  .public-story-copy {
    grid-column: 1;
  }

  .public-story-library {
    grid-template-columns: 1fr;
  }

  .public-story-library .story-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }

  .public-story-library .story-select {
    grid-template-columns: 1fr;
  }

  .public-story-library .story-select img {
    height: auto;
  }

  .product-mark {
    max-width: 620px;
    width: 100%;
    margin-inline: auto;
  }

  .product-mark__image {
    min-height: 240px;
  }

  .document-layout {
    grid-template-columns: 1fr;
  }

  .document-index {
    position: static;
  }

  .document-index nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-index__support {
    display: inline-grid;
    padding-inline: 18px;
  }

  .public-story-poster {
    order: -1;
    max-width: 720px;
    width: 100%;
    margin-inline: auto;
  }
}

@media (max-width: 760px) {
  .nav-inner {
    min-height: 64px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .nav-links {
    display: none;
  }

  .brand-subtitle,
  .brand > span small {
    display: none;
  }

  .logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .landing-hero {
    padding: 26px 22px;
    border-radius: 21px;
  }

  .landing-hero h1 {
    font-size: clamp(43px, 13vw, 58px);
  }

  .cta-stack--hero {
    grid-template-columns: 1fr;
  }

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

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

  .footer-inner {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .footer-columns {
    gap: 18px;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .reader-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .reader-toolbar .reader-toolbar__actions {
    justify-content: space-between;
  }

  .pdf-reader__progress {
    top: 176px;
  }

  .pdf-reader {
    min-height: 70vh;
  }
}

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

  .brand {
    gap: 9px;
  }

  .brand-title,
  .brand > span strong {
    font-size: 16px;
  }

  .locale-switch__button {
    min-width: 34px;
    padding-inline: 6px;
  }

  main {
    padding-block: 28px 46px;
  }

  .eyebrow {
    margin-bottom: 18px;
    font-size: 9px;
  }

  .landing-main {
    gap: 12px;
  }

  .landing-hero #pageLead {
    margin-top: 20px;
    font-size: 16px;
  }

  .product-mark__image {
    min-height: 210px;
    padding: 32px;
  }

  .product-mark__image img {
    width: min(100%, 220px);
  }

  .product-mark figcaption {
    padding: 17px;
  }

  .feature-grid,
  .resource-grid,
  .document-index nav {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 210px;
  }

  .landing-editorial-section,
  .landing-trust-section,
  .resource-section {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .landing-editorial-copy h2 {
    font-size: 38px;
  }

  .landing-trust-section h2 {
    font-size: 32px;
  }

  .page-intro h1 {
    font-size: clamp(28px, 8vw, 42px);
  }

  .page-intro__lead {
    font-size: 16px;
  }

  .legal-document {
    padding: 20px;
  }

  .document-section {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-block: 24px;
  }

  .document-section__number {
    font-size: 10px;
  }

  .technical-page {
    min-height: 68vh;
  }

  .technical-card {
    padding: 28px 22px;
  }

  .technical-code {
    margin-bottom: 24px;
  }

  .actions .button {
    flex: 1 1 100%;
  }

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

  .footer-columns > div:last-child {
    grid-column: 1 / -1;
  }

  .public-story-hero,
  .public-story-section {
    padding: 20px;
    border-radius: 20px;
  }

  .public-story-hero {
    padding: 0;
  }

  .public-story-copy {
    padding: 24px 20px;
  }

  .reader-toolbar {
    border-radius: 16px;
  }

  .pdf-reader__pages {
    width: calc(100% + 32px);
    margin-left: -16px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
