/* ============================================================
   LUCIANO SALEMME — Personal Site
   Design: IDE / Editor theme — nerd + professional
   ============================================================ */

/* Fonts are loaded via <link> in <head> (with preconnect) — no @import here. */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #09090e;
  --bg-card:    #0d1117;
  --bg-card-2:  #13161d;
  --bg-hover:   #1a1f2e;
  --border:     #21262d;
  --border-2:   #30363d;
  --text:       #e6edf3;
  --text-2:     #8b949e;
  --text-3:     #484f58;
  --blue:       #58a6ff;
  --violet:     #d2a8ff;
  --green:      #3fb950;
  --amber:      #ffa657;
  --red:        #ff7b72;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 32px rgba(0,0,0,.4);
  --shadow-lg:  0 8px 64px rgba(0,0,0,.6);

  /* IDE chrome dimensions */
  --titlebar-h: 32px;
  --tabbar-h:   38px;
  --statusbar-h: 24px;
  --activity-w: 48px;
  --sidebar-w:  220px;
  --chrome-top: calc(var(--titlebar-h) + var(--tabbar-h));
  --chrome-left: calc(var(--activity-w) + var(--sidebar-w));
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: var(--chrome-top);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Inline SVG line icons */
.ic {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: block;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .8; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

::selection { background: rgba(88,166,255,.2); }

/* ---- Utilities ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: 'JetBrains Mono', monospace; }
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid transparent;
}
.tag-blue   { background: rgba(88,166,255,.1);  color: var(--blue);   border-color: rgba(88,166,255,.2);  }
.tag-violet { background: rgba(210,168,255,.1); color: var(--violet); border-color: rgba(210,168,255,.2); }
.tag-green  { background: rgba(63,185,80,.1);   color: var(--green);  border-color: rgba(63,185,80,.2);   }
.tag-amber  { background: rgba(255,166,87,.1);  color: var(--amber);  border-color: rgba(255,166,87,.2);  }

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--blue);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 60px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 14px;
}
.section-sub {
  color: var(--text-2);
  font-size: 1.05rem;
  max-width: 600px;
  margin-bottom: 48px;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }


/* ============================================================
   IDE CHROME
   ============================================================ */

/* --- File type icons --- */
.fi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 13px;
  border-radius: 2px;
  font-size: 6.5px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
.fi-md   { background: rgba(79,193,255,.12);  color: #79c0ff; border: 1px solid rgba(79,193,255,.22); }
.fi-ts   { background: rgba(49,120,198,.18);  color: #7caee8; border: 1px solid rgba(49,120,198,.28); }
.fi-json { background: rgba(255,166,87,.14);  color: #ffa657; border: 1px solid rgba(255,166,87,.24); }
.fi-yaml { background: rgba(255,123,114,.14); color: #ff8b82; border: 1px solid rgba(255,123,114,.24);}

/* --- Titlebar --- */
.ide-titlebar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--titlebar-h);
  background: #0a0a16;
  border-bottom: 1px solid rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 500;
  user-select: none;
}

.titlebar-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}
.tdot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: filter .2s;
}
.tdot-r { background: #ff5f57; }
.tdot-y { background: #febc2e; }
.tdot-g { background: #28c840; }
.titlebar-dots:hover .tdot { filter: brightness(1.15); }

.titlebar-center {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  color: var(--text-3);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}
.titlebar-icon { color: var(--blue); flex-shrink: 0; }

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.taction {
  width: 28px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 3px;
  transition: background .15s, color .15s;
  line-height: 1;
}
.taction:hover { background: rgba(255,255,255,.1); color: var(--text-2); }
.taction-x:hover { background: rgba(255,95,87,.25); color: #ff5f57; }

/* --- Tab bar --- */
.ide-tabbar {
  position: fixed;
  top: var(--titlebar-h);
  left: 0; right: 0;
  height: var(--tabbar-h);
  background: #0b0b17;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  overflow-x: auto;
  z-index: 400;
}
.ide-tabbar::-webkit-scrollbar { height: 0; }

.ide-sidebar-btn {
  flex-shrink: 0;
  width: var(--activity-w);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #09090f;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-3);
  cursor: pointer;
  transition: color .2s, background .2s;
}
.ide-sidebar-btn:hover { color: var(--text-2); background: rgba(255,255,255,.04); }

.ide-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  height: 36px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--text-3);
  background: #09090f;
  border-right: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .15s, background .15s;
  position: relative;
  user-select: none;
  white-space: nowrap;
}
.ide-tab:hover { color: var(--text-2); background: rgba(255,255,255,.03); }
.ide-tab.active {
  color: var(--text);
  background: var(--bg);
  margin-bottom: -1px;
}
.ide-tab.active::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--blue);
  box-shadow: 0 0 10px rgba(88,166,255,.5);
}
.ide-tab.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(88,166,255,.04) 0%, transparent 60%);
  pointer-events: none;
}

