/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: auto; }
a { color: inherit; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(255,255,255,0.3), rgba(255,255,255,0.15)); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0.25)); }
html { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.25) rgba(255,255,255,0.03); }

/* Scroll progress bar */
.scroll-progress { position: fixed; top: 0; left: 0; width: 0%; height: 3px; background: linear-gradient(90deg, rgba(255,255,255,0.5), rgba(255,255,255,0.85)); z-index: 100; transition: width 60ms linear; box-shadow: 0 0 12px rgba(255,255,255,0.6); }
:root {
  --bg: #121317;
  --text: #e9eaee;
  --muted: #b0b3b9;
  --surface: #14161b;
  --card: transparent;
  --border: #31343b;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
/* Force dark mode: remove light defaults and media-based switching */
@media (prefers-color-scheme: dark) { :root { } }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* Background network canvas behind everything */
.bg-net { position: fixed; inset: 0; z-index: 0; display: block; pointer-events: none; }

/* Lift rest of content above canvas */
.site-hero, .toc, .page-content, .contact { position: relative; z-index: 1; }

/* Transparent hero background so effects show through */
.site-hero, .site-hero::before, .site-hero::after, .hero-inner { background: transparent !important; }

/* Sparkles (disabled) */
.sparkle { display: none; }

/* Top hero */
.site-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 28px 24px 30px 24px;
  background: var(--bg);
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1040px;
  width: 100%;
  justify-content: flex-start;
}

.avatar-container {
  position: relative;
  width: 120px;
  height: 120px;
  cursor: pointer;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  background: transparent;
  position: relative;
  z-index: 1;
}

.avatar-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%) rotate(-90deg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 2;
}

.avatar-container:hover .avatar-ring {
  opacity: 1;
}

.avatar-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 2.5;
}

.avatar-ring-progress {
  fill: none;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2.5;
  stroke-dasharray: 351.858;
  stroke-dashoffset: 351.858;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5));
  transition: stroke-dashoffset 10s linear;
}

.avatar-container:hover .avatar-ring-progress {
  stroke-dashoffset: 0;
}

