/* ═══════════════════════════════════════
   DESIGN SYSTEM — BASE
   Ken.AI Personal Website
   Industrial Supply Chain Theme
   Light Theme Only
   ═══════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  /* ── Backgrounds: Off-White / Cream ── */
  --bg-deep: #f7f7f5;
  --bg-card: #ffffff;
  --bg-elevated: #efeff0;
  --bg-hover: #e8e8eb;

  /* ── Borders: Metal Finish ── */
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-accent: rgba(0, 0, 0, 0.1);
  --metal-border: rgba(0, 0, 0, 0.08);
  --metal-accent: rgba(37, 99, 235, 0.12);

  /* ── Text ── */
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #6f7280;

  /* ── Accent: Industrial Blue (DIN/ISO standard blue inspired) ── */
  --accent: #2563eb;
  --accent-dim: rgba(37, 99, 235, 0.1);
  --accent-glow: rgba(37, 99, 235, 0.15);

  /* ── Quadrant Colors (Kraljic Matrix) ── */
  --q4-color: #2563eb;      /* Blue: Non-critical */
  --q3-color: #d97706;      /* Orange: Bottleneck */
  --q2-color: #059669;      /* Green: Leverage */
  --q1-color: #dc2626;      /* Red: Strategic */

  --q4-glow: rgba(37, 99, 235, 0.06);
  --q3-glow: rgba(217, 119, 6, 0.06);
  --q2-glow: rgba(5, 150, 105, 0.06);
  --q1-glow: rgba(220, 38, 38, 0.06);

  /* ── Gradients ── */
  --gradient-accent: linear-gradient(135deg, #2563eb, #1d4ed8);
  --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #2563eb 40%, #1d4ed8 80%, #1a1a2e 100%);

  /* ── Layout ── */
  --nav-height: 64px;
  --section-gap: 120px;
  --container-width: 1140px;

  /* ── Radius ── */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* ── Shadows ── */
  --shadow-glow: 0 0 40px rgba(37, 99, 235, 0.04);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-solid: 0 1px 2px rgba(0, 0, 0, 0.08);

  /* ── Transitions ── */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.5s ease;

  /* ── Nav backgrounds ── */
  --nav-bg: rgba(247, 247, 245, 0.9);
  --nav-bg-solid: rgba(247, 247, 245, 0.98);
  --modal-overlay: rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
  /* Increase base font size */
  font-size: 17px;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 3000;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 10px;
}

/* ── Grid Background (Technical Drawing Style) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  opacity: 0.3;
  pointer-events: none;
  z-index: -1;
}

/* Subtle noise overlay on top of grid */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.008;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

::selection {
  background: rgba(37, 99, 235, 0.2);
  color: #1a1a2e;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.8;
}

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

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

/* ── Typography (Increased Sizes) ── */
h1,
h2,
h3,
h4 {
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(42px, 6vw, 72px);
}

h2 {
  font-size: clamp(32px, 4.5vw, 48px);
}

h3 {
  font-size: clamp(24px, 3vw, 32px);
}

h4 {
  font-size: clamp(20px, 2.5vw, 24px);
}

/* Display font for numbers/data */
.font-display,
.font-data {
  font-family: 'Oswald', 'Roboto Condensed', sans-serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Layout ── */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 28px;
}

.section {
  padding: var(--section-gap) 0;
  position: relative;
}

/* ── Section Headers (Increased Sizes) ── */
.section-tag {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-tag::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-tag::after {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 600px;
  font-weight: 400;
  line-height: 1.8;
}

.section-divider {
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin: 20px 0 0;
}

.section-header-center {
  text-align: center;
  margin-bottom: 64px;
}

.section-header-center .section-subtitle {
  margin: 0 auto;
}

.section-header-center .section-tag::before,
.section-header-center .section-tag::after {
  width: 16px;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {

  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.5);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes glow-pulse {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.08);
  }

  50% {
    box-shadow: 0 0 40px rgba(37, 99, 235, 0.12);
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes scrollBounce {

  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }

  50% {
    transform: translateY(8px);
    opacity: 0.4;
  }
}

/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children .fade-in:nth-child(1) {
  transition-delay: 0.05s;
}

.stagger-children .fade-in:nth-child(2) {
  transition-delay: 0.1s;
}

.stagger-children .fade-in:nth-child(3) {
  transition-delay: 0.15s;
}

.stagger-children .fade-in:nth-child(4) {
  transition-delay: 0.2s;
}

.stagger-children .fade-in:nth-child(5) {
  transition-delay: 0.25s;
}

.stagger-children .fade-in:nth-child(6) {
  transition-delay: 0.3s;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  :root {
    --section-gap: 80px;
    --nav-height: 56px;
  }

  .container {
    padding: 0 20px;
  }

  .section-tag::before,
  .section-tag::after {
    width: 16px;
  }
}

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