/* ============================================================
   BCK Systems — Stylesheet
   
   Structure:
   1. Reset & Base
   2. Theme Variables (Dark / Light)
   3. Typography
   4. Layout & Utilities
   5. Atmosphere (grid, noise, glow)
   6. Navigation
   7. Theme Toggle
   8. Hero
   9. Sections (base)
   10. Capabilities
   11. Process
   12. About
   13. Contact / Form
   14. Custom Dropdown
   15. Footer
   16. Blog Index
   17. Article
   18. Animations
   19. Responsive
   ============================================================ */

/* =========================
   1. RESET & BASE
   ========================= */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Manrope', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  background: var(--bg-primary);
  color: var(--fg-primary);
  transition: background 0.4s ease, color 0.4s ease;
}

::selection {
  background: var(--selection);
  color: var(--selection-text);
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }


/* =========================
   2. THEME VARIABLES
   ========================= */

/* Dark (default) */
[data-theme="dark"] {
  --bg-primary: #0A0A0F;
  --bg-secondary: #111118;
  --bg-tertiary: #18181F;
  --bg-elevated: #1E1E26;
  --fg-primary: #D4D4D8;
  --fg-secondary: #A1A1AA;
  --fg-muted: #71717A;
  --fg-dim: #52525B;
  --separator: #27272A;
  --selection: rgba(212, 212, 216, 0.2);
  --selection-text: #fff;
  --btn-primary-bg: #D4D4D8;
  --btn-primary-fg: #0A0A0F;
  --btn-primary-hover: #FFFFFF;
  --btn-shadow: rgba(212, 212, 216, 0.12);
  --form-bg: #111118;
  --form-border: #27272A;
  --form-focus-border: #52525B;
  --form-focus-bg: #18181F;
  --form-focus-ring: rgba(212, 212, 216, 0.05);
  --grid-opacity: 0.03;
  --noise-opacity: 0.035;
  --glow-color: rgba(212, 212, 216, 0.03);
  --gradient-text-from: #D4D4D8;
  --gradient-text-to: #71717A;
  --nav-bg: rgba(10, 10, 15, 0.85);
  --mark-fg: #D4D4D8;
  --mark-bg: #0A0A0F;
}

/* Light */
[data-theme="light"] {
  --bg-primary: #FAFAFA;
  --bg-secondary: #F4F4F5;
  --bg-tertiary: #E4E4E7;
  --bg-elevated: #FFFFFF;
  --fg-primary: #18181B;
  --fg-secondary: #3F3F46;
  --fg-muted: #71717A;
  --fg-dim: #A1A1AA;
  --separator: #E4E4E7;
  --selection: rgba(24, 24, 27, 0.12);
  --selection-text: #18181B;
  --btn-primary-bg: #18181B;
  --btn-primary-fg: #FAFAFA;
  --btn-primary-hover: #27272A;
  --btn-shadow: rgba(0, 0, 0, 0.08);
  --form-bg: #FFFFFF;
  --form-border: #E4E4E7;
  --form-focus-border: #A1A1AA;
  --form-focus-bg: #FFFFFF;
  --form-focus-ring: rgba(24, 24, 27, 0.06);
  --grid-opacity: 0.04;
  --noise-opacity: 0.02;
  --glow-color: rgba(24, 24, 27, 0.02);
  --gradient-text-from: #18181B;
  --gradient-text-to: #71717A;
  --nav-bg: rgba(250, 250, 250, 0.85);
  --mark-fg: #27272A;
  --mark-bg: #FAFAFA;
}


/* =========================
   3. TYPOGRAPHY
   ========================= */
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--fg-dim);
}


/* =========================
   4. LAYOUT & UTILITIES
   ========================= */
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.gradient-text {
  background: linear-gradient(135deg, var(--gradient-text-from) 0%, var(--gradient-text-to) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* =========================
   5. ATMOSPHERE
   ========================= */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grid-opacity);
  background-image:
    linear-gradient(var(--fg-muted) 1px, transparent 1px),
    linear-gradient(90deg, var(--fg-muted) 1px, transparent 1px);
  background-size: 60px 60px;
  transition: opacity 0.4s ease;
}

.grid-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, transparent 0%, var(--bg-primary) 70%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--noise-opacity);
  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");
  background-repeat: repeat;
  background-size: 256px 256px;
  transition: opacity 0.4s ease;
}

.glow-orb {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: left 0.8s cubic-bezier(0.16, 1, 0.3, 1), top 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}


/* =========================
   6. NAVIGATION
   ========================= */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

nav.scrolled {
  padding: 14px 40px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--separator);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--fg-primary);
}

