/* ==========================================================================
   Riccardo Rovere — Personal CV site
   Stylesheet: themes, layout, components, responsive, print
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Manrope", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --bg: #040906;
  --bg-soft: #06100a;
  --surface: #0a1510;
  --surface-2: #0e1d15;
  --surface-3: #13261b;
  --border: rgba(128, 196, 154, 0.14);
  --border-strong: rgba(128, 196, 154, 0.28);
  --text: #e8f4ec;
  --text-soft: #c3d8c9;
  --muted: #8ca99a;
  --accent: #4ade80;
  --accent-2: #86efac;
  --accent-3: #a3e635;
  --accent-soft: rgba(74, 222, 128, 0.11);
  --accent-glow: rgba(74, 222, 128, 0.26);
  --success: #6ee7a0;
  --on-accent: #04130a;
  --glow-1: rgba(74, 222, 128, 0.1);
  --glow-2: rgba(134, 239, 172, 0.06);
  --glow-3: rgba(163, 230, 53, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.4);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --header-h: 74px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-soft: #eef3f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eaf0f7;
  --border: rgba(19, 48, 80, 0.1);
  --border-strong: rgba(19, 48, 80, 0.2);
  --text: #0d1b2a;
  --text-soft: #26374a;
  --muted: #5a6c81;
  --accent: #0b63d6;
  --accent-2: #0a8f7a;
  --accent-3: #7c4ddb;
  --accent-soft: rgba(11, 99, 214, 0.08);
  --accent-glow: rgba(11, 99, 214, 0.18);
  --success: #0f9d63;
  --on-accent: #ffffff;
  --glow-1: rgba(11, 99, 214, 0.08);
  --glow-2: rgba(53, 224, 192, 0.07);
  --glow-3: rgba(167, 139, 250, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 40, 70, 0.06);
  --shadow-md: 0 14px 34px rgba(15, 40, 70, 0.08);
  --shadow-lg: 0 30px 70px rgba(15, 40, 70, 0.12);
  color-scheme: light;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(60rem 40rem at 12% -10%, var(--glow-1), transparent 60%),
    radial-gradient(50rem 34rem at 92% 8%, var(--glow-2), transparent 62%),
    radial-gradient(40rem 30rem at 50% 110%, var(--glow-3), transparent 60%);
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--accent); color: #fff; }

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

.container {
  width: min(1160px, 100% - 48px);
  margin-inline: auto;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 100;
  background: transparent;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.08s linear;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--on-accent);
  background: linear-gradient(140deg, var(--accent), var(--accent-3));
  box-shadow: 0 8px 22px var(--accent-glow);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-display); font-size: 0.98rem; letter-spacing: -0.01em; }
.brand-text small { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-link {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-link.is-active { color: var(--accent); background: var(--accent-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }
.icon-sun { display: none; }
html[data-theme="light"] .icon-sun { display: block; }
html[data-theme="light"] .icon-moon { display: none; }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(56px, 8vw, 96px) 0 0;
  overflow: clip;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  margin: 0 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 18%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 16%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--success) 6%, transparent); }
}
.hero h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.55rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 20px;
}
.gradient-text {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 58%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  max-width: 36rem;
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  color: var(--text-soft);
  margin-bottom: 30px;
}
.hero-lead strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-3)));
  box-shadow: 0 10px 26px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 14px 34px var(--accent-glow); }
.btn-ghost {
  color: var(--text-soft);
  background: var(--surface);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--accent); border-color: var(--border-strong); background: var(--surface-2); }
.btn .icon { width: 17px; height: 17px; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
  font-size: 0.85rem;
  color: var(--muted);
}
.hero-meta span { color: var(--accent-2); margin-right: 4px; }

/* Terminal card */
.terminal-card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-3deg) rotateX(1.5deg);
  transition: transform 0.5s var(--ease);
}
.terminal-card:hover { transform: perspective(1200px) rotateY(0) rotateX(0); }
.terminal-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-glow), transparent 40%, rgba(53, 224, 192, 0.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-3) 55%, transparent);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.terminal-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.terminal-body {
  margin: 0;
  padding: 24px 22px 26px;
  font-family: var(--font-mono);
  font-size: clamp(0.76rem, 1.15vw, 0.88rem);
  line-height: 1.9;
  overflow-x: auto;
}
.terminal-body code { font-family: inherit; }
.t-prompt { color: var(--accent-2); }
.t-out { color: var(--text-soft); }
.t-ok { color: var(--success); }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(44px, 6vw, 72px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  overflow: hidden;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  transition: background-color 0.25s var(--ease);
}
.stat:hover { background: var(--surface-2); }
.stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.stat-value span { color: var(--accent); }
.stat-label { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }

