/* ============================================================
   AGENTOPIA — styles.css
   Sistema de diseño completo: tokens, componentes, animaciones
   ============================================================ */

/* ── 0. FUENTES LOCALES ────────────────────────────────────── */
@font-face {
  font-family: "Halfre";
  src: url("Font/halfre.otf") format("opentype"),
       url("Font/halfre.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── 1. DESIGN TOKENS ──────────────────────────────────────── */
:root {
  /* Core palette */
  --color-black-900: #191818;
  --color-blue-400: #4a7ff7;
  --color-blue-500: #1b5def;
  --color-orange-400: #e8734b;
  --color-orange-500: #e25327;
  --color-orange-700: #c2410c;
  --color-green-500: #22c55e;
  --color-green-700: #15803d;
  --color-cream-100: #f4f4f4;
  --color-sand-100: #f0ece4;
  --color-red-500: #ff5f57;
  --color-yellow-500: #ffbd2e;

  /* Semantic */
  --color-bg-primary: var(--color-cream-100);
  --color-text-primary: var(--color-black-900);
  --color-text-secondary: color-mix(in srgb, var(--color-black-900) 70%, transparent);
  --color-text-tertiary: color-mix(in srgb, var(--color-black-900) 50%, transparent);
  --color-border: color-mix(in srgb, var(--color-black-900) 10%, transparent);
  --color-border-subtle: color-mix(in srgb, var(--color-black-900) 8%, transparent);
  --color-surface-ghost: color-mix(in srgb, var(--color-black-900) 2%, transparent);
  --color-surface-subtle: color-mix(in srgb, var(--color-black-900) 5%, transparent);
  --color-shadow: color-mix(in srgb, var(--color-black-900) 25%, transparent);

  /* Tints */
  --color-blue-ghost: color-mix(in srgb, var(--color-blue-500) 5%, transparent);
  --color-blue-subtle: color-mix(in srgb, var(--color-blue-500) 10%, transparent);
  --color-blue-tint: color-mix(in srgb, var(--color-blue-500) 20%, transparent);
  --color-orange-subtle: color-mix(in srgb, var(--color-orange-500) 10%, transparent);
  --color-green-ghost: color-mix(in srgb, var(--color-green-500) 5%, transparent);
  --color-green-tint: color-mix(in srgb, var(--color-green-500) 20%, transparent);
  --color-glass-light: color-mix(in srgb, var(--color-cream-100) 65%, transparent);
  --color-glass: color-mix(in srgb, var(--color-cream-100) 80%, transparent);

  /* Typography */
  --font-display: "Halfre", "Fraunces", Georgia, serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  /* Type scale */
  --text-2xs: 10px;
  --text-xs:  12px;
  --text-sm:  14px;
  --text-md:  16px;
  --text-lg:  20px;
  --text-xl:  28px;
  --text-xxl: 40px;
  --text-3xl: 52px;

  /* 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: 80px;
  --space-10: 96px;

  /* Component helpers */
  --badge-padding: 2px var(--space-2);
  --container-max: 1200px;
  --container-pad: var(--space-6);
  --top-nav-height: 64px;
  --status-bar-height: 32px;

  /* Motion */
  --motion-fast:   .16s;
  --motion-medium: .24s;
  --motion-slow:   .32s;
  --ease-standard:  cubic-bezier(.4, 0, .2, 1);
  --ease-out-soft:  cubic-bezier(0, 0, .2, 1);
  --ease-out-expo:  cubic-bezier(.16, 1, .3, 1);

  /* Z-index layers */
  --z-base:        1;
  --z-sticky:    100;
  --z-nav:       999;
  --z-overlay:  1000;
  --z-modal:    9000;
  --z-cursor:   9997;
  --z-noise:    9998;
  --z-cursor-ring: 9999;
  --z-boot:    10000;

  /* Shadows */
  --shadow-sm: 0 1px 3px #0000001f;
  --shadow-md: 0 4px 12px #00000026;
  --shadow-lg: 0 10px 30px #0003;
}

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

html {
  font-size: 16px;
  scroll-behavior: auto; /* Lenis handles scroll */
  -webkit-text-size-adjust: 100%;
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

body {
  font-family: var(--font-body);
  font-size: var(--text-md);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none; /* Custom cursor */
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { cursor: none; font-family: inherit; }
ul { list-style: none; }

/* Skip link */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--color-black-900);
  color: var(--color-cream-100);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  z-index: calc(var(--z-boot) + 1);
  transition: top var(--motion-fast) var(--ease-standard);
}
.skip-to-content:focus { top: var(--space-4); }

/* ── 3. BOOT SEQUENCE ──────────────────────────────────────── */
.boot-sequence {
  position: fixed;
  inset: 0;
  background: var(--color-black-900);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  z-index: var(--z-boot);
  transition: opacity .4s var(--ease-standard);
}
.boot-sequence.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.boot-sequence__logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  /* Logo es negro: invertir para que sea visible sobre fondo oscuro */
  filter: invert(1) brightness(1.1);
  opacity: 0.9;
}
.boot-sequence__bar {
  width: 80px;
  height: 2px;
  background: color-mix(in srgb, var(--color-cream-100) 15%, transparent);
  overflow: hidden;
}
.boot-sequence__bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-cream-100);
  transition: width .1s linear;
}
.boot-sequence__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: color-mix(in srgb, var(--color-cream-100) 50%, transparent);
  letter-spacing: .1em;
}

