/* ============================================================
   rednalsidrah.sa — Portfolio Stylesheet v3
   Stack: Pure CSS + CSS Custom Properties (no build step)
   Type: Space Grotesk (display) · Inter (body) · JetBrains Mono (labels)
   Theme: Olive — light/dark auto + manual toggle
   Fonts are loaded via <link> in each page head (not @import).
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */

:root {
  /* Light mode */
  --bg:           #F4F0E6;
  --surface:      #ECE7D8;
  --surface-2:    #E3DDCB;
  --ink:          #25261C;
  --text:         #25261C;
  --text-muted:   #6B6852;
  --accent:       #5C6B2E;
  --accent-hover: #4A5524;
  --accent-soft:  #E9EBDA;
  --border:       #D6CEBB;
  --border-strong:#C4BBA4;
  --tag-bg:       #DFDAC7;
  --tag-text:     #45452D;
  --on-accent:    #FFFFFF;
  --shadow-sm:    0 1px 2px rgba(37, 38, 28, 0.05);
  --shadow-md:    0 14px 34px -18px rgba(37, 38, 28, 0.28);
  --shadow-lg:    0 24px 60px -28px rgba(37, 38, 28, 0.35);
  --grid-line:    rgba(37, 38, 28, 0.05);

  /* Typography */
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', 'Courier New', monospace;

  /* Scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --max-width:    1040px;
  --nav-height:   64px;
  --radius:       4px;
  --radius-lg:    10px;
  --radius-xl:    16px;

  /* Transitions */
  --transition: 200ms ease;
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #191A12;
    --surface:      #22231A;
    --surface-2:    #2B2C21;
    --ink:          #E8E4D4;
    --text:         #E8E4D4;
    --text-muted:   #9A9578;
    --accent:       #8FA44A;
    --accent-hover: #A8C057;
    --accent-soft:  #262B17;
    --border:       #37382B;
    --border-strong:#474836;
    --tag-bg:       #2E2F23;
    --tag-text:     #BDB894;
    --on-accent:    #14150E;
    --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md:    0 14px 34px -16px rgba(0, 0, 0, 0.6);
    --shadow-lg:    0 24px 60px -24px rgba(0, 0, 0, 0.7);
    --grid-line:    rgba(232, 228, 212, 0.05);
  }
}

/* Manual overrides from toggle */
[data-theme="light"] {
  --bg:           #F4F0E6;
  --surface:      #ECE7D8;
  --surface-2:    #E3DDCB;
  --ink:          #25261C;
  --text:         #25261C;
  --text-muted:   #6B6852;
  --accent:       #5C6B2E;
  --accent-hover: #4A5524;
  --accent-soft:  #E9EBDA;
  --border:       #D6CEBB;
  --border-strong:#C4BBA4;
  --tag-bg:       #DFDAC7;
  --tag-text:     #45452D;
  --on-accent:    #FFFFFF;
  --shadow-sm:    0 1px 2px rgba(37, 38, 28, 0.05);
  --shadow-md:    0 14px 34px -18px rgba(37, 38, 28, 0.28);
  --shadow-lg:    0 24px 60px -28px rgba(37, 38, 28, 0.35);
  --grid-line:    rgba(37, 38, 28, 0.05);
}

[data-theme="dark"] {
  --bg:           #191A12;
  --surface:      #22231A;
  --surface-2:    #2B2C21;
  --ink:          #E8E4D4;
  --text:         #E8E4D4;
  --text-muted:   #9A9578;
  --accent:       #8FA44A;
  --accent-hover: #A8C057;
  --accent-soft:  #262B17;
  --border:       #37382B;
  --border-strong:#474836;
  --tag-bg:       #2E2F23;
  --tag-text:     #BDB894;
  --on-accent:    #14150E;
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md:    0 14px 34px -16px rgba(0, 0, 0, 0.6);
  --shadow-lg:    0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --grid-line:    rgba(232, 228, 212, 0.05);
}

