/* ============================================================
   Quotologies Landing — page-level styles
   Tokens live in assets/colors_and_type.css
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ql-bg);
  color: var(--ql-fg);
  font-family: var(--ql-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(900px 600px at 80% -10%, rgba(255,213,0,0.06), transparent 60%),
    radial-gradient(800px 800px at -10% 20%, rgba(255,165,0,0.04), transparent 60%),
    var(--ql-bg);
}

::selection { background: var(--ql-yellow); color: #0a0a0b; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,213,0,0.18); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,213,0,0.35); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ----- shared utilities ----- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ql-yellow);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--ql-yellow);
  opacity: 0.6;
}
.eyebrow.no-rule::before { display: none; }

.section-title {
  font-weight: 800;
  font-size: clamp(2rem, 4.6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 16px 0 0;
  color: var(--ql-fg);
  text-wrap: balance;
}
.section-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--ql-yellow);
  font-family: 'Cormorant Garamond', 'IBM Plex Sans', serif;
}

.lede {
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.65;
  color: var(--ql-gray-300);
  font-weight: 300;
  max-width: 56ch;
  text-wrap: pretty;
}

/* ----- buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--ql-radius);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform var(--ql-dur-base) var(--ql-ease),
              box-shadow var(--ql-dur-base) var(--ql-ease),
              background var(--ql-dur-base) var(--ql-ease),
              border-color var(--ql-dur-base) var(--ql-ease);
  position: relative;
  overflow: hidden;
}
.btn .arrow {
  transition: transform var(--ql-dur-base) var(--ql-ease);
}
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary {
  background: var(--ql-grad-cta);
  color: #1a1300;
  box-shadow: var(--ql-shadow-cta);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--ql-shadow-cta-hover);
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ql-ease);
}
.btn-primary:hover::before { transform: translateX(100%); }

.btn-ghost {
  background: rgba(255,255,255,0.03);
  color: var(--ql-fg);
  border-color: var(--ql-border-strong);
}
.btn-ghost:hover {
  background: rgba(255,213,0,0.06);
  border-color: rgba(255,213,74,0.4);
  transform: translateY(-2px);
}

.btn-pill {
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  background: rgba(255,255,255,0.04);
  color: var(--ql-fg);
  border: 1px solid var(--ql-border);
}
.btn-pill:hover {
  background: rgba(255,213,0,0.08);
  border-color: rgba(255,213,74,0.35);
  color: var(--ql-yellow);
}

/* ----- shared cards ----- */
.card {
  background: var(--ql-card);
  border: 1px solid var(--ql-border);
  border-radius: var(--ql-radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--ql-shadow-card);
  transition: transform var(--ql-dur-base) var(--ql-ease),
              background var(--ql-dur-base) var(--ql-ease),
              border-color var(--ql-dur-base) var(--ql-ease),
              box-shadow var(--ql-dur-base) var(--ql-ease);
}
.card:hover {
  transform: translateY(-2px);
  background: var(--ql-card-hover);
  box-shadow: var(--ql-shadow-card-hover);
}

/* ----- shared chips / pills ----- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--ql-border);
  background: rgba(255,255,255,0.03);
  color: var(--ql-gray-300);
}
.pill.live    { color: var(--ql-success); border-color: rgba(74,222,128,0.25); background: rgba(74,222,128,0.06); }
.pill.soon    { color: var(--ql-yellow); border-color: rgba(255,213,0,0.25); background: rgba(255,213,0,0.06); }
.pill.beta    { color: var(--ql-info); border-color: rgba(96,165,250,0.25); background: rgba(96,165,250,0.06); }
.pill.dot::before {
  content: "";
  width: 6px; height: 6px; border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulseDot 2.4s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.4); }
}

/* ----- animated background atmosphere ----- */
.atmosphere {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: breathe 6s ease-in-out infinite;
}
.orb.gold { background: radial-gradient(circle, rgba(255,213,0,0.45), transparent 70%); }
.orb.amber { background: radial-gradient(circle, rgba(255,165,0,0.35), transparent 70%); }
.orb.warm { background: radial-gradient(circle, rgba(255,213,102,0.30), transparent 70%); }

@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.12); }
}

.particle {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--ql-yellow-glow);
  border-radius: 999px;
  box-shadow: 0 0 6px rgba(255,217,102,0.8);
  animation: drift 9s ease-in-out infinite;
  opacity: 0.7;
}
@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0); opacity: 0.6; }
  50%  { transform: translate(20px, -30px) rotate(180deg); opacity: 1; }
  100% { transform: translate(0, 0) rotate(360deg); opacity: 0.6; }
}

/* ----- grain overlay ----- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.85 0 0 0 0 0.55 0 0 0 0.45 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ----- ticker / marquee ----- */
.ticker {
  display: flex;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.ticker-track {
  display: flex;
  gap: 64px;
  animation: tickerScroll 40s linear infinite;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 64px;
}
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ----- divider with quill ornament ----- */
.quill-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 0 auto;
  opacity: 0.6;
  color: var(--ql-yellow);
}
.quill-divider::before,
.quill-divider::after {
  content: "";
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
}

/* ----- reveal on scroll ----- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  will-change: opacity, transform;
  transition: opacity 0.85s var(--ql-ease-soft), transform 0.85s var(--ql-ease-soft);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ----- hero first-paint choreography ----- */
