/* وطن واحد — site styles */
@font-face {
  font-family: "Thmanyah Serif Display";
  src: url("fonts/thmanyah-serif-display-bold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Serif Display";
  src: url("fonts/thmanyah-serif-display-light.woff") format("woff");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Markazi Text";
  src: url("fonts/markazi-text.woff") format("woff");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --night: #0d0b14;        /* storm sky from the cover */
  --night-2: #16121f;
  --dusk: #2a2140;         /* raised surfaces, lines */
  --ash: #cfc6dd;          /* body text on night */
  --mist: #9d94b1;         /* secondary text on night */
  --gold: #e2b866;         /* logo gold */
  --gold-hi: #f6dfa0;
  --violet: #a46bff;       /* arcane light — interaction only */
  --parchment: #efe6d2;    /* credits-page paper */
  --parchment-ink: #2b2116;
  --parchment-mute: #6b5a41;
  --display: "Thmanyah Serif Display", "Markazi Text", serif;
  --body: "Markazi Text", "Thmanyah Serif Display", serif;
  --wrap: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--night);
  color: var(--ash);
  font-family: var(--body);
  font-size: 20px;
  line-height: 1.8;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); text-underline-offset: 4px; }
a:hover { color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: 16px; top: -60px; background: var(--gold); color: var(--night); padding: 8px 16px; z-index: 100; border-radius: 6px; }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-head {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px);
}
.site-head .mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold); font-family: var(--display); font-size: 20px; }
.site-head .mark img { width: 34px; height: 34px; border-radius: 8px; }
.site-head nav { display: flex; gap: clamp(14px, 3vw, 28px); font-size: 16px; }
.site-head nav a { color: var(--ash); text-decoration: none; padding: 8px 0; }
.site-head nav a:hover { color: var(--gold-hi); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 28px; border-radius: 999px;
  font-family: var(--body); font-size: 19px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.btn-gold { background: var(--gold); color: #1a1006; }
.btn-gold:hover { background: var(--gold-hi); color: #1a1006; }
.btn-ghost { border-color: #4d4266; color: var(--ash); background: rgba(13, 11, 20, .35); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-hi); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden;
  isolation: isolate;
}
.hero-art {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(13, 11, 20, 0) 0%, rgba(13, 11, 20, .55) 70%, rgba(13, 11, 20, .9) 100%),
    linear-gradient(180deg, rgba(13, 11, 20, .55) 0%, rgba(13, 11, 20, 0) 22%, rgba(13, 11, 20, .25) 48%, rgba(13, 11, 20, .94) 76%, var(--night) 100%);
}
.hero-inner {
  width: min(100%, var(--wrap)); margin: 0 auto;
  padding: 120px 16px clamp(48px, 8vh, 88px);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px;
}
.hero-logo { width: min(92vw, 760px); height: auto; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .6)); }
.hero-quote {
  margin: 0; max-width: 34ch;
  font-family: var(--display); font-weight: 700; color: #f1e8d6;
  font-size: clamp(22px, 3.2vw, 32px); line-height: 1.6; text-wrap: balance;
}
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero-meta { font-size: 15px; color: var(--mist); margin: 0; }