/* ============================================================
   2. RESET
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea { font: inherit; }

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

::selection {
  background-color: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--text);
}

[id] { scroll-margin-top: calc(var(--nav-height) + 24px); }

/* ============================================================
   3. LAYOUT
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.section {
  padding-block: clamp(var(--space-16), 9vw, var(--space-24));
}

.section-tight { padding-block: clamp(var(--space-12), 7vw, var(--space-16)); }

.section + .section,
.section + .section-tight,
.section-tight + .section { border-top: 1px solid var(--border); }

/* Editorial two-column layout (label | content) */
.editorial-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 720px) {
  .editorial-row {
    grid-template-columns: 200px 1fr;
    gap: var(--space-12);
    align-items: start;
  }
}

.editorial-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding-top: 6px;
}

.editorial-label .index { color: var(--accent); margin-right: 0.5em; }

/* Section header pattern */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
  margin-bottom: clamp(var(--space-8), 5vw, var(--space-12));
}

.section-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.6vw, 2.625rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 22ch;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  white-space: nowrap;
  padding-bottom: 6px;
  transition: color var(--transition);
}

.section-link:hover { color: var(--accent); }
.section-link svg { transition: transform var(--transition); }
.section-link:hover svg { transform: translateX(3px); }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* Blueprint grid motif — subtle, used on hero / CTA band */
.bg-grid {
  position: relative;
}

.bg-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 78%);
}

.bg-grid > * { position: relative; }

/* ============================================================
   4. TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: var(--text-5xl); font-weight: 700; }
h2 { font-size: var(--text-3xl); font-weight: 700; }
h3 { font-size: var(--text-xl);  font-weight: 600; }
h4 { font-size: var(--text-lg);  font-weight: 600; }

p { color: var(--text); line-height: 1.75; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.lead {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 62ch;
}

.mono { font-family: var(--font-mono); }

.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 500;
  color: var(--accent);
  transition: gap var(--transition), color var(--transition);
}
.arrow-link:hover { gap: var(--space-3); color: var(--accent-hover); }

/* Prose — used in case studies, about bio, article body */
.prose { max-width: 68ch; }
.prose > * + * { margin-top: var(--space-5); }
.prose p { color: var(--text-muted); }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--text); }
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition);
}
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: var(--space-6); }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: var(--space-2); color: var(--text-muted); line-height: 1.7; }
.prose li::marker { color: var(--accent); }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius);
  color: var(--text);
}
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-5);
  margin-left: 0;
  color: var(--text-muted);
  font-style: italic;
}
.prose hr { border: none; border-top: 1px solid var(--border); margin: var(--space-12) 0; }

/* ============================================================
   5. HEADER & NAVIGATION
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition), border-color var(--transition);
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: -1;
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.nav-logo:hover { opacity: 0.75; }

.nav-logo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: color var(--transition);
  padding-block: 4px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: color var(--transition), background-color var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface);
}

.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="dark"]  .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"]  .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
  .theme-toggle .icon-sun  { display: block; }
  .theme-toggle .icon-moon { display: none; }
}

/* Mobile hamburger */
.nav-mobile-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-mobile-btn:hover { color: var(--text); }

/* Mobile nav drawer */
.nav-mobile-menu {
  display: none;
  position: fixed;
  inset: var(--nav-height) 0 0 0;
  background: var(--bg);
  padding: var(--space-8) var(--space-6) var(--space-6);
  z-index: 99;
  overflow-y: auto;
  flex-direction: column;
  gap: 0;
}

.nav-mobile-menu.is-open { display: flex; }

.nav-mobile-menu > a {
  font-size: var(--text-2xl);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-block: var(--space-4);
  transition: color var(--transition), padding-left var(--transition);
}

.nav-mobile-menu > a:hover { color: var(--accent); padding-left: var(--space-2); }