.text { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.name {
  margin: 0;
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -0.02em;
}
.name { animation: titleIn 700ms 120ms ease-out both; }
@keyframes titleIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.meta { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; animation: metaIn 700ms 240ms ease-out both; }
@keyframes metaIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.meta-item {
  cursor: pointer;
  transition: color 200ms ease, transform 200ms ease;
  position: relative;
}

.meta-item:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.location {
  margin: 8px 0 0 0;
  color: var(--muted);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.location .pin { width: 24px; height: 24px; object-fit: contain; filter: brightness(1.4); opacity: 0.95; transition: transform 200ms ease; }
.location:hover .pin { transform: scale(1.1); }

.location-text {
  display: inline-block;
  position: relative;
}

.role {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
}
.role:hover {
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}
.bullet {
  margin-top: 8px;
  color: #ffffff;
  font-size: 18px;
}
.age { color: var(--muted); position: relative; top: 5.5px; }

/* Small screens */
@media (max-width: 640px) {
  .site-hero { padding: 20px; min-height: 160px; }
  .hero-inner { flex-direction: column; text-align: center; gap: 12px; align-items: center; }
  .avatar-container { width: 96px; height: 96px; }
  .avatar { width: 96px; height: 96px; }
  .avatar-ring { width: 96px; height: 96px; }
  .name { font-size: 28px; }
}

/* Animate hero in */
.site-hero { animation: fadeUp 700ms ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.avatar { animation: popIn 600ms 120ms ease-out both, floatY 6s ease-in-out 1.2s infinite alternate; }
@keyframes popIn { 0% { transform: scale(0.92); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes floatY { from { transform: translateY(0); } to { transform: translateY(-4px); } }

/* Page content placeholder so page is scrollable */
.page-content {
  min-height: 140vh;
  padding: 24px 24px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

/* Left-middle simple TOC made of lines */
.toc {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3;
}
.toc a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.toc a .bar {
  display: block;
  width: 36px;
  height: 3px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  transition: width 160ms ease, opacity 160ms ease, transform 160ms ease;
  opacity: 0.85;
}
.toc:hover a .bar, .toc.expanded a .bar { width: 56px; opacity: 1; }
.toc a:hover .bar, .toc a:focus-visible .bar { transform: translateX(2px); outline: none; }
.toc a:hover .bar { width: 64px; }
.toc a.active .bar { width: 64px; opacity: 1; }
.toc a .label {
  color: var(--muted);
  font-size: 13px;
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
  text-decoration: none;
  transform: translateX(0) scale(0.98);
  white-space: nowrap;
}
.toc:hover a .label, .toc.expanded a .label, .toc a.active .label { opacity: 1; transform: translateX(2px) scale(1); }
.toc a:hover .label, .toc a:focus-visible .label { transform: translateX(4px) scale(1.06); }

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

/* Placeholder sections */
.section { padding: 96px 0; }

/* Fade-in sections on scroll */
.fade-section { opacity: 0; transform: translateY(30px) scale(.98); filter: blur(2px); transition: opacity 600ms ease, transform 600ms ease, filter 600ms ease; }
.fade-section.visible { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }

/* Timeline */
.timeline { max-width: 1400px; margin: 0 auto; padding: 0 0 8px 0; }
.timeline-header { text-align: center; padding: 0 0 24px 0; position: relative; }
.timeline-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
.projects-timeline .timeline-header::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 0; height: 2px; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.28), rgba(255,255,255,0)); }
.timeline-tabs { display: flex; justify-content: center; gap: 16px; margin: 0; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; background: var(--bg); }
.timeline-tabs::after { content: ''; position: absolute; left: 24px; right: 24px; bottom: -1px; height: 2px; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.14), rgba(255,255,255,0)); }
.timeline-tabs .tab { padding: 10px 6px; background: transparent; border: none; color: var(--muted); font-weight: 800; letter-spacing: -0.01em; font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; cursor: pointer; position: relative; }
.timeline-tabs .tab.active { color: var(--text); }
.timeline-tabs .tab.active::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -1px; height: 3px; background: rgba(255,255,255,0.8); border-radius: 2px; animation: underlinePulse 800ms ease-out both; }
@keyframes underlinePulse { 0% { left: 45%; right: 45%; opacity: 0; } 60% { left: 8%; right: 8%; opacity: 1; } 100% { left: 10%; right: 10%; opacity: 1; } }
.timeline-panels { display: block; }
.panel[hidden] { display: none !important; }

/* Attach the timeline to the same underline */
.panel { position: relative; padding: 24px 12px 8px 56px; border: 0; border-radius: 16px; background: transparent; box-shadow: none; }
.panel::before { content: ""; position: absolute; left: 32px; top: -1px; bottom: 6px; width: 2px; background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04)); }

