/* ============================================================
   Chuck Hernandez — chuckhernandez.com
   Dual-theme design system: Light (cool precision) + Dark (deep tech)
   ============================================================ */

/* ----- THEME: LIGHT (default) ----- */
[data-theme="light"],
:root {
  --bg-primary: #f4f6f9;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.78);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-header: rgba(244, 246, 249, 0.90);
  --bg-code: rgba(15, 118, 110, 0.05);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.08);
  --accent-glow: rgba(13, 148, 136, 0.12);
  --accent-vivid: #14b8a6;

  --secondary-accent: #6366f1;

  --border: rgba(15, 23, 42, 0.06);
  --border-strong: rgba(15, 23, 42, 0.12);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.06), 0 20px 48px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 0 1px rgba(13, 148, 136, 0.10), 0 4px 24px rgba(13, 148, 136, 0.08);
  --shadow-card-hover: 0 8px 24px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(13, 148, 136, 0.06);

  --gradient-hero:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(13, 148, 136, 0.08) 0%, transparent 100%),
    radial-gradient(ellipse at 80% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, #f4f6f9 0%, #edf0f4 100%);
  --grid-color: rgba(15, 23, 42, 0.025);
  --grid-opacity: 0.4;
  --blob-opacity: 0.06;

  --toggle-bg: rgba(13, 148, 136, 0.10);
  --toggle-knob: var(--accent);

  --pill-bg: rgba(255, 255, 255, 0.72);
  --metric-bg: rgba(255, 255, 255, 0.72);

  --card-gradient: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.68));
  --portrait-gradient: linear-gradient(145deg, rgba(13, 148, 136, 0.06), rgba(99, 102, 241, 0.04));

  --selection-bg: var(--accent);
  --selection-color: #ffffff;

  --gradient-text-from: #0d9488;
  --gradient-text-to: #6366f1;
  --gradient-bar: linear-gradient(90deg, rgba(13, 148, 136, 0.0), rgba(13, 148, 136, 0.18), rgba(99, 102, 241, 0.10), rgba(13, 148, 136, 0.0));
  --list-bullet: var(--accent);

  --btn-primary-color: #ffffff;
  --btn-primary-bg: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  --btn-primary-shadow: 0 4px 14px rgba(13, 148, 136, 0.25), 0 1px 3px rgba(0,0,0,0.08);
  --btn-primary-hover-bg: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  --btn-secondary-bg: rgba(255, 255, 255, 0.72);
  --btn-secondary-border: rgba(15, 23, 42, 0.10);
  --btn-secondary-hover-border: rgba(13, 148, 136, 0.25);
  --btn-secondary-hover-bg: rgba(13, 148, 136, 0.05);

  --brand-bg: linear-gradient(135deg, #0d9488 0%, #6366f1 100%);
  --brand-shadow: 0 6px 20px rgba(13, 148, 136, 0.22), 0 2px 6px rgba(99, 102, 241, 0.12);

  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --max-width: 1180px;
  --transition-speed: 0.35s;
}

