/* ==========================================================================
   Story-AR — Design System  ·  "Warm storybook" theme
   Shared tokens + base + landing + creator app (dashboard / editor)
   RTL-first (Arabic default), works in LTR via logical properties.
   ========================================================================== */

/* ---------- 1. TOKENS ---------- */
:root {
  /* surfaces */
  --paper:      #FBF7F0;
  --paper-2:    #F6EFE3;
  --paper-3:    #F1E7D6;
  --surface:    #FFFFFF;

  /* ink */
  --ink:        #1A1720;
  --ink-2:      #4A4356;
  --ink-3:      #857D93;
  --line:       rgba(26, 23, 32, 0.10);
  --line-2:     rgba(26, 23, 32, 0.16);

  /* brand */
  --amber:      #F5A623;
  --amber-2:    #FFC25C;
  --amber-deep: #B5730A;
  --amber-soft: #FFF3DC;
  --coral:      #E8734A;
  --coral-soft: #FDECE5;
  --teal:       #0E7C7B;
  --teal-soft:  #E2F1F0;
  --ok:         #14804A;
  --ok-soft:    #E5F4EC;
  --danger:     #C6362F;
  --danger-soft:#FBEAE9;

  /* radii */
  --r-xs: 8px;
  --r-sm: 12px;
  --r:    18px;
  --r-lg: 26px;
  --r-xl: 34px;
  --r-full: 999px;

  /* elevation */
  --sh-1: 0 1px 2px rgba(26,23,32,.05), 0 6px 16px rgba(26,23,32,.05);
  --sh-2: 0 2px 4px rgba(26,23,32,.05), 0 18px 40px rgba(26,23,32,.09);
  --sh-3: 0 30px 70px rgba(26,23,32,.14);
  --sh-amber: 0 10px 24px rgba(245,166,35,.30);

  /* layout */
  --container: 1160px;
  --nav-h: 68px;

  --font: "Cairo", "Segoe UI", system-ui, -apple-system, "Tahoma", sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-2);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 520px at 88% -8%, rgba(245,166,35,.14), transparent 60%),
    radial-gradient(900px 480px at 4% 4%, rgba(14,124,123,.08), transparent 62%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 800; line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--amber); color: var(--ink); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

/* ---------- 3. TYPE SCALE ---------- */
.h1, h1 { font-size: clamp(2.15rem, 1.35rem + 3.3vw, 3.7rem); font-weight: 900; letter-spacing: -.01em; }
.h2, h2 { font-size: clamp(1.65rem, 1.2rem + 1.7vw, 2.5rem); }
.h3, h3 { font-size: clamp(1.15rem, 1.02rem + .5vw, 1.4rem); font-weight: 700; }
.lead { font-size: clamp(1.02rem, .96rem + .35vw, 1.2rem); color: var(--ink-2); line-height: 1.9; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
:root[dir="ltr"] .h1, :root[dir="ltr"] h1 { letter-spacing: -.025em; }

/* ---------- 4. LAYOUT ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 22px; }
.section { padding-block: clamp(56px, 7vw, 104px); position: relative; }
.section--tint { background: linear-gradient(180deg, transparent, var(--paper-2) 12%, var(--paper-2) 88%, transparent); }
.section-head { max-width: 720px; margin-inline: auto; text-align: center; margin-bottom: clamp(32px, 4vw, 56px); }
.section-head p { margin-bottom: 0; }
.grid { display: grid; gap: clamp(16px, 2vw, 24px); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* numbers and fractions always read left-to-right, even inside Arabic text */
.num, .stat b, .price__amount { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- 5. BITS ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); font-size: .84rem; font-weight: 700;
  padding: 7px 15px; border-radius: var(--r-full); box-shadow: var(--sh-1);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(245,166,35,.22); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700;
  padding: 4px 11px; border-radius: var(--r-full);
  background: var(--amber-soft); color: var(--amber-deep);
}
.badge--teal { background: var(--teal-soft); color: var(--teal); }
.badge--ok   { background: var(--ok-soft);   color: var(--ok); }
.badge--muted{ background: rgba(26,23,32,.05); color: var(--ink-3); }