/* Poppy panel switch-in */
.panel.active { animation: panelPop 260ms cubic-bezier(.2,.8,.2,1) both; }
.panel.enter-left { animation: panelSlideLeft 320ms cubic-bezier(.2,.8,.2,1) both; }
.panel.enter-right { animation: panelSlideRight 320ms cubic-bezier(.2,.8,.2,1) both; }
@keyframes panelPop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes panelSlideLeft { from { opacity: 0; transform: translateX(-26px) scale(.98); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes panelSlideRight { from { opacity: 0; transform: translateX(26px) scale(.98); } to { opacity: 1; transform: translateX(0) scale(1); } }

/* Stagger cards when panel just activated */
.panel.just-activated .card { opacity: 0; transform: translateY(16px); }
.panel.just-activated .card:nth-child(1) { animation: cardStagger 260ms 40ms ease-out forwards; }
.panel.just-activated .card:nth-child(2) { animation: cardStagger 260ms 100ms ease-out forwards; }
.panel.just-activated .card:nth-child(3) { animation: cardStagger 260ms 160ms ease-out forwards; }
.panel.just-activated .card:nth-child(4) { animation: cardStagger 260ms 220ms ease-out forwards; }
@keyframes cardStagger { to { opacity: 1; transform: translateY(0); } }

.card { position: relative; padding: 8px 8px 12px 8px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; transform: translateY(6px); opacity: 0; transition: transform 220ms ease, opacity 220ms ease, background 160ms ease; }
.card.in-view { transform: translateY(0); opacity: 1; }
.card:hover { transform: translateY(-4px) scale(1.01); }
.card + .card { margin-top: 6px; border-top: 1px solid rgba(255,255,255,0.06); }
.card:hover { background: rgba(255,255,255,0.02); }
.card-header { position: relative; padding-left: 28px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.card-header .dot { position: absolute; left: -28px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: #dcdcdc; box-shadow: none; border: 1px solid var(--border); }
.card:not(:last-child)::after { content: ""; position: absolute; left: -23px; top: 18px; width: 2px; height: calc(100% + 12px); background: var(--border); }
.card-header .meta { display: flex; flex-direction: column; }
.card-header .dates { color: var(--muted); font-size: 12px; }
.dates-inline { color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 8px; white-space: nowrap; }
.card-header .title .dates-inline { margin-left: auto; }
.card-header .title { margin: 0; font-size: 18px; display: flex; align-items: baseline; gap: 8px; }
.card-header .sub { color: var(--muted); font-size: 14px; }
.bullets { margin: 10px 0 0 0; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.bullets li { margin-bottom: 6px; }
.bullets b, .bullets strong { color: var(--text); }
.badge { display: inline-block; margin-left: 6px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 999px; font-size: 11px; color: var(--muted); }

/* slot where future per-entry images can sit */
.img-slot { width: 56px; height: 56px; border-radius: 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); display: inline-block; object-fit: cover; margin-right: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.25), 0 0 0 3px rgba(255,255,255,0.04); }

@media (max-width: 640px) {
  .timeline-tabs { grid-template-columns: 1fr 1fr 1fr; }
  .card-header .title { font-size: 16px; }
  .toc { left: 12px; gap: 6px; }
  .toc a { min-height: 22px; padding: 3px 8px; }
  .toc a .bar { width: 28px; height: 2.5px; }
  .toc:hover a .bar, .toc.expanded a .bar, .toc a.active .bar { width: 42px; }
  .toc a:hover .bar { width: 50px; }
  .toc a .label { font-size: 12px; }
  .toc:hover a .label, .toc.expanded a .label { opacity: 1; }
  .page-content { padding: 16px 16px 16px 72px; }
}

/* Desktop: horizontal number-line presentation */
@media (min-width: 900px) {
  .panel { padding: 20px 12px 10px 12px; display: flex; gap: 12px; align-items: flex-start; }
  .panel::before { display: none; }
  .panel .card { flex: 1; padding: 10px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; margin-top: 0; }
  .panel .card::after { content: ""; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); width: 2px; height: 20px; background: var(--border); }
  .panel .card-header { padding-left: 0; margin-bottom: 6px; }
  .panel .card-header .dot { display: none; }
  .panel .card-header .title { white-space: nowrap; }
  .panel.is-other { display: block; }
  #work.panel { padding-left: 12px; justify-content: center; }
  #work.panel .card { flex: 0 1 auto; max-width: 48%; }
  #work.panel .sub-centered { text-align: center; }
}

/* Skills panel tweaks */
.is-skills::before { display: none; }
.is-skills .card::after { display: none; }
.is-skills .card { background: transparent; border: 0; }
.icon-slot { display: inline-block; width: 32px; height: 32px; border-radius: 4px; border: 0; background: transparent; margin-right: 8px; vertical-align: -6px; box-shadow: none; }
.is-skills .icon-slot img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; display: block; }

/* Micro alignment per icon to visually align baselines */
.icon-linux { transform: translateY(2px) scale(0.98); }
.icon-docker { transform: translateY(1px) scale(1.02); }
.icon-git { transform: translateY(2px) scale(1.00); }
.icon-claude { transform: translateY(0px) scale(1.04); }
.icon-cuda { transform: translateY(3px) scale(0.96); }
.icon-chatgpt { transform: translateY(1px) scale(1.02); }

/* Contact footer */
.contact {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-top: none;
  backdrop-filter: none;
  z-index: 1;
  padding: 28px 0 90px 0;
  margin-top: auto;
}
.contact::before { content: ""; position: absolute; top: auto; left: 0; right: 0; height: 0; background: none; }
.contact-inner { max-width: 1040px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.contact-title { margin: 0; font-size: 16px; color: var(--muted); letter-spacing: 0.02em; }
.contact-actions { display: inline-flex; gap: 18px; align-items: center; }
.icon-btn { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: none; background: transparent; transition: transform 150ms ease, opacity 120ms ease; }
.icon-btn:hover { transform: translateY(-3px) scale(1.08); opacity: 1; }
.icon-btn img { width: 28px; height: 28px; opacity: 0.95; object-fit: contain; }

/* Ensure content isn't hidden behind bottom bar */
.page-content { padding-bottom: 0; }

@media (max-width: 640px) {
  .contact { height: auto; padding-bottom: 84px; }
  .icon-btn { width: 52px; height: 52px; }
  .icon-btn img { width: 32px; height: 32px; }
}

/* Projects */
.projects-section { padding-top: 180px; margin-top: 40px; }
.projects { max-width: 1400px; margin: 0 auto; padding: 0 8px 64px 8px; }
.projects-header { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 4px 24px 4px; text-align: center; }
.projects-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.projects-sub { margin: 0; color: var(--muted); font-size: 14px; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; justify-items: center; }
@media (min-width: 700px) { .projects-grid { gap: 18px; } }
@media (min-width: 1100px) { .projects-grid { gap: 20px; } }

/* Slider */
.projects-slider { position: relative; padding: 12px 0 28px; overflow: hidden; }
.projects-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(260px 180px at var(--gx, 50%) var(--gy, 30%), rgba(255,255,255,0.06), transparent 60%); mix-blend-mode: screen; opacity: 0.7; }
.projects-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(380px, 640px); gap: 32px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline mandatory; padding: 8px 12px; cursor: grab; scrollbar-width: thin; scrollbar-color: rgba(180,180,190,0.6) rgba(255,255,255,0.06); scrollbar-gutter: stable both-edges; }
.projects-track:active, .projects-track.dragging { cursor: grabbing; }
/* WebKit scrollbar */
.projects-track::-webkit-scrollbar { height: 12px; }
.projects-track::-webkit-scrollbar-thumb { background: linear-gradient(90deg, rgba(180,180,190,0.35), rgba(220,220,230,0.6)); border-radius: 999px; border: 2px solid rgba(14,14,16,0.85); }
.projects-track::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 999px; }
.project-card { scroll-snap-align: center; }

