/* ============================================
   TVYAL.COM — DESIGN SYSTEM v3
   Pure black. GHEA Mariam serif titles.
   Noto Sans body. Attio tight grid.
   ============================================ */

/* ============================================
   0. FONTS — self-hosted
   Files in website_v4/fonts/ :
     GHEAMariamReg.otf
     GHEAMariamBld.otf
     GHEAMariamRIt.otf
     GHEAMariamBlit.otf
     NotoSansArmenian-Regular.ttf
     NotoSansArmenian-Medium.ttf
     NotoSansArmenian-SemiBold.ttf
     NotoSansArmenian-Bold.ttf
     arnamu_mono.ttf
   ============================================ */

/* GHEA Mariam — display serif (headings only) */
@font-face {
  font-family: 'GHEAMariam';
  src: url('../fonts/GHEAMariamReg.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'GHEAMariam';
  src: url('../fonts/GHEAMariamBld.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'GHEAMariam';
  src: url('../fonts/GHEAMariamRIt.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'GHEAMariam';
  src: url('../fonts/GHEAMariamBlit.otf') format('opentype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Noto Sans Armenian — self-hosted (HY script) */
@font-face {
  font-family: 'NotoSansArm';
  src: url('../fonts/NotoSansArmenian-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'NotoSansArm';
  src: url('../fonts/NotoSansArmenian-Medium.ttf') format('truetype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'NotoSansArm';
  src: url('../fonts/NotoSansArmenian-SemiBold.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'NotoSansArm';
  src: url('../fonts/NotoSansArmenian-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* Arian AMU Mono — trilingual monospace */
@font-face {
  font-family: 'ArianAMUMono';
  src: url('../fonts/arnamu_mono.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ============================================
   1. CSS CUSTOM PROPERTIES
   ============================================ */

:root {
  /* ── Brand palette (from tvyal newsletter) ── */
  --brand-navy:    #003f5c;
  --brand-blue:    #2f4b7c;
  --brand-purple:  #665191;
  --brand-violet:  #a05195;
  --brand-coral:   #d45087;
  --brand-pink:    #f95d6a;
  --brand-orange:  #ff7c43;
  --brand-gold:    #ffa600;
  --brand-cream:   #fffcf5;

  /* ── Dark mode tokens (default = pure black) ── */
  --bg:              #000000;
  --bg-secondary:    #0a0a0a;
  --surface:         #111111;
  --surface-elevated:#161616;
  --border:          rgba(255,124,67,0.12);
  --border-subtle:   rgba(255,255,255,0.06);

  --text-primary:    #fffcf5;
  --text-secondary:  rgba(255,252,245,0.55);
  --text-tertiary:   rgba(255,252,245,0.25);

  --accent:          #ff7c43;
  --accent-hover:    #f95d6a;
  --accent-subtle:   rgba(255,124,67,0.08);

  /* ── Typography ── */
  --font-serif: 'GHEAMariam', 'Georgia', serif;
  --font-sans:  'NotoSansArm', 'Noto Sans', system-ui, sans-serif;
  --font-mono:  'ArianAMUMono', 'Courier New', monospace;

  /* ── Scale ── */
  --text-xs:   12px;  /* was 11px — too small/thin in dark mode */
  --text-sm:   14px;  /* was 13px */
  --text-base: 15px;
  --text-lg:   17px;
  --text-xl:   22px;
  --text-2xl:  28px;
  --text-3xl:  36px;
  --text-4xl:  48px;
  --text-5xl:  64px;
  --text-hero: clamp(3.2rem, 6vw, 6.5rem);

  --weight-normal:   400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  --leading-tight:  1.05;
  --leading-snug:   1.2;
  --leading-normal: 1.6;
  --leading-loose:  1.85;

  /* ── Spacing ── */
  --space-1:  4px;  --space-2:  8px;   --space-3:  12px;
  --space-4:  16px; --space-5:  24px;  --space-6:  32px;
  --space-7:  48px; --space-8:  64px;  --space-9:  96px;
  --space-10: 128px;

  /* Legacy spacing aliases */
  --space-xs: 0.5rem; --space-sm: 1rem;
  --space-md: 2rem;   --space-lg: 4rem; --space-xl: 6rem;

  /* ── Layout ── */
  --container-max:       1200px;
  --container-max-width: 1200px;
  --container-pad:       clamp(24px, 5vw, 80px);
  --container-padding:   clamp(24px, 5vw, 80px);

  /* ── Radius ── */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-pill: 999px;

  /* ── Legacy aliases (backward compat with existing JS) ── */
  --color-main:       #003f5c;
  --color-main-rgb:   0, 63, 92;
  --color-second:     #ff7c43;
  --color-second-n2:  #f95d6a;
  --color-dark:       #000000;
  --color-light:      #fffcf5;
  --color-gray:       #1a1a1a;
  --transition-speed: 300ms;

  /* Legacy theme aliases */
  --heading-color:      var(--text-primary);
  --text-color:         var(--text-secondary);
  --card-bg-color:      var(--surface);
  --body-bg-color:      var(--bg);
  --border-color:       var(--border);
  --link-color:         var(--accent);
  --link-hover-color:   var(--accent-hover);
  --hero-overlay-color: rgba(0,0,0,0.35);
}

/* ── Light mode (warm off-white Attio) ── */
body:not(.dark-mode),
body.light-mode {
  --bg:              #f8f7f4;
  --bg-secondary:    #f0ede8;
  --surface:         #ffffff;
  --surface-elevated:#faf9f7;
  --border:          #e2ddd6;
  --border-subtle:   #ede9e3;

  --text-primary:    #1a1a1a;
  --text-secondary:  #5a5a5a;
  --text-tertiary:   #9a9a9a;

  --accent-subtle:   rgba(255,124,67,0.08);

  --heading-color:      var(--text-primary);
  --text-color:         var(--text-secondary);
  --card-bg-color:      var(--surface);
  --body-bg-color:      var(--bg);
  --border-color:       var(--border);
  --hero-overlay-color: rgba(0,0,0,0.45);
}

/* ── Explicit dark-mode class (set by global-ui.js) ── */
body.dark-mode {
  --bg:              #000000;
  --bg-secondary:    #0a0a0a;
  --surface:         #111111;
  --surface-elevated:#161616;
  --border:          rgba(255,124,67,0.12);
  --border-subtle:   rgba(255,255,255,0.06);
  --text-primary:    #fffcf5;
  --text-secondary:  rgba(255,252,245,0.55);
  --text-tertiary:   rgba(255,252,245,0.25);
  --accent-subtle:   rgba(255,124,67,0.1);
  --heading-color:      #fffcf5;
  --text-color:         rgba(255,252,245,0.55);
  --card-bg-color:      #111111;
  --body-bg-color:      #000000;
  --border-color:       rgba(255,124,67,0.12);
  --hero-overlay-color: rgba(0,0,0,0.35);
}

/* ============================================
   2. GLOBAL RESETS & BASE
   ============================================ */

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

html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overflow-x: hidden;
  scroll-padding-top: 56px;
}

body {
  background-color: var(--bg);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  overflow-x: hidden;
  transition: background-color var(--transition-speed) ease,
              color var(--transition-speed) ease;
  padding-top: 56px;
  padding-bottom: 0;
}

/* Serif for all headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  transition: color var(--transition-speed) ease;
}

h1 { font-weight: 700; margin-bottom: var(--space-5); }
h2 { font-weight: 700; margin-bottom: var(--space-5); }
h3 { font-weight: 700; margin-bottom: var(--space-4); }

p {
  font-family: var(--font-sans);
  line-height: var(--leading-loose);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}
a:hover { color: var(--accent-hover); }

/* ============================================
   3. SNAP SCROLLING
   ============================================ */

.snap-section {
  min-height: 100vh;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--container-pad); /* 64px not 96px */
}

.section-container {
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
}

/* Thin orange-tinted border between sections */
.snap-section + .snap-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--container-pad);
  right: var(--container-pad);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border) 15%,
    var(--border) 85%,
    transparent
  );
}

@media (max-width: 768px) {
  html { scroll-snap-type: none; }
  .snap-section {
    min-height: auto;
    padding: var(--space-8) var(--space-5);
  }
}

/* ============================================
   4. SECTION HEADER PATTERN (Armenian Stone)
   e.g. "01 — What We Do ────────"
   ============================================ */

.section-eyebrow {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  margin-bottom: var(--space-5); /* was --space-7, tighter */
}

.section-number {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;  /* was no weight set — readable on dark bg */
  letter-spacing: 0.3em;
  color: var(--accent);
  opacity: 0.9;      /* was 0.8 */
  white-space: nowrap;
}

.section-eyebrow h1,
.section-eyebrow h2 {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  line-height: var(--leading-snug);
  margin-bottom: 0;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: var(--space-4);
  align-self: center;
}

/* ============================================
   5. TOP NAV
   ============================================ */

#top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 0; /* children control their own spacing */
  padding: 0 var(--container-pad);
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-speed) ease,
              border-color var(--transition-speed) ease;
}

body:not(.dark-mode) #top-nav,
body.light-mode #top-nav {
  background: rgba(248,247,244,0.88);
  border-bottom-color: var(--border);
}

#top-nav .nav-logo {
  height: 26px;
  display: block;
  flex-shrink: 0;
  margin-right: var(--space-5); /* gap between logo and nav links */
  transition: opacity 200ms ease, filter 300ms ease;
}
#top-nav .nav-logo:hover { opacity: 0.7; }

/* Nav links — sit immediately after logo on the LEFT */
#top-nav .nav-links {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}

/* Spacer — pushes controls cluster to far right */
#top-nav .nav-spacer {
  flex: 1;
}

/* Controls cluster — theme toggle + lang, far right */
#top-nav .nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

#top-nav .nav-links a {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;  /* was 500 — boost for dark bg readability */
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: color 200ms ease;
  text-decoration: none;
}
#top-nav .nav-links a:hover { color: var(--accent); }
#top-nav .nav-links a.active { color: var(--text-secondary); }

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
  opacity: 0.8;
  flex-shrink: 0;
}