/* ── 4. NOISE OVERLAY ──────────────────────────────────────── */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-noise);
  opacity: .035;
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* ── 5. CUSTOM CURSOR ──────────────────────────────────────── */
.custom-cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: var(--z-cursor-ring);
  will-change: transform;
}
.custom-cursor__ring {
  position: absolute;
  width: 32px; height: 32px;
  border: 1px solid color-mix(in srgb, var(--color-black-900) 40%, transparent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width var(--motion-fast), height var(--motion-fast), border-color var(--motion-fast);
}
.custom-cursor__dot {
  position: absolute;
  width: 4px; height: 4px;
  background: var(--color-black-900);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-hover .custom-cursor__ring {
  width: 48px; height: 48px;
  border-color: var(--color-blue-500);
}

/* ── 6. NAVIGATION ─────────────────────────────────────────── */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--top-nav-height);
  background: color-mix(in srgb, var(--color-cream-100) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: var(--z-nav);
}
.top-nav__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top-nav__wordmark {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}
.top-nav__logo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.top-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.top-nav__link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  position: relative;
  transition: color var(--motion-fast) var(--ease-standard);
}
.top-nav__link::after {
  content: '';
  position: absolute;
  bottom: 0; left: var(--space-3); right: var(--space-3);
  height: 1px;
  background: var(--color-blue-500);
  transform: scaleX(0);
  transition: transform var(--motion-medium) var(--ease-out-soft);
}
.top-nav__link:hover,
.top-nav__link.is-active { color: var(--color-text-primary); }
.top-nav__link.is-active::after,
.top-nav__link:hover::after { transform: scaleX(1); }

/* Hamburger */
.top-nav__burger {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  padding: var(--space-2);
  width: 36px; height: 36px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.top-nav__burger-icon { display: flex; flex-direction: column; gap: 5px; }
.top-nav__burger-icon span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--color-text-primary);
  transition: transform var(--motion-medium) var(--ease-standard), opacity var(--motion-fast);
}
.top-nav__burger.is-open .top-nav__burger-icon span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.top-nav__burger.is-open .top-nav__burger-icon span:nth-child(2) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile overlay */
.top-nav__overlay {
  position: fixed;
  inset: 0;
  background: var(--color-cream-100);
  z-index: var(--z-nav-overlay, calc(var(--z-nav) + 1));
  transform: translateX(100%);
  transition: transform var(--motion-slow) var(--ease-out-expo);
  padding: var(--space-8) var(--container-pad);
}
.top-nav__overlay.is-open { transform: translateX(0); }
.top-nav__overlay-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-8); }
.top-nav__overlay-title { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-secondary); }
.top-nav__overlay-close {
  background: none; border: 1px solid var(--color-border);
  width: 36px; height: 36px;
  font-size: 20px; color: var(--color-text-primary);
  display: flex; align-items: center; justify-content: center;
}
.top-nav__overlay-links { display: flex; flex-direction: column; gap: var(--space-4); }
.top-nav__overlay-link {
  font-family: var(--font-display);
  font-size: var(--text-xxl);
  font-weight: 700;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--motion-fast);
}
.top-nav__overlay-link:hover { color: var(--color-blue-500); }

