/* Crawler-only fallback content, visible to bots, offscreen for users.
   React replaces #root's children on hydration, so this rule becomes a
   no-op once the app mounts. */
.crawler-only {
  position: absolute;
  left: -10000px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ─── Grafynt Design Tokens ────────────────────────────────── */
:root {
  /* Deep cinematic backdrop with navy undertone */
  --bg:         #0a0c14;
  --bg-2:       #0f111b;
  --surface:    #13151f;
  --surface-2:  #181b27;
  --surface-3:  #1f2230;

  --border:     #23252e;
  --border-2:   #2c2f3a;
  --border-3:   #383b48;

  /* Brand */
  --navy:        #141852;        /* signature deep navy */
  --navy-lift:   #2b32a8;        /* legible-on-dark navy */
  --navy-glow:   #4f57c4;        /* highlight on dark */
  --navy-mist:   rgba(79,87,196,0.14);
  --red:         #ff0a0a;        /* signature red */
  --red-soft:    rgba(255,10,10,0.12);

  /* Text */
  --fg:          #f5f5f7;
  --fg-mute:     #b9bcc7;
  --fg-dim:      #7a7d8c;
  --fg-faint:    #4d505e;
  --white:       #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { background: var(--bg); color: var(--fg); }
body {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--red); color: var(--white); }

/* Type utilities */
.g-mono   { font-family: 'Geist Mono', monospace; }
.g-serif  { font-family: 'Instrument Serif', serif; }
.g-sans   { font-family: 'Outfit', sans-serif; }

/* Animations */
@keyframes fadeUp { from {opacity:0; transform:translateY(20px);} to {opacity:1; transform:translateY(0);} }
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }
@keyframes slideIn { from {opacity:0; transform:translateX(-10px);} to {opacity:1; transform:translateX(0);} }
@keyframes ticker { 0% {transform:translateX(0);} 100% {transform:translateX(-50%);} }
@keyframes redPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,10,10,0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(255,10,10,0); }
}
@keyframes float-a {
  0%,100% { transform: translate(0,0); }
  50%     { transform: translate(0,-6px); }
}
@keyframes float-b {
  0%,100% { transform: translate(0,0); }
  50%     { transform: translate(0,8px); }
}
@keyframes float-c {
  0%,100% { transform: translate(0,0); }
  50%     { transform: translate(-4px,-4px); }
}
@keyframes glowPulse {
  0%,100% { opacity: 0.6; }
  50%     { opacity: 1; }
}

/* Page wrapper */
.shell { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.shell-wide { max-width: 1440px; margin: 0 auto; padding: 0 32px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px; font-weight: 500; letter-spacing: 0.4px;
  cursor: pointer; transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-primary:hover {
  background: #e60909;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -10px rgba(255,10,10,0.6);
}
.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--fg);
  border-color: rgba(255,255,255,0.14);
  backdrop-filter: blur(12px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.24); }

.btn-nav {
  padding: 9px 20px;
  background: var(--red);
  color: var(--white);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.4px;
}
.btn-nav:hover { background: #e60909; }

/* Section tag */
.section-tag {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  font-family: 'Geist Mono', monospace;
  font-size: 10px; letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.section-tag::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); flex-shrink: 0;
  animation: redPulse 2.4s infinite;
}

/* Red dot */
.red-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); vertical-align: baseline;
}

/* Capability chip (floats around hero portrait) */
.chip {
  position: absolute;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px 9px 12px;
  background: rgba(15,17,27,0.72);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px; font-weight: 400;
  color: var(--fg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  letter-spacing: 0.2px;
  white-space: nowrap;
  z-index: 4;
}
.chip::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px rgba(255,10,10,0.7);
}

/* Hero portrait container */
.hero-portrait-wrap {
  position: relative;
  width: 100%;
  max-width: 1120px;
  margin: 40px auto 0;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  overflow: visible;
  background: transparent;
}
.hero-portrait-wrap::after {
  /* Gentle bottom fade only, grounds the robot into the page
     without re-introducing a boxed panel look */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
      rgba(10,12,20,0.0) 72%,
      rgba(10,12,20,0.55) 100%);
  pointer-events: none;
  z-index: 2;
}

.hero-portrait-slot {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  filter: drop-shadow(0 20px 50px rgba(0,0,0,0.55));
  user-select: none;
  -webkit-user-drag: none;
}

