/* ==========================================================================
   NASAQ — Editorial Product Design System
   Implementation of affinity-design-system.md for NASAQ Tech Solutions.
   ========================================================================== */

/* ——— 2. Color Tokens ——— */
:root {
  --bg-stage:    #0B0B0D;
  --bg-paper:    #F4EFE6;
  --bg-surface:  #15120E;

  --accent:      #C8923B;     /* illuminated manuscript gold */
  --accent-ink:  #0B0B0D;
  --accent-soft: #E5B868;

  --neutral:     #D9D4CB;
  --text-stage:  #FAF7F1;
  --text-paper:  #0B0B0D;
  --text-muted:  #8A8277;

  --hairline:    #2a261f;

  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-ui:      'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-ar:      'Amiri', 'Scheherazade New', serif;
  --font-mark-ar: 'Cairo Play', 'Amiri', system-ui, sans-serif;

  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --radius-pill: 9999px;

  /* Buttons — foil + seal language (manuscript / binding) */
  --btn-foil-top:   color-mix(in srgb, var(--accent) 78%, #fff 22%);
  --btn-foil-mid:   var(--accent);
  --btn-foil-depth: color-mix(in srgb, var(--accent) 72%, #000 28%);
  --btn-foil-rim:   color-mix(in srgb, var(--accent-soft) 55%, #fff 45%);

  --section-py-d: 120px;
  --section-py-m: 64px;
  --max-w: 1440px;
  --gutter: 32px;
  --outer: 80px;
}

/* ——— Reset ——— */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* Stage color fills the strip behind the transparent nav at page-load so the
     bar reads as part of the hero, not a separate chrome. Every visible
     section below paints its own background. */
  background: var(--bg-stage);
}
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-paper);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul { list-style: none; padding: 0; margin: 0; }

/* ——— 3. Typography ——— */
.display-xl {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 9vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.display-lg {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 88px);
  line-height: 1.0;
  letter-spacing: -0.015em;
}
.display-md {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.lede {
  font-family: var(--font-ui);
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 58ch;
}
.lede--center { margin: 0 auto; text-align: center; }
.meta {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 12px;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
}

/* The one-word emphasis: italic swash only — applied consistently everywhere. */
.emphasis {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-feature-settings: "swsh" 1, "salt" 1;
  color: inherit;
}

/* ——— Layout helpers ——— */
.section {
  padding: var(--section-py-d) var(--outer);
}
.section--stage { background: var(--bg-stage); color: var(--text-stage); }
.section--paper { background: var(--bg-paper); color: var(--text-paper); }
.section--stage .eyebrow { color: var(--text-muted); }
.section--stage .lede { color: var(--text-muted); }

.section__header {
  max-width: 880px;
  margin: 0 auto 64px;
  text-align: center;
}
.section__header .eyebrow { margin: 0 auto 24px; }
.section__header .display-lg { margin-bottom: 20px; }

@media (max-width: 900px) {
  .section { padding: var(--section-py-m) 24px; }
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--outer);
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  color: var(--text-stage);
  border-bottom: none;
  transition: background 240ms ease, backdrop-filter 240ms ease,
              border-color 240ms ease;
}
/* Once the user scrolls past the hero top, dissolve in a frosted chrome that
   still reads as part of the stage rather than a separate bar. */
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg-stage) 72%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 70%, transparent);
}
.nav__mark {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.nav__mark-latin { font-size: 26px; line-height: 1; }
.nav__mark-ar    {
  font-family: var(--font-mark-ar);
  font-size: 24px;
  line-height: 1;
  color: var(--accent);
}
.nav__links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}
.nav__links a {
  text-decoration: none;
  text-underline-offset: 0.28em;
  text-decoration-thickness: 1px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}
.nav__links a:hover,
.nav__links a:focus-visible {
  color: var(--text-stage);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}
@media (max-width: 900px) {
  .nav { padding: 10px 24px; }
  .nav__links { display: none; }
}