/* ── 7. BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background var(--motion-medium) var(--ease-standard),
    border-color var(--motion-medium) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
  position: relative;
  overflow: hidden;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--color-black-900);
  color: var(--color-cream-100);
  border-color: var(--color-black-900);
}
.btn--primary:hover {
  background: var(--color-blue-500);
  border-color: var(--color-blue-500);
}
.btn--secondary {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border);
}
.btn--secondary:hover {
  background: var(--color-surface-subtle);
  border-color: color-mix(in srgb, var(--color-black-900) 25%, transparent);
}
.btn--large {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-md);
}

/* ── 8. SECTION SYSTEM ─────────────────────────────────────── */
.page-section {
  padding: var(--space-10) 0;
  position: relative;
  overflow: hidden;
}
.page-section--alt { background: var(--color-surface-ghost); }
.page-section__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  position: relative;
}
.section-header {
  margin-bottom: var(--space-7);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xxl);
  font-weight: 900;
  color: var(--color-text-primary);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin-top: var(--space-2);
}
.section-subtitle {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  margin-top: var(--space-3);
  max-width: 600px;
  line-height: 1.6;
}
.section-scanline--top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border) 30%, var(--color-border) 70%, transparent);
  animation: scanline-sweep 4s ease-in-out infinite;
}
@keyframes scanline-sweep {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}

/* Section numbers */
.section-number {
  position: absolute;
  font-family: var(--font-mono);
  font-size: var(--sn-font-size, 120px);
  font-weight: 900;
  color: var(--color-text-primary);
  opacity: var(--sn-opacity, .1);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.section-number--top-left  { top: calc(var(--top-nav-height) + var(--space-4)); left: var(--container-pad); }
.section-number--top-right { top: calc(var(--top-nav-height) + var(--space-4)); right: var(--container-pad); }
.section-number--bottom-left { bottom: var(--space-5); left: var(--container-pad); }
.section-number--display { overflow: hidden; }
.section-number--crop { clip-path: inset(0); }

/* Annotations */
.system-annotation {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  display: block;
  margin-bottom: var(--space-2);
}
.system-annotation--muted   { color: var(--color-text-tertiary); }
.system-annotation--default { color: var(--color-text-secondary); }
.system-annotation--accent  { color: var(--color-blue-500); }
.system-annotation__link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Inline link */
.inline-link {
  color: var(--color-blue-500);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── 9. HERO SECTION ───────────────────────────────────────── */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-8) var(--container-pad);
  padding-top: calc(var(--top-nav-height) + var(--space-8));
  padding-bottom: calc(var(--space-8) * 2);
  position: relative;
  overflow: hidden;
  width: 100%;
}

/* Data rain background */
.data-rain-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  overflow: hidden;
  opacity: .08;
}
.data-rain-bg__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__container {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
}
.hero__content { display: flex; flex-direction: column; }
.hero__pre-title {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}
.hero__micro-hook { color: var(--color-text-secondary); }
.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-xxl);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: var(--space-3) 0;
}
.hero__greeting,
.hero__name { display: block; }
.hero__role {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  margin: var(--space-3) 0 var(--space-4);
  max-width: 500px;
  min-height: 1.5em;
}
.hero__tagline {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin: 0 0 var(--space-6);
  max-width: 440px;
}
.hero__cta { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* Hero char animation (scramble) */
.hero__char {
  display: inline-block;
  overflow: hidden;
}

/* Profile image */
.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}
.hero__image-frame {
  width: 90%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
}
.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.hero__lottie {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
}

/* Scroll hint */
.hero__scroll-hint {
  position: absolute;
  bottom: var(--space-8);
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  z-index: 1;
}
.hero__scroll-chevron {
  color: var(--color-text-secondary);
  opacity: .5;
  animation: scroll-bob 2s ease-in-out infinite;
}
@keyframes scroll-bob {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50%       { transform: translateY(6px); opacity: .8; }
}

