/* ============================================================
   Alessandro Pierobon — Portfolio
   ============================================================ */

:root {
  /* Accent — overridable via Tweaks */
  --accent-h: 38;
  --accent-s: 90%;
  --accent-l: 55%;
  --accent: oklch(0.78 0.16 65);
  --accent-soft: oklch(0.78 0.16 65 / 0.12);
  --accent-glow: oklch(0.78 0.16 65 / 0.4);

  /* Dark theme — warm amber-tinted */
  --bg:        #0f0d08;
  --bg-1:      #161208;
  --bg-2:      #1f1a10;
  --bg-3:      #2a2316;
  --fg:        #f5efe0;
  --fg-2:      #b8ad95;
  --fg-3:      #7a7560;
  --border:    #2a2316;
  --border-2:  #3a3220;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-display: "Inter", ui-sans-serif, system-ui, sans-serif;

  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 1px 0 0 var(--border) inset, 0 20px 40px -20px rgba(0,0,0,0.5);

  --maxw: 1180px;
}

html[data-theme="light"] {
  --bg:        #faf7ef;
  --bg-1:      #f3eee0;
  --bg-2:      #ece5d2;
  --bg-3:      #ddd4be;
  --fg:        #14110a;
  --fg-2:      #4a4530;
  --fg-3:      #7a7560;
  --border:    #ddd4be;
  --border-2:  #c8bea4;
  --accent:    oklch(0.62 0.16 65);
  --accent-soft: oklch(0.62 0.16 65 / 0.12);
  --accent-glow: oklch(0.62 0.16 65 / 0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

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

a { color: inherit; text-decoration: none; }

/* Background canvas (particles) */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}

/* Grid pattern overlay */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  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 at 50% 0%, black 0%, transparent 70%);
  opacity: 0.3;
}

main, nav, footer { position: relative; z-index: 1; }

/* ============================================================
   NAV
   ============================================================ */
nav.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse 2.4s ease-in-out infinite;
}

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

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--fg-2);
  font-family: var(--font-mono);
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
  display: flex; align-items: center; gap: 6px;
}
.nav-links a::before {
  content: "//";
  color: var(--fg-3);
  font-size: 11px;
}
.nav-links a:hover { color: var(--fg); background: var(--bg-1); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::before { color: var(--accent); }

.nav-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.icon-btn, .pill-btn {
  height: 32px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--fg-2);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}
.icon-btn { width: 32px; }
.pill-btn { padding: 0 12px; gap: 6px; }
.icon-btn:hover, .pill-btn:hover {
  color: var(--fg);
  border-color: var(--border-2);
  background: var(--bg-2);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  background: var(--bg-1);
  border-radius: var(--radius);
  padding: 2px;
}
.lang-switch button {
  background: none;
  border: none;
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.lang-switch button.active {
  background: var(--accent);
  color: #14110a;
}

/* ============================================================
   SECTION SCAFFOLD
   ============================================================ */
section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 28px;
  position: relative;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 48px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
.section-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}
.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.section-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-top: 64px;
  padding-bottom: 72px;
  min-height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}

.hero-left {
  position: relative;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 6px 12px;
  border: 1px solid var(--border-2);
  background: var(--accent-soft);
  border-radius: 999px;
}
.hero-tag .blink {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: blink 1.4s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero h1 {
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0 0 8px;
  position: relative;
}
.hero h1 .glitch {
  position: relative;
  display: inline-block;
  cursor: default;
}
.hero h1 .glitch::before,
.hero h1 .glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  pointer-events: none;
  opacity: 0;
}
.hero h1 .glitch:hover::before {
  animation: glitch-1 0.4s infinite linear alternate-reverse;
  color: var(--accent);
  opacity: 0.9;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  transform: translate(-2px, 0);
}
.hero h1 .glitch:hover::after {
  animation: glitch-2 0.5s infinite linear alternate-reverse;
  color: #58c4ff;
  opacity: 0.8;
  clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%);
  transform: translate(2px, 0);
}
@keyframes glitch-1 {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 1px); }
  40% { transform: translate(-1px, -2px); }
  60% { transform: translate(2px, 1px); }
  100% { transform: translate(-2px, 0); }
}
@keyframes glitch-2 {
  0% { transform: translate(0); }
  25% { transform: translate(2px, -1px); }
  50% { transform: translate(-2px, 2px); }
  75% { transform: translate(1px, 1px); }
  100% { transform: translate(2px, 0); }
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--fg-2);
  margin: 0 0 12px;
  min-height: 28px;
}
.hero-sub .prefix { color: var(--accent); }
.hero-sub .cursor {
  display: inline-block;
  width: 9px;
  height: 19px;
  background: var(--fg);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
  transform: translateY(-1px);
}