@media (max-width: 700px) {
  .hero-art { object-position: 50% 30%; }
  .hero::before {
    background: linear-gradient(180deg, rgba(13, 11, 20, .55) 0%, rgba(13, 11, 20, 0) 14%, rgba(13, 11, 20, 0) 40%, rgba(13, 11, 20, .88) 66%, var(--night) 92%);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-logo { animation: rise 1.6s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-quote { animation: rise 1.6s .35s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-actions, .hero-meta { animation: rise 1.4s .6s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
}

/* ---------- parchment: the story ---------- */
.scroll {
  position: relative; background: var(--parchment); color: var(--parchment-ink);
  padding: clamp(72px, 10vw, 120px) 16px;
}
.scroll::before, .scroll::after { /* deckled edges */
  content: ""; position: absolute; inset-inline: 0; height: 12px;
  background: var(--parchment);
  -webkit-mask: radial-gradient(6px 6px at 50% 0, #0000 98%, #000) 0 0 / 14px 12px repeat-x;
          mask: radial-gradient(6px 6px at 50% 0, #0000 98%, #000) 0 0 / 14px 12px repeat-x;
}
.scroll::before { top: -11px; transform: scaleY(-1); }
.scroll::after { bottom: -11px; }
.scroll-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.ornament { display: block; width: 180px; height: 22px; margin: 0 auto 28px; color: #a9844a; }
.scroll h2 {
  margin: 0 0 32px; font-family: var(--display); font-size: clamp(34px, 5vw, 48px); line-height: 1.3; color: #1f170e;
}
.scroll p { margin: 0 0 24px; font-size: 23px; line-height: 1.9; }
.scroll p.lead { font-family: var(--display); font-weight: 300; font-size: clamp(26px, 3.6vw, 32px); line-height: 1.75; color: #1f170e; }
.scroll .closing {
  margin: 40px 0 36px; padding-top: 30px; border-top: 1px solid #cdbb94;
  font-family: var(--display); font-weight: 300; font-size: clamp(24px, 3.2vw, 29px); line-height: 1.8; color: #5a3d16;
}
.scroll .btn-ink { background: #1f170e; color: var(--parchment); }
.scroll .btn-ink:hover { background: #3a2a17; color: #fff; }

/* ---------- chapters ---------- */
.section { width: min(100%, var(--wrap)); margin: 0 auto; padding: clamp(80px, 10vw, 120px) clamp(16px, 4vw, 40px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section h2 { margin: 0; font-family: var(--display); font-size: clamp(32px, 4.5vw, 44px); color: #f1e8d6; line-height: 1.3; }
.section-head p { margin: 0; color: var(--mist); font-size: 16px; }

.chapter-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--dusk); }
.chapter {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 22px; align-items: center;
  padding: 20px 0; border-bottom: 1px solid var(--dusk);
}
.chapter img { width: 96px; height: 144px; object-fit: cover; border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.chapter-no { font-size: 15px; color: var(--gold); margin: 0; }
.chapter h3 { margin: 2px 0 6px; font-family: var(--display); font-size: clamp(24px, 3vw, 30px); line-height: 1.35; }
.chapter h3 a { color: #f6ecd6; text-decoration: none; }
.chapter h3 a::after { content: ""; position: absolute; inset: 0; }
.chapter { position: relative; }
.chapter h3 a:hover { color: var(--gold-hi); }
.chapter .sum { margin: 0 0 6px; font-size: 19px; line-height: 1.8; color: var(--ash); max-width: 52ch; }
.chapter .facts { margin: 0; font-size: 14px; color: var(--mist); }
.chapter .go { position: relative; z-index: 1; }
.chapter.soon { grid-template-columns: 96px minmax(0, 1fr); opacity: .7; }
.chapter.soon .ph {
  width: 96px; height: 144px; border-radius: 6px; border: 1px dashed #4d4266;
  display: grid; place-items: center; color: var(--mist); font-family: var(--display); font-size: 30px;
}
@media (max-width: 640px) {
  .chapter { grid-template-columns: 84px minmax(0, 1fr); gap: 16px; }
  .chapter img, .chapter.soon .ph { width: 84px; height: 126px; }
  .chapter .go { grid-column: 1 / -1; width: 100%; }
}

/* ---------- author ---------- */
.author { border-top: 1px solid var(--dusk); }
.author-inner { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.author h2 { font-size: clamp(28px, 3.5vw, 36px); }
.author p { margin: 8px 0 0; max-width: 56ch; color: var(--ash); }

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--dusk); padding: 36px clamp(16px, 4vw, 40px) 48px;
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
  font-size: 14px; color: var(--mist);
}
.site-foot img { width: 150px; height: auto; opacity: .85; }
.site-foot p { margin: 0; }

/* ---------- 404 ---------- */
.lost { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 24px; }
.lost h1 { font-family: var(--display); font-size: 40px; color: #f1e8d6; margin: 24px 0 8px; }