/* Reveal states (pre-animation) */
[data-hero-reveal] {
  opacity: 0;
  transform: translateY(20px);
}

/* ── 10. BACKGROUND PATTERNS ───────────────────────────────── */
/* Minesweeper */
.minesweeper-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: .35;
  z-index: 0;
}
.minesweeper-bg__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Dot grid */
.dot-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.dot-grid__pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--color-text-primary) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .15;
}

/* Bg fades */
.bg-fade {
  position: absolute;
  pointer-events: none;
}
.bg-fade--radial {
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, var(--color-bg-primary) 80%);
}
.bg-fade--edges {
  inset: 0;
  background:
    linear-gradient(to right, var(--color-bg-primary) 0%, transparent 10%, transparent 90%, var(--color-bg-primary) 100%),
    linear-gradient(to bottom, transparent 80%, var(--color-bg-primary) 100%);
}
.bg-fade--top {
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to bottom, var(--color-bg-primary), transparent);
}

/* ── 11. PROBLEM SECTION ───────────────────────────────────── */
.problems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  position: relative;
  z-index: 1;
}
.problem-card {
  position: relative;
  padding: var(--space-5);
  padding-top: var(--space-6);
  background: var(--color-glass-light);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-orange-500);
  transition:
    background var(--motion-medium) var(--ease-standard),
    border-color var(--motion-medium) var(--ease-standard) 60ms;
}
.problem-card:hover { background: color-mix(in srgb, var(--color-cream-100) 75%, transparent); }
.problem-card:hover .problem-card__title { color: var(--color-orange-400); }
.problem-card__index {
  position: absolute;
  top: var(--space-3); right: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--color-orange-500);
  opacity: .6;
}
.problem-card__title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  margin: 0 0 var(--space-2);
  color: var(--color-text-primary);
  transition: color var(--motion-medium) var(--ease-standard) 80ms;
}
.problem-card__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
}
.problems-cta {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  max-width: 600px;
  position: relative;
  z-index: 1;
}

/* ── 12. ABOUT / STATS ─────────────────────────────────────── */
.about-preview--enhanced {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-8);
  align-items: center;
}
.about-preview__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.about-preview__lead {
  font-size: var(--text-xl);
  color: var(--color-text-primary);
  line-height: 1.5;
  margin: 0;
}
.about-preview__lead strong { color: var(--color-blue-500); }
.about-preview__stats {
  padding: var(--space-5);
  background: var(--color-surface-ghost);
  border: 1px solid var(--color-border);
}
.stats-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
.animated-counter {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.animated-counter__value {
  font-family: var(--font-display);
  font-size: var(--text-xxl);
  font-weight: 900;
  color: var(--color-text-primary);
  line-height: 1;
  display: flex;
  align-items: baseline;
}
.animated-counter__suffix {
  font-size: var(--text-xl);
  margin-left: 2px;
}
.animated-counter__label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  font-weight: 500;
}
.animated-counter__sublabel {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--color-text-tertiary);
}

/* About section inner bg */
#about > .page-section__container {
  background: color-mix(in srgb, var(--color-cream-100) 55%, transparent);
  border: 1px solid var(--color-border);
  padding: var(--space-6);
  position: relative;
  z-index: 1;
}

