/* ===== DESIGN TOKENS ===== */
:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* Spacing (4px base) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'Inter', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;
}

/* ===== LIGHT MODE (Syncora Blue) ===== */
:root, [data-theme="light"] {
  --color-bg:             #f5f7fa;
  --color-surface:        #ffffff;
  --color-surface-2:      #f0f3f8;
  --color-surface-offset: #e8ecf3;
  --color-surface-dynamic: #dce2ed;
  --color-divider:        #d0d7e3;
  --color-border:         #c4cdd9;

  --color-text:           #0f1a2e;
  --color-text-muted:     #5a6a82;
  --color-text-faint:     #9aa7b8;
  --color-text-inverse:   #ffffff;

  /* Primary: Syncora Blue */
  --color-primary:        #1a56a8;
  --color-primary-hover:  #134080;
  --color-primary-active: #0e2e5c;
  --color-primary-light:  #e8f0fc;
  --color-primary-highlight: #c8daf2;

  /* Dark blue (hero bg) */
  --color-hero:           #0d2d5e;
  --color-hero-light:     #1a4a8a;

  /* Accent */
  --color-accent:         #2d8cf0;
  --color-accent-hover:   #1a7ae0;

  /* Semantic */
  --color-success:        #1d8348;
  --color-error:          #c0392b;

  --shadow-sm: 0 1px 3px rgba(15,26,46,0.06);
  --shadow-md: 0 4px 12px rgba(15,26,46,0.08);
  --shadow-lg: 0 12px 32px rgba(15,26,46,0.12);
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --color-bg:             #0a0f1a;
  --color-surface:        #111827;
  --color-surface-2:      #1a2236;
  --color-surface-offset: #151d2e;
  --color-surface-dynamic: #1e2a42;
  --color-divider:        #1e2a42;
  --color-border:         #2a3a56;

  --color-text:           #e2e8f0;
  --color-text-muted:     #8a9ab4;
  --color-text-faint:     #546380;
  --color-text-inverse:   #0a0f1a;

  --color-primary:        #4d8fde;
  --color-primary-hover:  #6aa4eb;
  --color-primary-active: #3a78c4;
  --color-primary-light:  #152340;
  --color-primary-highlight: #1e3058;

  --color-hero:           #060c1a;
  --color-hero-light:     #0d1f3f;

  --color-accent:         #5ca8f5;
  --color-accent-hover:   #7bbcf8;

  --color-success:        #2ecc71;
  --color-error:          #e74c3c;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #0a0f1a;
    --color-surface:        #111827;
    --color-surface-2:      #1a2236;
    --color-surface-offset: #151d2e;
    --color-surface-dynamic: #1e2a42;
    --color-divider:        #1e2a42;
    --color-border:         #2a3a56;
    --color-text:           #e2e8f0;
    --color-text-muted:     #8a9ab4;
    --color-text-faint:     #546380;
    --color-text-inverse:   #0a0f1a;
    --color-primary:        #4d8fde;
    --color-primary-hover:  #6aa4eb;
    --color-primary-active: #3a78c4;
    --color-primary-light:  #152340;
    --color-primary-highlight: #1e3058;
    --color-hero:           #060c1a;
    --color-hero-light:     #0d1f3f;
    --color-accent:         #5ca8f5;
    --color-accent-hover:   #7bbcf8;
    --color-success:        #2ecc71;
    --color-error:          #e74c3c;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  }
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 { font-family: var(--font-display); }
h1 { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: var(--text-lg); font-weight: 600; }

/* ===== LAYOUT ===== */
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--space-8); }
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-4) 0;
  transition: background 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}

.header.scrolled {
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.logo-hex {
  width: 40px;
  height: 40px;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}

.nav-links {
  display: none;
  list-style: none;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav-links a:hover {
  color: var(--color-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: color var(--transition-interactive), background var(--transition-interactive);
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}

.mobile-menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

@media (min-width: 768px) {
  .mobile-menu-btn { display: none; }
}

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  z-index: 99;
  padding: var(--space-24) var(--space-6) var(--space-6);
  flex-direction: column;
  gap: var(--space-6);
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0a1e47 0%, #1a4a8a 40%, #2563b0 70%, #1a56a8 100%);
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.hero-hexagons {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hex {
  position: absolute;
  opacity: 0.06;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(255,255,255,0.5);
}

.hex-1 { width: 180px; height: 208px; top: 5%; left: -3%; }
.hex-2 { width: 120px; height: 139px; top: 15%; right: 8%; }
.hex-3 { width: 90px; height: 104px; bottom: 20%; left: 12%; }
.hex-4 { width: 200px; height: 231px; bottom: -5%; right: -4%; }
.hex-5 { width: 70px; height: 81px; top: 40%; left: 30%; }
.hex-6 { width: 150px; height: 173px; top: -4%; left: 45%; }
.hex-7 { width: 100px; height: 116px; bottom: 10%; right: 25%; }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 980px;
  padding-top: var(--space-24);
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
  backdrop-filter: blur(8px);
}

.hero h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
}

.hero-description {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  margin-bottom: var(--space-8);
}

.hero-stats {
  display: flex;
  gap: var(--space-10);
  flex-wrap: wrap;
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255,255,255,0.12);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ===== SECTION SHARED ===== */
.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.section-label .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.section-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

.section-description {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-10);
}

/* ===== ABOUT / VALUE PROP ===== */
.about-section {
  background: var(--color-surface);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: start;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }
}