/* ==========================================================================
   Buttons — shadcn-style (default + outline)
   --------------------------------------------------------------------------
   Keep the Nasaq palette, but use restrained shadcn-like geometry, motion,
   and ring focus states (no foil glints / ornamental bevels).
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  line-height: 1;
  min-height: 40px;
  height: auto;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}
.btn--sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn--primary {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 88%, #000 12%);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}
.btn--primary:hover {
  background: color-mix(in srgb, var(--accent) 92%, #000 8%);
  border-color: color-mix(in srgb, var(--accent) 82%, #000 18%);
}
.btn--primary:active {
  transform: scale(0.98);
}

.btn--neutral {
  color: var(--text-paper);
  background: color-mix(in srgb, var(--bg-paper) 95%, var(--text-paper) 5%);
  border-color: color-mix(in srgb, var(--text-paper) 16%, transparent);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}
.btn--neutral:hover {
  background: color-mix(in srgb, var(--bg-paper) 90%, var(--text-paper) 10%);
  border-color: color-mix(in srgb, var(--text-paper) 28%, transparent);
}
.btn--neutral:active {
  transform: scale(0.98);
}

.section--stage .btn--neutral {
  color: var(--text-stage);
  background: transparent;
  border-color: color-mix(in srgb, var(--text-stage) 24%, transparent);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.24);
}
.section--stage .btn--neutral:hover {
  background: color-mix(in srgb, var(--text-stage) 8%, transparent);
  border-color: color-mix(in srgb, var(--text-stage) 36%, transparent);
}
.section--stage .btn--neutral:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg-stage),
    0 0 0 4px color-mix(in srgb, var(--accent) 65%, #fff 35%);
}
.section--paper .btn:focus-visible {
  box-shadow:
    0 0 0 2px var(--bg-paper),
    0 0 0 4px color-mix(in srgb, var(--accent) 65%, #fff 35%);
}

/* ==========================================================================
   Pattern layers — Islamic geometric watermark
   --------------------------------------------------------------------------
   The pattern is introduced as texture, never decoration. It only appears on
   dark (bg-stage / accent) surfaces, tinted with a single color, always
   faded under a gradient mask so typography never competes with ornament.
   ========================================================================== */
.pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.pattern__tile {
  position: absolute;
  inset: -80px;
  background-color: var(--accent);
  -webkit-mask-image: url("patterns/geometric.svg");
          mask-image: url("patterns/geometric.svg");
  -webkit-mask-size: 520px 390px;
          mask-size: 520px 390px;
  -webkit-mask-repeat: repeat;
          mask-repeat: repeat;
  -webkit-mask-position: center;
          mask-position: center;
}

/* Hero — large-scale foiled motifs tiled across the stage, softly vignetted
   so the motif is strongest along the outer frame and fades behind the
   display headline. The restraint rule: pattern is frame, type is subject. */
.pattern--hero {
  opacity: 0.18;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 0%, transparent 25%, #000 85%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 0%, transparent 25%, #000 85%);
}
.pattern--hero .pattern__tile {
  -webkit-mask-size: 640px 480px;
          mask-size: 640px 480px;
}

/* Marquee — pattern-foil effect on the accent ribbon, drawn in accent-ink. */
.pattern--marquee { opacity: 0.28; }
.pattern--marquee .pattern__tile {
  background-color: var(--accent-ink);
  -webkit-mask-size: 240px 180px;
          mask-size: 240px 180px;
}