.hero-intro {
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-2);
  max-width: 540px;
  margin: 24px 0 36px;
  text-wrap: pretty;
}
.hero-intro strong { color: var(--fg); font-weight: 600; }

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--accent);
  color: #14110a;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px var(--accent-glow);
}
.btn-ghost {
  border-color: var(--border-2);
  color: var(--fg);
  background: var(--bg-1);
}
.btn-ghost:hover {
  background: var(--bg-2);
  border-color: var(--accent);
  color: var(--accent);
}

.btn svg { width: 14px; height: 14px; }

/* Hero right — terminal frame containing avatar */
.terminal {
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6), 0 0 0 1px var(--border);
  font-family: var(--font-mono);
  position: relative;
}
.terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, var(--accent-soft) 100%);
  opacity: 0.25;
  z-index: 1;
}

.term-bar {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  gap: 8px;
  position: relative;
  z-index: 2;
}
.term-bar .dots {
  display: flex;
  gap: 6px;
}
.term-bar .dots span {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg-3);
}
.term-bar .dots span:nth-child(1) { background: #ff5f57; }
.term-bar .dots span:nth-child(2) { background: #febc2e; }
.term-bar .dots span:nth-child(3) { background: #28c840; }
.term-bar .title {
  font-size: 12px;
  color: var(--fg-3);
  margin: 0 auto;
  padding-right: 50px;
}

.term-body {
  padding: 24px 24px 28px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--fg-2);
  position: relative;
  z-index: 2;
  min-height: 380px;
}

.term-line { display: block; }
.term-prompt { color: var(--accent); }
.term-user { color: oklch(0.78 0.12 145); }
.term-cmd { color: var(--fg); }
.term-out { color: var(--fg-2); }
.term-key { color: var(--accent); }
.term-comment { color: var(--fg-3); font-style: italic; }
.term-spacer { display: block; height: 12px; }

.avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 14px 0 18px;
  padding: 14px;
  background: var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, var(--accent) 0%, oklch(0.6 0.16 30) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 22px;
  color: #14110a;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--bg-1), 0 0 0 4px var(--accent), 0 0 30px var(--accent-glow);
}
.avatar::after {
  content: "";
  position: absolute;
  bottom: 2px; right: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: oklch(0.78 0.18 145);
  border: 2px solid var(--bg-1);
  z-index: 2;
}
.avatar .avatar-initials {
  position: relative;
  z-index: 0;
}
.avatar .avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  z-index: 1;
}
.avatar-row .meta { font-family: var(--font-mono); font-size: 12px; line-height: 1.7; }
.avatar-row .meta .k { color: var(--fg-3); }
.avatar-row .meta .v { color: var(--fg); }
.avatar-row .meta .v.ok { color: oklch(0.72 0.18 145); font-weight: 600; }
.avatar-row .meta .comment { color: var(--fg-3); font-style: italic; }

/* Interests list inside terminal */
.term-list {
  list-style: none;
  margin: 12px 0 4px;
  padding: 0 0 0 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-2);
}
.term-list li {
  padding: 4px 0;
  position: relative;
}
.term-list li::before {
  content: "›";
  position: absolute;
  left: -16px;
  color: var(--accent);
  font-weight: 700;
}
.term-list li .sep { color: var(--fg-3); margin: 0 4px; }

/* ============================================================
   ABOUT
   ============================================================ */
.about-text {
  max-width: 760px;
}
.about-text p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg-2);
  margin: 0 0 18px;
  text-wrap: pretty;
}
.about-text p strong { color: var(--fg); font-weight: 600; }
.about-text .hl { color: var(--accent); }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat {
  padding: 22px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.stat:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}
.stat:hover::before { opacity: 1; }
.stat .v {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 6px;
}
.stat .v .unit { font-size: 16px; color: var(--fg-3); font-weight: 500; margin-left: 4px; }
.stat .k {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   EDUCATION — git log style timeline
   ============================================================ */
.timeline {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-2);
  position: relative;
  padding-left: 0;
}

