/* ============================================================
   AG8NTIFY — Design System
   Obsidian black · Singularity gold · Inter
   ============================================================ */


:root {
  /* — surfaces (brand: Obsidian / Carbon / Graphite) — */
  --bg:        #050505;
  --bg-2:      #101010;
  --bg-3:      #181818;
  --surface:   rgba(255, 255, 255, 0.022);
  --surface-2: rgba(255, 255, 255, 0.045);
  --line:      rgba(255, 255, 255, 0.085);
  --line-2:    rgba(255, 255, 255, 0.15);

  /* — ink (brand: White / Platinum / Titanium) — */
  --white:   #FFFFFF;
  --cream:   #F2F2F2;
  --muted:   #9ea1a6;
  --muted-2: #6c6f74;
  --faint:   #3e4044;

  /* — Singularity Gold — */
  --gold:        #D9A441;
  --gold-bright: #EFC677;
  --gold-deep:   #A67C2C;
  --gold-glow:   rgba(217, 164, 65, 0.38);

  /* — data accents — */
  --green:  #74D69B;
  --blue:   #7BA9FF;
  --violet: #B79CFF;
  --rose:   #F09590;

  /* — type (brand: Inter) — */
  --serif: 'Inter', system-ui, -apple-system, sans-serif;   /* display */
  --sans:  'Inter', system-ui, -apple-system, sans-serif;
  --mono:  'Geist Mono', ui-monospace, 'SF Mono', monospace;

  /* — layout — */
  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 16px;
  --radius-sm: 11px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: linear-gradient(180deg, #080706, var(--bg) 38%);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

/* — global ambient layers — */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.9; }

::selection { background: var(--gold); color: #1a1306; }

a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   TYPE SYSTEM
   ============================================================ */
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex; align-items: center; gap: 0.7em;
}
.eyebrow::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 10px var(--gold-glow);
}
.eyebrow.center { justify-content: center; }

.display {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.022em;
  color: var(--white);
  text-wrap: pretty;
}
h1.display { font-size: clamp(40px, 5.4vw, 80px); line-height: 1.04; font-weight: 700; letter-spacing: -0.03em; }
h2.display { font-size: clamp(31px, 4.4vw, 58px); font-weight: 700; letter-spacing: -0.025em; }
h3.display { font-size: clamp(24px, 3vw, 36px); font-weight: 700; }

.gold-ink { color: var(--gold); font-style: normal; }
em { font-style: italic; }

.lead {
  font-size: clamp(17px, 1.5vw, 21px);
  color: var(--muted);
  line-height: 1.65;
  max-width: 56ch;
  font-weight: 400;
  text-wrap: pretty;
}

.label {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); position: relative; z-index: 2; }
section { position: relative; z-index: 2; }
.section-pad { padding-block: clamp(90px, 13vh, 170px); }

.rule { height: 1px; background: var(--line); border: 0; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--sans); font-size: 14.5px; font-weight: 500;
  letter-spacing: 0.01em;
  padding: 14px 24px; border-radius: 100px;
  transition: transform 0.4s var(--ease), background 0.3s, color 0.3s, box-shadow 0.4s;
  white-space: nowrap; position: relative; overflow: hidden;
}
.btn .arr { transition: transform 0.4s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

.btn-primary {
  background: var(--cream); color: #14110a;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 14px 40px -16px rgba(217,164,65,0.55);
}
.btn-primary:hover { background: var(--gold-bright); transform: translateY(-2px); box-shadow: 0 20px 50px -16px rgba(217,164,65,0.7); }

.btn-ghost { background: var(--surface-2); color: var(--cream); border: 1px solid var(--line-2); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); transform: translateY(-2px); border-color: var(--gold-deep); }