/* ── Theme toggle ── */
#theme-toggle {
  width: 52px;
  height: 26px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: all var(--transition-speed) ease;
}
#theme-toggle .slider {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  left: 3px;
  transition: transform var(--transition-speed) ease;
  z-index: 0;
}
#theme-toggle.active .slider { transform: translateX(26px); }

.theme-label {
  width: 50%;
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  z-index: 1;
  line-height: 26px;
  transition: opacity 0.3s ease;
  user-select: none;
}
#theme-toggle .theme-label:first-child  { opacity: 1; }
#theme-toggle .theme-label:last-child   { opacity: 0.3; }
#theme-toggle.active .theme-label:first-child { opacity: 0.3; }
#theme-toggle.active .theme-label:last-child  { opacity: 1; }

/* ── Language selector ── */
#lang-selector {
  display: flex;
  height: 26px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  flex-shrink: 0;
}

.lang-option {
  padding: 0 9px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 200ms ease;
  line-height: 24px;
  user-select: none;
}
.lang-option:not(:last-child) { border-right: 1px solid var(--border-subtle); }
.lang-option.active { background: var(--accent); color: #fff; }
.lang-option:hover:not(.active) { color: var(--accent); }

/* Legacy bubble elements — hidden (controls moved to nav) */
#theme-bubble, #language-bubble { display: none; }
#ui-controls-footer { display: none; }

@media (max-width: 640px) {
  .nav-divider { display: none; }
  #top-nav .nav-links a { padding: 4px 6px; font-size: 10px; }
}

/* ============================================
   6. BUTTONS
   ============================================ */

/* Ghost / secondary */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 28px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid rgba(255,252,245,0.25);
  color: var(--text-primary);
  background: transparent;
  cursor: pointer;
  transition: all 200ms ease;
  text-decoration: none;
}
.btn-primary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

