/* Moses Man Portfolio — Editorial Warm Monochrome */

/* ── Theme tokens ── */
:root,
[data-theme="dark"] {
  --bg: #12100e;
  --bg-elevated: #1a1714;
  --bg-surface: #211d19;
  --bg-inset: #0c0b0a;
  --border: rgba(232, 220, 200, 0.09);
  --border-strong: rgba(232, 220, 200, 0.16);
  --text: #ece4d8;
  --text-secondary: #b8aa98;
  --text-muted: #7a6f62;
  --accent: #c96a3a;
  --accent-soft: rgba(201, 106, 58, 0.14);
  --accent-hover: #dd7f4d;
  --green: #6b9e72;
  --green-soft: rgba(107, 158, 114, 0.12);
  --amber: #c9a227;
  --amber-soft: rgba(201, 162, 39, 0.12);
  --linkedin: #0a66c2;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.22);
  --noise-opacity: 0.045;
  --grid-opacity: 0.04;
  --hero-orb: rgba(201, 106, 58, 0.08);
  --cursor-ring: rgba(201, 106, 58, 0.35);
}

[data-theme="light"] {
  --bg: #f4efe6;
  --bg-elevated: #faf7f1;
  --bg-surface: #ebe4d8;
  --bg-inset: #e2d9cb;
  --border: rgba(26, 22, 18, 0.1);
  --border-strong: rgba(26, 22, 18, 0.18);
  --text: #1a1612;
  --text-secondary: #4a4238;
  --text-muted: #7a7064;
  --accent: #a84f28;
  --accent-soft: rgba(168, 79, 40, 0.1);
  --accent-hover: #8c4020;
  --green: #4a7a52;
  --green-soft: rgba(74, 122, 82, 0.1);
  --amber: #9a7a18;
  --amber-soft: rgba(154, 122, 24, 0.1);
  --shadow: 0 24px 64px rgba(26, 22, 18, 0.08);
  --shadow-sm: 0 8px 24px rgba(26, 22, 18, 0.06);
  --noise-opacity: 0.035;
  --grid-opacity: 0.06;
  --hero-orb: rgba(168, 79, 40, 0.06);
  --cursor-ring: rgba(168, 79, 40, 0.4);
}

:root {
  --radius: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Sora', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: 0.35s var(--ease-out);
  --nav-height: 72px;
  --container: 1120px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color-scheme: dark;
}

[data-theme="light"] { color-scheme: light; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.5s var(--ease-out), color 0.5s var(--ease-out);
}

body.has-custom-cursor { cursor: none; }
body.has-custom-cursor a,
body.has-custom-cursor button { cursor: none; }

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

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

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

strong { color: var(--text); font-weight: 600; }
em { font-style: italic; color: var(--text-secondary); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
}

.main { position: relative; z-index: 1; }

/* ── Ambient texture ── */
.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.page-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grid-opacity);
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 20%, transparent 75%);
}

/* ── Custom cursor ── */
.cursor-glow { display: none; }

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10001;
  pointer-events: none;
  mix-blend-mode: difference;
}

.cursor-dot,
.cursor-ring {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--text);
  transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out), opacity 0.25s;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid var(--cursor-ring);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), width 0.25s var(--ease-out), height 0.25s var(--ease-out), opacity 0.25s;
}

.custom-cursor.cursor-hover .cursor-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
}

.custom-cursor.cursor-hover .cursor-ring {
  width: 52px;
  height: 52px;
  border-color: var(--accent);
}

