/* ═══════════════════════════════════
   CONCIVIS — Design System v1.0
   Dark-Luxury Tech Aesthetic
   ═══════════════════════════════════ */

:root {
  --ink:        #0A1610;
  --paper:      #F5F3EE;
  --beige:      #EAE6DC;
  --beige-dark: #D4CFC3;
  --primary:    #005C35;
  --accent:     #00A367;
  --accent-bright: #00d480;
  --gold:       #C8962A;
  --muted:      rgba(10, 22, 16, 0.48);
  --muted-light: rgba(243, 245, 240, 0.5);

  --display: 'Space Grotesk', sans-serif;
  --body:    'Open Sans', sans-serif;
  --mono:    'JetBrains Mono', monospace;

  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Utilities ── */
.mono { font-family: var(--mono); }

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.tag.light { color: var(--muted-light); }

/* ═══════════════════════════════════
   NAV
   ═══════════════════════════════════ */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 56px;
  height: 72px;
  transition: background 0.5s, backdrop-filter 0.5s, border-color 0.5s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: rgba(10, 22, 16, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom-color: rgba(243, 245, 240, 0.06);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--paper);
}
.nav-wordmark {
  font-family: var(--body);
  font-size: 15px;
  letter-spacing: 0.18em;
  color: var(--paper);
}
.nav-wordmark span { font-weight: 300; }
.nav-wordmark strong { font-weight: 800; }
.nav-links { display: flex; gap: 40px; }
.nav-links a {
  font-size: 14px;
  font-weight: 400;
  color: rgba(243, 245, 240, 0.65);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}
.nav-links a:hover { color: var(--paper); }
.nav-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--accent);
  padding: 10px 24px;
  border-radius: 100px;
  text-decoration: none;
  transition: background 0.2s, transform 0.25s var(--ease-out);
  letter-spacing: 0.01em;
}
.nav-cta:hover { background: var(--accent-bright); transform: translateY(-1px); }

/* ═══════════════════════════════════
   HERO
   ═══════════════════════════════════ */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 720px;
  background: var(--ink);
  display: flex;
  align-items: center;
  overflow: hidden;
}
#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-grid-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(rgba(0, 163, 103, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 163, 103, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 3;
  padding: 0 80px;
  max-width: 860px;
}
.hero-tag {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 36px;
}
.hero-h1 {
  font-family: var(--display);
  font-size: clamp(52px, 7.5vw, 100px);
  font-weight: 700;
  line-height: 0.97;
  color: var(--paper);
  margin-bottom: 36px;
  letter-spacing: -0.03em;
}
.hero-h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 50%, #5ddfaa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 300;
  color: rgba(243, 245, 240, 0.65);
  max-width: 500px;
  line-height: 1.75;
  margin-bottom: 52px;
}
.hero-actions { display: flex; gap: 20px; align-items: center; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: var(--accent);
  padding: 16px 34px;
  border-radius: 100px;
  text-decoration: none;
  transition: background 0.2s, transform 0.25s var(--ease-out), box-shadow 0.25s;
  letter-spacing: 0.01em;
}
.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 163, 103, 0.35);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 400;
  color: rgba(243, 245, 240, 0.65);
  text-decoration: none;
  border-bottom: 1px solid rgba(243, 245, 240, 0.18);
  padding-bottom: 3px;
  transition: color 0.2s, border-color 0.2s;
}
.btn-ghost:hover { color: var(--paper); border-color: rgba(243, 245, 240, 0.6); }
.hero-scroll {
  position: absolute;
  bottom: 52px; left: 80px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.scroll-line {
  width: 1px; height: 64px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2.4s ease-in-out infinite;
}
.hero-scroll span {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(243, 245, 240, 0.35);
  writing-mode: vertical-rl;
  text-transform: uppercase;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(0.55); transform-origin: top; }
}

/* ═══════════════════════════════════
   TICKER
   ═══════════════════════════════════ */
.ticker-wrap {
  background: var(--primary);
  overflow: hidden;
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 36px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: rgba(243, 245, 240, 0.75);
  white-space: nowrap;
  animation: ticker 28s linear infinite;
}
.ticker-track .dot { color: var(--accent); font-size: 8px; }
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ═══════════════════════════════════
   SERVICES
   ═══════════════════════════════════ */
#services { padding: 128px 80px; background: var(--paper); }

.section-intro { margin-bottom: 64px; }
.section-intro h2 {
  font-family: var(--display);
  font-size: clamp(40px, 5vw, 68px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}
.section-lead {
  font-size: 18px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.7;
  max-width: 520px;
}

/* Bento */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.bento-card {
  background: var(--beige);
  border-radius: var(--r-xl);
  padding: 44px 40px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s;
}
.bento-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 28px 56px rgba(10, 22, 16, 0.1);
}
.card-ai     { grid-column: span 7; background: var(--ink); color: var(--paper); min-height: 380px; border: 1px solid rgba(0,163,103,0.12); }
.card-infra  { grid-column: span 5; }
.card-sap    { grid-column: span 4; }
.card-research { grid-column: span 4; background: var(--primary); color: var(--paper); }
.card-strategy { grid-column: span 4; }