/* Cards */
.project-card { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 14px; border-radius: 18px; border: 1px solid var(--border); padding: 16px; background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); text-decoration: none; color: inherit; transform: translateY(12px) rotateX(0deg) rotateY(0deg); opacity: 0; transition: transform 200ms ease, opacity 220ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease; box-shadow: 0 12px 34px rgba(0,0,0,0.42); perspective: 1000px; }
.project-card.in-view { transform: translateY(0); opacity: 1; }
.project-card:hover { background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)); border-color: rgba(255,255,255,0.22); box-shadow: 0 18px 54px rgba(0,0,0,0.5); }
.project-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(220px 140px at var(--mx, 50%) -20%, rgba(255,255,255,0.18), transparent 60%); opacity: 0; transition: opacity 150ms ease; pointer-events: none; }
.project-card:hover::after { opacity: 0.6; }
.project-thumb { width: 100%; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; position: relative; background: rgba(255,255,255,0.05); border: 1px solid var(--border); }
.project-thumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 60% at 50% -10%, rgba(255,255,255,0.14), transparent 40%); pointer-events: none; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-body { display: flex; flex-direction: column; gap: 10px; }
.project-title { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.project-desc { margin: 0; color: var(--muted); font-size: 15px; }
.project-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* Modal */
.proj-modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20; }
.proj-modal[hidden] { display: none; }
.proj-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.proj-modal-dialog { position: relative; width: min(92vw, 780px); max-height: 86vh; border-radius: 14px; border: 1px solid var(--border); background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)); box-shadow: 0 28px 80px rgba(0,0,0,0.5); padding: 16px; overflow: auto; }
.proj-modal-close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.06); color: var(--text); cursor: pointer; }
.proj-modal-content { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 800px) { .proj-modal-content { grid-template-columns: 2fr 3fr; align-items: start; } }
.proj-modal-thumb { width: 100%; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: rgba(255,255,255,0.06); }
.proj-modal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 640px) {
  .projects-track { grid-auto-columns: minmax(300px, 480px); gap: 22px; }
  .project-card { max-width: 480px; }
}