/* ── 13. WORK CARDS ────────────────────────────────────────── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  position: relative;
  z-index: 1;
}
.work-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface-ghost);
  border: 1px solid var(--color-border);
  text-decoration: none;
  overflow: hidden;
  transition:
    background var(--motion-medium) var(--ease-standard),
    border-color var(--motion-medium) var(--ease-standard) 80ms,
    box-shadow var(--motion-medium) var(--ease-standard);
}
.work-card:hover {
  background: color-mix(in srgb, var(--color-black-900) 4%, transparent);
  border-color: var(--color-blue-500);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--color-black-900) 10%, transparent);
}
.work-card:hover .work-card__title { color: var(--color-blue-500); }
.work-card__image {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--color-black-900) 10%, transparent);
}
.work-card__img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
}
.work-card__img-placeholder--blue {
  background: linear-gradient(135deg, #1b5def22, #4a7ff722, #0a2570);
}
.work-card__img-placeholder--orange {
  background: linear-gradient(135deg, #e2532722, #e8734b22, #7a1a00);
}
.work-card__img-placeholder--green {
  background: linear-gradient(135deg, #22c55e22, #15803d22, #0a3d1a);
}
.work-card__content {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}
.work-card__header { display: flex; align-items: center; gap: var(--space-3); }
.work-card__year {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-orange-700);
  background: var(--color-orange-subtle);
  padding: var(--badge-padding);
}
.work-card__role {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-blue-500);
}
.work-card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin: var(--space-1) 0 0;
  color: var(--color-text-primary);
  transition: color var(--motion-medium) var(--ease-standard) .1s;
}
.work-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: var(--space-1) 0 0;
}
.work-card__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.work-card__tag {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  padding: var(--badge-padding);
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}
.work-card__cta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-blue-500);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  opacity: .7;
  transform: translateY(8px);
  transition:
    transform .4s var(--ease-out-soft),
    opacity .4s var(--ease-out-soft);
}
.work-card:hover .work-card__cta { transform: translateY(0); opacity: 1; }
.work-card__cta .arrow { transition: transform var(--motion-fast) var(--ease-standard); }
.work-card:hover .work-card__cta .arrow { transform: translateX(4px); }
.work-cta { margin-top: var(--space-4); text-align: center; position: relative; z-index: 1; }

/* ── 14. SERVICE CARDS ─────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.service-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-surface-ghost);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition:
    background var(--motion-medium) var(--ease-standard),
    border-color var(--motion-medium) var(--ease-standard) 80ms;
}
.service-card:hover {
  background: var(--color-surface-subtle);
  border-color: var(--color-blue-500);
}
.service-card:hover .service-card__title { color: var(--color-blue-500); }
.service-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  transition: color var(--motion-medium) var(--ease-standard) .1s;
}
.service-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}
.services-cta { text-align: center; }

/* Glyphs (3×3 pixel icons) */
.glyph { display: inline-flex; }
.glyph__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 32px;
  height: 32px;
}
.glyph--large .glyph__grid { width: 48px; height: 48px; }
.glyph__cell {
  background: transparent;
  border-radius: 1px;
  transition:
    background var(--motion-fast) var(--ease-standard),
    opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}
.glyph--blue  .glyph__cell--on { background: var(--color-blue-500); }
.glyph--orange .glyph__cell--on { background: var(--color-orange-500); }
.glyph--dark  .glyph__cell--on { background: var(--color-black-900); }

/* Glyph hover animation (cells pop in via JS class) */
.glyph__cell--hover-on {
  transform: scale(1) !important;
  opacity: 1 !important;
}
.glyph--blue  .glyph__cell--hover-on { background: var(--color-blue-500); }
.glyph--orange .glyph__cell--hover-on { background: var(--color-orange-500); }
.glyph--dark  .glyph__cell--hover-on { background: var(--color-black-900); }

/* Off cells during hover: dim but visible as track */
.glyph.is-hovered .glyph__cell:not(.glyph__cell--hover-on):not(.glyph__cell--on) {
  background: color-mix(in srgb, var(--color-black-900) 8%, transparent);
}

/* Keyframe for the pop-in effect */
@keyframes glyph-cell-appear {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.glyph__cell--animating {
  animation: glyph-cell-appear .18s var(--ease-out-expo) forwards;
}

/* ── 15. WRITING CARDS ─────────────────────────────────────── */
.writing-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}
.writing-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--color-surface-ghost);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition:
    background var(--motion-medium) var(--ease-standard),
    border-color var(--motion-medium) var(--ease-standard) 80ms;
}
.writing-card:hover {
  background: var(--color-surface-subtle);
  border-color: var(--color-blue-500);
}
.writing-card:hover .writing-card__title { color: var(--color-blue-500); }
.writing-card__date {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.writing-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  transition: color var(--motion-medium) var(--ease-standard) .1s;
}
.writing-card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}
.writing-card__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-1); }
.writing-card__tag {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  padding: var(--badge-padding);
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}
.writing-cta { text-align: center; }