body:not(.dark-mode) .btn-primary,
body.light-mode .btn-primary {
  border-color: rgba(0,0,0,0.2);
  color: var(--text-primary);
}
body:not(.dark-mode) .btn-primary:hover,
body.light-mode .btn-primary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 28px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  background: transparent;
  cursor: pointer;
  transition: all 200ms ease;
  text-decoration: none;
}
.btn-secondary:hover { color: var(--accent); border-color: var(--accent); }

/* Primary CTA — orange fill */
.demo-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 28px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--accent);
  color: #000;
  border: none;
  cursor: pointer;
  transition: all 200ms ease;
  text-decoration: none;
}
.demo-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-icon { font-size: 1em; }

/* ============================================
   7. HERO
   ============================================ */

#hero {
  min-height: 75vh;   /* tight — FX section visible below */
  height: 75vh;
  /* no scroll-snap-align — free scroll entry so FX peeks naturally */
  position: relative;
  overflow: visible;
  background: var(--bg);
  padding: 0;
  display: block;
}

/* Subtle orange grid */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,124,67,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,124,67,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Radial glow behind logo column */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 55% 70% at 72% 50%,
    rgba(0,63,92,0.35) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* Factory animation (untouched) */
#factory-animation-container {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  overflow: hidden;
  opacity: 0.15; /* subdued — logo column is the hero now */
}