@keyframes heroFade {
  from { opacity: 0; transform: translateY(40px); filter: blur(8px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
@keyframes heroLineSweep {
  from { opacity: 0; transform: translateY(60px) skewY(2deg); }
  to   { opacity: 1; transform: translateY(0) skewY(0); }
}
@keyframes heroChipFade {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes heroGlow {
  from { text-shadow: 0 0 0 rgba(255,213,0,0); }
  to   { text-shadow: 0 0 60px rgba(255,213,0,0.4); }
}

.hero-anim-chip {
  animation: heroChipFade 0.8s var(--ql-ease-soft) both;
  animation-delay: 0.05s;
}
.hero-anim-eyebrow {
  animation: heroFade 0.9s var(--ql-ease-soft) both;
  animation-delay: 0.2s;
}
.hero-anim-line-1 {
  display: block;
  animation: heroLineSweep 1.1s var(--ql-ease-soft) both;
  animation-delay: 0.35s;
}
.hero-anim-line-2 {
  display: block;
  animation: heroLineSweep 1.1s var(--ql-ease-soft) both;
  animation-delay: 0.5s;
}
.hero-anim-line-3 {
  display: block;
  animation: heroLineSweep 1.1s var(--ql-ease-soft) both, heroGlow 1.5s var(--ql-ease-soft) both;
  animation-delay: 0.65s, 0.9s;
}
.hero-anim-lede {
  animation: heroFade 0.9s var(--ql-ease-soft) both;
  animation-delay: 0.95s;
}
.hero-anim-cta {
  animation: heroFade 0.9s var(--ql-ease-soft) both;
  animation-delay: 1.1s;
}
.hero-anim-ticker {
  animation: heroFade 1.1s var(--ql-ease-soft) both;
  animation-delay: 1.4s;
}

/* The faint quill watermark gets a slow rise */
@keyframes quillRise {
  from { opacity: 0; transform: translateY(40px) rotate(-3deg); }
  to   { opacity: 0.14; transform: translateY(0) rotate(0); }
}
.hero-anim-quill { animation: quillRise 1.6s var(--ql-ease-soft) both; animation-delay: 0.1s; }

/* ----- focus rings ----- */
:focus-visible {
  outline: 2px solid var(--ql-yellow);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   Arabic / RTL adjustments
   ============================================================= */
html[lang="ar"],
html.ql-ar,
html[dir="rtl"] {
  font-family: var(--ql-font-arabic);
}
html[lang="ar"] body,
html.ql-ar body,
html[dir="rtl"] body { font-family: var(--ql-font-arabic); }

/* Mono + Latin brand glyphs stay in Latin face even in AR */
html[dir="rtl"] .ql-mono,
html[dir="rtl"] [style*="var(--ql-font-mono)"] {
  font-family: var(--ql-font-mono);
}

/* The italic accent in headings — Cormorant Garamond has no Arabic.
   Fall back to IBM Plex Sans Arabic with a regular italic-style slant. */
html[dir="rtl"] .section-title em {
  font-family: var(--ql-font-arabic);
  font-style: normal;
  font-weight: 500;
}

/* The eyebrow rule line should sit on the right of the text in RTL */
html[dir="rtl"] .eyebrow::before { /* native flex flip handles position */ }

/* Mirror the arrow shift on hover for RTL — arrows visually move toward
   the inline-end of the button (which is the LEFT side in RTL). */
html[dir="rtl"] .btn:hover .arrow { transform: translateX(-3px); }
html[dir="rtl"] .btn .arrow { transform: scaleX(-1); }
html[dir="rtl"] .btn:hover .arrow { transform: scaleX(-1) translateX(-3px); }

/* Ticker — reverse direction so it scrolls right-to-left visually
   the same way (i.e. items keep entering from the side they read from). */
html[dir="rtl"] .ticker-track {
  animation-direction: reverse;
  padding-right: 0;
  padding-left: 64px;
}

/* Arabic ligatures shatter under aggressive Latin letter-spacing.
   Override the inline tight tracking we apply for Latin headings. */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] .section-title,
html[dir="rtl"] .hero-anim-line-1,
html[dir="rtl"] .hero-anim-line-2,
html[dir="rtl"] .hero-anim-line-3 {
  letter-spacing: normal !important;
}

/* Arabic has no italic — Latin code paints italic on accent words;
   render those upright with a weight bump so they still read as accents. */
html[dir="rtl"] em,
html[dir="rtl"] [style*="font-style: italic"],
html[dir="rtl"] [style*="font-style:italic"] {
  font-style: normal !important;
}

/* The big stat numerals get -0.05em tracking inline. Arabic-Indic digits
   don't need it and look detached when crushed. */
html[dir="rtl"] [style*="tabular-nums"] {
  letter-spacing: normal !important;
}

/* Hero h1 weight 200 looks like wire in Arabic — bump to 300 minimum. */
html[dir="rtl"] section#top h1 > span > span {
  font-weight: 400 !important;
}
html[dir="rtl"] section#top h1 > .hero-anim-line-2 > span {
  font-weight: 800 !important;
}
html[dir="rtl"] section#top h1 > .hero-anim-line-3 > span {
  font-weight: 900 !important;
}

/* ----- reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