.ide-cmdpalette-btn {
  margin-left: auto;
  margin-right: 12px;
  margin-bottom: 6px;
  padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  color: var(--text-3);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .2s;
  white-space: nowrap;
  align-self: center;
}
.ide-cmdpalette-btn:hover {
  color: var(--text-2);
  border-color: var(--border-2);
  background: rgba(255,255,255,.07);
}

/* --- Language switch (segmented IT | EN) --- */
.lang-switch {
  display: inline-flex;
  align-items: stretch;
  margin-left: auto;
  margin-right: 8px;
  align-self: center;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.lang-switch + .ide-cmdpalette-btn { margin-left: 0; }
.lang-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: none;
  border: none;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.lang-opt + .lang-opt { border-left: 1px solid var(--border); }
.lang-opt:hover { color: var(--text-2); }
.lang-opt.active {
  color: var(--text);
  background: rgba(88,166,255,.14);
  cursor: default;
}
.lang-flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  display: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}
.lang-opt.active .lang-flag { display: block; }
.lang-flag svg { display: block; width: 100%; height: 100%; }

/* --- Bilingual visibility (toggled via <html lang>) --- */
html[lang="en"] .l-it { display: none !important; }
html[lang="it"] .l-en { display: none !important; }

/* --- Activity bar --- */
.ide-activity {
  position: fixed;
  top: var(--chrome-top);
  left: 0;
  bottom: var(--statusbar-h);
  width: var(--activity-w);
  background: #080810;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 2px;
  z-index: 300;
}

.act-btn {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color .2s, background .2s;
  position: relative;
}
.act-btn:hover { color: var(--text-2); background: rgba(255,255,255,.05); }
.act-btn.act-active { color: var(--text); }
.act-btn.act-active::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 22px;
  background: var(--blue);
  border-radius: 0 2px 2px 0;
  box-shadow: 1px 0 6px rgba(88,166,255,.5);
}
.act-spacer { flex: 1; }

/* --- Sidebar --- */
.ide-sidebar {
  position: fixed;
  top: var(--chrome-top);
  left: var(--activity-w);
  bottom: var(--statusbar-h);
  width: var(--sidebar-w);
  background: #0b0b16;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 299;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.ide-sidebar::-webkit-scrollbar { width: 3px; }
.ide-sidebar::-webkit-scrollbar-thumb { background: var(--border); }
.ide-sidebar.collapsed { transform: translateX(-100%); }

.sidebar-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  color: var(--text-3);
  letter-spacing: .12em;
  padding: 11px 12px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #0b0b16;
  z-index: 1;
}
.sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 3px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s, background .2s;
}
.sidebar-toggle-btn:hover { color: var(--text-2); background: rgba(255,255,255,.06); }

.sidebar-folder { margin-bottom: 2px; }

.sfolder-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  letter-spacing: .06em;
  transition: color .2s;
}
.sfolder-header:hover { color: var(--text); }

.sfolder-chev {
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform .2s;
}
.sfolder-chev-closed { transform: rotate(-90deg); }
.sidebar-folder.open .sfolder-chev-closed { transform: rotate(0deg); }

.sfolder-files { padding: 2px 0; }