.commit {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 0;
  position: relative;
}
.commit-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
}
.commit-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
  position: relative;
  z-index: 2;
}
.commit-dot.filled {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 16px var(--accent-glow);
}
.commit-line {
  width: 2px;
  flex: 1;
  background: var(--border-2);
  margin-top: -2px;
}
.commit:last-child .commit-line { display: none; }

.commit-body {
  padding: 0 0 36px 16px;
}
.commit-year {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  margin-bottom: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.commit-title {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0 0 6px;
}
.commit-where {
  font-size: 13px;
  color: var(--fg-2);
  margin-bottom: 12px;
}

.commit-fields {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.commit-fields .row { display: flex; gap: 10px; }
.commit-fields .row .lbl { color: var(--fg-3); min-width: 80px; }
.commit-fields .row .val { color: var(--fg-2); }
.commit-fields .row .val .badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border-2);
}
.commit-fields .row .val .badge.live {
  background: oklch(0.55 0.18 145 / 0.15);
  color: oklch(0.78 0.18 145);
  border-color: oklch(0.55 0.18 145 / 0.4);
}
html[data-theme="light"] .commit-fields .row .val .badge.live { color: oklch(0.45 0.18 145); }
.commit-fields .row .val .badge.live::before {
  content: "●";
  margin-right: 4px;
  animation: blink 1.4s steps(2) infinite;
}
.commit-fields .row .val .badge.done {
  background: oklch(0.55 0.10 160 / 0.12);
  color: oklch(0.78 0.10 160);
  border-color: oklch(0.55 0.10 160 / 0.35);
}
html[data-theme="light"] .commit-fields .row .val .badge.done { color: oklch(0.42 0.10 160); }
.commit-fields .row .val .badge.done::before {
  content: "✓";
  margin-right: 4px;
  font-weight: 700;
}

.countdown {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-1);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--fg-2);
}
.countdown .num {
  font-size: 18px;
  color: var(--accent);
  font-weight: 700;
}

/* ============================================================
   TECH STACK
   ============================================================ */
.stack-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.stack-group {
  padding: 22px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s;
}
.stack-group:hover { border-color: var(--border-2); }

.stack-group h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stack-group h3::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  display: inline-block;
}

.skill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: padding 0.2s;
}
.skill:last-child { border-bottom: none; }
.skill:hover { padding-left: 6px; }
.skill .name { color: var(--fg); }
.skill .lvl {
  display: flex;
  gap: 3px;
}
.skill .lvl span {
  width: 16px; height: 4px;
  background: var(--bg-3);
  border-radius: 1px;
}
.skill .lvl span.on { background: var(--accent); }

/* Compact stack — rows of chips */
.stack-compact {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sc-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.sc-row:first-child { border-top: none; padding-top: 0; }
.sc-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sc-label::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  display: inline-block;
}
.sc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  transition: all 0.18s ease;
  cursor: default;
  position: relative;
}
.chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}
/* Tooltip livello esperienza */
.chip[data-level] { cursor: help; }
.chip[data-level]::before,
.chip[data-level]::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.chip[data-level]::after {
  content: "esperienza: " attr(data-level);
  bottom: calc(100% + 10px);
  transform: translate(-50%, 4px);
  background: var(--bg-2);
  color: var(--fg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--accent-soft);
  z-index: 50;
}
.chip[data-level]::before {
  content: "";
  bottom: calc(100% + 4px);
  transform: translate(-50%, 4px);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--accent);
  z-index: 50;
}
.chip[data-level]:hover::before,
.chip[data-level]:hover::after,
.chip[data-level].show-tip::before,
.chip[data-level].show-tip::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (max-width: 700px) {
  .sc-row { grid-template-columns: 1fr; gap: 10px; }
  .sc-label { padding-top: 0; }
}

/* ============================================================
   HOMELAB
   ============================================================ */
.homelab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.lab-diagram {
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--fg-2);
  white-space: pre;
  overflow-x: auto;
  position: relative;
}
.lab-diagram::before {
  content: "topology.txt";
  position: absolute;
  top: 12px; right: 16px;
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.05em;
}
.lab-diagram .acc { color: var(--accent); }
.lab-diagram .dim { color: var(--fg-3); }