/* ---------- Sections ---------- */
.section {
  padding: clamp(64px, 8vw, 104px) 0;
}
.section-alt {
  background: color-mix(in srgb, var(--bg-soft) 72%, transparent);
  border-block: 1px solid var(--border);
}
.section-head { max-width: 720px; margin-bottom: clamp(32px, 4vw, 48px); }
.section-kicker {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-head h2,
.section-contact h2 {
  font-size: clamp(1.85rem, 3.4vw, 2.7rem);
  font-weight: 800;
  margin-bottom: 14px;
}
.section-sub {
  margin: 0;
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  color: var(--muted);
  max-width: 62ch;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Profile ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.prose p { color: var(--text-soft); }
.prose .lead {
  font-size: clamp(1.08rem, 1.5vw, 1.22rem);
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 1.2rem;
}
.prose strong { color: var(--text); font-weight: 600; }
.quote {
  margin: 28px 0 0;
  padding: 18px 22px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text);
}
.quote em { color: var(--accent); font-style: normal; }

.profile-side { display: grid; gap: 18px; }
.card {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card-accent {
  background:
    linear-gradient(150deg, var(--accent-soft), transparent 55%),
    var(--surface);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
}
.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 18px;
}
.strength-list { list-style: none; display: grid; gap: 16px; }
.strength-list li { display: flex; gap: 12px; }
.strength-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 3px;
}
.strength-list strong { display: block; font-size: 0.92rem; }
.strength-list p { margin: 2px 0 0; font-size: 0.83rem; color: var(--muted); line-height: 1.5; }

.fact-list { display: grid; gap: 0; margin: 0; }
.fact-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.fact-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.fact-list dt { font-size: 0.8rem; color: var(--muted); flex: 0 0 auto; }
.fact-list dd { margin: 0; font-size: 0.84rem; font-weight: 500; text-align: right; color: var(--text-soft); }

/* ---------- Experiences tabs ---------- */
.exp-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 34px);
  align-items: start;
}
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 620px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.exp-list::-webkit-scrollbar { width: 8px; }
.exp-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.exp-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 13px 14px 13px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.exp-tab::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  translate: 0 -50%;
  width: 3px;
  height: 0;
  border-radius: 3px;
  background: linear-gradient(var(--accent), var(--accent-2));
  transition: height 0.25s var(--ease);
}
.exp-tab:hover { background: var(--surface-2); }
.exp-tab.is-active { background: var(--accent-soft); }
.exp-tab.is-active::before { height: 62%; }
.exp-period {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}
.exp-tab.is-active .exp-period { color: var(--accent); }
.exp-role { font-size: 0.87rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.exp-company { font-size: 0.76rem; color: var(--muted); }

.exp-panels {
  min-height: 100%;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(40rem 20rem at 100% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-md);
}
.exp-panel[hidden],
.skill-panel[hidden] { display: none; }
.exp-panel.is-active,
.skill-panel.is-active { animation: fadeUp 0.4s var(--ease); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.panel-kicker {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  letter-spacing: 0.03em;
}
.panel-head h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); font-weight: 700; }
.panel-company { margin: 5px 0 0; font-size: 0.86rem; color: var(--muted); }
.badge {
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-soft);
  white-space: nowrap;
}
.badge-live {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 38%, transparent);
  background: color-mix(in srgb, var(--success) 10%, transparent);
}
.panel-intro {
  font-size: 0.96rem;
  color: var(--text-soft);
  margin-bottom: 22px;
}
.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(22px, 3vw, 38px);
}
.panel-grid h4 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.panel-grid h4:not(:first-child) { margin-top: 22px; }
.panel-grid p { font-size: 0.9rem; color: var(--muted); }