/* ---------- 6. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid transparent; border-radius: var(--r-full);
  padding: 13px 26px; font-size: 1rem; font-weight: 800; line-height: 1.2;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn-primary { background: linear-gradient(135deg, var(--amber-2), var(--amber)); color: #241802; box-shadow: var(--sh-amber); }
.btn-primary:hover { box-shadow: 0 14px 30px rgba(245,166,35,.42); }
.btn-ink { background: var(--ink); color: #fff; box-shadow: 0 10px 24px rgba(26,23,32,.22); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--sh-1); }
.btn-ghost:hover { border-color: var(--amber); }
.btn-quiet { background: rgba(26,23,32,.05); color: var(--ink-2); }
.btn-quiet:hover { background: rgba(26,23,32,.09); }
.btn-ok { background: linear-gradient(135deg, #2BB673, #14804A); color: #fff; box-shadow: 0 10px 24px rgba(20,128,74,.28); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(198,54,47,.25); }
.btn-danger:hover { background: rgba(198,54,47,.14); }
.btn-lg { padding: 16px 32px; font-size: 1.06rem; }
.btn-sm { padding: 8px 16px; font-size: .84rem; border-radius: var(--r-full); }
.btn-block { width: 100%; }

/* ---------- 7. CARD ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 2.4vw, 30px);
  box-shadow: var(--sh-1);
}
.card--flat { box-shadow: none; }
.card--tint { background: linear-gradient(180deg, #fff, var(--paper-2)); }

/* ==========================================================================
   LANDING
   ========================================================================== */

/* ---------- 8. HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251,247,240,.82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 6px 24px rgba(26,23,32,.05); }
.site-header .container { display: flex; align-items: center; gap: 18px; min-height: var(--nav-h); }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; color: var(--ink); font-size: 1.12rem; }
.brand__mark { width: 38px; height: 38px; flex: none; }
.brand__sub { display: block; font-size: .68rem; font-weight: 600; color: var(--ink-3); line-height: 1; margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav a { padding: 9px 14px; border-radius: var(--r-full); font-size: .95rem; font-weight: 600; color: var(--ink-2); transition: background .18s, color .18s; }
.nav a:hover { background: rgba(26,23,32,.055); color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 10px; }

.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink);
  border-radius: var(--r-full); padding: 8px 14px; font-size: .86rem; font-weight: 800;
  box-shadow: var(--sh-1); transition: border-color .18s, transform .18s;
}
.lang-toggle:hover { border-color: var(--amber); transform: translateY(-1px); }
.lang-toggle svg { width: 15px; height: 15px; opacity: .6; }

.nav-burger { display: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 11px; box-shadow: var(--sh-1); }
.nav-burger svg { width: 20px; height: 20px; }

/* ---------- 9. HERO ---------- */
.hero { padding-block: clamp(34px, 5vw, 76px) clamp(44px, 6vw, 88px); position: relative; }
.hero__grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(28px, 4vw, 60px); align-items: center; }
.hero__copy h1 { margin-bottom: .38em; }
.hero__copy h1 .hl { position: relative; color: var(--ink); white-space: nowrap; }
.hero__copy h1 .hl::after {
  content: ""; position: absolute; inset-inline: -6px; bottom: .02em; height: .24em;
  background: linear-gradient(90deg, rgba(245,166,35,.55), rgba(255,194,92,.75));
  border-radius: var(--r-full); z-index: -1;
}
.hero__eyebrow { margin-bottom: 20px; }
.hero__lead { max-width: 33em; margin-bottom: 26px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.hero__trust { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .9rem; color: var(--ink-3); font-weight: 600; }
.hero__trust li { display: inline-flex; align-items: center; gap: 7px; }
.hero__trust svg { width: 17px; height: 17px; color: var(--ok); flex: none; }

/* hero visual */
.hero__visual { position: relative; }
.hero__stage {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  background: linear-gradient(160deg, #FFF9EE, #F7EEDD);
  border: 1px solid var(--line); box-shadow: var(--sh-2);
  aspect-ratio: 4 / 3;
}
.hero__stage img { width: 100%; height: 100%; object-fit: cover; }
.hero__stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(251,247,240,.55));
}
.chip {
  position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--r-full);
  padding: 9px 15px; font-size: .84rem; font-weight: 800; color: var(--ink);
  box-shadow: var(--sh-2); white-space: nowrap;
}
.chip svg { width: 16px; height: 16px; color: var(--amber-deep); }
.chip--1 { inset-block-start: 8%;  inset-inline-start: -14px; animation: float 6s ease-in-out infinite; }
.chip--2 { inset-block-end: 16%;  inset-inline-end: -10px; animation: float 6s ease-in-out infinite .9s; }
.chip--3 { inset-block-end: -14px; inset-inline-start: 12%; animation: float 6s ease-in-out infinite 1.8s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* scanning sweep over the hero art */
.hero__scan {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; border-radius: var(--r-xl);
}
.hero__scan span {
  position: absolute; inset-inline: 0; height: 34%;
  background: linear-gradient(180deg, transparent, rgba(245,166,35,.20), transparent);
  animation: sweep 4.6s var(--ease) infinite;
}
@keyframes sweep { 0% { transform: translateY(-40%); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(320%); opacity: 0; } }

/* ---------- 10. LOGO STRIP / STATS ---------- */
.factbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.factbar div { background: var(--surface); padding: 20px 18px; text-align: center; }
.factbar b { display: block; color: var(--ink); font-size: 1.5rem; font-weight: 900; line-height: 1.2; }
.factbar span { font-size: .86rem; color: var(--ink-3); font-weight: 600; }

/* ---------- 11. STEPS ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: clamp(16px, 2vw, 26px); position: relative; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 24px; box-shadow: var(--sh-1); position: relative; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.step:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.step__n {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: var(--amber-soft); color: var(--amber-deep); font-weight: 900; font-size: 1.05rem; margin-bottom: 16px;
}
.step:nth-child(2) .step__n { background: var(--teal-soft); color: var(--teal); }
.step:nth-child(3) .step__n { background: var(--coral-soft); color: #B4441E; }
.step h3 { margin-bottom: 8px; }
.step p { margin: 0; font-size: .96rem; color: var(--ink-2); }

/* animated explainer */
.explainer { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 3vw, 48px); align-items: center; }
.explainer__art { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(16px, 2vw, 26px); box-shadow: var(--sh-1); }
.explainer__list li { display: flex; gap: 14px; padding-block: 12px; align-items: flex-start; }
.explainer__list li + li { border-top: 1px dashed var(--line-2); }
.explainer__list .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--paper-2); display: grid; place-items: center; flex: none; color: var(--amber-deep); }
.explainer__list .ic svg { width: 21px; height: 21px; }
.explainer__list b { color: var(--ink); display: block; font-size: 1.02rem; }
.explainer__list span { font-size: .93rem; color: var(--ink-3); }