/* Livemark — large central ornament framing the NASAQ wordmark. */
.pattern--livemark {
  opacity: 0.16;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 0%, #000 25%, transparent 78%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 0%, #000 25%, transparent 78%);
}
.pattern--livemark .pattern__tile {
  -webkit-mask-size: 1100px auto;
          mask-size: 1100px auto;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: 50% 50%;
          mask-position: 50% 50%;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  background: var(--bg-stage);
  color: var(--text-stage);
  padding: 80px var(--outer) 40px;
  position: relative;
  overflow: hidden;
}
.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 0 40px;
  text-align: center;
}
.hero .signal-strip,
.hero .scroll-hint { position: relative; z-index: 1; }
.hero__inner .eyebrow { color: var(--text-muted); }
.hero .display-xl { margin: 8px auto 24px; max-width: 18ch; }
.hero .lede { margin: 0 auto 36px; color: var(--text-muted); text-align: center; }

.cta-pair {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.micro-attribution {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Signal strip */
.signal-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 72px auto 0;
  max-width: 1280px;
}
.signal { margin: 0; }
.signal__art {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 3/2;
  border: 1px solid var(--hairline);
  transition: transform 400ms ease-out;
}
.signal__art svg { width: 100%; height: 100%; }
.signal:hover .signal__art { transform: translateY(-6px); }

.signal__overlay {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
}
.signal__overlay--dark {
  background: var(--bg-surface);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.signal__cap {
  margin-top: 12px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.signal__cap em {
  font-family: var(--font-display);
  font-style: italic;
  font-feature-settings: "swsh" 1, "salt" 1;
  color: var(--text-stage);
}

.scroll-hint {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 56px;
}

@media (max-width: 900px) {
  .hero { padding: 32px 24px; }
  .signal-strip { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ==========================================================================
   Pill tabs + synced demo
   ========================================================================== */
.pill-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 6px;
  background: rgba(11,11,13,0.05);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  margin: 0 auto 40px;
}
.section--paper .pill-tabs { background: color-mix(in srgb, var(--bg-stage) 6%, transparent); border-color: color-mix(in srgb, var(--bg-stage) 10%, transparent); }

.pill-tabs button {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  transition: background 160ms ease-out, color 160ms ease-out;
}
.pill-tabs button[aria-selected="true"] {
  background: var(--bg-paper);
  color: var(--text-paper);
  border: 1px solid var(--accent);
}
.section--paper .pill-tabs button[aria-selected="true"] {
  background: var(--bg-paper);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.demo { text-align: center; }
.demo__stage {
  margin: 0 auto;
  max-width: 1200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-stage);
  border: 1px solid var(--hairline);
}
.demo__panel { display: none; }
.demo__panel.is-active { display: block; animation: crossfade 200ms ease-out; }
@keyframes crossfade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.demo__panel svg { width: 100%; height: auto; display: block; }
.demo__cap {
  padding: 20px 24px 28px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-stage);
  text-align: left;
}
.demo__cap em {
  font-family: var(--font-display);
  font-style: italic;
  font-feature-settings: "swsh" 1, "salt" 1;
  color: var(--text-stage);
}

/* ==========================================================================
   Fanned-stack feature row
   ========================================================================== */
.fan {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
}
.fan__stack {
  position: relative;
  height: 420px;
}
.fan__card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  height: 320px;
  transform-origin: bottom center;
  transition: transform 500ms cubic-bezier(.2,.8,.2,1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--bg-paper);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.5);
}
.fan__card svg { width: 100%; height: 100%; display: block; }
.fan__tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
}

.fan__card--1 { transform: translate(-50%,-50%) rotate(-14deg) translateX(-160px); }
.fan__card--2 { transform: translate(-50%,-50%) rotate(-7deg)  translateX(-80px);  }
.fan__card--3 { transform: translate(-50%,-50%) rotate(0deg);                      z-index: 3; }
.fan__card--4 { transform: translate(-50%,-50%) rotate(7deg)   translateX(80px);   }
.fan__card--5 { transform: translate(-50%,-50%) rotate(14deg)  translateX(160px);  }