.sfile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .71rem;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s, color .12s;
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sfile:hover { background: rgba(255,255,255,.04); color: var(--text); }
.sfile.active {
  background: rgba(88,166,255,.08);
  color: var(--text);
  border-left-color: var(--blue);
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(0,0,0,.5);
}
.ide-sidebar.mobile-open .sidebar-overlay { display: block; }

/* --- Content wrapper --- */
.ide-content {
  margin-top: var(--chrome-top);
  margin-left: var(--chrome-left);
  padding-bottom: var(--statusbar-h);
  min-height: calc(100dvh - var(--chrome-top));
}

/* --- Status bar --- */
.ide-statusbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--statusbar-h);
  background: #0078d4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 500;
  user-select: none;
}
.statusbar-left, .statusbar-right {
  display: flex;
  align-items: center;
}
.sitem {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  height: var(--statusbar-h);
  font-family: 'JetBrains Mono', monospace;
  font-size: .66rem;
  color: rgba(255,255,255,.88);
  cursor: default;
  transition: background .12s;
  white-space: nowrap;
}
.sitem:hover { background: rgba(255,255,255,.15); }
.sitem-branch { gap: 5px; }
.sitem-ok { color: #b5f3c8; }
.sitem-lang { color: rgba(255,255,255,.8); }
.sitem-avail {
  font-weight: 600;
  color: #b5f3c8;
  gap: 5px;
}
.sitem-avail::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #28c840;
  animation: pulseDot 2s infinite;
  flex-shrink: 0;
}

/* --- Command palette --- */
.cmd-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.cmd-overlay.open { display: flex; }

.cmd-palette {
  width: 100%;
  max-width: 580px;
  background: #141422;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.9);
  animation: cmdSlideIn .15s ease;
}
@keyframes cmdSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.cmd-input-wrap svg { color: var(--text-3); flex-shrink: 0; }
.cmd-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: .9rem;
  outline: none;
}
.cmd-input::placeholder { color: var(--text-3); }

.cmd-esc {
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  color: var(--text-3);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border-2);
  border-radius: 3px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.cmd-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 4px 0;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background .1s;
}
.cmd-item:hover, .cmd-item.cmd-active { background: rgba(88,166,255,.1); }
.cmd-item.cmd-active .cmd-item-file { color: var(--blue); }

.cmd-item-file {
  font-family: 'JetBrains Mono', monospace;
  font-size: .76rem;
  color: var(--blue);
  flex-shrink: 0;
  min-width: 140px;
}
.cmd-item-label {
  font-size: .8rem;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmd-empty {
  padding: 20px 16px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  color: var(--text-3);
}


/* ============================================================
   HERO
   ============================================================ */
#hero {
  position: relative;
  min-height: calc(100dvh - var(--chrome-top));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 60px 0 60px;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(9,9,14,.55) 0%, rgba(9,9,14,.82) 70%, rgba(9,9,14,.94) 100%),
    linear-gradient(180deg, rgba(9,9,14,.5) 0%, rgba(9,9,14,.75) 100%);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 24px;
  max-width: 860px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 500;
  background: rgba(63,185,80,.08);
  border: 1px solid rgba(63,185,80,.25);
  color: var(--green);
  margin-bottom: 28px;
  animation: fadeDown .6s ease both;
}
.hero-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(63,185,80,.4); }
  50% { opacity: .8; box-shadow: 0 0 0 4px rgba(63,185,80,0); }
}

.hero-name {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 12px;
  animation: fadeUp .7s .1s ease both;
}