.mobile-menu-foot {
  margin-top: auto;
  padding-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.mobile-menu-mail {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
}

.mobile-menu-social {
  display: flex;
  gap: var(--space-5);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.mobile-menu-social a:hover { color: var(--text); }

@media (max-width: 767px) {
  .nav-links { display: none; }
  .nav-mobile-btn { display: flex; }
}

/* ============================================================
   6. FOOTER
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-12) var(--space-8);
  margin-top: auto;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--surface) 55%, transparent));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: var(--space-12);
  }
}

.footer-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text);
}

.footer-tag {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 32ch;
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-nav a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  width: fit-content;
  transition: color var(--transition);
}

.footer-nav a:hover { color: var(--accent); }

.footer-bottom {
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.footer-copy,
.footer-loc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ============================================================
   7. BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius);
  padding: 10px 20px;
  transition: background-color var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.btn-lg {
  font-size: var(--text-base);
  padding: 13px 26px;
  border-radius: var(--radius-lg);
}

/* Buttons inside prose must beat .prose a (higher specificity wins). */
.prose a.btn { text-decoration: none; }
.prose a.btn-primary { color: var(--on-accent); }
.prose a.btn-ghost { color: var(--text); }
.prose a.btn-ghost:hover { color: var(--accent); }

/* ============================================================
   8. TAGS / BADGES
   ============================================================ */

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--tag-bg);
  color: var(--tag-text);
  white-space: nowrap;
  line-height: 1.6;
}

.tag-accent {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border-radius: 100px;
  padding: 6px 14px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .pulse-dot {
    animation: pulse 2.4s ease-out infinite;
  }

  @keyframes pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
    70%  { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
  }
}

/* ============================================================
   9. HERO — HOME
   ============================================================ */

