/* Datafence — landing page styles */

/* Self-hosted fonts (latin, variable). No external CDN — keeps CSP at 'self'. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("fonts/space-grotesk-latin.woff2") format("woff2");
}

:root {
  /* color */
  --bg: #0A0E14;
  --surface: #111823;
  --border: #1E2A3A;
  --border-strong: #2C3E54;
  --text: #E8EDF4;
  --muted: #93A1B5;
  --faint: #5E6E83;
  --accent: #3DD8C4;
  --accent-hover: #5BE8D6;
  --accent-deep: #0E5C55;

  /* spacing */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-12: 6rem;
  --space-16: 8rem;

  /* type */
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --section-pad: clamp(4rem, 10vw, 8rem);
  --container: 1120px;
  --radius: 12px;
}

/* reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 4vw, 2rem);
}
.section { padding-block: var(--section-pad); }

/* skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* typography helpers */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.eyebrow.accent { color: var(--accent); }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text);
}

.lead {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.5;
  color: var(--muted);
}
.measure { max-width: 60ch; }
.measure-center { max-width: 60ch; margin-inline: auto; }

.small { font-size: 0.875rem; line-height: 1.5; color: var(--muted); }

.card-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--text);
}

.section-head { display: flex; flex-direction: column; gap: var(--space-3); }
.section-head.center { text-align: center; align-items: center; }
.section-head + .card-grid,
.section-head + .pillars,
.section-head + .split { margin-top: var(--space-6); }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease, color 150ms ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 24px -6px var(--accent);
}
.btn-primary:active { transform: translateY(0); }
.btn-lg { padding: 0.9rem 2rem; font-size: 1.0625rem; }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 0.75rem 0.25rem;
}
.btn-ghost .arrow { transition: transform 150ms ease; }
.btn-ghost:hover .arrow { transform: translateX(4px); }
.btn-ghost {
  position: relative;
}
.btn-ghost::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  bottom: 0.5rem;
  height: 1px;
  width: 0;
  background: var(--accent-hover);
  transition: width 150ms ease;
}
.btn-ghost:hover::after { width: calc(100% - 1.75rem); }

/* focus */
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* body links */
main p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
main p a:hover { color: var(--accent-hover); }

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 200ms ease, border-color 200ms ease, backdrop-filter 200ms ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.header-nav { display: flex; align-items: center; gap: var(--space-3); }
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 150ms ease;
}
.nav-link:hover { color: var(--text); }

/* hero */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding-block: clamp(5rem, 12vw, 9rem);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 120%);
  height: 600px;
  background: radial-gradient(closest-side, rgba(61, 216, 196, 0.16), rgba(14, 92, 85, 0.06) 55%, transparent 75%);
  animation: glow-breathe 8s ease-in-out infinite;
}
.hero-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 760px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 22ch;
}
.hero-sub { max-width: 60ch; }
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* hero perimeter draw-in */
.hero-field .draw {
  stroke-dasharray: 4000;
  stroke-dashoffset: 4000;
  animation: draw-in 1.2s ease-out forwards;
}

/* card grid (problem) */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color 150ms ease;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 150ms ease;
}
.card:hover { border-color: var(--border-strong); }
.card:hover::before { transform: scaleX(1); }
.card p { color: var(--muted); font-size: 1.0625rem; }

.icon { color: var(--accent); flex-shrink: 0; }

/* vision band */
.band {
  position: relative;
  background: rgba(17, 24, 35, 0.4);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
}
.split-prose { display: flex; flex-direction: column; gap: var(--space-3); max-width: 60ch; }
.split-prose p { color: var(--muted); }
.split-figure { display: flex; justify-content: center; }
.ringfence { width: 100%; max-width: 440px; height: auto; }

/* pillars */
.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
.pillar {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  transition: border-color 150ms ease;
}
.pillar:hover { border-color: var(--border-strong); }
.pillar .icon { margin-top: 0.15rem; }
.pillar-body { display: flex; flex-direction: column; gap: var(--space-1); }
.pillar-body p { color: var(--muted); }

/* contact */
.contact-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 3.5rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  overflow: hidden;
}
.contact-glow {
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(closest-side, rgba(61, 216, 196, 0.12), transparent 70%);
  pointer-events: none;
  animation: glow-breathe 8s ease-in-out infinite;
}
.contact-panel > * { position: relative; z-index: 1; }
.contact-panel .section-title { max-width: 24ch; }
.contact-panel .btn { margin-top: var(--space-2); }
.contact-sub { color: var(--faint); }

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding-block: var(--space-6);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: flex-start;
}
.footer-left { display: flex; flex-direction: column; gap: 0.35rem; }
.footer-desc { color: var(--muted); }
.footer-copy { color: var(--faint); }
.footer-email {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 0.875rem;
}
.footer-email:hover { color: var(--accent-hover); }

/* reveal animation (JS-driven, safe without JS) */
.reveal {
  opacity: 1;
  transform: none;
}
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.js .reveal.in-view {
  opacity: 1;
  transform: none;
}

/* keyframes */
@keyframes draw-in {
  to { stroke-dashoffset: 0; }
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* breakpoints */
@media (min-width: 768px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: row; align-items: center; }
}
@media (min-width: 1024px) {
  .split { grid-template-columns: 1fr 1fr; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero-field .draw { stroke-dashoffset: 0; }
  .js .reveal { opacity: 1; transform: none; }
}