/* Ticker */
.ticker {
  overflow: hidden;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.ticker-track {
  display: flex; gap: 56px; white-space: nowrap;
  animation: ticker 38s linear infinite;
  width: max-content;
}
.ticker-item {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px; letter-spacing: 4px;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.ticker-item::after {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--red);
}

/* Inputs */
.input {
  width: 100%;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--fg);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.input:focus { border-color: var(--navy-glow); }
.input::placeholder { color: var(--fg-faint); }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  transition: all 0.3s ease;
}
.card:hover { border-color: var(--border-3); background: var(--surface-2); }

/* Big wordmark footer */
.wordmark-giant {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: clamp(80px, 22vw, 360px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.10);
  user-select: none;
}

/* Hide scrollbar but keep functional */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ─── Hero breathing background ─────────────────────────────── */
@keyframes auroraDrift {
  0%   { transform: translate3d(-3%, -2%, 0) scale(1.05); opacity: 0.55; }
  50%  { transform: translate3d(3%, 2%, 0)  scale(1.12); opacity: 0.9; }
  100% { transform: translate3d(-3%, -2%, 0) scale(1.05); opacity: 0.55; }
}
@keyframes auroraDrift2 {
  0%   { transform: translate3d(2%, 3%, 0) scale(1.0);  opacity: 0.4; }
  50%  { transform: translate3d(-2%, -3%, 0) scale(1.1); opacity: 0.7; }
  100% { transform: translate3d(2%, 3%, 0) scale(1.0);  opacity: 0.4; }
}
.hero-aurora {
  position: absolute; inset: -10%;
  pointer-events: none; z-index: 0;
}
.hero-aurora::before, .hero-aurora::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  filter: blur(60px);
}
.hero-aurora::before {
  background: radial-gradient(ellipse 50% 45% at 38% 42%, rgba(79,87,196,0.28) 0%, transparent 62%);
  animation: auroraDrift 16s ease-in-out infinite;
}
.hero-aurora::after {
  background: radial-gradient(ellipse 45% 40% at 64% 56%, rgba(255,10,10,0.12) 0%, transparent 60%);
  animation: auroraDrift2 20s ease-in-out infinite;
}
/* faint drifting star/particle field */
.hero-particles {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(rgba(255,255,255,0.30) 1px, transparent 1px),
    radial-gradient(rgba(79,87,196,0.28) 1px, transparent 1px);
  background-size: 64px 64px, 112px 112px;
  background-position: 0 0, 30px 40px;
  opacity: 0.35;
  animation: particleFloat 60s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 0%, transparent 75%);
}
@keyframes particleFloat {
  from { background-position: 0 0, 30px 40px; }
  to   { background-position: 0 -640px, 30px -600px; }
}

/* Scroll cue */
.scroll-cue {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--fg-faint);
}
.scroll-cue .g-mono { font-size: 9px; letter-spacing: 2.6px; text-transform: uppercase; }
.scroll-cue svg { animation: scrollBob 1.8s ease-in-out infinite; }
@keyframes scrollBob {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50%      { transform: translateY(7px); opacity: 1; }
}

/* Red glow behind robot */
.hero-portrait-wrap::before {
  content: ''; position: absolute; z-index: 0;
  left: 50%; bottom: 4%; transform: translateX(-50%);
  width: 62%; height: 46%;
  background: radial-gradient(ellipse at center, rgba(255,10,10,0.20) 0%, rgba(255,10,10,0.06) 40%, transparent 72%);
  filter: blur(26px);
  pointer-events: none;
  animation: glowPulse 5s ease-in-out infinite;
}

/* ─── Why Grafynt, frosted glass background ────────────────── */
.why-section { position: relative; overflow: hidden; }
.why-bg-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; z-index: 0; opacity: 0.9;
}
.why-frost {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(10,12,20,0.74) 0%, rgba(10,12,20,0.80) 55%, rgba(10,12,20,0.88) 100%);
  backdrop-filter: blur(7px) saturate(1.08);
  -webkit-backdrop-filter: blur(7px) saturate(1.08);
}
.why-section > .shell { position: relative; z-index: 2; }

/* ─── Services "What we build", frosted grid background ───── */
.build-section { position: relative; overflow: hidden; }
.build-bg-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center bottom; z-index: 0; opacity: 0.9;
}
.build-frost {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg,
    rgba(10,12,20,0.86) 0%,
    rgba(10,12,20,0.78) 42%,
    rgba(10,12,20,0.70) 72%,
    rgba(10,12,20,0.82) 100%);
  backdrop-filter: blur(7px) saturate(1.08);
  -webkit-backdrop-filter: blur(7px) saturate(1.08);
}
.build-section > section { position: relative; z-index: 2; }