.check-list { list-style: none; display: grid; gap: 10px; }
.check-list li {
  position: relative;
  padding-left: 22px;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.55;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.52em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.check-list strong { color: var(--text); font-weight: 600; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
}
.chips li {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--text-soft);
  white-space: nowrap;
}

/* ---------- Skills ---------- */
.skill-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.skill-tab {
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.skill-tab:hover { color: var(--text); background: var(--surface-2); }
.skill-tab.is-active {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--accent-3)));
  box-shadow: 0 6px 16px var(--accent-glow);
}
html[data-theme="light"] .skill-tab.is-active { color: var(--on-accent); }

.skill-panel {
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.skill-panel .panel-intro { max-width: 78ch; }
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.skill-card {
  position: relative;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.skill-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.skill-card h3 { font-size: 0.94rem; font-weight: 700; margin-bottom: 6px; }
.skill-card p { font-size: 0.83rem; color: var(--muted); line-height: 1.55; margin-bottom: 12px; }
.skill-level {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ---------- Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr);
  gap: clamp(22px, 3vw, 34px);
  align-items: start;
}
.edu-main { display: grid; gap: 14px; }
.edu-card {
  display: flex;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.edu-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.edu-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.edu-icon .icon { width: 22px; height: 22px; }
.edu-date {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.edu-body h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.edu-body p:last-child { margin: 0; font-size: 0.85rem; color: var(--muted); }

.lang-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, var(--accent-soft), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.lang-block { margin-bottom: 20px; }
.lang-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.lang-head span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); }
.lang-bar {
  height: 6px;
  border-radius: 6px;
  background: var(--surface-3);
  overflow: hidden;
}
.lang-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.lang-levels { list-style: none; display: grid; gap: 7px; }
.lang-levels li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
.lang-levels li span:last-child {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-soft);
}
.lang-note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Hobbies ---------- */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.hobby-card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.hobby-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.hobby-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--accent-soft), transparent);
  border: 1px solid var(--border);
  color: var(--accent);
}
.hobby-icon .icon { width: 24px; height: 24px; }
.hobby-card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 4px; }
.hobby-tag {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.hobby-card > p:not(.hobby-tag) { font-size: 0.88rem; color: var(--muted); }
.hobby-points { list-style: none; display: grid; gap: 6px; margin-top: 14px; }
.hobby-points li {
  position: relative;
  padding-left: 16px;
  font-size: 0.81rem;
  color: var(--text-soft);
}
.hobby-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
}

/* ---------- Contact ---------- */
.section-contact { padding-bottom: clamp(72px, 9vw, 120px); }
.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(28px, 4vw, 52px);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(46rem 28rem at 0% 0%, var(--accent-soft), transparent 55%),
    radial-gradient(36rem 24rem at 100% 100%, rgba(53, 224, 192, 0.08), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.contact-copy h2 { margin-bottom: 14px; }
.contact-copy > p { max-width: 52ch; color: var(--muted); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.contact-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-left: clamp(0px, 3vw, 30px);
  border-left: 1px solid var(--border);
}
.contact-list { list-style: none; display: grid; gap: 16px; }
.contact-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
}
.contact-label {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-list a,
.contact-list li > span:not(.contact-label) {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}
.contact-list a:hover { color: var(--accent); }
.copy-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.btn-print { width: 100%; font-size: 0.85rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 24px 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.footer-inner p { margin: 0; }
.footer-note { font-size: 0.75rem; }
.back-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-soft);
}
.back-top:hover { color: var(--accent); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  translate: -50% 20px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), translate 0.25s var(--ease);
}
.toast.is-visible { opacity: 1; translate: -50% 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .terminal-card { max-width: 560px; transform: none; }
  .profile-grid,
  .edu-grid { grid-template-columns: 1fr; }
  .profile-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .exp-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .hobby-grid { grid-template-columns: 1fr 1fr; }
  .hobby-grid .hobby-card:last-child { grid-column: 1 / -1; }
  .contact-card { grid-template-columns: 1fr; }
  .contact-side { padding-left: 0; padding-top: 24px; border-left: 0; border-top: 1px solid var(--border); }
}