/* ── Live badge ── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-soft);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

.live-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.5); }
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  min-height: var(--nav-height);
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease-out), border-color 0.4s, backdrop-filter 0.4s;
}

.nav-scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px clamp(20px, 4vw, 40px);
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

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

.nav-logo-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  transition: border-color var(--transition), transform var(--transition);
}

.nav-logo:hover .nav-logo-mark {
  border-color: var(--accent);
  transform: rotate(-3deg);
}

.nav-live {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.nav-clock {
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), transform 0.2s var(--ease-snap);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(-8deg);
}

.theme-icon { width: 16px; height: 16px; }

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

.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
  order: 3;
  width: 100%;
  padding-top: 2px;
  border-top: 1px solid transparent;
}

.nav-scrolled .nav-links {
  border-top-color: var(--border);
  padding-top: 6px;
}

.nav-links a {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 12px;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 10px;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text);
  transition: var(--transition);
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-height) + 48px) clamp(20px, 4vw, 40px) 80px;
  position: relative;
  overflow: hidden;
}

.hero-parallax {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--hero-orb) 0%, transparent 70%);
  filter: blur(40px);
}

.hero-orb-1 {
  width: 480px;
  height: 480px;
  top: -120px;
  right: -80px;
}

.hero-orb-2 {
  width: 320px;
  height: 320px;
  bottom: 10%;
  left: -60px;
}

.hero-line {
  position: absolute;
  background: var(--border-strong);
  transform-origin: left center;
}

.hero-line-1 {
  width: 40%;
  height: 1px;
  top: 28%;
  left: 0;
  transform: rotate(-2deg);
}

.hero-line-2 {
  width: 25%;
  height: 1px;
  bottom: 22%;
  right: 8%;
  transform: rotate(3deg);
}

.hero-content {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
  background: var(--green-soft);
  padding: 8px 16px;
  margin-bottom: 32px;
}

.label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 10vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin-bottom: 24px;
}

.hero-name-line {
  display: block;
}

.hero-name-accent {
  color: var(--accent);
  font-weight: 500;
  padding-left: 0.08em;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 28px;
  min-height: 1.7em;
  line-height: 1.6;
}

.cursor-blink {
  animation: blink 1s step-end infinite;
  color: var(--accent);
  font-weight: 500;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-subtext {
  max-width: 580px;
  margin-bottom: 40px;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
}

.hero-subtext p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.75;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 40px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-data-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.stamp-icon { width: 12px; height: 12px; opacity: 0.7; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), transform 0.2s var(--ease-out);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.btn svg, .btn i { width: 15px; height: 15px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

.btn-accent {
  background: #c96a3a;
  color: #fff;
  border-color: #c96a3a;
  box-shadow: 0 0 0 0 rgba(201, 106, 58, 0.35), 0 4px 16px rgba(201, 106, 58, 0.2);
  animation: accent-pulse 2.5s ease-in-out infinite;
}

.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(201, 106, 58, 0.12), 0 6px 24px rgba(201, 106, 58, 0.4);
}

@keyframes accent-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(201, 106, 58, 0.35), 0 4px 16px rgba(201, 106, 58, 0.2);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(201, 106, 58, 0.06), 0 4px 28px rgba(201, 106, 58, 0.45);
  }
}

/* ── Network Topology ── */
.network-topology {
  margin-top: 48px;
  padding: clamp(28px, 4vw, 40px);
  background: var(--bg);
  border: 1px solid var(--border);
}

.topo-header {
  margin-bottom: 32px;
  text-align: center;
}

.topo-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.topo-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.topo-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 720px;
  margin: 0 auto;
}

.topo-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  min-width: 160px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), background var(--transition);
}

.topo-node:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.topo-node[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.topo-node-sm {
  min-width: 140px;
  padding: 14px 18px;
}

.topo-node-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), background var(--transition);
}

.topo-node-icon svg { width: 22px; height: 22px; color: var(--accent); }