.nav-mark {
  width: 36px;
  height: 36px;
  color: var(--mark-fg);
}

.nav-wordmark {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--fg-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.3s;
}

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

.nav-cta {
  padding: 10px 24px !important;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg) !important;
  border-radius: 6px;
  font-weight: 700 !important;
  font-size: 12px !important;
  letter-spacing: 1px !important;
  text-transform: uppercase;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.nav-cta:hover {
  background: var(--btn-primary-hover) !important;
  color: var(--btn-primary-fg) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--btn-shadow);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--fg-primary);
  cursor: pointer;
  padding: 8px;
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}


/* =========================
   7. THEME TOGGLE
   ========================= */
.theme-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  transition: background 0.3s, border-color 0.3s;
}

.theme-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--fg-dim);
  cursor: pointer;
  transition: all 0.25s ease;
}

.theme-toggle button:hover {
  color: var(--fg-secondary);
}

.theme-toggle button.active {
  background: var(--bg-elevated);
  color: var(--fg-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.theme-toggle button svg {
  width: 14px;
  height: 14px;
}


/* =========================
   8. HERO
   ========================= */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 40px 80px;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(42px, 6vw, 80px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 32px;
  max-width: 900px;
}

.hero-subtitle {
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 400;
  line-height: 1.7;
  color: var(--fg-secondary);
  max-width: 580px;
  margin-bottom: 48px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--btn-shadow);
}

.btn-primary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 28px;
  background: transparent;
  color: var(--fg-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  border: 1px solid var(--separator);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-ghost:hover {
  color: var(--fg-primary);
  border-color: var(--fg-dim);
  background: var(--form-focus-ring);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--fg-dim);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: float 3s ease-in-out infinite;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--fg-dim), transparent);
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}


/* =========================
   9. SECTIONS (BASE)
   ========================= */
section {
  position: relative;
  z-index: 2;
  padding: 120px 40px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 20px;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
  max-width: 700px;
}

.section-description {
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg-secondary);
  max-width: 560px;
  margin-bottom: 60px;
}


/* =========================
   10. CAPABILITIES
   ========================= */
#capabilities {
  border-top: 1px solid var(--separator);
}

.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--separator);
  border: 1px solid var(--separator);
  border-radius: 12px;
  overflow: hidden;
}

.capability-card {
  background: var(--bg-primary);
  padding: 48px 40px;
  transition: background 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.capability-card:hover {
  background: var(--bg-secondary);
}

.capability-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 24px;
  color: var(--fg-dim);
  transition: color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.capability-card:hover .capability-icon {
  color: var(--fg-primary);
}

.capability-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.capability-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--fg-muted);
}


/* =========================
   10b. USE CASES
   ========================= */
#use-cases {
  border-top: 1px solid var(--separator);
  background: var(--bg-secondary);
  transition: background 0.4s ease;
}

.use-cases-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--separator);
  border-radius: 12px;
  overflow: hidden;
}

.use-case {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  padding: 40px;
  border-bottom: 1px solid var(--separator);
  transition: background 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.use-case:last-child {
  border-bottom: none;
}

.use-case:hover {
  background: var(--bg-tertiary);
}

.use-case-function {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding-top: 4px;
}

.use-case-title {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.7;
  color: var(--fg-primary);
  margin-bottom: 12px;
}

.use-case-detail {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-muted);
}

@media (max-width: 768px) {
  .use-case {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 28px 24px;
  }

  .use-case-function {
    padding-top: 0;
  }

  .use-case-title {
    font-size: 15px;
  }
}


/* =========================
   11. PROCESS
   ========================= */
#process {
  border-top: 1px solid var(--separator);
  background: var(--bg-secondary);
  transition: background 0.4s ease;
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  position: relative;
}

.process-steps::before {
  content: '';
  position: absolute;
  top: 28px;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--separator), var(--fg-dim), var(--separator));
}

.process-step {
  text-align: left;
  position: relative;
}

.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--separator);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--fg-dim);
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.process-step:hover .step-number {
  border-color: var(--fg-muted);
  color: var(--fg-primary);
  background: var(--bg-tertiary);
}

.step-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.step-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--fg-muted);
}

.step-detail {
  margin-top: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-dim);
  letter-spacing: 0.5px;
}


/* =========================
   12. ABOUT
   ========================= */
#about {
  border-top: 1px solid var(--separator);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-text p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--fg-secondary);
  margin-bottom: 24px;
}

.about-text p:first-child {
  font-size: 20px;
  color: var(--fg-primary);
  font-weight: 500;
}