.hero-home {
  position: relative;
  padding-top: clamp(var(--space-16), 8vw, var(--space-24));
  padding-bottom: clamp(var(--space-16), 8vw, var(--space-24));
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

.hero-eyebrow-rule {
  width: 36px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

.hero-title {
  font-size: clamp(2.5rem, 6.5vw, 4.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 15ch;
  margin-bottom: var(--space-6);
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-lead {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 56ch;
  margin-bottom: var(--space-8);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hero-meta {
  margin-top: clamp(var(--space-10), 5vw, var(--space-16));
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-12);
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.hero-meta-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.hero-meta-value {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

/* Home hero split layout */
.home-hero-split {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

@media (min-width: 800px) {
  .home-hero-split {
    flex-direction: row;
    align-items: center;
    gap: var(--space-16);
  }
}

.home-hero-text { min-width: 0; flex: 1; }

.home-hero-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  order: -1;
}

@media (min-width: 800px) {
  .home-hero-portrait {
    order: 0;
    flex-shrink: 0;
    align-items: center;
  }
}

.portrait-wrap {
  position: relative;
  width: 148px;
  height: 148px;
}

@media (min-width: 800px) {
  .portrait-wrap { width: 264px; height: 264px; }
}

.portrait-wrap::before {
  content: '';
  position: absolute;
  inset: -10px;
  border: 1px dashed var(--border-strong);
  border-radius: 50%;
  transition: transform 24s linear;
}

@media (prefers-reduced-motion: no-preference) {
  .portrait-wrap:hover::before { transform: rotate(180deg); }
}

.home-portrait {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 8%;
  display: block;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  filter: sepia(8%) contrast(1.02);
  transition: filter var(--transition);
}

.home-portrait:hover { filter: sepia(0%) contrast(1.04); }

/* ============================================================
   10. PAGE HERO — SUBPAGES
   ============================================================ */

.page-hero {
  padding-top: clamp(var(--space-16), 8vw, var(--space-24));
  padding-bottom: clamp(var(--space-12), 6vw, var(--space-20));
  border-bottom: 1px solid var(--border);
}

.page-hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 24ch;
  margin-bottom: var(--space-5);
}

.page-hero-title em { font-style: normal; color: var(--accent); }

.page-hero-lead {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 60ch;
}

/* ============================================================
   11. PROOF BAND — STATS
   ============================================================ */

.stats-band {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-block: 1px solid var(--border);
}

.stat-cell {
  padding: clamp(var(--space-6), 4vw, var(--space-10)) var(--space-6);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-cell:nth-child(2n) { border-right: none; }
.stat-cell:nth-child(n+3) { border-bottom: none; }

@media (min-width: 720px) {
  .stats-band { grid-template-columns: repeat(4, 1fr); }
  .stat-cell { border-bottom: none; }
  .stat-cell:not(:last-child) { border-right: 1px solid var(--border); }
  .stat-cell:nth-child(2n) { border-right: 1px solid var(--border); }
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(2.125rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-3);
}

.stat-value .unit { color: var(--accent); }

.stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  line-height: 1.6;
}

.stats-note {
  margin-top: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.stats-note span { color: var(--accent); }

/* ============================================================
   12. CAPABILITY CARDS — WHAT I DO
   ============================================================ */

.cap-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 720px) {
  .cap-grid { grid-template-columns: 1fr 1fr; }
}

.cap-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: clamp(var(--space-6), 4vw, var(--space-8));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.cap-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.cap-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.cap-index {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.08em;
}

.cap-card h3 {
  font-size: var(--text-xl);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.cap-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
}

.cap-card .tags { margin-top: auto; }

/* ============================================================
   13. CASE STUDY CARDS
   ============================================================ */

.work-grid {
  display: grid;
  gap: var(--space-4);
}

.case-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: clamp(var(--space-6), 4vw, var(--space-8));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.case-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.case-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}

.case-card-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.case-card h3 {
  font-size: var(--text-xl);
  line-height: 1.3;
  letter-spacing: -0.015em;
  max-width: 30ch;
}

.case-card-arrow {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition), transform var(--transition), background-color var(--transition);
}

.case-card:hover .case-card-arrow {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  transform: rotate(45deg);
}

.case-card-summary {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
}

.case-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--border);
}

.metric { display: flex; flex-direction: column; gap: 1px; }

.metric-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.case-card-link {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
}

/* Featured card — larger on desktop */
@media (min-width: 720px) {
  .work-grid { grid-template-columns: 1fr 1fr; }
  .case-card.featured { grid-column: 1 / -1; }
  .case-card.featured h3 { font-size: var(--text-2xl); max-width: 34ch; }
}

/* ============================================================
   14. TIMELINE (Experience)
   ============================================================ */

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: var(--space-8);
  padding-bottom: var(--space-8);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-1);
}

.timeline-role {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-1);
}

.timeline-company {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.timeline-note {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 62ch;
}

.timeline-bullets {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: var(--space-4);
  border-left: 2px solid var(--border);
}

.timeline-bullets li {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.65;
}

/* Compact variant used on the home page */
.timeline-compact .timeline-item { padding-bottom: var(--space-8); }
.timeline-compact .timeline-note { margin-top: var(--space-1); }

/* ============================================================
   15. EXPERTISE DOMAINS
   ============================================================ */

.domain-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.domain-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 720px) {
  .domain-row {
    grid-template-columns: 240px 1fr;
    gap: var(--space-8);
    align-items: start;
  }
}

.domain-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.domain-index {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.05em;
}

.skills-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.skill-pill {
  font-size: var(--text-sm);
  padding: 5px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}

.skill-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

/* Skills groups (about page) */
.skills-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.skills-group h4 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: var(--space-3);
}

/* ============================================================
   16. PERSONAL SIDE CARDS
   ============================================================ */

.duo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 720px) {
  .duo-grid { grid-template-columns: 1fr 1fr; }
}

.duo-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.duo-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.duo-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.duo-card h3 {
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}

.duo-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
}

.duo-card .arrow-link {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ============================================================
   17. CTA BAND
   ============================================================ */

.cta-band {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--border);
  padding-block: clamp(var(--space-16), 9vw, var(--space-24));
  text-align: center;
}

