/* =========================================================================
   Peramouth — بيراموث   |  SPECTREX Library
   Palette sampled directly from assets/cover.jpg.
   ========================================================================= */

:root {
  /* --- surfaces --- */
  --ink:         #050506;
  --ink-2:       #0b0b0d;
  --surface:     #141416;
  --surface-2:   #1a1a1c;
  --brown:       #2a2118;
  --brown-2:     #3a2e22;

  /* --- gold, from the cover calligraphy --- */
  --gold:        #c4a484;
  --gold-2:      #d9b98c;
  --gold-bright: #f2e9ca;
  --amber:       #c08a4e;

  /* --- text --- */
  --text:        #e8e2d8;
  --text-muted:  #9c9086;
  --danger:      #e0796b;

  /* --- type --- */
  --font-display-ar: "Aref Ruqaa", "Amiri", "Times New Roman", serif;
  --font-body-ar:    "Tajawal", system-ui, "Segoe UI", sans-serif;
  --font-display-en: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body-en:    "Inter", system-ui, "Segoe UI", sans-serif;

  --radius:      14px;
  --radius-sm:   10px;
  --shell:       1180px;
}

html[lang="ar"] {
  --font-display: var(--font-display-ar);
  --font-body:    var(--font-body-ar);
  --lh:           1.9;
}

html[lang="en"] {
  --font-display: var(--font-display-en);
  --font-body:    var(--font-body-en);
  --lh:           1.65;
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--ink);
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(192, 138, 78, 0.10), transparent 60%),
    radial-gradient(90% 50% at 50% 110%, rgba(42, 33, 24, 0.55), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.06rem);
  line-height: var(--lh);
  overflow-x: clip;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; margin: 0; }
p { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }

::selection { background: rgba(217, 185, 140, 0.28); color: var(--gold-bright); }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 12px;
  z-index: 20;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  background: var(--surface);
  color: var(--gold-bright);
  border: 1px solid var(--gold);
  padding: 10px 18px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus {
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
}

.page {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
  padding-block-end: 8px;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: clamp(16px, 3vw, 26px);
  border-block-end: 1px solid rgba(58, 46, 34, 0.6);
}

.brand {
  font-family: var(--font-display-en);
  font-size: 0.86rem;
  letter-spacing: 0.28em;
  color: var(--gold);
  white-space: nowrap;
}
.brand-thin { color: var(--text-muted); }

.langtoggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--brown-2);
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.7);
}

.langtoggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1;
  padding: 9px 16px;
  min-height: 36px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.langtoggle button:hover { color: var(--gold-2); }
.langtoggle button[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(217, 185, 140, 0.18), rgba(217, 185, 140, 0.07));
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px rgba(217, 185, 140, 0.35);
}

/* ---------------------------------------------------------------- layout */

.layout {
  display: grid;
  gap: clamp(28px, 5vw, 56px);
  padding-block: clamp(28px, 6vw, 64px);
  align-items: start;
}

@media (min-width: 1000px) {
  .layout {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
    gap: clamp(40px, 5vw, 72px);
  }
  .art-col { position: sticky; top: 28px; }
}

/* ------------------------------------------------------------- hero art */

.hero-art { position: relative; }

.hero-art img {
  width: 100%;
  aspect-ratio: 1024 / 1046;      /* crops the poster's own CTA band away */
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}

.glow {
  position: absolute;
  inset: 4% 0 6%;
  z-index: -1;
  background:
    radial-gradient(46% 34% at 50% 62%, rgba(192, 138, 78, 0.42), transparent 70%),
    radial-gradient(60% 46% at 50% 30%, rgba(217, 185, 140, 0.16), transparent 72%);
  filter: blur(38px);
  opacity: 0.85;
}

/* ------------------------------------------------------------ hero copy */

.content-col {
  display: grid;
  gap: clamp(26px, 4vw, 38px);
  align-content: start;
}

.hero-copy { text-align: start; }

.chip {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--brown-2);
  border-radius: 999px;
  padding: 6px 16px;
  margin-block-end: 18px;
  background: rgba(20, 20, 22, 0.6);
}
html[lang="ar"] .chip {
  letter-spacing: normal;
  text-transform: none;
  font-size: 0.85rem;
  padding-block: 4px;
}

.title {
  font-size: clamp(2.6rem, 1.6rem + 4.4vw, 4.4rem);
  color: var(--gold-bright);
  text-shadow: 0 0 34px rgba(192, 138, 78, 0.35);
  margin-block-end: 6px;
}
html[lang="en"] .title { letter-spacing: 0.06em; }
html[lang="ar"] .title { line-height: 1.5; }