/* ----- THEME: DARK ----- */
[data-theme="dark"] {
  --bg-primary: #0c0f14;
  --bg-secondary: #12161e;
  --bg-card: rgba(18, 22, 30, 0.80);
  --bg-card-hover: rgba(24, 30, 42, 0.90);
  --bg-header: rgba(12, 15, 20, 0.88);
  --bg-code: rgba(56, 220, 180, 0.06);

  --text-primary: #e8eaed;
  --text-secondary: #a0a6b4;
  --text-muted: #6b7280;

  --accent: #38dcb4;
  --accent-hover: #2bc4a0;
  --accent-soft: rgba(56, 220, 180, 0.08);
  --accent-glow: rgba(56, 220, 180, 0.15);
  --accent-vivid: #5eead4;

  --secondary-accent: #a78bfa;

  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(56, 220, 180, 0.08), 0 4px 20px rgba(56, 220, 180, 0.06);
  --shadow-card-hover: 0 0 40px rgba(56, 220, 180, 0.08), 0 4px 20px rgba(56, 220, 180, 0.06);

  --gradient-hero: radial-gradient(ellipse at 20% 0%, rgba(56, 220, 180, 0.08) 0%, transparent 50%),
                    radial-gradient(ellipse at 80% 0%, rgba(212, 149, 107, 0.06) 0%, transparent 40%),
                    linear-gradient(180deg, #0c0f14 0%, #10131a 100%);
  --grid-color: rgba(255, 255, 255, 0.025);
  --grid-opacity: 0.5;
  --blob-opacity: 1;

  --toggle-bg: rgba(56, 220, 180, 0.15);
  --toggle-knob: var(--accent);

  --pill-bg: rgba(255, 255, 255, 0.04);
  --metric-bg: rgba(255, 255, 255, 0.03);

  --card-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  --portrait-gradient: linear-gradient(135deg, rgba(56, 220, 180, 0.06), rgba(212, 149, 107, 0.04));

  --selection-bg: var(--accent);
  --selection-color: #0c0f14;

  --gradient-text-from: #38dcb4;
  --gradient-text-to: #d4956b;
  --gradient-bar: linear-gradient(90deg, rgba(56, 220, 180, 0.0), rgba(56, 220, 180, 0.18), rgba(212, 149, 107, 0.12), rgba(56, 220, 180, 0.0));
  --list-bullet: var(--accent);

  --btn-primary-color: #0c0f14;
  --btn-primary-bg: linear-gradient(135deg, #38dcb4 0%, #2bc4a0 100%);
  --btn-primary-shadow: 0 8px 24px rgba(56, 220, 180, 0.22);
  --btn-primary-hover-bg: linear-gradient(135deg, #2bc4a0 0%, #22a88a 100%);
  --btn-secondary-bg: rgba(255, 255, 255, 0.04);
  --btn-secondary-border: rgba(255, 255, 255, 0.10);
  --btn-secondary-hover-border: rgba(56, 220, 180, 0.20);
  --btn-secondary-hover-bg: rgba(56, 220, 180, 0.06);

  --brand-bg: linear-gradient(135deg, #38dcb4 0%, #a78bfa 100%);
  --brand-shadow: 0 6px 20px rgba(56, 220, 180, 0.25), 0 2px 6px rgba(167, 139, 250, 0.15);

  --gradient-text-to: #a78bfa;
}

/* ===== BASE RESET ===== */

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--gradient-hero);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* Subtle grid overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, var(--grid-color) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: var(--grid-opacity);
  z-index: 0;
  transition: opacity var(--transition-speed) ease;
}

/* Animated ambient glow blob */
body::after {
  content: "";
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: var(--blob-opacity);
  animation: float 20s ease-in-out infinite;
  transition: opacity var(--transition-speed) ease;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-80px, 60px) scale(1.1); }
  66% { transform: translate(40px, -40px) scale(0.95); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

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

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

/* ===== SKIP LINK ===== */

.skip-link {
  position: absolute;
  left: 16px;
  top: -56px;
  z-index: 200;
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--selection-color);
  background: var(--accent);
  text-decoration: none;
}

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

/* ===== LAYOUT ===== */

.container {
  position: relative;
  z-index: 1;
  width: min(100% - 40px, var(--max-width));
  margin: 0 auto;
}

/* ===== SITE HEADER ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* ===== BRAND ===== */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #ffffff;
  background: var(--brand-bg);
  box-shadow: var(--brand-shadow);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  overflow: hidden;
  transition: box-shadow var(--transition-speed) ease, background var(--transition-speed) ease, transform 0.2s ease;
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 50%);
  pointer-events: none;
}

.brand:hover .brand-mark {
  transform: scale(1.05);
  box-shadow: var(--brand-shadow), 0 0 24px var(--accent-glow);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  transition: color var(--transition-speed) ease;
}

.brand-tag {
  font-family: "IBM Plex Mono", monospace;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color var(--transition-speed) ease;
}

/* ===== NAVIGATION ===== */