.cta-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 20ch;
  margin-inline: auto;
  margin-bottom: var(--space-5);
}

.cta-title em { font-style: normal; color: var(--accent); }

.cta-sub {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 54ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.cta-note {
  margin-top: var(--space-8);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================================
   18. PRINCIPLES (About)
   ============================================================ */

.principles {
  counter-reset: principle;
  display: flex;
  flex-direction: column;
}

.principles li {
  counter-increment: principle;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--space-5);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.principles li:first-child { border-top: 1px solid var(--border); }

.principle-num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
  padding-top: 3px;
}

.principle-num::before { content: counter(principle, decimal-leading-zero); }

.principle-body strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.principle-body span {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================================
   19. CERTIFICATIONS
   ============================================================ */

.cert-group + .cert-group { margin-top: var(--space-8); }

.cert-group-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--space-3);
}

.cert-card {
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: border-color var(--transition), transform var(--transition);
}

.cert-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.cert-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.cert-issuer {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================================
   20. RESUME
   ============================================================ */

.resume-download-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

.resume-download-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.resume-download-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.resume-section-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-8);
}

/* ============================================================
   21. CASE STUDY DETAIL PAGES
   ============================================================ */

.case-hero {
  position: relative;
  padding-top: clamp(var(--space-16), 8vw, var(--space-24));
  padding-bottom: clamp(var(--space-12), 6vw, var(--space-20));
  border-bottom: 1px solid var(--border);
}

.case-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
  transition: color var(--transition);
}

.case-back:hover { color: var(--accent); }

.case-hero-title {
  font-size: clamp(2rem, 5vw, 3.125rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 24ch;
  margin-bottom: var(--space-5);
}

.case-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-6);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
  margin-top: var(--space-8);
}

.case-meta-item { display: flex; flex-direction: column; gap: var(--space-1); }

.case-meta-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.case-meta-value {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

.case-body {
  padding-block: clamp(var(--space-12), 7vw, var(--space-20));
}

.case-section { margin-bottom: clamp(var(--space-12), 7vw, var(--space-20)); }
.case-section:last-child { margin-bottom: 0; }

.case-section-heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.outcomes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.outcome-card {
  padding: var(--space-5) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--accent);
}

.outcome-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: var(--space-1);
}

.outcome-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

.case-nav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.arch-frame {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-6);
}

/* ============================================================
   22. STRAVA / RUNNING ACTIVITIES
   ============================================================ */

.strava-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.strava-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FC4C02;
  transition: opacity var(--transition);
}
.strava-link:hover { opacity: 0.75; }
.strava-link svg { width: 16px; height: 16px; }

.activity-grid {
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .activity-grid { grid-template-columns: 1fr 1fr; }
}

.activity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.activity-card:hover {
  border-color: #FC4C02;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.activity-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.activity-type-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FC4C02;
}

.activity-date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.activity-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.activity-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.activity-stat { display: flex; flex-direction: column; gap: 2px; }

.activity-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.activity-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.activity-elevation {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.activity-loading, .activity-error {
  grid-column: 1 / -1;
  padding: var(--space-12);
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* ============================================================
   23. PAGE — CONTACT
   ============================================================ */

.email-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: clamp(var(--space-6), 4vw, var(--space-8));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.email-address {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.6vw, 1.375rem);
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
  line-height: 1.4;
}

.email-address a:hover { color: var(--accent); }

.email-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.copy-btn.is-copied {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.help-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .help-list { grid-template-columns: 1fr 1fr; }
}

.help-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.help-list svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--accent);
}

.social-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}

.social-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 140px;
  height: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition),
              background-color var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}