.topo-node-cloudflare .topo-icon-cloud {
  border-color: color-mix(in srgb, #f48120 40%, var(--border));
  background: rgba(244, 129, 32, 0.1);
}

.topo-node-cloudflare .topo-icon-cloud svg { color: #f48120; }

.topo-node-label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
}

.topo-port {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: var(--radius);
  letter-spacing: 0.04em;
}

.topo-connector {
  width: 2px;
  height: 36px;
  flex-shrink: 0;
}

.topo-connector-h {
  width: 40px;
  height: 20px;
  flex-shrink: 0;
  align-self: center;
  margin-top: 28px;
}

.topo-connector-short {
  width: 48px;
  height: 20px;
}

.topo-flow-line {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 6 6;
  stroke-linecap: round;
  animation: topo-flow 1.2s linear infinite;
  opacity: 0.7;
}

@keyframes topo-flow {
  to { stroke-dashoffset: -12; }
}

.topo-detail {
  width: 100%;
  max-width: 480px;
  margin: 8px 0 4px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  animation: topo-detail-in 0.3s var(--ease-out);
}

.topo-detail-inline {
  max-width: none;
  grid-column: 1 / -1;
}

.topo-detail p { margin: 0; }

@keyframes topo-detail-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.topo-vps-zone {
  width: 100%;
  margin-top: 8px;
  padding: 24px;
  background: var(--bg-inset);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.topo-zone-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

.topo-vps-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.topo-services {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 0 4px;
  width: 100%;
}

.topo-service-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 180px;
}

.topo-service-col .topo-detail-inline {
  width: 100%;
}

@media (max-width: 640px) {
  .topo-services {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .topo-service-col {
    max-width: 100%;
    width: 100%;
  }

  .topo-connector-h {
    display: none;
  }
}

/* ── Playground ── */
.playground {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-inset);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.playground-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.playground-snippets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.playground-snippet {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 7px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.playground-snippet:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

.playground-run {
  flex-shrink: 0;
}

.playground-run:disabled {
  opacity: 0.6;
  cursor: wait;
}

.playground-editor-wrap {
  padding: 0;
  background: #1e1e1e;
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .playground-editor-wrap {
  background: #1a1714;
}

.playground-editor {
  display: block;
  width: 100%;
  min-height: 220px;
  padding: 18px 20px;
  border: none;
  outline: none;
  resize: none;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  color: #d4d4d4;
  background: transparent;
  tab-size: 4;
}

.playground-editor::selection {
  background: rgba(201, 106, 58, 0.35);
}

.playground-output-wrap {
  padding: 16px 20px 20px;
  background: var(--bg-inset);
}

.playground-output-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.playground-output {
  margin: 0;
  min-height: 72px;
  max-height: 280px;
  overflow: auto;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.playground-output:not(:empty) {
  color: var(--text);
}

@media (max-width: 640px) {
  .playground-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .playground-run {
    width: 100%;
    justify-content: center;
  }
}

/* ── Sections ── */
.section {
  padding: clamp(72px, 12vw, 120px) 0;
  position: relative;
}

.section-alt {
  background: var(--bg-elevated);
}

.section-header {
  display: flex;
  align-items: flex-end;
  gap: clamp(16px, 4vw, 32px);
  margin-bottom: clamp(36px, 6vw, 56px);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.section-number {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: color-mix(in srgb, var(--accent) 25%, transparent);
  flex-shrink: 0;
}

.section-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.section-subtext {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 36px;
  line-height: 1.7;
}

/* ── Panels ── */
.panel,
.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: clamp(24px, 4vw, 36px);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition);
}

.panel:hover,
.glass-panel:hover {
  border-color: var(--border-strong);
}

.panel p,
.glass-panel p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.75;
}

.panel p:last-child,
.glass-panel p:last-child { margin-bottom: 0; }

/* ── About ── */
.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.about-text p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.8;
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.highlight-card {
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 16px;
  align-items: start;
  padding: 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.highlight-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.45s var(--ease-out);
}

.highlight-card:hover {
  border-color: var(--border-strong);
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
}

.highlight-card:hover::before {
  transform: scaleY(1);
  transform-origin: top;
}

.highlight-index {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.6;
  padding-top: 2px;
}

.highlight-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
  transition: border-color var(--transition), background var(--transition);
}

.highlight-card:hover .highlight-icon {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.highlight-icon svg { width: 18px; height: 18px; color: var(--accent); }

.highlight-card h4 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.highlight-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 28px;
  padding-top: 0;
  transition: transform 0.4s var(--ease-out), border-color var(--transition), box-shadow var(--transition);
  transform-style: preserve-3d;
}

.project-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow);
}

.project-index {
  position: absolute;
  top: 20px;
  right: 24px;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: color-mix(in srgb, var(--text) 6%, transparent);
  pointer-events: none;
  transition: color var(--transition);
}

.project-card:hover .project-index {
  color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.project-banner {
  height: 3px;
  margin: 0 -28px 24px;
  width: calc(100% + 56px);
}

.oci-banner { background: var(--accent); }
.polybrain-banner { background: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.polygnosis-banner { background: var(--amber); }
.homelab-banner { background: var(--green); }

.project-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.project-title svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }

.project-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
  padding: 4px 10px;
  display: inline-block;
  margin-top: 8px;
}