.site-nav-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--pill-bg);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.menu-button svg {
  width: 20px;
  height: 20px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.header-cta {
  margin-left: 6px;
}

/* ===== THEME TOGGLE ===== */

.theme-toggle {
  display: flex;
  align-items: center;
  margin-left: 4px;
}

.theme-switch {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--toggle-bg);
  cursor: pointer;
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
  flex-shrink: 0;
}

.theme-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--toggle-knob);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-speed) ease, background var(--transition-speed) ease;
}

[data-theme="light"] .theme-switch::after {
  transform: translateX(22px);
}

.theme-switch-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  transition: opacity var(--transition-speed) ease;
  stroke: var(--text-muted);
}

.icon-moon {
  left: 5px;
  opacity: 1;
}

.icon-sun {
  right: 5px;
  opacity: 0.4;
}

[data-theme="light"] .icon-moon {
  opacity: 0.4;
}

[data-theme="light"] .icon-sun {
  opacity: 1;
}

/* ===== BUTTONS ===== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background var(--transition-speed) ease, border-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--btn-primary-color) !important;
  background: var(--btn-primary-bg);
  box-shadow: var(--btn-primary-shadow);
}

.button-primary:hover {
  background: var(--btn-primary-hover-bg);
  box-shadow: var(--btn-primary-shadow), 0 0 32px var(--accent-glow);
}

.button-secondary {
  color: var(--text-primary);
  background: var(--btn-secondary-bg);
  border-color: var(--btn-secondary-border);
}

.button-secondary:hover {
  border-color: var(--btn-secondary-hover-border);
  background: var(--btn-secondary-hover-bg);
}

.button-tertiary {
  color: var(--accent);
  background: transparent;
  border-color: var(--accent-soft);
}

/* ===== PAGE HERO ===== */

.page-hero {
  padding: 90px 0 40px;
  position: relative;
}

.page-hero.compact {
  padding-bottom: 12px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 40px;
  align-items: start;
}

.hero-copy {
  padding-right: 24px;
}

.hero-side {
  display: grid;
  gap: 18px;
}

/* ===== EYEBROW ===== */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  transition: background var(--transition-speed) ease;
}

[data-theme="dark"] .eyebrow::before {
  animation: pulse 2s ease-in-out infinite;
}

/* ===== TYPOGRAPHY ===== */

.display {
  max-width: 14ch;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  transition: color var(--transition-speed) ease;
}

.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;
}

.page-title {
  max-width: 13ch;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.lead {
  max-width: 68ch;
  margin-top: 22px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  transition: color var(--transition-speed) ease;
}

/* ===== CTA + TRUST ROWS ===== */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--pill-bg);
  font-size: 0.84rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  text-decoration: none;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

/* ===== PORTRAIT CARD ===== */

.portrait-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-gradient);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.portrait-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -40%;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
}

.portrait-card::after {
  content: "";
  position: absolute;
  inset: auto 24px 0;
  height: 3px;
  border-radius: 999px;
  background: var(--gradient-bar);
}

.portrait-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 280px);
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transition: border-color var(--transition-speed) ease;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-copy {
  margin-top: 16px;
  display: grid;
  gap: 4px;
  text-align: center;
}

.portrait-copy strong {
  font-size: 1rem;
}

.portrait-copy span {
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: color var(--transition-speed) ease;
}

.portrait-note {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.75;
  text-align: center;
  transition: color var(--transition-speed) ease;
}

/* ===== HERO PANEL ===== */

.hero-panel {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-gradient);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.hero-panel h2,
.panel-title,
.card h3,
.case-study h2,
.article-card h3,
.quote-card h3,
.contact-panel h2 {
  font-size: 1.18rem;
  line-height: 1.3;
}

.hero-panel p,
.card p,
.case-study p,
.article-card p,
.timeline-card p,
.contact-panel p {
  color: var(--text-muted);
  transition: color var(--transition-speed) ease;
}

/* ===== LIST CLEAN ===== */

.list-clean {
  margin-top: 16px;
  list-style: none;
}