#factory-conveyor-belt {
  position: absolute;
  bottom: 45%; left: 0;
  width: 100%; height: 60px;
  background-size: 120px 60px;
  background-repeat: repeat-x;
  animation: conveyorMove 8s linear infinite;
  opacity: 0.3;
}
@keyframes conveyorMove {
  0%   { background-position: 0 0; }
  100% { background-position: 120px 0; }
}
#factory-black-box {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 200px; height: auto; z-index: 3; opacity: 0.8;
}
#factory-black-base-box,
#factory-black-shine-box,
#factory-shine-box {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 180px; height: 180px; z-index: 2;
}
.factory-item {
  position: absolute; top: 45%;
  transform: translateY(-50%);
  width: 100px; height: auto; z-index: 4; opacity: 0;
}
#factory-rubbish { left: -200px; }
#factory-gold { left: 50%; transform: translate(-50%, -50%); }

/* Two-column hero layout */
.hero-overlay {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 75vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 var(--container-pad);
  max-width: calc(var(--container-max) + var(--container-pad) * 2);
  margin: 0 auto;
}

/* Left column — text */
.hero-content {
  padding-right: var(--space-8);
  animation: heroFadeUp 0.9s ease both;
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Eyebrow line — "Yerevan, Armenia · Data Analytics" */
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4); /* was --space-6 */
  display: flex;
  align-items: center;
  gap: var(--space-4);
  animation: heroFadeUp 0.9s 0.1s ease both;
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 2.5rem;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

.hero-content h1 {
  font-family: var(--font-serif);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-4); /* was --space-6 */
  animation: heroFadeUp 0.9s 0.2s ease both;
}

.hero-content h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-content h2 {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  line-height: var(--leading-loose);
  margin-bottom: var(--space-5); /* was --space-7 */
  max-width: 30rem;
  animation: heroFadeUp 0.9s 0.3s ease both;
}

.hero-buttons {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  animation: heroFadeUp 0.9s 0.4s ease both;
}

/* Right column — animated logo */
.hero-logo-col {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  animation: heroFadeUp 1s 0.25s ease both;
}

.hero-logo-wrapper {
  position: relative;
  width: clamp(280px, 38vw, 440px);
  height: clamp(280px, 38vw, 440px);
}


/* Static logo — white in dark mode, unchanged (native blue SVG) in light mode */
.hero-logo-static {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 48px rgba(255,124,67,0.15));
  transition: opacity 0.5s ease, filter 0.4s ease;
}
body.dark-mode .hero-logo-static {
  filter: brightness(0) invert(1) drop-shadow(0 0 48px rgba(255,124,67,0.15));
}

/* Animated SVG injected by hero-logo.js — color set inline by JS */
#hero-logo-wrapper svg.hero-anim-svg {
  /* styles set inline by JS */
}
#hero-logo-wrapper.mutating .hero-logo-static { opacity: 0; }

/* Scroll indicator — removed, FX section visible by bleed instead */
.hero-scroll-hint { display: none; }


/* Geo coords decoration */
.hero-coords {
  position: absolute;
  bottom: var(--space-7);
  right: var(--container-pad);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-tertiary);
  text-align: right;
  z-index: 11;
  line-height: 1.8;
}