/* Card enter + hover */
.card { animation: cardIn 600ms ease-out both; animation-delay: 140ms; transition: transform 200ms ease, background 160ms ease, box-shadow 160ms ease; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.card:hover { transform: translateY(-2px); background: rgba(255,255,255,0.03); box-shadow: 0 12px 26px rgba(0,0,0,0.38); }

/* Slight glow on icons */
.icon-slot img { filter: drop-shadow(0 2px 6px rgba(255,255,255,0.22)); transition: transform 160ms ease, filter 160ms ease; }
.icon-slot img:hover { transform: translateY(-2px) scale(1.08); filter: drop-shadow(0 4px 10px rgba(255,255,255,0.28)); }

/* Projects timeline */
.projects-timeline { padding-top: 48px; }
.projects-timeline .panel { padding: 24px 12px 8px 56px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.projects-timeline .card { max-width: none; margin: 0; padding: 12px 12px 16px 12px; }
.project-card-item { cursor: pointer; transition: transform 200ms ease, background 160ms ease, box-shadow 160ms ease; }
.project-card-item:hover { transform: translateY(-3px); background: rgba(255,255,255,0.04); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.project-card-item .title { font-size: 18px; }
.project-card-item .sub { font-size: 14px; }
/* Project cover image under text */
.project-cover { width: 100%; margin-top: 10px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: rgba(255,255,255,0.05); aspect-ratio: 4/3; position: relative; }
.project-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.02); transition: transform 220ms ease; }
.project-card-item:hover .project-cover img { transform: scale(1.06); }
.project-links-row { display: flex; justify-content: flex-end; margin-top: 10px; }
.project-links { display: inline-flex; gap: 10px; }
.project-link { min-width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid var(--border); background: rgba(255,255,255,0.06); transition: transform 150ms ease, background 150ms ease; text-decoration: none; padding: 0 6px; }
.project-link:hover { transform: translateY(-2px) scale(1.05); background: rgba(255,255,255,0.12); }
.project-link img { width: 18px; height: 18px; display: block; }
.project-link svg { width: 16px; height: 16px; color: var(--text); }
.project-link-external { width: 28px; padding: 0; }
.project-modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.modal-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: rgba(255,255,255,0.08); color: var(--text); text-decoration: none; transition: transform 150ms ease, background 150ms ease; font-size: 14px; }
.modal-link:hover { background: rgba(255,255,255,0.16); transform: translateY(-2px); }
.modal-link img { width: 18px; height: 18px; display: block; }
.modal-link svg { width: 16px; height: 16px; color: var(--text); }
.modal-link span { color: var(--text); }