.list-clean li {
  position: relative;
  padding-left: 22px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color var(--transition-speed) ease;
}

.list-clean li + li {
  margin-top: 12px;
}

.list-clean li::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--list-bullet);
  transition: background var(--transition-speed) ease;
}

/* ===== CREDENTIALS ===== */

.credentials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.credential {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--pill-bg);
  border: 1px solid var(--border);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

/* ===== PANELS ===== */

.panel {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

/* ===== METRICS ===== */

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.metric {
  padding: 20px;
  border-radius: var(--radius-sm);
  background: var(--metric-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.metric:hover {
  transform: translateY(-2px);
  border-color: var(--accent-glow);
  box-shadow: var(--shadow-glow);
}

.metric-value {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--gradient-text-from), var(--gradient-text-to));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.metric-label {
  margin-top: 8px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--transition-speed) ease;
}

/* ===== SECTIONS ===== */

.section {
  padding: 64px 0;
}

.section-alt {
  padding: 64px 0;
}

.section-alt .panel,
.section-alt .card,
.section-alt .case-study,
.section-alt .article-card,
.section-alt .faq-item,
.section-alt .quote-card,
.section-alt .contact-panel,
.section-alt .timeline-card {
  background: var(--bg-card-hover);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 70ch;
  margin-bottom: 32px;
}

.section-kicker {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color var(--transition-speed) ease;
}

.section-head h2 {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  transition: color var(--transition-speed) ease;
}

.section-head p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  transition: color var(--transition-speed) ease;
}

/* ===== GRIDS ===== */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* ===== CARDS ===== */

.card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-speed) ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-glow);
  box-shadow: var(--shadow-card-hover);
}

.card-tag,
.article-meta,
.case-meta,
.service-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color var(--transition-speed) ease;
}

.card-tag::before,
.article-meta::before,
.case-meta::before,
.service-meta::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 4px var(--accent-glow);
}

/* ===== SERVICE CARDS ===== */

.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: "";
  position: absolute;
  inset: auto 24px 0 24px;
  height: 3px;
  border-radius: 999px;
  background: var(--gradient-bar);
}

.service-card h3 {
  max-width: 18ch;
  font-size: 1.32rem;
}

.service-card .link-inline {
  margin-top: 18px;
}

/* ===== DETAIL GRID ===== */

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(250px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.detail-sidebar {
  padding: 20px;
  border-radius: 18px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.detail-sidebar h3 {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-sidebar p + p,
.detail-sidebar ul {
  margin-top: 12px;
}

.detail-sidebar ul {
  list-style: none;
}

.detail-sidebar li + li {
  margin-top: 10px;
}

/* ===== PROCESS GRID ===== */

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.process-step {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.process-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--btn-primary-color);
  background: var(--accent);
  font-weight: 700;
}

.process-step h3 {
  margin-top: 16px;
  font-size: 1.04rem;
}

.process-step p {
  margin-top: 10px;
  color: var(--text-muted);
  transition: color var(--transition-speed) ease;
}

/* ===== QUOTE CARD ===== */

.quote-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.quote-card p {
  font-size: 1.06rem;
  line-height: 1.9;
  color: var(--text-secondary);
  transition: color var(--transition-speed) ease;
}

.quote-attribution {
  margin-top: 18px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--transition-speed) ease;
}

/* ===== CASE STUDY / TIMELINE / ARTICLE / CONTACT ===== */

.case-study,
.timeline-card,
.article-card,
.contact-panel {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.case-study + .case-study,
.timeline-card + .timeline-card {
  margin-top: 20px;
}

.case-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1fr);
  gap: 24px;
}

.case-summary {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color var(--transition-speed) ease;
}

.case-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.case-point {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--pill-bg);
  border: 1px solid var(--border);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.case-point h3 {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-point p {
  margin-top: 8px;
  font-size: 0.94rem;
}

/* ===== TIMELINE ===== */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.timeline-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
}

.timeline-year {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color var(--transition-speed) ease;
}

.timeline-card h3 {
  font-size: 1.12rem;
}