@media (max-width: 900px) {
  /* Hero: let it grow to fit stacked logo + content — no fixed height */
  #hero {
    height: auto;
    min-height: 100svh; /* svh = small viewport height (excludes mobile browser chrome) */
  }

  .hero-overlay {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100svh;
    padding-top: var(--space-9);
    padding-bottom: var(--space-8);
    align-items: center;
  }
  .hero-content {
    padding-right: 0;
    text-align: center;
    order: 2;
  }
  .hero-eyebrow { justify-content: center; }
  .hero-content h2 { margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; }
  .hero-logo-col { order: 1; margin-bottom: var(--space-7); }
  .hero-logo-wrapper { width: clamp(200px, 60vw, 320px); height: clamp(200px, 60vw, 320px); }
  .hero-coords { display: none; }
}

/* ============================================
   8. FX PREVIEW
   ============================================ */

#fx-preview {
  background: var(--bg-secondary);
  min-height: auto; /* not full-screen — it's a peek section */
  padding: var(--space-7) var(--container-pad); /* tight */
  position: relative;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

#fx-preview::before {
  content: '';
  position: absolute; top: 0;
  left: var(--container-pad); right: var(--container-pad);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 15%, var(--border) 85%, transparent);
}

.fx-section-container {
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
}

.fx-currency-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.fx-tab {
  padding: 5px 14px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 200ms ease;
}
.fx-tab.active { background: transparent; border-color: var(--accent); color: var(--accent); }
.fx-tab:hover:not(.active) { color: var(--text-secondary); border-color: var(--border-subtle); }

.fx-stats-row {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.fx-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
  flex: 1;
  min-width: 130px;
}

.fx-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}
.fx-stat-value {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.fx-stat-change {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  margin-top: var(--space-2);
  font-weight: 500;
}
.fx-stat-change.up   { color: #4ade80; }
.fx-stat-change.down { color: var(--accent-hover); }

.fx-chart-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-5);
  position: relative;
  height: 520px;
}
.fx-chart-wrapper canvas { width: 100% !important; height: 100% !important; }

.fx-coming-soon {
  position: absolute;
  bottom: var(--space-4); right: var(--space-5);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.fx-coming-soon::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: fxPulse 2s ease-in-out infinite;
}
@keyframes fxPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.fx-timeframe-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  justify-content: flex-end;
}

.fx-time-btn {
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 200ms ease;
}
.fx-time-btn.active { color: var(--text-secondary); border-color: rgba(255,252,245,0.2); }

/* ============================================
   9. WHAT WE DO
   ============================================ */

#what-we-do { background: var(--bg); }

/* Tight grid with orange-tinted dividers (Armenian stone style) */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: var(--space-5);
}

.service-card {
  background: var(--bg);
  padding: var(--space-7) var(--space-6); /* was clamp(--space-7, 5vw, --space-9) */
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

/* Orange top-line reveal on hover */
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.service-card:hover::before { transform: scaleX(1); }
.service-card:hover { background: rgba(0,63,92,0.15); }

.service-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.service-tag::before {
  content: '';
  display: block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.service-card h3 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: var(--leading-snug);
  margin-bottom: var(--space-4);
}

.service-card p {
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
  color: var(--text-secondary);
  margin: 0;
}

/* Keep .card for backward compat */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-6);
  transition: all 200ms ease;
}
.card:hover { border-color: rgba(255,252,245,0.15); }
.card h3 { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.card .emoji { font-size: 1.5rem; }

.three-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-5);
}

@media (max-width: 768px) {
  .services-grid { grid-template-columns: 1fr; }
  .three-card-grid { grid-template-columns: 1fr; }
}

/* ============================================
   10. RESEARCH / CHART
   ============================================ */

#research { background: var(--bg-secondary); }

.two-column-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-8);
  margin-top: var(--space-5);
  align-items: start;
}
@media (max-width: 1024px) {
  .two-column-layout { grid-template-columns: 1fr; gap: var(--space-6); }
}

.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-6);
}

#chart-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