/* Project modal */
.project-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.project-modal[hidden] { display: none; }
.project-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px); }
.project-modal-dialog { position: relative; max-width: 960px; width: 94%; max-height: 88vh; overflow: auto; background: linear-gradient(180deg, rgba(20, 22, 27, 0.98), rgba(18, 19, 23, 0.98)); border: 1px solid var(--border); border-radius: 16px; padding: 32px 40px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); animation: modalIn 300ms cubic-bezier(.2,.8,.2,1) both; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.project-modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border: none; background: rgba(255, 255, 255, 0.1); color: var(--text); font-size: 24px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 150ms ease, transform 150ms ease; }
.project-modal-close:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.1); }
.project-modal-title { margin: 0 0 8px 0; font-size: 30px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); display: inline-flex; align-items: center; gap: 10px; }
.project-modal-title .gh-inline { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid var(--border); background: rgba(255,255,255,0.08); }
.project-modal-title .gh-inline img { width: 16px; height: 16px; display: block; }
.gh-inline { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid var(--border); background: rgba(255,255,255,0.08); vertical-align: -4px; }
.gh-inline img { width: 18px; height: 18px; display: block; }
.project-modal-body { color: var(--muted); font-size: 16px; line-height: 1.7; }
.project-modal-body p { margin: 0 0 16px 0; }
.project-modal-body ul { margin: 12px 0; padding-left: 24px; }
.project-modal-body li { margin-bottom: 8px; }
.project-modal-body b, .project-modal-body strong { color: var(--text); font-weight: 600; }
/* Wrapped images inside modal */
.wrap-img-left, .wrap-img-right { max-width: 36%; }
.wrap-img-left img, .wrap-img-right img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.05); }
.wrap-img-left { float: left; margin: 6px 18px 12px 0; }
.wrap-img-right { float: right; margin: 6px 0 12px 18px; }
.project-modal-body::after { content: ""; display: table; clear: both; }

@media (max-width: 800px) {
  .wrap-img-left, .wrap-img-right { max-width: 100%; float: none; margin: 10px 0; }
}
@media (max-width: 640px) {
  .projects-timeline .panel { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding-left: 32px; }
}

/* Gallery layout for project modal */
.proj-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 16px 0; }
.proj-gallery img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.05); display: block; }
@media (max-width: 800px) { .proj-gallery { grid-template-columns: 1fr; } }

/* Commissions gallery */
.commissions-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 16px 0; }
.commission-item { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: rgba(255,255,255,0.05); cursor: pointer; transition: transform 200ms ease, box-shadow 200ms ease; }
.commission-item:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.commission-item img { width: 100%; height: auto; display: block; aspect-ratio: 16/9; object-fit: cover; }
.commission-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.85), transparent); padding: 12px; }
.commission-title { color: var(--text); font-weight: 600; font-size: 14px; }
.commission-detail-dialog { max-width: 700px; width: 90%; }
.commission-video { position: relative; width: 100%; padding-bottom: 56.25%; margin: 16px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: rgba(0,0,0,0.3); }
.commission-video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
@media (max-width: 640px) {
  .commissions-gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .commission-detail-dialog { width: 95%; }
}


@media (max-width: 640px) {
  .project-modal-dialog { padding: 24px; max-height: 90vh; }
  .project-modal-title { font-size: 24px; }
  .project-modal-body { font-size: 15px; }
}


/* Static bar above contact */
.contact-tabs { display: none; }

/* About section */
.about-section { padding: 160px 24px 80px 24px; display: flex; justify-content: center; align-items: center; margin-bottom: 160px; }
.about-content { max-width: 720px; width: 100%; text-align: center; }
.about-title { margin: 0 0 20px 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
.about-text { margin: 0; font-size: 16px; line-height: 1.7; color: var(--muted); }
.about-text b { color: var(--text); font-weight: 600; }

@media (max-width: 640px) {
  .about-section { padding: 40px 20px; }
  .about-title { font-size: 20px; }
  .about-text { font-size: 15px; line-height: 1.65; }
}

/* Contact at bottom */
.contact { padding: 24px 0 24px 0; }