.project-meta {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.project-stars,
.project-updated {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-icon { width: 12px; height: 12px; opacity: 0.7; }

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 18px;
}

.project-highlights {
  list-style: none;
  margin-bottom: 20px;
}

.project-highlights li {
  font-size: 0.84rem;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
  margin-bottom: 8px;
  line-height: 1.55;
}

.project-highlights li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  margin-top: auto;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: var(--radius);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tag-icon { width: 10px; height: 10px; opacity: 0.5; }

.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.project-link {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  transition: gap var(--transition), color var(--transition);
}

.project-link:hover {
  gap: 14px;
  color: var(--accent-hover);
}

.project-link svg { width: 14px; height: 14px; }

/* ── Homelab Services ── */
.homelab-services {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.service-card {
  padding: 28px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-align: center;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.service-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color var(--transition), background var(--transition);
}

.service-card:hover .service-icon {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.service-icon svg { width: 22px; height: 22px; color: var(--accent); }

.service-card h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.service-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── Activity ── */
.activity-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 24px;
  margin-top: 36px;
}

.activity-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.activity-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.activity-heading svg { width: 17px; height: 17px; color: var(--accent); }

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color var(--transition), transform var(--transition);
}

.activity-item:hover {
  border-color: var(--border-strong);
  transform: translateX(4px);
}

.activity-icon-box {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.activity-body { flex: 1; min-width: 0; }

.activity-repo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
  margin-bottom: 2px;
}

.activity-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.activity-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 4px;
}

.activity-loading,
.activity-error {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.activity-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.activity-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contribution-heatmap {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 24px;
}

.heatmap-heading {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.heatmap-heading svg { width: 16px; height: 16px; color: var(--accent); }

.heatmap-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.heatmap-bar {
  min-height: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  position: relative;
  overflow: hidden;
}

.heatmap-bar::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: var(--accent-soft);
  border-right: 2px solid var(--accent);
  transition: width 1.4s var(--ease-out);
}

.heatmap-bar.animated::before { width: var(--h, 50%); }

.heatmap-bar span {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.commit-spotlight,
.active-repo {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 20px;
}

.spotlight-heading,
.active-repo-heading {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spotlight-heading svg,
.active-repo-heading svg { width: 15px; height: 15px; color: var(--accent); }

.spotlight-content,
.active-repo-content {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.spotlight-loading {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.spotlight-msg {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 10px 12px;
  border: 1px solid var(--border);
  margin-top: 6px;
  word-break: break-word;
  line-height: 1.5;
}

.spotlight-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: var(--font-mono);
}

.active-repo-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.active-repo-detail {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.skill-group {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 28px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.skill-group:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.skill-group-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 18px;
  transition: border-color var(--transition), background var(--transition);
}

.skill-group:hover .skill-group-icon {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.skill-group-icon svg { width: 20px; height: 20px; color: var(--accent); }

.skill-group-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.skill-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Certifications ── */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.cert-card {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 24px;
  transition: transform 0.4s var(--ease-out), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.cert-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.cert-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.cert-card:hover::after { opacity: 1; }

.cert-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
  padding: 4px 10px;
  display: inline-block;
  margin-bottom: 16px;
}

.cert-badge-progress {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: color-mix(in srgb, var(--amber) 25%, transparent);
}

.cert-logo {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  margin-bottom: 14px;
}

.cert-logo svg { width: 20px; height: 20px; color: var(--accent); }

.cert-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.35;
}

.cert-issuer {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}

.cert-date {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 12px;
}

.cert-progress-bar {
  width: 100%;
  height: 3px;
  background: var(--bg-inset);
  margin: 12px 0;
  overflow: hidden;
}

.cert-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 1.4s var(--ease-out);
}

.cert-progress-fill.animated { width: var(--w, 50%); }

.cert-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* ── Blog ── */
.blog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(28px, 4vw, 40px);
}

.blog-tab {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.blog-tab:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.blog-tab.active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--accent-soft);
}

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

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  outline: none;
}

.blog-card:hover,
.blog-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
}

.blog-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.blog-source-icon {
  flex-shrink: 0;
}

.blog-source-devto { color: #0a0a0a; background: #fff; border-radius: 3px; padding: 2px; }
[data-theme="light"] .blog-source-devto { color: #fff; background: #0a0a0a; }

.blog-source-linkedin { color: var(--linkedin); }

.blog-source-original { color: var(--accent); }

.blog-card-date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.blog-card-excerpt {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-tags,
.blog-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.blog-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 4px 8px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.blog-loading,
.blog-empty {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Blog modal */
.blog-modal {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), visibility 0.35s;
}

.blog-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.blog-modal-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg-inset) 70%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.blog-modal-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: min(85vh, 800px);
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 36px);
  transform: translateY(16px);
  transition: transform 0.4s var(--ease-out);
}

.blog-modal.open .blog-modal-panel {
  transform: translateY(0);
}

.blog-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.blog-modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.blog-modal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.blog-modal-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.blog-modal-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  padding-right: 36px;
}