.social-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.social-btn svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.social-btn-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (min-width: 640px) {
  .social-btn { width: 160px; height: 160px; }
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

/* ============================================================
   24. WRITING / ARTICLE PAGE
   ============================================================ */

.article-hero {
  padding-block: clamp(var(--space-16), 8vw, var(--space-24)) var(--space-12);
  border-bottom: 1px solid var(--border);
}

.article-body { padding-block: var(--space-12) clamp(var(--space-16), 9vw, var(--space-24)); }
.article-body .prose { max-width: 68ch; }

.article-body .prose h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: var(--space-12);
  color: var(--text);
}

.article-byline {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.article-byline strong { color: var(--text); font-weight: 500; }
.article-reading-time { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.04em; }

.article-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: var(--space-8);
  transition: color var(--transition);
}
.article-back:hover { color: var(--accent); }

.article-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 24ch;
  color: var(--text);
}

/* ============================================================
   25. SCROLL REVEAL ANIMATIONS
   Applied only when JS is available (html.js) and motion is allowed.
   ============================================================ */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  will-change: opacity, transform;
}

html.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

html.js [data-reveal].d1 { transition-delay: 60ms; }
html.js [data-reveal].d2 { transition-delay: 120ms; }
html.js [data-reveal].d3 { transition-delay: 180ms; }
html.js [data-reveal].d4 { transition-delay: 240ms; }

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

  html.js [data-reveal],
  html.js [data-reveal].d1,
  html.js [data-reveal].d2,
  html.js [data-reveal].d3,
  html.js [data-reveal].d4 {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   26. UTILITIES
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.hidden { display: none !important; }

.font-display { font-family: var(--font-display); }
.font-mono    { font-family: var(--font-mono); }

.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }

.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ============================================================
   27. RESPONSIVE TWEAKS
   ============================================================ */

@media (max-width: 639px) {
  .section { padding-block: var(--space-16); }
  .stat-cell { padding-inline: var(--space-4); }
  .case-card, .cap-card, .repo-card { padding: var(--space-5); }
  .principles li { grid-template-columns: 36px 1fr; gap: var(--space-4); }
  .email-block { align-items: stretch; flex-direction: column; }
  .email-actions { justify-content: flex-start; }
}

/* ============================================================
   28. PRINT
   ============================================================ */

@media print {
  .site-header, .site-footer, .btn, .copy-btn, .no-print { display: none !important; }
  body { color: #000; background: #fff; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.75em; color: #666; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   29. ACCESSIBILITY — SKIP LINK
   ============================================================ */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-2) var(--space-5);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--space-3); }

/* ============================================================
   30. ARCHITECTURE DIAGRAM — DARK MODE OVERRIDES
   The inline SVG in work/alrajhi-vmware-platform.html uses hardcoded
   hex presentation attributes; CSS property overrides win in modern
   browsers. Keep selectors in sync with the SVG markup.
   ============================================================ */