#indicator-selector { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.indicator-btn,
.chart-toggle-btn {
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 200ms ease;
}
.indicator-btn:hover,
.chart-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.indicator-btn.active,
.chart-toggle-btn.active { background: var(--accent); border-color: var(--accent); color: #000; }

.chart-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 360px;
}
.chart-padding-layer {
  position: relative;
  width: 100%; height: 100%;
  padding: var(--space-4);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
}
#research-chart { width: 100% !important; height: 100% !important; }

.caption {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-top: var(--space-4);
}

.text-column { display: flex; flex-direction: column; gap: var(--space-4); }

.research-cta-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

@media (max-width: 768px) {
  .chart-canvas-wrapper { height: 260px; }
  #indicator-selector { flex-direction: column; }
  .indicator-btn, .chart-toggle-btn { width: 100%; }
}

/* ============================================
   11. CASE STUDIES
   ============================================ */

#case-studies { background: var(--bg); }

.case-study-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.case-study-card {
  border: 1px solid rgba(255,252,245,0.07);
  padding: var(--space-8) var(--space-7);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.case-study-card:hover { border-color: rgba(255,124,67,0.4); }

/* Large ghost index number */
.case-study-card::after {
  content: attr(data-index);
  position: absolute;
  top: -1rem; right: var(--space-6);
  font-family: var(--font-serif);
  font-size: 8rem;
  font-weight: 900;
  color: rgba(255,124,67,0.04);
  line-height: 1;
  pointer-events: none;
}

.case-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-hover);
  margin-bottom: var(--space-5);
}

.case-study-card h3 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.case-study-card p {
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
  margin-bottom: var(--space-6);
}

.case-metric {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.case-metric-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: var(--space-2);
  margin-bottom: var(--space-6);
}

.case-icon { font-size: 2rem; margin-bottom: var(--space-4); }

@media (max-width: 768px) { .case-study-grid { grid-template-columns: 1fr; } }

/* ============================================
   12. WHY TVYAL
   ============================================ */

#why-me { background: var(--bg-secondary); }

.why-theme { margin-bottom: var(--space-7); }

.why-cta-buttons {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-5);
  flex-wrap: wrap;
}

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.stat-card {
  background: var(--bg-secondary);
  padding: var(--space-6);
  text-align: center;
  transition: background 200ms ease;
}
.stat-card:hover { background: rgba(0,63,92,0.15); }

.stat-number {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* Hidden photo (kept for future) */
.photo-container {
  position: relative;
  width: 100%; max-width: 400px;
  aspect-ratio: 3/4;
  overflow: hidden;
  margin: 0 auto;
}
.photo { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity var(--transition-speed) ease; }
.photo.hover { opacity: 0; }
.photo-container:hover .photo.hover { opacity: 1; }
.image-column { text-align: center; }

@media (max-width: 768px) {
  .why-cta-buttons { flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   13. FOOTER
   ============================================ */

#site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: var(--space-8) var(--container-pad);
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--space-7);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-logo {
  height: 32px;
  width: auto;
  opacity: 0.7;
  transition: opacity 200ms ease, filter 300ms ease;
}
.footer-logo:hover { opacity: 1; }

/* Light mode: invert off-white logo to navy */
body:not(.dark-mode) .footer-logo,
body:not(.dark-mode) .nav-logo {
  filter: invert(1) sepia(1) saturate(3) hue-rotate(175deg) brightness(0.3);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-end;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  transition: color 200ms ease;
}
.footer-links a:hover { color: var(--accent); }

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-end;
}

.footer-contact a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

@media (max-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .footer-links, .footer-contact { align-items: flex-start; }
}

/* ============================================
   14. MODAL
   ============================================ */

#demo-modal-overlay,
#consultation-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-speed) ease;
}
#demo-modal-overlay.active,
#consultation-modal-overlay.active { opacity: 1; pointer-events: auto; }

#demo-modal-window,
#consultation-modal-window {
  position: relative;
  width: 90%;
  max-width: 1200px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 32px 100px rgba(0,0,0,0.8);
}
#demo-modal-window { height: 80vh; }
#demo-modal-window.modal-window-fullheight { height: 100% !important; }
#consultation-modal-window { max-width: 600px; padding: var(--space-8); }