/* ─── FAQ section, frosted glass background ───────────────── */
.faq-section { position: relative; overflow: hidden; }
.faq-bg-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; z-index: 0; opacity: 0.9;
}
.faq-frost {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(10,12,20,0.74) 0%, rgba(10,12,20,0.80) 55%, rgba(10,12,20,0.88) 100%);
  backdrop-filter: blur(7px) saturate(1.08);
  -webkit-backdrop-filter: blur(7px) saturate(1.08);
}
.faq-section > .shell { position: relative; z-index: 2; }

/* ─── Red contrast marquee strip ───────────────────────────── */
.marquee-strip {
  background: var(--red);
  overflow: hidden;
  padding: 13px 0;
  border-top: 1px solid rgba(0,0,0,0.18);
  border-bottom: 1px solid rgba(0,0,0,0.18);
}
.marquee-track {
  display: flex; align-items: center; gap: 0; white-space: nowrap;
  animation: ticker 24s linear infinite;
  width: max-content;
}
.marquee-item {
  display: inline-flex; align-items: center; gap: 28px;
  font-family: 'Geist Mono', monospace;
  font-size: 12px; letter-spacing: 3.5px; font-weight: 500;
  color: #fff; text-transform: uppercase; padding-right: 28px;
}
.marquee-item::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
}

/* ─── Service cards: hover lift + red glow ─────────────────── */
.svc-card { transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; }
.svc-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255,10,10,0.42);
  box-shadow: 0 24px 60px -24px rgba(255,10,10,0.40);
}
.svc-card .svc-img { transition: transform 0.7s cubic-bezier(0.2,0.7,0.2,1); }
.svc-card:hover .svc-img { transform: scale(1.06); }
.svc-metric {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--fg-dim); display: flex; align-items: center; gap: 8px;
}
.svc-metric::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--red); flex-shrink: 0;
}

/* ─── Process: giant step numbers + timeline ───────────────── */
.proc-num {
  position: absolute; top: 6px; right: 14px;
  font-family: 'Outfit', sans-serif; font-weight: 800;
  font-size: 92px; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.07);
  pointer-events: none; user-select: none; z-index: 0;
}
.proc-cell > * { position: relative; z-index: 1; }
.proc-timeline {
  position: relative; height: 2px; width: 100%;
  background: var(--border-2); margin-bottom: 0;
}
.proc-timeline::before {
  content: ''; position: absolute; left: 0; top: 0; height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--red) 0%, rgba(255,10,10,0.15) 100%);
  transform-origin: left;
}
.proc-node {
  position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%;
  background: var(--red); transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(255,10,10,0.12);
}

/* ─── Case study (replaces fake testimonials) ──────────────── */
.case-card {
  position: relative; overflow: hidden;
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface);
}
.case-metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.case-metric {
  padding: 24px 22px;
  border-right: 1px solid var(--border);
}
.case-metric:last-child { border-right: none; }
@media (max-width: 760px) {
  .case-metric-grid { grid-template-columns: 1fr 1fr; }
  .case-metric:nth-child(2) { border-right: none; }
  .case-metric:nth-child(1), .case-metric:nth-child(2) { border-bottom: 1px solid var(--border); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-aurora::before, .hero-aurora::after,
  .hero-particles, .scroll-cue svg,
  .hero-portrait-wrap::before,
  .marquee-track, .ticker-track { animation: none !important; }
  body::after { display: none; }
}

/* ─── Invoice print ─────────────────────────────────────────
   In the printable preview state, strip all site chrome and
   show only the white invoice paper. */
@media print {
  nav, footer, .no-print { display: none !important; }
  html, body { background: #ffffff !important; }
  .gf-inv-preview-wrap { padding: 0 !important; }
  .gf-inv-preview-wrap .shell { max-width: none !important; padding: 0 !important; }
  .invoice-paper {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }
  @page { margin: 1.5cm; }
}

/* Responsive */
@media (max-width: 900px) {
  .gf-hide-md { display: none !important; }
}
@media (max-width: 640px) {
  .shell, .shell-wide { padding: 0 20px; }
  .chip { font-size: 10px; padding: 6px 12px 6px 10px; }
}

/* iOS Safari zooms in when focusing inputs with font-size < 16px.
   Keep the visual size on desktop, bump to 16px on touch devices. */
@media (max-width: 820px) {
  .input { font-size: 16px; }
}

/* ─── Grain texture overlay ─────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