.btn-lg { padding: 17px 30px; font-size: 15.5px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8,8,11,0.72); backdrop-filter: blur(18px) saturate(1.3);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 34px; width: auto; display: block; }
.footer .brand-logo { height: 40px; }
.nav-links { display: flex; gap: 30px; }
.nav-links a { font-size: 13.5px; color: var(--muted); transition: color 0.25s; position: relative; }
.nav-links a::after { content: ''; position: absolute; left: 0; bottom: -5px; height: 1px; width: 0; background: var(--gold); transition: width 0.3s var(--ease); }
.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: 16px; }

.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); z-index: 101; width: 0; box-shadow: 0 0 12px var(--gold-glow); }

@media (max-width: 880px) { .nav-links { display: none; } }

/* mobile: drop the CTA button and center the logo (desktop unchanged) */
@media (max-width: 700px) {
  .nav-inner { justify-content: center; }
  .nav-cta { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding-block: 132px 96px; overflow: hidden; }
.hero-scene {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: center center;
  --media-object-fit: cover; --media-object-position: center center;
  --controls: none; background: var(--bg);
  z-index: 1; pointer-events: none; opacity: var(--scene-op, 0.7);
  filter: brightness(var(--scene-bright, 1)) saturate(var(--scene-sat, 1));
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 75% at 50% 46%, rgba(5,5,5,var(--scrim-a, 0.5)), rgba(5,5,5,0) 60%);
}
.hero-inner { text-align: center; margin: 0 auto; max-width: 1320px; }
.eclipse {
  --sz: 60px; width: var(--sz); height: var(--sz); margin: 0 auto 26px; position: relative;
}
.eclipse .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 32px var(--gold-glow), inset 0 0 16px rgba(217,164,65,0.25);
}
.eclipse .core {
  position: absolute; inset: 22%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1a1813, #050505 75%);
  box-shadow: 0 0 30px 4px rgba(0,0,0,0.9);
}
.eclipse .flare { position: absolute; inset: -40%; border-radius: 50%; background: radial-gradient(circle, var(--gold-glow), transparent 60%); animation: pulse 4s var(--ease-io) infinite; }
@keyframes pulse { 0%,100% { opacity: 0.5; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1.08); } }

.hero h1 { margin: 26px auto 30px; line-height: 1.05; width: 100%; max-width: 100%; }
.hero h1 .nowrap { white-space: nowrap; }
h1.display { font-size: clamp(34px, 5vw, 72px); }
.hero .lead { margin: 0 auto 34px; text-align: center; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 22px; font-family: var(--mono); font-size: 12px; color: var(--muted-2); letter-spacing: 0.04em; }

/* floating stat chips */
.chip {
  position: absolute; z-index: 3;
  background: rgba(14,14,18,0.72); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px;
  width: 168px; box-shadow: 0 24px 50px -28px rgba(0,0,0,0.9);
}
.chip .cv { font-family: var(--serif); font-size: 27px; color: var(--gold); line-height: 1; }
.chip .ck { font-size: 12px; color: var(--white); margin-top: 5px; font-weight: 500; }
.chip .cd { font-size: 11px; color: var(--muted-2); margin-top: 2px; line-height: 1.35; }
.chip.c1 { top: 26%; left: 2%; }
.chip.c2 { top: 52%; left: 5%; }
.chip.c3 { top: 28%; right: 2%; }
.chip.c4 { top: 55%; right: 4%; }
@media (max-width: 1080px) { .chip { display: none; } }

/* mobile/tablet: let the headline wrap so the hero never overflows.
   The hero is a flex container, so without this the no-wrap first line
   sizes the whole block wider than the viewport and gets clipped. */
@media (max-width: 700px) {
  .hero h1 .nowrap { white-space: normal; }
  .hero-inner { width: 100%; min-width: 0; }
}