#modal-close-btn,
#consultation-close-btn {
  position: absolute;
  top: var(--space-4); right: var(--space-4);
  width: 34px; height: 34px;
  background: var(--surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 10;
  transition: all 200ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
#modal-close-btn:hover,
#consultation-close-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); }
#modal-close-btn.hidden,
#consultation-close-btn.hidden { display: none; }

#modal-iframe { width: 100%; height: 100%; border: none; opacity: 0; transition: opacity var(--transition-speed) ease; }
#modal-content-loader { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }

.spinner {
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  width: 40px; height: 40px;
  animation: spin 0.9s linear infinite;
  margin: 0 auto var(--space-4);
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal-window-fullheight {
  width: 100vw !important; height: 100vh !important;
  max-width: 100vw !important; max-height: 100vh !important;
  margin: 0 !important; border-radius: 0 !important;
}
.modal-window-fullheight #modal-close-btn { display: none; }
.modal-window-fullheight #modal-iframe { width: 100%; height: 100%; border: none; }

#demo-modal-overlay.active { display: flex; align-items: center; justify-content: center; }

/* Consultation form */
.consultation-content h2 { margin-bottom: var(--space-4); }
#consultation-form { margin-top: var(--space-6); }
.form-group { margin-bottom: var(--space-4); }
.form-group label { display: block; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: var(--space-2); color: var(--text-secondary); }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  transition: border-color var(--transition-speed) ease;
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 100px; }
#consultation-form button[type="submit"] { width: 100%; margin-top: var(--space-4); }

.consult-contact-info {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

@media (max-width: 768px) {
  #demo-modal-window { width: 95%; height: 70vh; }
  #consultation-modal-window { width: 95%; padding: var(--space-6); }
  #demo-modal-window.modal-window-fullheight { width: 100% !important; height: 100% !important; }
}

/* ============================================
   15. LANGUAGE ADJUSTMENTS
   ============================================ */

/* Armenian (HY) — Noto Sans Armenian renders optically larger than Latin/Cyrillic.
   Scale down body copy and UI text only. Headings use clamp() so leave them alone. */
body.lang-hy p,
body.lang-hy .hero-content h2,
body.lang-hy button,
body.lang-hy a,
body.lang-hy label,
body.lang-hy input,
body.lang-hy textarea,
body.lang-hy .section-eyebrow,
body.lang-hy .fx-stat-label,
body.lang-hy .nav-links a,
body.lang-hy .footer-links a {
  font-size: 94%;
}

/* Eyebrow / monospace labels — Armenian needs a bit more room */
body.lang-hy .hero-eyebrow {
  letter-spacing: 0.04em; /* reduce tracking — Armenian has wider glyphs */
}

/* Russian (RU) — Cyrillic via Noto Sans, generally fine at 1:1 with Latin */
/* No scaling needed — Noto Sans covers Cyrillic natively at correct optical size */

/* Dark mode: tiny labels need more weight — thin white on black dissolves */
body.dark-mode .fx-stat-label,
body.dark-mode .fx-time-btn,
body.dark-mode .fx-tab,
body.dark-mode .section-eyebrow,
body.dark-mode .case-tag,
body.dark-mode .case-metric-label,
body.dark-mode .stat-label,
body.dark-mode .caption {
  font-weight: 500;
  opacity: 0.85;
}

/* ============================================
   16. UTILITIES
   ============================================ */

.text-center  { text-align: center; }
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-tertiary); }

/* Legacy spacing */
.mt-0 { margin-top: 0; }       .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: var(--space-xs); }  .mb-1 { margin-bottom: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }  .mb-2 { margin-bottom: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }  .mb-3 { margin-bottom: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }  .mb-4 { margin-bottom: var(--space-lg); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.6s ease forwards; }

/* ============================================
   17. ACCESSIBILITY
   ============================================ */

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   18. PRINT
   ============================================ */

@media print {
  #top-nav, #site-footer, #demo-modal-overlay,
  #consultation-modal-overlay, #factory-animation-container { display: none !important; }
  .snap-section { page-break-inside: avoid; }
}