/* ── 16. TESTIMONIALS ──────────────────────────────────────── */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-5);
}
.testimonial-card {
  position: relative;
  padding: var(--space-5);
  padding-left: calc(var(--space-5) + 4px);
  background: var(--color-surface-ghost);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-blue-500);
  margin: 0;
  transition: background var(--motion-medium) var(--ease-standard);
}
.testimonial-card:hover { background: color-mix(in srgb, var(--color-black-900) 4%, transparent); }
.testimonial-card__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin: 0 0 var(--space-4);
  font-style: italic;
}
.testimonial-card__text::before {
  content: '"';
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-blue-500);
  opacity: .5;
  margin-right: var(--space-1);
}
.testimonial-card__footer { display: flex; flex-direction: column; gap: 2px; }
.testimonial-card__author {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  font-style: normal;
  font-weight: 500;
}
.testimonial-card__role {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--color-text-secondary);
  opacity: .7;
}

/* ── 17. CONTACT SECTION ───────────────────────────────────── */
.contact-section { padding-bottom: calc(var(--space-8) * 2.5); }
.contact-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  position: relative;
  z-index: 1;
}
.contact-title {
  font-family: var(--font-display);
  font-size: var(--text-xxl);
  font-weight: 900;
  margin: 0;
}
.contact-subtitle {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  max-width: 500px;
  margin: 0;
}
.contact-availability {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-green-700);
  padding: var(--space-2) var(--space-3);
  background: var(--color-green-ghost);
  border: 1px solid var(--color-green-tint);
}
.availability-dot {
  width: 6px; height: 6px;
  background: var(--color-green-500);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--color-green-500); }
  50% { opacity: .7; box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-green-500) 0%, transparent); }
}
.contact-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.contact-link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-decoration: none;
}
.contact-link:hover { color: var(--color-blue-500); }
.contact-link-sep { color: var(--color-text-tertiary); }

/* ── 18. SITE FOOTER ───────────────────────────────────────── */
.site-footer {
  position: relative;
  background: var(--color-black-900);
  color: var(--color-cream-100);
  overflow: hidden;
  padding-bottom: var(--status-bar-height);
}
.site-footer__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .15;
}
.site-footer__fade {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to bottom, var(--color-black-900), transparent);
}
.site-footer__container {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-8) var(--container-pad) var(--space-6);
  display: grid;
  gap: var(--space-6);
}
.site-footer__brand {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--color-cream-100);
}
.site-footer__tagline {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: color-mix(in srgb, var(--color-cream-100) 50%, transparent);
  margin-top: -var(--space-4);
}
.site-footer__nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.site-footer__col { display: flex; flex-direction: column; gap: var(--space-3); }
.site-footer__link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: color-mix(in srgb, var(--color-cream-100) 50%, transparent);
  text-decoration: none;
  transition: color var(--motion-fast);
}
.site-footer__link:hover { color: var(--color-cream-100); }
.site-footer__link--heading {
  color: color-mix(in srgb, var(--color-cream-100) 80%, transparent);
  font-weight: 600;
}
.site-footer__legal {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid color-mix(in srgb, var(--color-cream-100) 10%, transparent);
}
.site-footer__legal-link {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: color-mix(in srgb, var(--color-cream-100) 40%, transparent);
  text-decoration: none;
}
.site-footer__legal-link:hover { color: var(--color-cream-100); }
.site-footer__legal-sep { color: color-mix(in srgb, var(--color-cream-100) 20%, transparent); }
.site-footer__copy {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: color-mix(in srgb, var(--color-cream-100) 30%, transparent);
  margin-top: -var(--space-3);
}