.tagline {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 0.95rem + 0.7vw, 1.45rem);
  color: var(--gold);
  margin-block-end: 14px;
}

.author {
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-block-end: 26px;
}


/* ------------------------------------------------------------- form card */

.reserve { scroll-margin-top: 24px; }

.card {
  background: linear-gradient(180deg, rgba(20, 20, 22, 0.96), rgba(11, 11, 13, 0.96));
  border: 1px solid var(--brown-2);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 34px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(217, 185, 140, 0.06);
}

.card-title {
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem);
  color: var(--gold-bright);
}

.card-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-block: 8px 26px;
}

.field { margin-block-end: 20px; }

.field > label {
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gold);
  margin-block-end: 8px;
}

.hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-block: -4px 8px;
}

.field input,
.field select,
.field textarea {
  display: block;          /* kills the inline baseline gap under textareas */
  width: 100%;
  min-height: 50px;
  padding: 12px 15px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid #2b2620;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  text-align: start;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.field textarea { min-height: 96px; resize: vertical; }

.field input::placeholder,
.field textarea::placeholder { color: #6b635b; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--brown-2); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold-2);
  background: #1d1c1a;
  box-shadow: 0 0 0 3px rgba(192, 138, 78, 0.18);
  outline: none;
}

/* custom select chevron, mirrored for RTL */
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='none' stroke='%23c4a484' stroke-width='1.6' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-inline-end: 42px;
}
[dir="rtl"] .field select {
  background-position: left 15px center;
  padding-inline-end: 15px;
  padding-inline-start: 42px;
}
.field select option { background: var(--surface); color: var(--text); }

/* ------------------------------------------------------------- validation */

.err, .form-error {
  color: var(--danger);
  font-size: 0.86rem;
  line-height: 1.55;
  margin-block-start: 7px;
}
.err[hidden], .form-error[hidden] { display: none; }

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(224, 121, 107, 0.14);
}

.form-error {
  margin-block: 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(224, 121, 107, 0.45);
  background: rgba(224, 121, 107, 0.08);
  border-radius: var(--radius-sm);
}

/* ----------------------------------------------------------------- button */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 14px 28px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.25s ease, transform 0.12s ease, color 0.2s ease;
}

.btn-solid {
  width: 100%;
  border: 1px solid var(--gold-2);
  color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(217, 185, 140, 0.16), rgba(217, 185, 140, 0.05));
}
.btn-solid:hover:not([disabled]) {
  background: linear-gradient(180deg, rgba(217, 185, 140, 0.26), rgba(217, 185, 140, 0.10));
  box-shadow: 0 0 30px rgba(192, 138, 78, 0.28);
}
.btn-solid:active:not([disabled]) { transform: translateY(1px); }
.btn-solid[disabled] { opacity: 0.55; cursor: progress; box-shadow: none; }

/* ----------------------------------------------------------------- thanks */

.thanks { text-align: center; padding-block: clamp(18px, 4vw, 32px); }
.thanks:focus { outline: none; }
.thanks-mark {
  font-size: 1.9rem;
  color: var(--gold-2);
  text-shadow: 0 0 26px rgba(192, 138, 78, 0.55);
  margin-block-end: 12px;
}
.thanks-body {
  color: var(--text-muted);
  margin-block-start: 12px;
  max-width: 46ch;
  margin-inline: auto;
}

/* ----------------------------------------------------------------- footer */

.foot {
  border-block-start: 1px solid rgba(58, 46, 34, 0.6);
  padding-block: 22px 30px;
  text-align: center;
  color: #6b635b;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

/* -------------------------------------------------------------- motion */

.reveal { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s ease, transform 0.8s ease;
  }
  body.is-ready .reveal { opacity: 1; transform: none; }
  body.is-ready .art-col   .reveal { transition-delay: 0.05s; }
  body.is-ready .hero-copy { transition-delay: 0.18s; }
  body.is-ready .reserve   { transition-delay: 0.30s; }

  .glow { animation: emberPulse 7s ease-in-out infinite; }
  @keyframes emberPulse {
    0%, 100% { opacity: 0.72; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.04); }
  }
}

/* Aref Ruqaa is calligraphic — beautiful for the book title, harder to read
   at section-heading size, so Arabic headings inside the card use Tajawal. */
html[lang="ar"] .card-title { font-family: var(--font-body-ar); font-weight: 700; }