@media (prefers-color-scheme: dark) {
  .arch-svg text                        { fill: #F0ECD8; }
  .arch-svg text[fill="#7A7860"]        { fill: #C4BE9F !important; }
  .arch-svg text[fill="#4A4A30"]        { fill: #C4BE9F !important; }
  .arch-svg text[fill="#5C6B2E"]        { fill: #A8C057 !important; }
  .arch-svg text[fill="#8FA44A"]        { fill: #BACE6B !important; }
  .arch-svg rect[fill="#fff"]           { fill: #3E4228 !important; fill-opacity: 1 !important; }
  .arch-svg rect[fill-opacity="0.06"]   { fill-opacity: 0.28 !important; }
  .arch-svg rect[fill-opacity="0.08"]   { fill-opacity: 0.28 !important; }
  .arch-svg rect[fill-opacity="0.1"]    { fill-opacity: 0.25 !important; }
  .arch-svg rect[fill-opacity="0.12"]   { fill-opacity: 0.32 !important; }
  .arch-svg rect[stroke="#D4CCBA"]      { stroke: #555843 !important; }
  .arch-svg polygon                     { fill: #A8C057 !important; }
  .arch-svg polygon[fill="#8FA44A"]     { fill: #BACE6B !important; }
}

[data-theme="dark"] .arch-svg text                        { fill: #F0ECD8; }
[data-theme="dark"] .arch-svg text[fill="#7A7860"]        { fill: #C4BE9F !important; }
[data-theme="dark"] .arch-svg text[fill="#4A4A30"]        { fill: #C4BE9F !important; }
[data-theme="dark"] .arch-svg text[fill="#5C6B2E"]        { fill: #A8C057 !important; }
[data-theme="dark"] .arch-svg text[fill="#8FA44A"]        { fill: #BACE6B !important; }
[data-theme="dark"] .arch-svg rect[fill="#fff"]           { fill: #3E4228 !important; fill-opacity: 1 !important; }
[data-theme="dark"] .arch-svg rect[fill-opacity="0.06"]   { fill-opacity: 0.28 !important; }
[data-theme="dark"] .arch-svg rect[fill-opacity="0.08"]   { fill-opacity: 0.28 !important; }
[data-theme="dark"] .arch-svg rect[fill-opacity="0.1"]    { fill-opacity: 0.25 !important; }
[data-theme="dark"] .arch-svg rect[fill-opacity="0.12"]   { fill-opacity: 0.32 !important; }
[data-theme="dark"] .arch-svg rect[stroke="#D4CCBA"]      { stroke: #555843 !important; }
[data-theme="dark"] .arch-svg polygon                     { fill: #A8C057 !important; }
[data-theme="dark"] .arch-svg polygon[fill="#8FA44A"]     { fill: #BACE6B !important; }

/* Explicit LIGHT MODE reset — cancels dark rules when the user manually
   toggles light while the OS is in dark mode. */
[data-theme="light"] .arch-svg text                        { fill: #25261C !important; }
[data-theme="light"] .arch-svg text[fill="#7A7860"]        { fill: #7A7860 !important; }
[data-theme="light"] .arch-svg text[fill="#4A4A30"]        { fill: #4A4A30 !important; }
[data-theme="light"] .arch-svg text[fill="#5C6B2E"]        { fill: #5C6B2E !important; }
[data-theme="light"] .arch-svg text[fill="#8FA44A"]        { fill: #8FA44A !important; }
[data-theme="light"] .arch-svg rect[fill="#fff"]           { fill: #fff !important; fill-opacity: 0.6 !important; }
[data-theme="light"] .arch-svg rect[fill-opacity="0.06"]   { fill-opacity: 0.06 !important; }
[data-theme="light"] .arch-svg rect[fill-opacity="0.08"]   { fill-opacity: 0.08 !important; }
[data-theme="light"] .arch-svg rect[fill-opacity="0.1"]    { fill-opacity: 0.1  !important; }
[data-theme="light"] .arch-svg rect[fill-opacity="0.12"]   { fill-opacity: 0.12 !important; }
[data-theme="light"] .arch-svg rect[stroke="#D4CCBA"]      { stroke: #D4CCBA !important; }
[data-theme="light"] .arch-svg polygon                     { fill: #5C6B2E !important; }
[data-theme="light"] .arch-svg polygon[fill="#8FA44A"]     { fill: #8FA44A !important; }

/* ============================================================
   31. OPEN SOURCE / REPO CARDS (Work page)
   Static cards live in the markup for no-JS visitors; main.js
   refreshes them from the GitHub API (1h localStorage cache)
   and can render new repos not yet in the static set.
   ============================================================ */

.repo-grid {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 720px) {
  .repo-grid { grid-template-columns: 1fr 1fr; }
}

.repo-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.repo-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.repo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}

.repo-card h3 {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--accent);
  line-height: 1.3;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.repo-card-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}

.repo-card:hover .repo-card-icon {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
}

.repo-card-summary {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
}

.repo-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.repo-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.repo-lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent);
}

.repo-stars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.repo-stars svg { fill: currentColor; }

.repo-updated { margin-left: auto; white-space: nowrap; }

.repo-card .tags { margin-top: 0; }

.repo-card-link {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
}
