/* ============================================================
   FINISIT — BASE & PRIMITIVES
   ============================================================ */

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

/* Remove tap highlight flash on iOS */
* { -webkit-tap-highlight-color: transparent; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent iOS font size bump on orientation change */
  text-size-adjust: none;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 700px at 80% -10%, rgba(212,184,135,0.06), transparent 70%),
    radial-gradient(900px 500px at -5% 40%, rgba(31,73,89,0.08), transparent 70%);
  overflow-x: hidden;
}

/* Film grain — subtle luxe texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/></svg>");
  mix-blend-mode: overlay;
}

::selection { background: var(--gold); color: var(--ink-void); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ivory);
  margin: 0;
  /* Reserve safe vertical space for descenders + italic slant — display
     fonts at clamp(3rem,…,var(--text-6xl)) clip the lower terminals
     of "y", "g", "p", "j" and italic letterforms when parent containers
     have overflow:hidden. 0.08em ≈ 8% of font size, just enough. */
  padding-bottom: 0.08em;
}
h1 { font-size: clamp(3rem, 7vw, var(--text-6xl)); font-weight: 300; letter-spacing: var(--tracking-tightest); }
h2 { font-size: clamp(2.25rem, 5vw, var(--text-4xl)); font-weight: 400; }
h3 { font-size: clamp(1.5rem, 2.5vw, var(--text-2xl)); font-weight: 500; }
h4 { font-size: var(--text-lg); font-weight: 500; }

/* ── Gradient-text safety: any heading using -webkit-background-clip:text
   needs extra leading because the bg-clip mask reveals only the glyph
   silhouette, so any line-box undercut shows up as visible truncation
   (italic descenders, "j", "g", "y", etc.). Combined with the parent
   overflow:hidden on hero blocks, the result is a clipped letter. */
[class*="hero__title"] em,
[class*="title"][style*="background-clip"],
.gradient-text {
  display: inline-block;
  padding-bottom: 0.12em;
  line-height: 1.1;
}

p { margin: 0 0 var(--sp-4); color: var(--ivory-soft); }

a { color: inherit; text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--accent); }

/* ---------- Focus-visible: keyboard navigation ring ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
/* Buttons and interactive elements get a slightly stronger ring */
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(212,184,135,0.18);
}

img, svg { display: block; max-width: 100%; height: auto; }

/* Ticker clearance — when #fin-ticker is fixed, push body content down */
body:has(#fin-ticker) {
  padding-top: var(--ticker-h);
}

hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
  margin: var(--sp-8) 0;
}

/* ---------- Utility: container ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}
.container-wide { max-width: var(--container-wide); }
.container-narrow { max-width: 880px; }

/* ---------- Utility: section ---------- */
.section {
  padding: var(--sp-10) 0;
  position: relative;
}
.section-sm { padding: var(--sp-8) 0; }

/* ---------- Eyebrow label ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--gold);
  opacity: 0.6;
}

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.95em 1.8em;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-luxe);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-gold);
  color: var(--ink-void);
  box-shadow: var(--shadow-gold);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(212,184,135,0.35);
  color: var(--ink-void);
}
.btn-ghost {
  background: transparent;
  color: var(--ivory);
  border-color: var(--border-gold);
}
.btn-ghost:hover {
  background: rgba(212,184,135,0.08);
  border-color: var(--gold);
  color: var(--ivory);
}
.btn-text {
  padding: 0.5em 0;
  background: transparent;
  color: var(--gold);
  border: none;
  border-bottom: 1px solid var(--border-gold);
  border-radius: 0;
}
.btn-text:hover { color: var(--gold-light); border-color: var(--gold); }

/* ---------- Divider ornament (shark-fin inspired) ---------- */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin: var(--sp-6) auto;
  color: var(--gold);
  opacity: 0.55;
}
.ornament::before, .ornament::after {
  content: '';
  height: 1px;
  width: 72px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.ornament::after { background: linear-gradient(90deg, var(--gold), transparent); }

/* ---------- Back-to-top button ---------- */
.back-to-top {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  width: 44px;
  height: 44px;
  background: var(--ink-charcoal);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-pill);
  color: var(--gold);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-lg);
}
.back-to-top.is-visible { display: inline-flex; }
.back-to-top:hover { background: var(--border-gold); color: var(--ink-void); transform: translateY(-2px); }

/* Sticky help / chat FAB — global */
.help-fab {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 950;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink-void);
  border: 0; cursor: pointer;
  box-shadow: 0 8px 24px rgba(212,184,135,0.35), 0 4px 8px rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.help-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(212,184,135,0.45), 0 6px 12px rgba(0,0,0,0.4); }
.help-fab:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.help-fab__menu {
  position: fixed;
  right: 18px; bottom: 80px;
  z-index: 950;
  width: 248px;
  background: var(--ink-charcoal, #171B24);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
  display: flex; flex-direction: column;
}
.help-fab__menu[hidden] { display: none; }
.help-fab__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ivory);
  border-radius: 8px;
  font-size: 13px;
  transition: background 0.1s;
}
.help-fab__item:hover { background: rgba(255,255,255,0.04); }
.help-fab__item-text { display: flex; flex-direction: column; line-height: 1.3; }
.help-fab__item-sub {
  color: var(--ivory-dim, #888); font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.04em;
}
.help-fab__icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--gold); }
@media (max-width: 600px) {
  .help-fab { width: 46px; height: 46px; right: 12px; bottom: 12px; }
  .help-fab__menu { right: 12px; bottom: 68px; width: calc(100vw - 24px); max-width: 280px; }
}
.cookie-banner ~ .help-fab { bottom: 88px; }
@media (max-width: 600px) { .cookie-banner ~ .help-fab { bottom: 80px; } }