.fan:hover .fan__card--1 { transform: translate(-50%,-50%) rotate(-18deg) translateX(-200px) translateY(-8px); }
.fan:hover .fan__card--2 { transform: translate(-50%,-50%) rotate(-9deg)  translateX(-100px) translateY(-8px); }
.fan:hover .fan__card--3 { transform: translate(-50%,-50%) rotate(0deg)   translateY(-12px); }
.fan:hover .fan__card--4 { transform: translate(-50%,-50%) rotate(9deg)   translateX(100px)  translateY(-8px); }
.fan:hover .fan__card--5 { transform: translate(-50%,-50%) rotate(18deg)  translateX(200px)  translateY(-8px); }

.fan__body { max-width: 480px; }
.fan__body .eyebrow { color: var(--text-muted); }
.fan__body .display-lg { margin: 8px 0 20px; color: var(--text-stage); }
.fan__body .lede { margin-bottom: 28px; }

@media (max-width: 1080px) {
  .fan { grid-template-columns: 1fr; gap: 40px; }
  .fan__stack { height: 360px; }
}

/* ==========================================================================
   Marquee
   ========================================================================== */
.marquee {
  position: relative;
  background: var(--accent);
  color: var(--accent-ink);
  overflow: hidden;
  padding: 18px 0;
  border-top: 1px solid var(--bg-stage);
  border-bottom: 1px solid var(--bg-stage);
}
.marquee__track {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 28px;
  white-space: nowrap;
  animation: marquee 40s linear infinite;
  padding-left: 28px;
}
.marquee__item,
.marquee__dot {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.marquee__dot { opacity: 0.5; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ==========================================================================
   Method — accordion + synced visual
   ========================================================================== */
.method {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}
.method__visual {
  margin: 0;
  position: sticky;
  top: 100px;
}
.method__visual svg {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  transition: transform 400ms ease-out;
}
.method__meta {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
}

.accordion { width: 100%; }
.accordion__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 28px 0;
  border-top: 1px solid color-mix(in srgb, var(--text-paper) 12%, transparent);
  text-align: left;
  transition: padding 200ms ease-out;
}
.accordion__row:last-child { border-bottom: 1px solid color-mix(in srgb, var(--text-paper) 12%, transparent); }

.accordion__index {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--text-muted);
  min-width: 40px;
}
.accordion__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2vw, 32px);
  letter-spacing: -0.005em;
  line-height: 1.1;
  color: var(--text-paper);
}
.accordion__glyph {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 22px;
  color: var(--text-muted);
  width: 32px;
  text-align: right;
}
.accordion__body {
  grid-column: 2 / 3;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 300ms ease-out, opacity 200ms ease-out, margin-top 200ms ease-out;
}
.accordion__row.is-open .accordion__body {
  max-height: 400px;
  opacity: 1;
  margin-top: 16px;
}
.accordion__body p {
  max-width: 58ch;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.accordion__body p.meta { color: var(--accent); }
.accordion__row.is-open .accordion__index { color: var(--accent); }

@media (max-width: 1000px) {
  .method { grid-template-columns: 1fr; gap: 40px; }
  .method__visual { position: static; }
}

/* ==========================================================================
   Product cards row
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
}
.card {
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 32px 32px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  transition: transform 400ms ease-out, border-color 200ms ease-out;
}
.card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
}
.card__head { display: flex; flex-direction: column; gap: 6px; }
.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -0.01em;
  color: var(--text-stage);
}
.card__sub {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.card__body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
  flex: 1;
}
.card__cta {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  padding-bottom: 20px;
}
.card__cta:hover { color: var(--accent-soft); }

.card__art {
  margin: 0 -32px -1px;
  border-top: 1px solid var(--hairline);
}
.card__art svg { width: 100%; height: auto; display: block; border-radius: 0; }

@media (max-width: 1000px) {
  .cards { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Live-Product-Metaphor Wordmark
   ========================================================================== */
.livemark {
  position: relative;
  background: var(--bg-stage);
  color: var(--text-stage);
  padding: clamp(80px, 12vw, 180px) var(--outer);
  overflow: hidden;
}
.livemark__svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
}