.hero-role {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 400;
  color: var(--blue);
  margin-bottom: 20px;
  animation: fadeUp .7s .2s ease both;
  font-family: 'JetBrains Mono', monospace;
}
.hero-role::after {
  content: '█';
  font-size: .9em;
  margin-left: 3px;
  animation: blink 1.1s step-end infinite;
  color: var(--blue);
  opacity: .7;
}
@keyframes blink {
  0%, 100% { opacity: .7; }
  50%       { opacity: 0; }
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.1rem);
  color: var(--text-2);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.7;
  animation: fadeUp .7s .3s ease both;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
  animation: fadeUp .7s .35s ease both;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp .7s .4s ease both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 600;
  transition: all .2s;
  cursor: pointer;
}
.btn-primary {
  background: var(--blue);
  color: #000;
  border: none;
}
.btn-primary:hover { opacity: .9; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(88,166,255,.3); color: #000; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover { border-color: var(--text-2); transform: translateY(-2px); color: var(--text); opacity: 1; }

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: .75rem;
  animation: fadeUp .7s .6s ease both;
}
.hero-scroll-arrow {
  width: 24px; height: 24px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(4px); }
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  animation: fadeUp .7s .5s ease both;
}
.hero-stat { text-align: center; }
.hero-stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.hero-stat-num span { color: var(--blue); }
.hero-stat-label { font-size: .78rem; color: var(--text-2); }


/* ============================================================
   ABOUT
   ============================================================ */
#about { padding: 100px 0; }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-text p {
  color: var(--text-2);
  margin-bottom: 18px;
  line-height: 1.8;
  font-size: .98rem;
}
.about-text p strong { color: var(--text); font-weight: 600; }

.about-qualities {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.about-quality {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s;
}
.about-quality:hover { border-color: var(--blue); }
.about-quality-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(88,166,255,.1);
  border: 1px solid rgba(88,166,255,.2);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.about-quality-text h4 { font-size: .9rem; font-weight: 600; margin-bottom: 3px; }
.about-quality-text p { font-size: .82rem; color: var(--text-2); margin: 0; }

.about-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .2s, transform .2s;
}
.about-card:hover { border-color: var(--border-2); transform: translateY(-2px); }

.about-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.about-card-label { font-size: .72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.about-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.about-card-value span { color: var(--blue); }

.education-items { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.edu-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.edu-icon { color: var(--blue); flex-shrink: 0; margin-top: 1px; }
.edu-inst { font-size: .9rem; font-weight: 600; }
.edu-degree { font-size: .8rem; color: var(--blue); margin: 3px 0; }
.edu-year { font-size: .75rem; color: var(--text-3); }

/* ============================================================
   EXPERIENCE
   ============================================================ */
#experience { padding: 100px 0; background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

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

.timeline-item {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
  position: relative;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text-2);
  position: relative;
  z-index: 1;
  transition: border-color .2s, color .2s;
}
.timeline-dot .ic { width: 19px; height: 19px; }
.timeline-item.current .timeline-dot {
  border-color: var(--blue);
  background: rgba(88,166,255,.08);
  box-shadow: 0 0 0 4px rgba(88,166,255,.1);
  color: var(--blue);
}

.timeline-card {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  transition: border-color .2s, transform .2s;
  cursor: pointer;
}
.timeline-card:hover { border-color: var(--border-2); transform: translateX(4px); }
.timeline-item.current .timeline-card { border-color: rgba(88,166,255,.25); }

.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.timeline-company { font-size: 1.1rem; font-weight: 700; }
.timeline-period {
  font-size: .78rem;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}
.timeline-role { color: var(--text-2); font-size: .88rem; margin-bottom: 14px; font-weight: 500; }
.timeline-desc { color: var(--text-2); font-size: .88rem; line-height: 1.7; margin-bottom: 16px; }
.timeline-techs { display: flex; flex-wrap: wrap; gap: 6px; }

.timeline-detail {
  display: none;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.timeline-detail.open { display: block; }
.timeline-detail-title {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 10px;
}
.timeline-achievements { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.timeline-achievements li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: .86rem; color: var(--text-2); line-height: 1.6;
}
.timeline-achievements li::before { content: '✦'; color: var(--blue); flex-shrink: 0; margin-top: 1px; font-size: .7rem; }

.timeline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: .8rem;
  color: var(--blue);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  transition: opacity .2s;
}
.timeline-toggle:hover { opacity: .7; }
.timeline-toggle-arrow { transition: transform .3s; }
.timeline-toggle-arrow.open { transform: rotate(180deg); }

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 48px;
}
.research-card {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: border-color .2s;
}
.research-card:hover { border-color: var(--violet); }
.research-year { font-size: .72rem; font-family: 'JetBrains Mono', monospace; color: var(--violet); margin-bottom: 6px; }
.research-title { font-size: .9rem; font-weight: 600; margin-bottom: 6px; }
.research-desc { font-size: .8rem; color: var(--text-2); line-height: 1.5; }