@media (max-width: 980px) {
  :root { --header-h: 66px; }
  .nav-toggle { display: grid; }
  .main-nav {
    position: absolute;
    top: calc(var(--header-h) - 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 24px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
  }
  .main-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-link { padding: 11px 14px; font-size: 0.95rem; }
  .brand-text small { display: none; }
  .exp-layout { grid-template-columns: 1fr; }
  .exp-list {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px;
    scrollbar-width: thin;
  }
  .exp-tab { flex: 0 0 190px; padding: 12px 14px; }
  .exp-tab::before { left: 50%; top: auto; bottom: 4px; translate: -50% 0; width: 0; height: 3px; }
  .exp-tab.is-active::before { width: 48%; height: 3px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 20px 18px; }
}

@media (max-width: 640px) {
  .container { width: min(1160px, 100% - 32px); }
  .hero { padding-top: 44px; }
  .hero h1 { letter-spacing: -0.03em; }
  .hero-actions { gap: 9px; }
  .btn { padding: 11px 16px; font-size: 0.86rem; }
  .hero-meta { flex-direction: column; gap: 6px; }
  .terminal-body { padding: 18px 16px 20px; font-size: 0.72rem; line-height: 1.85; }
  .profile-side { grid-template-columns: 1fr; }
  .exp-panels { padding: 20px 18px; }
  .panel-head { flex-direction: column; gap: 10px; }
  .skill-tablist { gap: 6px; padding: 8px; }
  .skill-tab { padding: 8px 12px; font-size: 0.78rem; }
  .skill-panel { padding: 20px 18px; }
  .skill-grid { grid-template-columns: 1fr; }
  .hobby-grid { grid-template-columns: 1fr; }
  .hobby-grid .hobby-card:last-child { grid-column: auto; }
  .edu-card { flex-direction: column; gap: 12px; padding: 20px; }
  .contact-card { padding: 24px 20px; }
  .contact-actions .btn { width: 100%; }
  .footer-inner { justify-content: center; text-align: center; }
  .stats { margin-top: 40px; }
  .stat-value { font-size: 1.55rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #111; --text-soft: #222; --muted: #555; }
  body { background: #fff; color: #111; font-size: 11pt; }
  body::before,
  .site-header,
  .scroll-progress,
  .hero-actions,
  .terminal-card,
  .stats,
  .exp-list,
  .skill-tablist,
  .contact-actions,
  .contact-side .btn-print,
  .site-footer,
  .toast,
  .copy-btn { display: none !important; }
  .hero { padding: 0 0 16px; }
  .hero-grid { display: block; }
  .section { padding: 18px 0; break-inside: avoid; }
  .section-alt { background: none; border: 0; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .exp-layout { display: block; }
  .exp-panels { border: 0; box-shadow: none; padding: 0; background: none; }
  .exp-panel,
  .skill-panel { display: block !important; break-inside: avoid; page-break-inside: avoid; margin-bottom: 16px; }
  .exp-panel[hidden],
  .skill-panel[hidden] { display: block !important; }
  .panel-head h3 { font-size: 13pt; }
  .panel-head { padding-bottom: 8px; margin-bottom: 10px; }
  .profile-grid,
  .panel-grid,
  .edu-grid,
  .hobby-grid { display: block; }
  .profile-side { margin-top: 12px; }
  .card,
  .edu-card,
  .hobby-card,
  .skill-card { border: 1px solid #ddd; box-shadow: none; break-inside: avoid; }
  .skill-card { margin-bottom: 8px; }
  .hobby-card { margin-bottom: 10px; }
  .quote { background: none; }
  .contact-card { border: 1px solid #ddd; box-shadow: none; padding: 0; background: none; }
  .contact-card h2 { font-size: 15pt; }
  .contact-side { border: 0; padding: 0; margin-top: 10px; }
  .contact-list { display: flex; flex-wrap: wrap; gap: 12px 24px; }
  a { color: #111; text-decoration: none; }
}