/* ── 19. STATUS BAR ────────────────────────────────────────── */
.status-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--status-bar-height);
  background: var(--color-black-900);
  border-top: 1px solid color-mix(in srgb, var(--color-cream-100) 12%, transparent);
  z-index: var(--z-sticky);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: color-mix(in srgb, var(--color-cream-100) 60%, transparent);
}
.status-bar__inner {
  height: 100%;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.status-bar__live,
.status-bar__right {
  display: flex;
  align-items: center;
  gap: 0;
}
.status-bar__segment {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 var(--space-3);
  height: 100%;
  border-right: 1px solid color-mix(in srgb, var(--color-cream-100) 8%, transparent);
}
.status-bar__mode-value { color: var(--color-blue-400); }
.status-bar__path-value { color: color-mix(in srgb, var(--color-cream-100) 70%, transparent); }
.status-bar__hint-value { color: color-mix(in srgb, var(--color-cream-100) 40%, transparent); }
.status-bar__time-value { color: color-mix(in srgb, var(--color-cream-100) 50%, transparent); }
.status-bar__help {
  background: none;
  border: 1px solid color-mix(in srgb, var(--color-cream-100) 15%, transparent);
  color: color-mix(in srgb, var(--color-cream-100) 50%, transparent);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  padding: 2px var(--space-2);
  cursor: none;
  transition: border-color var(--motion-fast), color var(--motion-fast);
}
.status-bar__help:hover {
  border-color: var(--color-blue-500);
  color: var(--color-cream-100);
}

/* ── 20. BACK TO TOP ───────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: calc(var(--status-bar-height) + var(--space-4));
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: color-mix(in srgb, var(--color-cream-100) 90%, transparent);
  border: 1px solid var(--color-border);
  padding: var(--space-2);
  z-index: var(--z-sticky);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--motion-medium), transform var(--motion-medium) var(--ease-out-soft);
  pointer-events: none;
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--color-surface-subtle); border-color: var(--color-blue-500); }
.back-to-top__glyph {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  gap: 2px;
}
.back-to-top__glyph span {
  width: 4px; height: 4px;
  background: color-mix(in srgb, var(--color-black-900) 30%, transparent);
  border-radius: 1px;
}
.back-to-top__label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--color-text-secondary);
}

/* ── 21. SCROLL REVEAL ANIMATIONS ─────────────────────────── */
[data-reveal] {
  opacity: 0;
}
[data-reveal="up"]    { transform: translateY(30px); }
[data-reveal="left"]  { transform: translateX(-30px); }
[data-reveal="blur"]  { filter: blur(8px); }
[data-reveal="scale"] { transform: scale(0.96); }
[data-reveal="fade"]  {}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  filter: none;
  transition:
    opacity .6s var(--ease-out-expo),
    transform .6s var(--ease-out-expo),
    filter .5s var(--ease-out-soft);
}

/* ── 22. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero__container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero__content { order: 2; }
  .hero__visual  { order: 1; }
  .hero__tagline { margin-left: auto; margin-right: auto; }
  .hero__cta     { justify-content: center; }
  .about-preview--enhanced { grid-template-columns: 1fr; }
  .about-preview__stats    { order: -1; }
  .work-grid               { grid-template-columns: 1fr; }
  .top-nav__links          { display: none; }
  .top-nav__burger         { display: flex; }
}

@media (max-width: 768px) {
  .services-grid, .stats-mini-grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer__nav { grid-template-columns: repeat(2, 1fr); }
  .contact-section { padding-bottom: calc(var(--space-8) * 1.5); }
}

@media (max-width: 600px) {
  .hero__title    { font-size: var(--text-xl); }
  .section-title  { font-size: var(--text-xl); }
  .services-grid,
  .problems-grid,
  .writing-preview,
  .testimonials-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-mini-grid  { grid-template-columns: 1fr; gap: var(--space-3); }
  .site-footer__nav { grid-template-columns: 1fr; }
}

@media (min-width: 1440px) {
  .hero__container { gap: calc(var(--space-8) * 1.5); }
  .hero__title     { font-size: clamp(var(--text-xxl), 4vw, 3.5rem); }
}

/* ── 23. REDUCED MOTION ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .data-rain-bg,
  .availability-dot,
  .hero__scroll-chevron,
  .section-scanline--top { display: none; }
  [data-hero-reveal],
  [data-reveal] { opacity: 1; transform: none; filter: none; transition: none; }
  .work-card__cta { opacity: 1; transform: none; }
}

/* ── 24. CARD GLOW EFFECT ──────────────────────────────────── */
.card-glow-pulse {
  position: relative;
}
.card-glow-pulse::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, var(--color-blue-subtle), transparent 50%, var(--color-orange-subtle));
  opacity: 0;
  transition: opacity var(--motion-medium) var(--ease-standard);
  pointer-events: none;
  z-index: -1;
}
.card-glow-pulse:hover::before { opacity: 1; }