.about-text {
  max-width: 540px;
}

.about-text p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.7;
}

.about-pillars {
  display: grid;
  gap: var(--space-4);
}

.pillar {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
}

.pillar-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  color: var(--color-primary);
}

.pillar-content h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.pillar-content p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ===== ECOSYSTEM SECTION ===== */
.ecosystem-section {
  background: var(--color-surface);
}

.ecosystem-visual {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-top: var(--space-10);
}

@media (min-width: 768px) {
  .ecosystem-visual {
    grid-template-columns: repeat(3, 1fr);
  }
}

.eco-layer {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
  position: relative;
}

.eco-layer-number {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: oklch(from var(--color-primary) l c h / 0.08);
  line-height: 1;
  margin-bottom: var(--space-4);
}

.eco-layer-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.eco-layer-company {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.eco-layer-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

@media (min-width: 768px) {
  .eco-layer:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -18px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid var(--color-primary);
    opacity: 0.3;
    z-index: 2;
  }
}

/* ===== GLOBAL REACH ===== */
.reach-section {
  background: linear-gradient(135deg, var(--color-hero) 0%, var(--color-hero-light) 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.reach-section .section-label {
  color: rgba(255,255,255,0.6);
}

.reach-section .section-label .dot {
  background: rgba(255,255,255,0.6);
}

.reach-section .section-title {
  color: #ffffff;
}

.reach-section .section-description {
  color: rgba(255,255,255,0.65);
}

.reach-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .reach-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.reach-stat {
  text-align: center;
  padding: var(--space-6);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.08);
}

.reach-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.reach-stat-label {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===== VALUES ===== */
.values-section {
  background: var(--color-bg);
}

.values-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.value-card {
  padding: var(--space-8);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
}

.value-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  border-radius: var(--radius-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-5);
}

.value-card h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.value-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ===== CONTACT ===== */
.contact-section {
  background: var(--color-surface);
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
}

@media (min-width: 768px) {
  .contact-inner {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-info p {
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-6);
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.contact-detail svg {
  flex-shrink: 0;
  color: var(--color-primary);
}

.contact-detail a {
  color: var(--color-text);
  text-decoration: none;
}

.contact-detail a:hover {
  color: var(--color-primary);
}

.contact-subsidiary-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
}

.contact-subsidiary-links h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.sub-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background var(--transition-interactive), transform var(--transition-interactive);
}

.sub-link:hover {
  background: var(--color-primary-light);
  transform: translateX(2px);
}

.sub-link svg {
  color: var(--color-text-faint);
  transition: color var(--transition-interactive), transform var(--transition-interactive);
}

.sub-link:hover svg {
  color: var(--color-primary);
  transform: translateX(3px);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--color-bg);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--color-divider);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.footer-logo-hex {
  width: 28px;
  height: 28px;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
}

.footer-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: center;
}

@media (min-width: 768px) {
  .footer-right { align-items: flex-end; }
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer-attribution {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer-attribution a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-attribution a:hover {
  color: var(--color-primary);
}

/* ===== ANIMATIONS ===== */
.fade-in {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

/* Hero header scroll behavior */
.hero .logo-text,
.hero .nav-links a,
.hero .theme-toggle,
.hero .mobile-menu-btn {
  color: rgba(255,255,255,0.85);
}

.header:not(.scrolled) .logo-text {
  color: #ffffff;
}

.header:not(.scrolled) .nav-links a {
  color: rgba(255,255,255,0.7);
}

.header:not(.scrolled) .nav-links a:hover {
  color: #ffffff;
}

.header:not(.scrolled) .theme-toggle {
  color: rgba(255,255,255,0.7);
}

.header:not(.scrolled) .theme-toggle:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.1);
}

.header:not(.scrolled) .mobile-menu-btn {
  color: rgba(255,255,255,0.7);
}

/* Smooth number animation */
@property --num {
  syntax: '<integer>';
  initial-value: 0;
  inherits: false;
}

.count-up {
  animation: countUp 1.5s var(--ease-out) forwards;
  counter-reset: num var(--num);
}

@keyframes countUp {
  from { --num: 0; }
}
