/* =========================================================
   ICHIBOT ROBOTICS — global.css
   Design system: variables · reset · typography · glass utils
   ========================================================= */

/* ── Google Fonts ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=DM+Sans:wght@400;500;600&display=swap');

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
  /* Background palette */
  --bg-primary:        #0a0a0a;
  --bg-secondary:      #111111;
  --bg-elevated:       #161616;
  --bg-card:           #131313;

  /* Glass surfaces */
  --glass-bg:          rgba(255, 255, 255, 0.035);
  --glass-bg-hover:    rgba(255, 255, 255, 0.06);
  --glass-border:      rgba(255, 255, 255, 0.09);
  --glass-border-subtle: rgba(255, 255, 255, 0.05);
  --glass-border-red:  rgba(220, 30, 30, 0.55);
  --glass-inset:       rgba(255, 255, 255, 0.03);

  /* Accent — RED, used sparingly */
  --accent-red:        #dc1e1e;
  --accent-red-light:  #ff3333;
  --accent-red-dim:    rgba(220, 30, 30, 0.18);
  --accent-red-glow:   rgba(220, 30, 30, 0.12);

  /* Typography */
  --text-primary:      #f0ece4;
  --text-secondary:    #9a9590;
  --text-muted:        #5a5550;
  --text-inverse:      #0a0a0a;

  /* Fonts */
  --font-display:      'Rajdhani', sans-serif;
  --font-body:         'DM Sans', sans-serif;

  /* Spacing */
  --section-gap:       120px;
  --section-gap-sm:    72px;
  --container-max:     1240px;
  --container-pad:     24px;

  /* Borders & radius */
  --radius-card:       16px;
  --radius-card-lg:    22px;
  --radius-btn:        8px;
  --radius-pill:       999px;

  /* Blur */
  --blur-sm:           12px;
  --blur-md:           18px;
  --blur-lg:           28px;

  /* Shadows */
  --shadow-card:       0 4px 32px rgba(0, 0, 0, 0.45);
  --shadow-card-hover: 0 8px 56px rgba(0, 0, 0, 0.6);
  --shadow-red-glow:   0 0 28px rgba(220, 30, 30, 0.18);

  /* Transitions */
  --ease-out:          cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base:   0.28s var(--ease-out);
  --transition-slow:   0.48s var(--ease-out);

  /* Z-index layers */
  --z-base:    1;
  --z-card:    10;
  --z-nav:     100;
  --z-modal:   1000;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

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

/* subtle circuit-board accent lines behind hero */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image:
    linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 100%);
}

/* All direct children of body sit above texture */
body > * {
  position: relative;
  z-index: 1;
}

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.4rem, 6vw, 4.8rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  color: var(--text-secondary);
  line-height: 1.72;
  max-width: 68ch;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

ul, ol { list-style: none; }

img, svg {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-body);
}

/* ── Utility: accent text ──────────────────────────────── */
.text-red    { color: var(--accent-red); }
.text-muted  { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ── Container ─────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ── Section wrapper ───────────────────────────────────── */
.section {
  padding-block: var(--section-gap);
}
.section-sm {
  padding-block: var(--section-gap-sm);
}

/* ── Section heading group ─────────────────────────────── */
.section-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 12px;
}
.section-title {
  margin-bottom: 14px;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 56ch;
}
.section-header--center .section-subtitle {
  margin-inline: auto;
}

/* ── Glass card base ───────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  border-radius: var(--radius-card);
  box-shadow:
    0 0 0 1px var(--glass-inset) inset,
    var(--shadow-card);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

.glass-card:hover {
  border-color: var(--glass-border-red);
  box-shadow:
    0 0 28px var(--accent-red-glow),
    var(--shadow-card-hover);
  transform: translateY(-4px);
}

/* ── Glass card: no hover lift (static) ────────────────── */
.glass-card--static:hover {
  transform: none;
}

/* ── Divider ───────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--glass-border) 20%,
    var(--glass-border) 80%,
    transparent
  );
  margin-block: 0;
}

/* ── Badge ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-red {
  background: rgba(220, 30, 30, 0.2);
  border: 1px solid rgba(220, 30, 30, 0.35);
  color: var(--accent-red-light);
}
.badge-white {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}
.badge-gray {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border-subtle);
  color: var(--text-secondary);
}

/* ── Scroll reveal base ────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger helpers */
.reveal-d1  { transition-delay: 0.08s; }
.reveal-d2  { transition-delay: 0.16s; }
.reveal-d3  { transition-delay: 0.24s; }
.reveal-d4  { transition-delay: 0.32s; }
.reveal-d5  { transition-delay: 0.40s; }
.reveal-d6  { transition-delay: 0.48s; }

/* ── Background utilities ──────────────────────────────── */
.bg-secondary {
  background: var(--bg-secondary);
}

/* ── Text alignment utilities ──────────────────────────── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* ── Section header: title left, action right ──────────── */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.section-header .section-header-action {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-red);
  letter-spacing: 0.02em;
  transition: color var(--transition-base);
  white-space: nowrap;
}
.section-header .section-header-action:hover {
  color: var(--accent-red-light);
}

/* Center variant resets to block (stacked) */
.section-header--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ── Responsive helpers ────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --section-gap: 72px;
    --section-gap-sm: 48px;
  }
  .section-header {
    margin-bottom: 36px;
  }
}