/* ============================================================
   SKILLS
   ============================================================ */
#skills { padding: 100px 0; }

.skills-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}
.skills-tab {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.skills-tab:hover { border-color: var(--border-2); color: var(--text); }
.skills-tab.active {
  background: rgba(88,166,255,.1);
  border-color: rgba(88,166,255,.4);
  color: var(--blue);
}

.skills-panel { display: none; }
.skills-panel.active { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; animation: fadeUp .35s ease; }

.skills-tab .ic { width: 16px; height: 16px; }

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: border-color .2s, transform .2s;
}
.skill-card:hover { border-color: var(--border-2); transform: translateY(-2px); }

.skill-name { font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
.skill-desc { font-size: .78rem; color: var(--text-2); margin-bottom: 12px; line-height: 1.4; }

.skill-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .8s .2s cubic-bezier(.4,0,.2,1);
}
.skill-card.visible .skill-bar-fill { transform: scaleX(1); }

/* ============================================================
   ARCHITECTURE
   ============================================================ */
#architecture { padding: 100px 0; background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.arch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.arch-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  transition: border-color .2s, transform .2s;
}
.arch-card:hover { border-color: var(--border-2); transform: translateY(-4px); box-shadow: var(--shadow); }

.arch-title {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}
.arch-desc { font-size: .82rem; color: var(--text-2); text-align: center; margin-bottom: 24px; line-height: 1.5; }

.arch-flow { display: flex; flex-direction: column; align-items: center; gap: 0; width: 100%; }
.arch-node {
  width: 100%;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}
.arch-arrow {
  font-size: .75rem;
  color: var(--text-3);
  line-height: 1.2;
  padding: 3px 0;
  animation: arrowPulse 2s infinite;
}
@keyframes arrowPulse {
  0%, 100% { opacity: .4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(2px); }
}

/* ============================================================
   PROJECTS
   ============================================================ */
#projects { padding: 100px 0; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  cursor: default;
}
.project-card:hover { border-color: rgba(88,166,255,.3); transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.4); }

.project-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  flex-shrink: 0;
}
.project-icon .ic { width: 20px; height: 20px; }
.project-status {
  font-size: .7rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}

.project-name { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.project-company { font-size: .78rem; color: var(--text-3); margin-top: 2px; }
.project-desc { font-size: .86rem; color: var(--text-2); line-height: 1.6; flex: 1; }
.project-impact {
  font-size: .82rem;
  color: var(--green);
  padding: 10px 14px;
  background: rgba(63,185,80,.06);
  border-radius: 8px;
  border: 1px solid rgba(63,185,80,.15);
  line-height: 1.4;
}
.project-impact::before { content: '→ '; font-family: var(--font-mono); }
.project-techs { display: flex; flex-wrap: wrap; gap: 5px; }

/* ============================================================
   AI SECTION
   ============================================================ */
#ai-section {
  padding: 100px 0;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(88,166,255,.03) 50%, var(--bg) 100%);
}

.ai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.ai-topics { display: flex; flex-direction: column; gap: 12px; }
.ai-topic {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s;
}
.ai-topic:hover { border-color: var(--violet); }
.ai-topic-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(210,168,255,.1);
  border: 1px solid rgba(210,168,255,.2);
  color: var(--violet);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ai-topic-title { font-size: .92rem; font-weight: 600; margin-bottom: 4px; }
.ai-topic-desc { font-size: .8rem; color: var(--text-2); line-height: 1.5; }