.lab-services {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.svc {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: all 0.18s ease;
}
.svc:hover {
  border-color: var(--accent);
  background: var(--bg-2);
}
.svc .ico {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}
.svc .name { color: var(--fg); flex: 1; }
.svc .status {
  font-size: 11px;
  color: oklch(0.78 0.18 145);
  display: flex; align-items: center; gap: 5px;
}
.svc .status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: oklch(0.65 0.18 145);
  box-shadow: 0 0 8px oklch(0.65 0.18 145 / 0.6);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  text-align: center;
  padding-top: 64px;
  padding-bottom: 64px;
}
.contact h2 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  line-height: 1.05;
}
.contact h2 .acc { color: var(--accent); }
.contact .lead {
  font-size: 18px;
  color: var(--fg-2);
  max-width: 540px;
  margin: 0 auto 48px;
  text-wrap: pretty;
}

.socials {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 880px;
  margin: 0 auto;
}
.social-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 22px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
  text-align: left;
}
.social-card::after {
  content: "↗";
  position: absolute;
  top: 18px; right: 20px;
  font-size: 18px;
  color: var(--fg-3);
  transition: color 0.2s, transform 0.22s;
}
.social-card:hover {
  border-color: var(--accent);
  background: var(--bg-2);
  transform: translateY(-3px);
}
.social-card:hover::after {
  color: var(--accent);
  transform: translate(3px, -3px);
}
.social-card .ico {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.social-card .ico svg { width: 22px; height: 22px; }
.social-card .label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.social-card .handle {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg);
  word-break: break-all;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 28px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
}
footer .row { max-width: var(--maxw); margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer .row a:hover { color: var(--accent); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   TWEAKS PANEL
   ============================================================ */
#tweaks-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 280px;
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 0;
  z-index: 200;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  font-family: var(--font-mono);
  font-size: 12px;
  display: none;
}
#tweaks-panel.show { display: block; }
#tweaks-panel .tp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
#tweaks-panel .tp-close {
  background: none;
  border: none;
  color: var(--fg-3);
  cursor: pointer;
  font-size: 16px;
}
#tweaks-panel .tp-body { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
#tweaks-panel .tp-section .lbl { color: var(--fg-3); margin-bottom: 8px; text-transform: uppercase; font-size: 10px; letter-spacing: 0.1em; }
#tweaks-panel .swatches { display: flex; gap: 8px; }
#tweaks-panel .swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
#tweaks-panel .swatch:hover { transform: scale(1.1); }
#tweaks-panel .swatch.sel { border-color: var(--fg); }
#tweaks-panel .seg {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
#tweaks-panel .seg button {
  flex: 1;
  background: var(--bg);
  border: none;
  color: var(--fg-3);
  padding: 8px 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  border-right: 1px solid var(--border);
}
#tweaks-panel .seg button:last-child { border-right: none; }
#tweaks-panel .seg button.on { background: var(--accent); color: #14110a; }
#tweaks-panel .toggle-row { display: flex; justify-content: space-between; align-items: center; }
#tweaks-panel .switch {
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--bg-3);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
#tweaks-panel .switch.on { background: var(--accent); }
#tweaks-panel .switch::after {
  content: "";
  width: 14px; height: 14px;
  background: var(--fg);
  border-radius: 50%;
  position: absolute;
  top: 3px; left: 3px;
  transition: transform 0.2s;
}
#tweaks-panel .switch.on::after { transform: translateX(16px); background: #14110a; }

/* ============================================================
   HERO VARIANTS
   ============================================================ */
body[data-hero="centered"] .hero {
  grid-template-columns: 1fr;
  text-align: center;
  min-height: auto;
  padding-bottom: 64px;
}
body[data-hero="centered"] .hero-left { max-width: 760px; margin: 0 auto; }
body[data-hero="centered"] .hero-intro { margin-left: auto; margin-right: auto; }
body[data-hero="centered"] .hero-tag { margin-left: auto; margin-right: auto; }
body[data-hero="centered"] .cta-row { justify-content: center; }
body[data-hero="centered"] .terminal { max-width: 720px; margin: 56px auto 0; }

body[data-hero="terminal"] .hero {
  grid-template-columns: 1fr;
  max-width: 880px;
}
body[data-hero="terminal"] .hero-left { display: none; }
body[data-hero="terminal"] .terminal { width: 100%; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 32px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .stack-groups { grid-template-columns: 1fr; }
  .homelab-grid { grid-template-columns: 1fr; }
  .socials { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  section { padding: 64px 20px; }
  .hero h1 { font-size: clamp(40px, 12vw, 64px); }
}

@media (max-width: 520px) {
  .socials { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .nav-inner { padding: 12px 16px; gap: 8px; }
  .lang-switch button { font-size: 10px; padding: 3px 6px; }
}