.livemark__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 320px;
  letter-spacing: -0.03em;
  fill: var(--text-stage);
}
.livemark__axis {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--text-muted);
}
.livemark__guide  { stroke: var(--accent); stroke-width: 1; opacity: 0.45; }
.livemark__guide--dim { opacity: 0.18; stroke-dasharray: 2 6; }

.livemark__selection {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.8;
}
.livemark__handle {
  stroke: var(--text-muted);
  stroke-width: 0.8;
  opacity: 0.6;
}
.livemark__anchor {
  fill: var(--bg-stage);
  stroke: var(--text-stage);
  stroke-width: 1.2;
}
.livemark__anchor--active { fill: var(--accent); stroke: var(--accent); }

.livemark__harakat { opacity: 0.92; }

.livemark__cursor-bg { fill: var(--accent); }
.livemark__cursor-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  fill: var(--accent-ink);
  letter-spacing: 0.02em;
}

.livemark__chip rect { fill: none; stroke: var(--accent); stroke-width: 1; }
.livemark__chip text {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--accent);
}

.livemark__overlay {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: -80px auto 0;
  text-align: center;
  padding: 0 24px;
}
.livemark__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--text-stage);
  margin-bottom: 20px;
}
.livemark__body {
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 auto 28px;
  max-width: 54ch;
}
.livemark__by {
  position: absolute;
  right: 24px;
  bottom: 16px;
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: clamp(14px, 1.2vw, 18px);
}
.livemark__by .emphasis { color: var(--text-stage); }
.livemark__by-ar { font-family: var(--font-mark-ar); color: var(--accent); }

/* Pulse animation on active anchor + cursor */
@keyframes livemark-pulse {
  0%, 100% { transform: translateY(0); }
  40%, 60% { transform: translateY(-6px); }
}
.livemark__edit .livemark__anchor--active,
.livemark__edit .livemark__cursor {
  transform-box: fill-box;
  transform-origin: center;
  animation: livemark-pulse 6s ease-in-out infinite;
}

@media (max-width: 900px) {
  .livemark { padding: 64px 24px; }
  .livemark__word { font-size: 160px; }
  .livemark__overlay { margin-top: -20px; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--bg-stage);
  color: var(--text-stage);
  padding: 80px var(--outer) 40px;
  border-top: 1px solid var(--hairline);
}
.footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto 64px;
}
.footer h4 {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.footer li { padding: 8px 0; }
.footer a {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-stage);
}
.footer a:hover { color: var(--accent); }
.footer .offsite { color: var(--text-muted); font-size: 11px; margin-left: 4px; }

.footer__base {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.footer__tag {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-stage);
}
.footer__tag .emphasis { color: var(--accent); }

@media (max-width: 900px) {
  .footer { padding: 48px 24px 32px; }
  .footer__cols { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .footer__base { flex-direction: column; gap: 12px; text-align: center; }
}

/* ==========================================================================
   Floating chip (persistent UI)
   ========================================================================== */
.floating-chip {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--btn-foil-rim) 65%, transparent);
  background:
    linear-gradient(180deg, var(--btn-foil-top) 0%, var(--btn-foil-mid) 50%, var(--btn-foil-depth) 100%);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 12px 32px -8px color-mix(in srgb, var(--accent) 50%, transparent);
  z-index: 40;
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 160ms ease;
}
.floating-chip:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16),
    0 16px 40px -10px color-mix(in srgb, var(--accent) 58%, transparent);
}
.floating-chip:active { transform: translateY(-1px); }
.floating-chip:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-soft) 70%, #fff 30%);
  outline-offset: 3px;
}

/* ==========================================================================
   Reduced motion kill switch
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .marquee__track { animation: none; }
  .livemark__edit * { animation: none !important; }
  .fan:hover .fan__card { transform: translate(-50%,-50%) rotate(var(--r, 0deg)); }
}