.credentials {
  display: grid;
  gap: 1px;
  background: var(--separator);
  border: 1px solid var(--separator);
  border-radius: 12px;
  overflow: hidden;
}

.credential-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--separator);
}

.credential {
  background: var(--bg-primary);
  padding: 32px;
  transition: background 0.4s ease;
}

.credential-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.credential-label {
  font-size: 12px;
  color: var(--fg-muted);
  letter-spacing: 0.5px;
}


/* =========================
   13. CONTACT / FORM
   ========================= */
#contact {
  border-top: 1px solid var(--separator);
  padding: 120px 40px 160px;
}

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

.contact-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 20px;
}

.contact-subtitle {
  font-size: 18px;
  color: var(--fg-secondary);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.contact-form {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.form-group label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.form-group input,
.form-group textarea {
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: var(--fg-primary);
  background: var(--form-bg);
  border: 1px solid var(--form-border);
  border-radius: 8px;
  padding: 14px 16px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--fg-dim);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--form-focus-border);
  background: var(--form-focus-bg);
  box-shadow: 0 0 0 3px var(--form-focus-ring);
}

/* Validation states */
.form-group.error input,
.form-group.error textarea,
.form-group.error .custom-select-trigger {
  border-color: #B91C1C;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}

.form-group.error input:focus,
.form-group.error textarea:focus,
.form-group.error .custom-select-trigger:focus {
  border-color: #B91C1C;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15);
}

.form-group.valid input,
.form-group.valid textarea,
.form-group.valid .custom-select-trigger {
  border-color: var(--form-border);
}

.form-error {
  font-size: 12px;
  font-weight: 500;
  color: #EF4444;
  margin-top: 2px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  height: 0;
  overflow: hidden;
}

.form-group.error .form-error {
  opacity: 1;
  transform: translateY(0);
  height: auto;
  margin-top: 6px;
}

/* Server error banner */
.form-server-error {
  display: none;
  padding: 14px 18px;
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.2);
  border-radius: 8px;
  color: #EF4444;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
  animation: fadeUp 0.3s ease both;
}

.form-server-error.show {
  display: block;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-submit {
  margin-top: 8px;
}

.form-submit .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 18px 36px;
}

.form-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--fg-dim);
}

.form-footer a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.3s;
}

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

/* Success state */
.form-success {
  display: none;
  text-align: center;
  padding: 60px 20px;
  max-width: 560px;
  margin: 0 auto;
}

.form-success.show {
  display: block;
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.form-success .check-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--fg-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--fg-primary);
  animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.form-success .check-circle svg .check-path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawCheck 0.4s ease 0.5s forwards;
}

@keyframes drawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

.form-success h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.form-success p {
  color: var(--fg-secondary);
  font-size: 16px;
  line-height: 1.6;
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

/* Submit button loading state */
.btn-primary.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-primary.loading svg {
  display: none;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: var(--btn-primary-fg);
  border-right-color: var(--btn-primary-fg);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Form fade out */
.contact-form.submitting {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}


/* =========================
   14. CUSTOM DROPDOWN
   ========================= */
.custom-select {
  position: relative;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: var(--fg-dim);
  background: var(--form-bg);
  border: 1px solid var(--form-border);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  outline: none;
}

.custom-select-trigger:focus {
  border-color: var(--form-focus-border);
  background: var(--form-focus-bg);
  box-shadow: 0 0 0 3px var(--form-focus-ring);
}

.custom-select-trigger.has-value {
  color: var(--fg-primary);
}

.custom-select-trigger:hover {
  border-color: var(--form-focus-border);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--form-focus-border);
  background: var(--form-focus-bg);
  box-shadow: 0 0 0 3px var(--form-focus-ring);
}

.custom-select-trigger .arrow {
  width: 16px;
  height: 16px;
  color: var(--fg-dim);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.custom-select.open .custom-select-trigger .arrow {
  transform: rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: 10px;
  padding: 6px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--separator);
}

.custom-select.open .custom-select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-select-option {
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-select-option:hover {
  background: var(--bg-tertiary);
  color: var(--fg-primary);
}

.custom-select-option.selected {
  color: var(--fg-primary);
  font-weight: 600;
}

/* Hidden native select for form submission */
.custom-select select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}


/* =========================
   15. FOOTER
   ========================= */
footer {
  position: relative;
  z-index: 2;
  padding: 40px;
  border-top: 1px solid var(--separator);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-mark {
  width: 24px;
  height: 24px;
  opacity: 0.4;
  color: var(--fg-primary);
}

.footer-copy {
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.5px;
}

.footer-right {
  font-size: 12px;
  color: var(--fg-dim);
}

.footer-right a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.3s;
}

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


/* =========================
   16. BLOG INDEX
   ========================= */
.blog-header {
  padding-top: 160px;
  padding-bottom: 40px;
}

.blog-list-section {
  padding-top: 0;
  padding-bottom: 120px;
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--separator);
  border: 1px solid var(--separator);
  border-radius: 12px;
  overflow: hidden;
}