.card-tag {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.45;
  margin-bottom: 20px;
}
.bento-card h3 {
  font-family: var(--display);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.bento-card p {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.72;
  opacity: 0.68;
  max-width: 340px;
}
.card-glow {
  position: absolute;
  top: -80px; right: -80px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(0,163,103,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.card-icon {
  position: absolute;
  bottom: 36px; right: 36px;
  width: 72px; height: 72px;
  color: var(--accent);
  opacity: 0.55;
}

/* ═══════════════════════════════════
   NUMBERS / D3
   ═══════════════════════════════════ */
#numbers { background: var(--ink); padding: 128px 80px; }
.numbers-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.numbers-h2 {
  font-family: var(--display);
  font-size: clamp(36px, 4.5vw, 60px);
  font-weight: 700;
  color: var(--paper);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 64px;
}
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; }
.stat-row { display: flex; align-items: baseline; gap: 4px; line-height: 1; }
.stat-n {
  font-size: clamp(52px, 5.5vw, 76px);
  font-weight: 400;
  color: var(--accent);
}
.stat-plus { font-size: 40px; color: var(--accent); }
.stat-label {
  display: block;
  font-size: 13px;
  font-weight: 300;
  color: rgba(243, 245, 240, 0.4);
  margin-top: 10px;
  letter-spacing: 0.06em;
  font-family: var(--body);
}
#d3-container { width: 100%; aspect-ratio: 1; }
#d3-graph { width: 100%; height: 100%; }

/* ═══════════════════════════════════
   APPROACH
   ═══════════════════════════════════ */
#approach { padding: 128px 80px; background: var(--beige); }
.approach-header { margin-bottom: 80px; }
.approach-h2 {
  font-family: var(--display);
  font-size: clamp(44px, 5.5vw, 76px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.steps { display: flex; align-items: stretch; gap: 0; }
.step {
  flex: 1;
  padding: 48px 40px;
  background: var(--paper);
  border-radius: var(--r-xl);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s;
}
.step:hover { transform: translateY(-6px); box-shadow: 0 24px 48px rgba(10,22,16,0.1); }
.step-line {
  width: 40px; height: 1px;
  background: var(--beige-dark);
  align-self: center; flex-shrink: 0;
}
.step-num {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 24px;
}
.step h3 {
  font-family: var(--display);
  font-size: 22px; font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.step p { font-size: 15px; font-weight: 300; line-height: 1.72; color: var(--muted); }

/* ═══════════════════════════════════
   RESEARCH
   ═══════════════════════════════════ */
#research { padding: 128px 80px; background: var(--paper); }
.research-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.research-text h2 {
  font-family: var(--display);
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}
.research-text p {
  font-size: 17px; font-weight: 300;
  color: var(--muted); line-height: 1.75;
  margin-bottom: 40px; max-width: 420px;
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  font-size: 15px; font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 4px;
  transition: color 0.2s, border-color 0.2s;
}
.btn-outline:hover { color: var(--accent); border-color: var(--accent); }
.research-topics { display: flex; flex-direction: column; gap: 12px; }
.topic {
  display: flex;
  gap: 20px;
  padding: 24px 28px;
  background: var(--beige);
  border-radius: var(--r-md);
  transition: background 0.25s, transform 0.3s var(--ease-out);
  align-items: flex-start;
}
.topic:hover { background: var(--beige-dark); transform: translateX(6px); }
.topic-num {
  font-size: 10px; font-weight: 500;
  color: var(--accent); letter-spacing: 0.12em;
  flex-shrink: 0; padding-top: 2px;
}
.topic h4 { font-family: var(--display); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.topic p { font-size: 13px; font-weight: 300; color: var(--muted); line-height: 1.6; }

/* ═══════════════════════════════════
   CONTACT
   ═══════════════════════════════════ */
#contact { background: var(--ink); padding: 128px 80px; text-align: center; }
.contact-inner { max-width: 720px; margin: 0 auto; }
.contact-h2 {
  font-family: var(--display);
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 700;
  color: var(--paper);
  line-height: 1.0;
  letter-spacing: -0.04em;
  margin-bottom: 28px;
}
.contact-sub {
  font-size: 18px; font-weight: 300;
  color: rgba(243, 245, 240, 0.55);
  line-height: 1.7; margin-bottom: 52px;
}
.contact-email {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 163, 103, 0.3);
  padding-bottom: 6px;
  margin-bottom: 44px;
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: -0.01em;
}
.contact-email:hover { color: var(--accent-bright); border-color: var(--accent-bright); }
.contact-meta {
  display: flex; justify-content: center; align-items: center;
  gap: 14px; font-size: 12px;
  color: rgba(243, 245, 240, 0.28);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.contact-meta .sep { opacity: 0.4; }

/* ═══════════════════════════════════
   FOOTER
   ═══════════════════════════════════ */
footer {
  background: var(--ink);
  border-top: 1px solid rgba(243, 245, 240, 0.07);
  padding: 44px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-logo { display: flex; align-items: center; gap: 14px; color: var(--paper); }
.footer-wordmark { font-family: var(--body); font-size: 14px; letter-spacing: 0.18em; color: var(--paper); }
.footer-wordmark span { font-weight: 300; }
.footer-wordmark strong { font-weight: 800; }
.footer-links { display: flex; gap: 32px; }
.footer-links a {
  font-size: 13px; font-weight: 300;
  color: rgba(243, 245, 240, 0.4);
  text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: var(--paper); }
.footer-legal { font-size: 11px; color: rgba(243, 245, 240, 0.2); letter-spacing: 0.06em; }

/* ═══════════════════════════════════
   GLOBAL — Touch & Smooth Scroll
   ═══════════════════════════════════ */
a, button { touch-action: manipulation; }
html { scroll-behavior: smooth; }

/* ═══════════════════════════════════
   HAMBURGER BUTTON
   ═══════════════════════════════════ */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: -8px;
  order: 3;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--paper);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s;
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ═══════════════════════════════════
   RESPONSIVE — Tablet 1100px
   ═══════════════════════════════════ */
@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(6, 1fr); }
  .card-ai { grid-column: span 6; }
  .card-infra { grid-column: span 6; }
  .card-sap, .card-research, .card-strategy { grid-column: span 2; }
}

/* ═══════════════════════════════════
   RESPONSIVE — Mobile 768px
   ═══════════════════════════════════ */
@media (max-width: 768px) {
  /* Nav */
  #nav { padding: 0 20px; }
  .nav-cta { display: none; }
  .nav-hamburger { display: flex; }

  .nav-links {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: rgba(10, 22, 16, 0.97);
    backdrop-filter: blur(24px) saturate(180%);
    padding: 24px 20px 32px;
    gap: 4px;
    border-bottom: 1px solid rgba(243, 245, 240, 0.08);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease-out), opacity 0.25s;
    z-index: 99;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links a {
    font-size: 18px;
    font-weight: 300;
    padding: 14px 0;
    border-bottom: 1px solid rgba(243, 245, 240, 0.07);
    color: rgba(243, 245, 240, 0.8);
  }
  .nav-links a:last-child { border-bottom: none; }

  /* Hero */
  .hero-inner { padding: 0 24px; max-width: 100%; }
  .hero-h1 { font-size: clamp(36px, 10vw, 52px); }
  .hero-sub { max-width: 100%; font-size: 15px; }
  .hero-scroll { display: none; }
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 14px; }
  .btn-primary, .btn-ghost { font-size: 14px; }

  /* Ticker */
  .ticker-track { font-size: 9px; gap: 20px; }

  /* Services */
  #services { padding: 72px 20px; }
  .section-intro { margin-bottom: 40px; }
  .bento { grid-template-columns: 1fr; gap: 12px; }
  .card-ai, .card-infra, .card-sap, .card-research, .card-strategy { grid-column: span 1; }
  .card-ai { min-height: 300px; }
  .bento-card { padding: 32px 28px; border-radius: var(--r-lg); }

  /* Numbers */
  #numbers { padding: 72px 20px; }
  .numbers-inner { grid-template-columns: 1fr; gap: 48px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 32px; }
  #d3-container { max-width: 100%; aspect-ratio: 1 / 1; }
  .stat-n { font-size: clamp(40px, 10vw, 60px); }

  /* Approach */
  #approach { padding: 72px 20px; }
  .steps { flex-direction: column; gap: 0; }
  .step { border-radius: var(--r-lg); }
  .step-line { width: 1px; height: 28px; align-self: center; }

  /* Research */
  #research { padding: 72px 20px; }
  .research-inner { grid-template-columns: 1fr; gap: 48px; }

  /* Contact */
  #contact { padding: 80px 20px; }
  .contact-h2 { font-size: clamp(36px, 8vw, 56px); }
  .contact-email { font-size: clamp(18px, 5vw, 26px); }

  /* Footer */
  footer { flex-direction: column; gap: 24px; text-align: center; padding: 40px 20px; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 20px; }
}

/* ═══════════════════════════════════
   RESPONSIVE — Small 375px
   ═══════════════════════════════════ */
@media (max-width: 420px) {
  .hero-h1 { font-size: clamp(32px, 9vw, 44px); line-height: 1.02; }
  .bento-card { padding: 24px 20px; }
  .step { padding: 32px 24px; }
  .stats { gap: 24px; }
}