.ai-callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
}
.ai-callout-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--violet);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 16px;
}
.ai-callout h3 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}
.ai-callout p { color: var(--text-2); font-size: .92rem; line-height: 1.7; margin-bottom: 24px; }
.ai-code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  line-height: 1.8;
  color: var(--text-2);
}
.ai-code .k { color: #ff7b72; }
.ai-code .s { color: #a5d6ff; }
.ai-code .p { color: var(--violet); }
.ai-code .c { color: #6e7681; }

/* ============================================================
   CONTACT
   ============================================================ */
#contact { padding: 100px 0; }

.contact-wrapper { max-width: 760px; margin: 0 auto; }

.contact-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 0;
}
.contact-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 28px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color .2s, transform .2s;
  font-weight: 500;
}
.contact-link:hover { border-color: var(--blue); transform: translateY(-2px); color: var(--text); opacity: 1; }
.contact-link-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-link-text { font-size: .86rem; word-break: break-word; }
.contact-link-label { font-size: .72rem; color: var(--text-3); margin-bottom: 4px; letter-spacing: .04em; text-transform: uppercase; }

.contact-form-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}
.contact-form-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 24px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { font-size: .8rem; color: var(--text-2); font-weight: 500; }
.form-input, .form-textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  width: 100%;
  transition: border-color .2s;
  outline: none;
}
.form-input:focus, .form-textarea:focus { border-color: var(--blue); }
.form-textarea { min-height: 120px; resize: vertical; }
.form-submit {
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: #000;
  font-weight: 600;
  font-size: .95rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: opacity .2s, transform .2s;
  margin-top: 6px;
}
.form-submit:hover { opacity: .9; transform: translateY(-1px); }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copy { font-size: .82rem; color: var(--text-3); }
.footer-credit {
  font-family: 'JetBrains Mono', monospace;
  font-size: .74rem;
  color: var(--text-3);
  letter-spacing: .03em;
}
.footer-credit a { color: var(--text-2); font-weight: 500; transition: color .2s; }
.footer-credit a:hover { color: var(--blue); opacity: 1; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: .82rem; color: var(--text-3); transition: color .2s; }
.footer-links a:hover { color: var(--text-2); opacity: 1; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero-role::after { animation: none; }
  .hero-video { display: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  :root {
    --activity-w: 0px;
    --sidebar-w:  0px;
    --chrome-left: 0px;
  }

  .ide-activity { display: none; }

  .ide-sidebar {
    left: 0;
    width: 240px;
    transform: translateX(-100%);
    z-index: 401;
  }
  .ide-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.6);
  }
  .ide-sidebar.mobile-open .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(0,0,0,.5);
  }

  /* Top bar: keep menu + language always reachable while tabs scroll */
  .ide-sidebar-btn { display: flex; width: 46px; position: sticky; left: 0; z-index: 3; }
  .ide-cmdpalette-btn { display: none; }
  .lang-switch {
    position: sticky;
    right: 8px;
    z-index: 3;
    margin-right: 0;
    background: #0b0b17;
    box-shadow: -12px 0 12px -6px #0b0b17;
  }

  .ide-content { margin-left: 0; }
  .ide-content .container { padding: 0 16px; }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .ai-grid { grid-template-columns: 1fr; gap: 40px; }
  .arch-grid { grid-template-columns: 1fr 1fr; }
  .contact-info { grid-template-columns: 1fr; }
  .contact-link { flex-direction: row; align-items: center; text-align: left; gap: 14px; padding: 20px 24px; }
  .contact-link-icon { width: 40px; height: 40px; border-radius: 10px; }
  .form-row { grid-template-columns: 1fr; }
  .contact-form-wrap { padding: 24px; }

  .titlebar-actions { display: none; }
}

@media (max-width: 700px) {
  #about, #experience, #skills, #architecture, #projects, #ai-section, #contact { padding: 64px 0; }
  .arch-grid { grid-template-columns: 1fr; }
  .timeline::before { display: none; }
  .timeline-item { flex-direction: column; gap: 12px; }
  .timeline-dot { width: 32px; height: 32px; }
  .skills-panel.active { grid-template-columns: 1fr 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }

  .ide-tabbar { overflow-x: auto; }
  .ide-tab { padding: 0 12px; font-size: .68rem; }
}

@media (max-width: 420px) {
  .skills-panel.active { grid-template-columns: 1fr; }
  .ide-tab { padding: 0 10px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1 1 100%; justify-content: center; }
}