.blog-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-primary);
  transition: background 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover {
  background: var(--bg-secondary);
}

.blog-card-inner {
  padding: 48px 44px;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-dim);
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.blog-card-sep {
  color: var(--separator);
}

.blog-card-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 14px;
  transition: color 0.3s;
}

.blog-card:hover .blog-card-title {
  color: var(--fg-primary);
}

.blog-card-excerpt {
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg-muted);
  max-width: 640px;
  margin-bottom: 24px;
}

.blog-card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: color 0.3s, gap 0.3s;
}

.blog-card-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover .blog-card-link {
  color: var(--fg-primary);
}

.blog-card:hover .blog-card-link svg {
  transform: translateX(3px);
}


/* =========================
   17. ARTICLE
   ========================= */
.article {
  position: relative;
  z-index: 2;
}

.article-header {
  padding: 160px 40px 60px;
  border-bottom: 1px solid var(--separator);
}

.article-header-inner {
  max-width: 680px;
  margin: 0 auto;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.3s;
}

.article-back:hover {
  color: var(--fg-primary);
}

.article-back svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-back:hover svg {
  transform: translateX(-3px);
}

.article-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--fg-muted);
}

.article-author {
  font-weight: 600;
  color: var(--fg-secondary);
}

.article-meta-sep {
  color: var(--separator);
}

/* Article body — readable long-form typography */
.article-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 40px 80px;
}

.article-body p {
  font-size: 17px;
  line-height: 1.85;
  color: var(--fg-secondary);
  margin-bottom: 28px;
}

.article-body .article-lede {
  font-size: 20px;
  line-height: 1.75;
  color: var(--fg-primary);
  font-weight: 400;
  margin-bottom: 40px;
}

.article-body h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-top: 56px;
  margin-bottom: 20px;
  color: var(--fg-primary);
}

.article-body h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin-top: 44px;
  margin-bottom: 16px;
  color: var(--fg-primary);
}

.article-body a {
  color: var(--fg-primary);
  text-decoration: underline;
  text-decoration-color: var(--fg-dim);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s;
}

.article-body a:hover {
  text-decoration-color: var(--fg-primary);
}

.article-body blockquote {
  margin: 36px 0;
  padding: 0 0 0 24px;
  border-left: 2px solid var(--fg-dim);
}

.article-body blockquote p {
  font-size: 18px;
  font-style: italic;
  color: var(--fg-secondary);
  line-height: 1.8;
  margin-bottom: 0;
}

.article-body ul,
.article-body ol {
  margin: 0 0 28px 0;
  padding-left: 24px;
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body li {
  font-size: 17px;
  line-height: 1.8;
  color: var(--fg-secondary);
  margin-bottom: 8px;
  padding-left: 4px;
}

.article-body li::marker {
  color: var(--fg-dim);
}

.article-body code {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Courier New', monospace;
  font-size: 0.88em;
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--fg-primary);
}

.article-body pre {
  margin: 32px 0;
  padding: 24px 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-body pre code {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--fg-secondary);
}

.article-body img {
  max-width: 100%;
  border-radius: 10px;
  margin: 36px 0;
  border: 1px solid var(--separator);
}

/* Article footer / back link */
.article-footer-section {
  padding: 48px 40px 80px;
  border-top: 1px solid var(--separator);
}

.article-back-bottom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.3s;
}

.article-back-bottom:hover {
  color: var(--fg-primary);
}

.article-back-bottom svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-back-bottom:hover svg {
  transform: translateX(-3px);
}


/* =========================
   18. ANIMATIONS
   ========================= */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }


/* =========================
   19. RESPONSIVE
   ========================= */

/* Tablet landscape / small desktop */
@media (max-width: 1080px) {
  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    gap: 48px;
  }
}