/* ---------- 12. FEATURES / USE CASES ---------- */
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 24px; box-shadow: var(--sh-1); transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease); }
.feature:hover { transform: translateY(-4px); border-color: rgba(245,166,35,.45); box-shadow: var(--sh-2); }
.feature__ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber-deep); margin-bottom: 16px; }
.feature__ic svg { width: 24px; height: 24px; }
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; font-size: .95rem; }
.feature--teal .feature__ic { background: var(--teal-soft); color: var(--teal); }
.feature--coral .feature__ic { background: var(--coral-soft); color: #B4441E; }

.usecase { background: linear-gradient(180deg, #fff, var(--paper-2)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 20px; text-align: center; box-shadow: var(--sh-1); }
.usecase .emo { font-size: 1.9rem; line-height: 1; margin-bottom: 12px; }
.usecase b { display: block; color: var(--ink); font-size: 1.03rem; margin-bottom: 4px; }
.usecase span { font-size: .9rem; color: var(--ink-3); }

/* ---------- 13. PRICING ---------- */
.price { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px 26px; box-shadow: var(--sh-1); display: flex; flex-direction: column; }
.price--featured { border-color: rgba(245,166,35,.55); box-shadow: var(--sh-2); }
.price--featured::before {
  content: attr(data-tag); position: absolute; inset-block-start: -13px; inset-inline-start: 26px;
  background: linear-gradient(135deg, var(--amber-2), var(--amber)); color: #241802;
  font-size: .76rem; font-weight: 900; padding: 5px 14px; border-radius: var(--r-full); box-shadow: var(--sh-amber);
}
.price__amount { display: flex; align-items: baseline; gap: 6px; margin-block: 6px 4px; }
.price__amount b { font-size: 2.5rem; font-weight: 900; color: var(--ink); line-height: 1; }
.price__amount span { color: var(--ink-3); font-size: .92rem; font-weight: 600; }
.price ul { margin-block: 18px; display: grid; gap: 10px; }
.price li { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.price li svg { width: 18px; height: 18px; color: var(--ok); flex: none; margin-top: 4px; }
.price .btn { margin-top: auto; }

/* ---------- 14. FAQ ---------- */
.faq { max-width: 820px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-inline-start: auto; font-size: 1.4rem; color: var(--amber-deep); font-weight: 700; line-height: 1; transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq__body { padding: 0 22px 20px; font-size: .96rem; color: var(--ink-2); }

/* ---------- 15. CTA BAND + FOOTER ---------- */
.cta-band {
  background: linear-gradient(135deg, #221D2B, #14111B);
  color: #F5F1EA; border-radius: var(--r-xl); padding: clamp(30px, 4vw, 56px);
  display: grid; grid-template-columns: 1fr auto; gap: 26px; align-items: center;
  box-shadow: var(--sh-3); position: relative; overflow: hidden;
}
.cta-band::before { content: ""; position: absolute; inset-block-start: -60%; inset-inline-end: -10%; width: 460px; height: 460px; background: radial-gradient(circle, rgba(245,166,35,.30), transparent 62%); }
.cta-band h2 { color: #fff; margin-bottom: 8px; position: relative; }
.cta-band p { color: rgba(245,241,234,.72); margin: 0; position: relative; }
.cta-band .btn { position: relative; }

.site-footer { border-top: 1px solid var(--line); margin-top: clamp(48px, 6vw, 90px); padding-block: 44px 34px; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.site-footer h4 { font-size: .9rem; color: var(--ink); margin-bottom: 12px; }
.site-footer a { color: var(--ink-3); font-size: .94rem; display: inline-block; padding-block: 4px; }
.site-footer a:hover { color: var(--amber-deep); }
.site-footer__bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 20px; font-size: .87rem; color: var(--ink-3); }
.mailpill { display: inline-flex; align-items: center; gap: 8px; background: var(--amber-soft); color: var(--amber-deep) !important; font-weight: 800; padding: 9px 16px; border-radius: var(--r-full); }

/* ==========================================================================
   CREATOR APP  (dashboard + editor)
   ========================================================================== */

/* view switching — must stay compatible with main.js showView() */
#landing-view, #dashboard-view, #editor-view { display: none; }
#landing-view.active-view, #dashboard-view.active-view, #editor-view.active-view { display: block; }

.appbar { position: sticky; top: 0; z-index: 50; background: rgba(251,247,240,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.appbar .container { display: flex; align-items: center; gap: 12px; min-height: var(--nav-h); flex-wrap: wrap; }
.appbar__spacer { margin-inline-start: auto; }
.usage-chip {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-full);
  padding: 8px 16px; font-size: .86rem; font-weight: 700; color: var(--ink-2); box-shadow: var(--sh-1);
}
.usage-chip b { color: var(--amber-deep); }

.app-main { padding-block: clamp(26px, 3.5vw, 46px) clamp(50px, 7vw, 90px); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h2 { margin-bottom: 4px; }
.page-head p { margin: 0; color: var(--ink-3); font-size: .96rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 2.4vw, 30px); box-shadow: var(--sh-1); margin-bottom: 22px; }
.panel--accent { background: linear-gradient(140deg, #FFF9EE, #FFFFFF 60%); border-color: rgba(245,166,35,.35); }
.panel__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel__head h3 { margin: 0; }
.panel__head .badge { margin-inline-start: auto; }
.panel p.hint { color: var(--ink-3); font-size: .93rem; margin-bottom: 18px; }

.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 800; color: var(--ink); margin: 34px 0 16px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* --- book cards --- */
.book-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-1); margin-bottom: 18px; transition: box-shadow .25s var(--ease), border-color .25s var(--ease); }
.book-card:hover { box-shadow: var(--sh-2); border-color: rgba(245,166,35,.4); }
.book-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px dashed var(--line-2); margin-bottom: 16px; }
.book-card__title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.book-card__title .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--amber-soft); color: var(--amber-deep); display: grid; place-items: center; flex: none; }
.book-card__title .ic svg { width: 22px; height: 22px; }
.book-card__title h3 { margin: 0; font-size: 1.22rem; overflow-wrap: anywhere; }
.book-card__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; }
.stat span { display: block; font-size: .76rem; font-weight: 800; color: var(--ink-3); }
.stat b { font-size: 1.4rem; font-weight: 900; color: var(--ink); line-height: 1.3; }
.stat b i { font-style: normal; font-size: .9rem; color: var(--ink-3); font-weight: 700; }
.stat--amber b { color: var(--amber-deep); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions .sep { width: 1px; height: 26px; background: var(--line-2); margin-inline: 4px; }

.empty { text-align: center; padding: 46px 24px; border: 2px dashed var(--line-2); border-radius: var(--r-lg); background: rgba(255,255,255,.5); }
.empty .emo { font-size: 2.4rem; margin-bottom: 10px; }
.empty b { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: 6px; }
.empty p { color: var(--ink-3); font-size: .95rem; margin: 0; }
.loading-line { text-align: center; color: var(--ink-3); padding: 30px; font-weight: 600; }

/* --- link / QR card --- */
.link-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.link-card__qr { width: 58px; height: 58px; border-radius: 14px; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.link-card__qr svg { width: 30px; height: 30px; }
.link-card__body { flex: 1; min-width: 220px; }
.link-card__body b { display: block; color: var(--ink); }
#viewer-link { color: var(--amber-deep); font-weight: 700; word-break: break-all; font-size: .95rem; text-decoration: underline; text-underline-offset: 3px; }

/* --- form fields --- */
.field { margin-bottom: 16px; }
.field > label { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); font-size: .95rem; margin-bottom: 7px; }
.field .req { font-size: .74rem; font-weight: 800; color: var(--amber-deep); background: var(--amber-soft); padding: 2px 8px; border-radius: var(--r-full); }
.field .opt { font-size: .74rem; font-weight: 700; color: var(--ink-3); background: rgba(26,23,32,.05); padding: 2px 8px; border-radius: var(--r-full); }
input[type="file"] {
  width: 100%; background: var(--paper-2); border: 1.5px dashed var(--line-2); border-radius: var(--r);
  padding: 12px 14px; color: var(--ink-3); font-size: .9rem; cursor: pointer; transition: border-color .2s, background .2s;
}
input[type="file"]:hover { border-color: var(--amber); background: var(--amber-soft); }
input[type="file"]::file-selector-button {
  background: var(--ink); color: #fff; border: none; border-radius: var(--r-full);
  padding: 8px 16px; font-weight: 800; font-size: .85rem; cursor: pointer; margin-inline-end: 14px; transition: opacity .2s;
}
input[type="file"]::file-selector-button:hover { opacity: .85; }
input[type="text"], input[type="number"], select, textarea {
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink);
  border-radius: var(--r-sm); padding: 10px 12px; width: 100%;
}
input[type="color"] { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; }

.status-note { display: flex; align-items: center; gap: 10px; background: var(--amber-soft); color: var(--amber-deep); border-radius: var(--r); padding: 12px 16px; font-weight: 700; font-size: .93rem; margin-top: 16px; }
.helper-note { display: flex; align-items: center; gap: 10px; background: var(--teal-soft); color: var(--teal); border-radius: var(--r); padding: 12px 16px; font-weight: 700; font-size: .93rem; margin-bottom: 16px; }

/* --- asset rows (AR models) --- */
.asset-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--sh-1); transition: border-color .2s; }
.asset-row:hover { border-color: rgba(245,166,35,.45); }
.asset-row__main { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.asset-row__thumb { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); flex: none; background: var(--paper-2); }
.asset-row__meta b { display: block; color: var(--ink); font-size: 1rem; overflow-wrap: anywhere; }
.asset-row__meta small { color: var(--ink-3); font-size: .84rem; }

/* --- games panel --- */
.game-panel { background: linear-gradient(150deg, var(--teal-soft), #FFFFFF 65%); border: 1px solid rgba(14,124,123,.28); border-radius: var(--r-lg); padding: 22px; margin-bottom: 26px; }
.game-panel__head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.game-panel__head h3 { margin: 0; color: var(--teal); }
.game-panel__head .badge { margin-inline-start: auto; }
.game-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px; }
.game-row__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.game-row__facts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.game-row__facts b { color: var(--ink); font-size: 1rem; }
.mini-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-full); padding: 4px 10px; font-size: .78rem; font-weight: 700; color: var(--ink-3); }
.dropzone-btn { width: 100%; background: rgba(245,166,35,.10); color: var(--amber-deep); border: 1.5px dashed rgba(245,166,35,.6); border-radius: var(--r); padding: 14px; font-weight: 800; transition: background .2s, border-color .2s; }
.dropzone-btn:hover { background: rgba(245,166,35,.18); border-color: var(--amber); }
.progress { display: none; width: 100%; height: 8px; background: rgba(26,23,32,.08); border-radius: var(--r-full); margin-top: 14px; overflow: hidden; }
.progress__bar { width: 0%; height: 100%; background: linear-gradient(90deg, var(--amber-2), var(--amber)); border-radius: var(--r-full); transition: width .3s var(--ease); }
.progress-text { display: none; text-align: center; color: var(--amber-deep); font-weight: 800; font-size: .85rem; margin: 8px 0 0; }

/* --- publish --- */
.publish-bar { background: linear-gradient(140deg, #F2FBF6, #FFFFFF 62%); border: 1px solid rgba(20,128,74,.3); border-radius: var(--r-lg); padding: 24px; text-align: center; margin-top: 30px; }
.publish-bar p { font-size: .9rem; color: var(--ink-3); margin: 14px 0 0; }

/* ---------- 16. RESPONSIVE ---------- */
@media (max-width: 980px) {
  .hero__grid, .explainer { grid-template-columns: 1fr; }
  .hero__visual { order: -1; }
  .cta-band { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { display: none; position: absolute; inset-block-start: var(--nav-h); inset-inline: 12px; flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; box-shadow: var(--sh-2); }
  .nav.is-open { display: flex; }
  .nav-burger { display: inline-flex; order: 3; }
  .header-actions .btn-primary { display: none; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .chip--1, .chip--2, .chip--3 { font-size: .76rem; padding: 7px 12px; }
  .chip--1 { inset-inline-start: -6px; }
  .chip--2 { inset-inline-end: -4px; }
  .page-head { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
/* print-friendly-ish + safety for very small screens */
@media (max-width: 380px) { .btn { padding: 12px 18px; font-size: .95rem; } }

/* ---------- 17. ILLUSTRATION + MOTION ---------- */
.hero__stage .hero-svg { width: 100%; height: 100%; }
.explainer__art { display: grid; place-items: center; }
.explainer__art .reader-svg { width: 100%; max-width: 320px; }

@keyframes flyBob   { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -10px; rotate: 2deg; } }
@keyframes flyBobR  { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -13px; rotate: -3deg; } }
@keyframes emerge   { 0%, 100% { opacity: .55; translate: 0 0; } 50% { opacity: 1; translate: 0 -7px; } }
@keyframes twinkle  { 0%, 100% { opacity: .85; } 50% { opacity: .25; } }
@keyframes driftUp  { 0%, 100% { translate: 0 0; opacity: .6; } 50% { translate: 0 -8px; opacity: .95; } }

.fly-1 { animation: flyBob 5.2s ease-in-out infinite; }
.fly-2 { animation: flyBobR 6s ease-in-out infinite .6s; }
.fly-3 { animation: flyBob 4.6s ease-in-out infinite 1.1s; }
.fly-4 { animation: flyBobR 5.6s ease-in-out infinite .3s; }
.fly-5 { animation: flyBob 6.4s ease-in-out infinite 1.6s; }
.fly-0 { animation: emerge 4.4s ease-in-out infinite; }
.b-sparks path, .b-sparks circle, .reader-sparks path, .reader-sparks circle { animation: twinkle 3.4s ease-in-out infinite; }
.b-sparks path:nth-of-type(2), .reader-sparks circle:nth-of-type(2) { animation-delay: .9s; }
.b-sparks path:nth-of-type(3), .reader-sparks circle:nth-of-type(3) { animation-delay: 1.7s; }
.b-sparks circle:nth-of-type(odd) { animation-delay: 1.2s; }
.b-lines rect { animation: driftUp 4.8s ease-in-out infinite; }
.b-lines rect:nth-of-type(2) { animation-delay: .8s; }
.b-lines rect:nth-of-type(3) { animation-delay: 1.6s; }
.reader-fly { animation: flyBob 5.4s ease-in-out infinite; }
.reader-fly2 { animation: flyBobR 6.2s ease-in-out infinite .8s; }

/* ---------- 18. TEXTURE & REVEAL POLISH ---------- */
.hero__stage::before, .cta-band::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .05; mix-blend-mode: multiply;
}
.cta-band::after { opacity: .07; mix-blend-mode: overlay; }

.rv { opacity: 0; translate: 0 22px; transition: opacity .65s var(--ease), translate .65s var(--ease); }
.rv-in { opacity: 1; translate: 0 0; }
.grid .rv:nth-child(2), .steps .rv:nth-child(2), .factbar .rv:nth-child(2) { transition-delay: .08s; }
.grid .rv:nth-child(3), .steps .rv:nth-child(3), .factbar .rv:nth-child(3) { transition-delay: .16s; }
.grid .rv:nth-child(4), .factbar .rv:nth-child(4) { transition-delay: .24s; }
.grid .rv:nth-child(5) { transition-delay: .1s; }
.grid .rv:nth-child(6) { transition-delay: .18s; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; translate: 0 0; transition: none; } }