.blog-modal-content {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.blog-modal-content p { margin-bottom: 16px; }
.blog-modal-content p:last-child { margin-bottom: 0; }

.blog-md-list {
  margin: 0 0 16px 0;
  padding-left: 20px;
}

.blog-md-list li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.blog-md-code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius);
  color: var(--accent);
}

.blog-md-pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 16px;
  line-height: 1.55;
}

.blog-md-pre code {
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.blog-modal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── LinkedIn Posts ── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.linkedin-post-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

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

.linkedin-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.linkedin-icon { width: 20px; height: 20px; color: var(--linkedin); flex-shrink: 0; }

.post-author {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  display: block;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.linkedin-embed-wrapper { min-height: 300px; }

.linkedin-embed {
  width: 100%;
  border: none;
  display: block;
  background: transparent;
}

.posts-more { text-align: center; }

.posts-loading {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.linkedin-posts-fallback {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  border: 1px dashed var(--border);
}

/* ── Contact ── */
.contact-panel {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.contact-panel > p {
  font-size: 1rem;
  margin-bottom: 28px;
  line-height: 1.75;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 22px 24px;
  margin-top: 8px;
  transition: border-color var(--transition);
}

.contact-card:hover { border-color: var(--border-strong); }

.contact-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.contact-card-icon svg { width: 22px; height: 22px; color: var(--linkedin); }

.contact-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

.contact-subtitle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: left;
}

.contact-card .btn { margin-left: auto; }

/* ── Footer ── */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-inset);
}

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

.footer p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.footer-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  opacity: 0.7;
  font-style: italic;
}

.footer-links {
  display: flex;
  gap: 10px;
}

.footer-links a {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition), transform 0.2s var(--ease-snap);
}

.footer-links a svg { width: 16px; height: 16px; }

.footer-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(-6deg);
}

/* ── Reveal animations ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
}

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

.spin { animation: spin 1s linear infinite; }

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

/* ── Responsive ── */
@media (max-width: 1024px) {
  .homelab-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .activity-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .nav-live { display: none; }
  .nav-inner { flex-wrap: nowrap; }
  .nav-links {
    order: unset;
    width: auto;
    flex: unset;
    border-top: none;
    padding-top: 0;
  }
}

@media (max-width: 768px) {
  :root { --nav-height: 64px; }

  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 12px clamp(20px, 4vw, 40px) 20px;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s var(--ease-out), opacity 0.4s;
    overflow: visible;
    flex-wrap: wrap;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    display: block;
    padding: 12px 0;
    font-size: 0.85rem;
  }

  .hero {
    padding-top: calc(var(--nav-height) + 32px);
    min-height: auto;
    padding-bottom: 64px;
  }

  .hero-subtext { padding-left: 14px; }
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
  .hero-stats { gap: 20px; }
  .section { padding: 64px 0; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .section-number { font-size: 2.5rem; }
  .homelab-services { grid-template-columns: 1fr; }
  .project-header { flex-direction: column; }
  .contact-card { flex-direction: column; text-align: center; }
  .contact-card h4,
  .contact-subtitle { text-align: center; }
  .contact-card .btn { margin-left: 0; width: 100%; justify-content: center; }
  .footer .container { flex-direction: column; text-align: center; }
  .custom-cursor { display: none; }
  body.has-custom-cursor { cursor: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .custom-cursor { display: none; }
}

/* ── Terminal page ── */
.terminal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-inset);
}

.terminal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(20px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.terminal-nav-brand {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.terminal-nav-brand:hover { color: var(--accent); }

.terminal-nav-links {
  display: flex;
  gap: 16px;
  list-style: none;
}

.terminal-nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.terminal-shell {
  flex: 1;
  padding: clamp(16px, 3vw, 32px);
  display: flex;
  flex-direction: column;
}

.terminal-frame {
  flex: 1;
  min-height: calc(100vh - 120px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #0c0b0a;
}

.terminal-frame .xterm {
  height: 100%;
  padding: 12px;
}

.terminal-frame .xterm-viewport {
  background: transparent !important;
}

.terminal-glow .xterm-rows {
  text-shadow: 0 0 8px rgba(201, 106, 58, 0.25), 0 0 2px rgba(236, 228, 216, 0.15);
}

[data-theme="light"] .terminal-frame {
  background: #1a1612;
}

[data-theme="light"] .terminal-glow .xterm-rows {
  text-shadow: 0 0 8px rgba(168, 79, 40, 0.3), 0 0 2px rgba(236, 228, 216, 0.2);
}