/* ===== FAQ ===== */

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  padding: 6px 24px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  padding-bottom: 10px;
  color: var(--text-muted);
  transition: color var(--transition-speed) ease;
}

/* ===== ARTICLE GRID ===== */

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.article-card h3 {
  max-width: 18ch;
  font-size: 1.26rem;
}

.article-card p {
  margin-top: 12px;
}

/* ===== LINK INLINE ===== */

.link-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.link-inline:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* ===== CONTACT PANEL ===== */

.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-link {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--pill-bg);
  text-decoration: none;
  transition: background var(--transition-speed) ease, border-color 0.2s ease;
}

.contact-link:hover {
  border-color: var(--accent-glow);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.contact-link {
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-link strong {
  display: block;
  font-size: 0.98rem;
}

.contact-link span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: color var(--transition-speed) ease;
}

/* ===== ARTICLE SHELL ===== */

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.34fr);
  gap: 24px;
  align-items: start;
}

.article-content,
.article-aside {
  padding: 28px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.article-aside h2 {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-aside p,
.article-aside li {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color var(--transition-speed) ease;
}

.article-aside ul {
  list-style: none;
  margin-top: 12px;
}

.article-aside li + li {
  margin-top: 10px;
}

/* ===== PROSE ===== */

.prose {
  display: grid;
  gap: 22px;
}

.prose h2,
.prose h3 {
  font-family: "IBM Plex Sans", sans-serif;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.prose h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.prose h3 {
  font-size: 1.55rem;
}

.prose p,
.prose li {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.9;
  transition: color var(--transition-speed) ease;
}

.prose ul,
.prose ol {
  margin-left: 20px;
}

.prose li + li {
  margin-top: 10px;
}

/* ===== FOOTER ===== */

.site-footer {
  padding: 40px 0 54px;
  position: relative;
  z-index: 1;
}

.site-footer .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  transition: border-color var(--transition-speed) ease;
}

.footer-copy p {
  max-width: 56ch;
  color: var(--text-muted);
  transition: color var(--transition-speed) ease;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.footer-links a {
  text-decoration: none;
}

/* ===== UTILITIES ===== */

.muted-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition-speed) ease;
}

.spacer-top {
  margin-top: 20px;
}

/* ===== REVEAL ANIMATION ===== */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button,
  .reveal,
  .card,
  .metric {
    transition: none;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
  }

  body::after {
    animation: none;
  }

  .eyebrow::before {
    animation: none;
  }
}

/* ===== RESPONSIVE: 1080px ===== */

@media (max-width: 1080px) {
  .hero-grid,
  .detail-grid,
  .contact-panel,
  .article-shell {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-right: 0;
  }

  .hero-side {
    max-width: 460px;
  }

  .article-grid,
  .grid-3,
  .process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== RESPONSIVE: 900px ===== */

@media (max-width: 900px) {
  .site-header .container {
    align-items: flex-start;
  }

  .menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav-wrap {
    flex-direction: column;
    align-items: flex-end;
  }

  .site-nav {
    display: none;
    width: min(320px, calc(100vw - 40px));
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-header);
    backdrop-filter: blur(20px) saturate(1.3);
    box-shadow: var(--shadow-lg);
    transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav a,
  .header-cta {
    width: 100%;
  }

  .header-cta {
    margin-left: 0;
    margin-top: 8px;
  }

  .header-cta .button {
    width: 100%;
  }

  .metric-row,
  .grid-2,
  .case-layout,
  .case-points,
  .timeline-card,
  .site-footer .container {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

/* ===== RESPONSIVE: 700px ===== */

@media (max-width: 700px) {
  .page-hero {
    padding-top: 60px;
  }

  .display {
    max-width: none;
  }

  .article-grid,
  .grid-3,
  .process-grid {
    grid-template-columns: 1fr;
  }

  .metric-row {
    margin-top: 30px;
  }

  .portrait-card,
  .hero-panel {
    padding: 22px;
  }

  .cta-row,
  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }
}