.scroll-cue { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 3; }
.scroll-cue .label { font-size: 10px; }
.scroll-cue .bar { width: 1px; height: 38px; background: linear-gradient(var(--gold), transparent); position: relative; overflow: hidden; }
.scroll-cue .bar::after { content:''; position:absolute; top:0; left:0; width:100%; height:40%; background: var(--gold-bright); animation: drop 2s var(--ease-io) infinite; }
@keyframes drop { 0% { transform: translateY(-100%); } 100% { transform: translateY(250%); } }

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee { border-block: 1px solid var(--line); padding-block: 22px; overflow: hidden; background: var(--bg-2); }
.marquee-head { text-align: center; margin-bottom: 18px; }
.marquee-track { display: flex; gap: 12px; width: max-content; animation: scroll-x 46s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll-x { to { transform: translateX(-50%); } }
.fn-chip {
  display: flex; flex-direction: column; gap: 3px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 18px; min-width: 220px; background: var(--surface);
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.fn-chip:hover { border-color: var(--gold-deep); background: var(--surface-2); transform: translateY(-3px); }
.fn-chip .tag { font-family: var(--mono); font-size: 10.5px; color: var(--gold-deep); letter-spacing: 0.08em; }
.fn-chip .nm { font-size: 14.5px; color: var(--white); font-weight: 500; }
.fn-chip .ds { font-size: 12px; color: var(--muted-2); }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.shead { max-width: 760px; }
.shead.center { margin-inline: auto; text-align: center; }
.shead .eyebrow { margin-bottom: 20px; }
.shead h2 { margin-bottom: 18px; }
/* "The Operating Layer Between / Strategy and Execution" must stay 2 lines */
#system .shead { max-width: 1040px; }
#system .shead h2.display { font-size: clamp(23px, 4.4vw, 58px); }

/* ============================================================
   GENERIC CARD
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; position: relative; overflow: hidden;
  transition: border-color 0.4s, background 0.4s, transform 0.4s;
}
.card:hover { border-color: var(--line-2); background: var(--surface-2); }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }
.reveal[data-d="5"] { transition-delay: 0.40s; }
.reveal[data-d="6"] { transition-delay: 0.48s; }
.reveal[data-d="7"] { transition-delay: 0.56s; }

/* ============================================================
   FX — text micro-interactions (char reveal, line reveal, glitch hover)
   Driven by keyframe animations (reliable on load) + a trigger class.
   .fx-* spans only exist when JS runs, so no-JS shows plain text.
   ============================================================ */

/* character reveal — hero headline assembles letter by letter */
.fx-char { display: inline-block; opacity: 0; will-change: opacity, transform; }
.fx-anim .fx-char { animation: fxCharIn 0.6s var(--ease) both; animation-delay: var(--cd, 0s); }
@keyframes fxCharIn { from { opacity: 0; transform: translateY(0.5em); } to { opacity: 1; transform: none; } }

/* line reveal — section intros rise line by line */
.fx-word { display: inline-block; opacity: 0; will-change: opacity, transform; }
.fx-in .fx-word { animation: fxWordIn 0.62s var(--ease) both; animation-delay: var(--ld, 0s); }
@keyframes fxWordIn { from { opacity: 0; transform: translateY(0.55em); } to { opacity: 1; transform: none; } }

/* failsafe — if the animation engine never advances (throttled tab, etc.),
   JS adds .fx-done after a timeout to force the text fully visible */
.fx-done .fx-char, .fx-done .fx-word { animation: none !important; opacity: 1 !important; transform: none !important; }

/* glitch hover — links flicker letter by letter on hover */
.fx-gchar { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  html.no-touch .fx-glitch:hover .fx-gchar {
    animation: fxGlitch 0.44s ease both;
    animation-delay: var(--gd, 0s);
  }
}
@keyframes fxGlitch {
  0%, 100% { opacity: 1; }
  25% { opacity: 0.2; }
  50% { opacity: 1; }
  68% { opacity: 0.42; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  .fx-char, .fx-word { opacity: 1 !important; transform: none !important; animation: none !important; }
  * { animation: none !important; }
  html { scroll-behavior: auto; }
}