/* Tablet portrait */
@media (max-width: 968px) {
  section {
    padding: 80px 24px;
  }

  nav {
    padding: 16px 24px;
  }

  nav.scrolled {
    padding: 12px 24px;
  }

  .hero {
    padding: 100px 24px 80px;
  }

  .hero-title {
    font-size: clamp(36px, 5.5vw, 64px);
  }

  .process-steps {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .process-steps::before {
    display: none;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .credential-row {
    grid-template-columns: 1fr 1fr;
  }

  .contact-form {
    max-width: 100%;
  }

  /* Nav: full-screen overlay */
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-primary);
    padding: 24px;
    gap: 28px;
    z-index: 99;
  }

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

  .nav-links a {
    font-size: 18px;
  }

  .nav-links .nav-cta {
    font-size: 14px !important;
    padding: 14px 32px !important;
  }

  .nav-toggle {
    display: block;
    z-index: 101;
  }

  .theme-toggle {
    order: 0;
  }

  .scroll-indicator {
    display: none;
  }
}

/* Large phone / small tablet */
@media (max-width: 768px) {
  .capabilities-grid {
    grid-template-columns: 1fr;
  }

  .capability-card {
    padding: 36px 28px;
  }

  .hero {
    min-height: auto;
    padding-bottom: 80px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .section-title {
    font-size: clamp(24px, 5vw, 36px);
  }

  .section-description {
    font-size: 15px;
    margin-bottom: 40px;
  }

  .contact-title {
    font-size: clamp(28px, 5vw, 44px);
  }

  #contact {
    padding: 80px 24px 100px;
  }
}

/* Phone */
@media (max-width: 640px) {
  section {
    padding: 64px 20px;
  }

  /* Hero */
  .hero {
    padding: 90px 20px 60px;
  }

  .hero-eyebrow {
    font-size: 10px;
    letter-spacing: 3px;
    margin-bottom: 20px;
  }

  .hero-title {
    font-size: clamp(32px, 8vw, 48px);
    letter-spacing: -1px;
    margin-bottom: 24px;
  }

  .hero-subtitle {
    font-size: 15px;
    margin-bottom: 36px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .btn-primary,
  .btn-ghost {
    justify-content: center;
    text-align: center;
  }

  /* Process */
  .process-steps {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .step-number {
    width: 48px;
    height: 48px;
    font-size: 14px;
  }

  /* About */
  .about-text p:first-child {
    font-size: 18px;
  }

  .about-text p {
    font-size: 15px;
  }

  .credential-row {
    grid-template-columns: 1fr;
  }

  .credential {
    padding: 24px;
  }

  .credential-value {
    font-size: 22px;
  }

  /* Contact */
  #contact {
    padding: 64px 20px 100px;
  }

  .contact-header {
    margin-bottom: 40px;
  }

  .contact-title {
    font-size: clamp(26px, 7vw, 40px);
    letter-spacing: -1px;
  }

  .contact-subtitle {
    font-size: 15px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* 16px prevents iOS Safari auto-zoom on input focus */
  .form-group input,
  .form-group textarea,
  .custom-select-trigger {
    font-size: 16px;
    padding: 14px 14px;
  }

  /* Footer */
  footer {
    padding: 24px 20px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .footer-left {
    flex-direction: column;
    gap: 8px;
  }
}

/* Phone — Blog */
@media (max-width: 640px) {
  .blog-header {
    padding-top: 120px;
    padding-bottom: 24px;
  }

  .blog-list-section {
    padding-bottom: 80px;
  }

  .blog-card-inner {
    padding: 28px 24px;
  }

  .blog-card-title {
    font-size: 20px;
  }

  .blog-card-excerpt {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .article-header {
    padding: 120px 20px 40px;
  }

  .article-title {
    font-size: clamp(26px, 7vw, 36px);
    letter-spacing: -1px;
  }

  .article-meta {
    font-size: 13px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .article-body {
    padding: 40px 20px 60px;
  }

  .article-body p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 24px;
  }

  .article-body .article-lede {
    font-size: 18px;
    margin-bottom: 32px;
  }

  .article-body h2 {
    font-size: 22px;
    margin-top: 44px;
  }

  .article-body h3 {
    font-size: 18px;
    margin-top: 36px;
  }

  .article-body blockquote {
    margin: 28px 0;
    padding-left: 20px;
  }

  .article-body blockquote p {
    font-size: 16px;
  }

  .article-body pre {
    padding: 20px;
    margin: 24px -20px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .article-body pre code {
    font-size: 13px;
  }

  .article-body li {
    font-size: 16px;
  }

  .article-footer-section {
    padding: 36px 20px 60px;
  }
}

/* Very small phones (iPhone SE, etc.) */
@media (max-width: 380px) {
  .hero-title {
    font-size: 28px;
  }

  .nav-wordmark {
    font-size: 12px;
    letter-spacing: 2px;
  }

  .capability-card {
    padding: 28px 20px;
  }

  .section-label {
    font-size: 10px;
    letter-spacing: 3px;
  }
}
