/* =========================================================
   Desmond Le — Portfolio
   Theme: Catppuccin Frappé · man-page metaphor · monospace
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500&display=swap');

:root {
  /* Catppuccin Mocha */
  --base:#1e1e2e; --mantle:#181825; --crust:#11111b;
  --surface0:#313244; --surface1:#45475a; --surface2:#585b70;
  --overlay0:#6c7086; --overlay1:#7f849c; --overlay2:#9399b2;
  --text:#cdd6f4; --subtext1:#bac2de; --subtext0:#a6adc8;
  --mauve:#cba6f7; --peach:#fab387; --green:#a6e3a1; --teal:#94e2d5;
  --blue:#89b4fa; --yellow:#f9e2af; --red:#f38ba8; --pink:#f5c2e7; --sky:#89dceb;

  --accent:var(--mauve);
  --accent2:var(--peach);
  --line:var(--surface0);

  --maxw:1040px;
  --pad:clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--mauve); color: var(--crust); }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--mauve); }

/* ---------- man-page top bar ---------- */
.manbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  padding: 13px var(--pad);
  font-size: 11.5px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--subtext0);
  background: var(--mantle);
  border-bottom: 1px solid var(--line);
}
.manbar b { color: var(--text); font-weight: 700; }
.manbar .mb-c { color: var(--overlay1); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 4px;
  padding: 10px var(--pad);
  background: color-mix(in srgb, var(--mantle) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--subtext0); font-size: 13.5px;
  padding: 6px 12px; border-radius: 6px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav a::before { content: "~/"; color: var(--overlay0); }
.nav a:hover { background: var(--surface0); color: var(--text); }
.nav a.active { color: var(--crust); background: var(--mauve); }
.nav a.active::before { color: var(--crust); opacity: .6; }
.nav .nav-spacer { flex: 1; }
.nav .nav-meta { color: var(--overlay0); font-size: 12px; }
.nav .nav-meta .dot { color: var(--green); }

/* ---------- page container ---------- */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 72px) var(--pad) 28px;
}
.page--wide { max-width: 1180px; }

/* ---------- sections ---------- */
.sec { margin-bottom: clamp(40px, 6vw, 64px); }
.sec:last-child { margin-bottom: 0; }
.sec-label {
  font-size: 12px; letter-spacing: 0.2em; font-weight: 700;
  color: var(--accent); margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.sec-label::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--surface1), transparent);
}

/* ---------- hero ---------- */
.name { font-size: clamp(44px, 8vw, 72px); font-weight: 800; letter-spacing: -0.025em; line-height: 0.98; margin: 0; }
.tag { font-size: clamp(15px, 2.2vw, 18px); color: var(--subtext1); margin-top: 20px; max-width: 660px; line-height: 1.65; text-wrap: pretty; }
.cursor { display: inline-block; width: 10px; height: 1em; background: var(--accent); vertical-align: -0.12em; margin-left: 5px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.trilingual { margin-top: 14px; font-size: 13px; color: var(--subtext0); letter-spacing: 0.04em; }
.roles { font-size: clamp(12px, 1.5vw, 15px); color: var(--subtext1); }
.roles .r { white-space: nowrap; }
.roles .d { color: var(--peach); margin: 0 8px; }
@media (min-width: 760px) { .roles { white-space: nowrap; } }
.trilingual b { color: var(--teal); font-weight: 600; }
.trilingual .sep { color: var(--overlay0); margin: 0 8px; }

/* ---------- synopsis / command chips ---------- */
.synopsis { display: flex; flex-wrap: wrap; gap: 10px; }
.cmd {
  font-size: 13.5px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--mantle); color: var(--text);
  display: inline-flex; gap: 9px; align-items: center;
  transition: border-color .15s, transform .15s, background .15s;
}
.cmd span.p { color: var(--accent2); }
.cmd:hover { border-color: var(--mauve); color: var(--text); transform: translateY(-2px); background: var(--surface0); }
.cmd .arr { color: var(--overlay1); transition: transform .15s; }
.cmd:hover .arr { transform: translateX(3px); color: var(--mauve); }

/* ---------- card grid ---------- */
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--mantle); padding: 22px 24px;
  display: flex; flex-direction: column; gap: 8px;
  transition: background .15s;
  color: inherit;
}
a.card:hover { background: var(--surface0); }
.card .no { font-size: 11px; letter-spacing: 0.12em; color: var(--accent); }
.card h4 { margin: 0; font-size: 15.5px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.card h4 .arr { color: var(--overlay1); }
a.card:hover h4 .arr { color: var(--mauve); }
.card p { margin: 0; font-size: 13px; color: var(--subtext0); line-height: 1.55; }

/* ---------- tags / stack ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.t {
  font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface0); color: var(--subtext1);
  border: 1px solid var(--surface1);
}
.t--accent { background: color-mix(in srgb, var(--mauve) 18%, var(--mantle)); color: var(--mauve); border-color: color-mix(in srgb, var(--mauve) 35%, transparent); }

/* ---------- project option blocks ---------- */
.opt { padding: 26px 0; border-top: 1px dashed var(--surface1); }
.opt:first-of-type { border-top: none; }
.opt-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.opt-flag { font-size: 21px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.opt-flag .dd { color: var(--accent2); }
.opt-year { font-size: 12px; color: var(--overlay0); margin-left: auto; }
.opt-role { font-size: 12.5px; color: var(--accent); margin-top: 2px; }
.opt-desc { font-size: 14px; color: var(--subtext1); margin: 12px 0 0; max-width: 720px; line-height: 1.65; }
.opt-links { display: flex; gap: 18px; margin-top: 14px; font-size: 13px; }
.opt-links a { display: inline-flex; gap: 6px; align-items: center; }
.opt-links a::before { content: "→"; color: var(--overlay1); }

/* ---------- resume rows ---------- */
.res-row { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--surface0); }
.res-row:first-of-type { border-top: none; }
.res-when { font-size: 12.5px; color: var(--overlay1); padding-top: 3px; }
.res-what h4 { margin: 0; font-size: 16px; font-weight: 700; }
.res-what .org { color: var(--accent); font-size: 13.5px; margin-top: 2px; }
.res-what ul { margin: 12px 0 0; padding-left: 18px; color: var(--subtext0); font-size: 13.5px; line-height: 1.65; }
.res-what ul li { margin-bottom: 5px; }
.res-what ul li::marker { content: "› "; color: var(--accent2); }

/* ---------- languages ---------- */
.langrow { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lang { background: var(--mantle); padding: 16px 24px; flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 4px; }
.lang-name { font-size: 16px; font-weight: 700; color: var(--text); }
.lang-meta { font-size: 12px; color: var(--teal); }

/* ---------- skills columns ---------- */
.skillcols { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; }
.skillcols h5 { margin: 0 0 12px; font-size: 13px; color: var(--accent2); letter-spacing: 0.06em; }
.skillcols ul { list-style: none; margin: 0; padding: 0; font-size: 13.5px; color: var(--subtext1); line-height: 1.9; }
.skillcols ul li::before { content: "■ "; color: var(--surface2); font-size: 9px; }

/* ---------- about / prose ---------- */
.prose { max-width: 680px; }
.prose p { color: var(--subtext1); font-size: 15px; line-height: 1.75; margin: 0 0 16px; text-wrap: pretty; }
.prose p strong { color: var(--text); font-weight: 600; }

/* ---------- inline code ---------- */
code {
  font-family: inherit; font-size: 0.92em;
  background: var(--surface0); color: var(--sky);
  padding: 1px 6px; border-radius: 5px;
}

/* ---------- club feature ---------- */
.club { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; }
.club-logo-wrap {
  width: 260px; height: 260px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--surface1);
  box-shadow: 0 0 0 1px var(--crust), 0 24px 60px -20px color-mix(in srgb, var(--blue) 60%, transparent);
  position: relative;
}
.club-logo-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.club-meta { margin-top: 16px; font-size: 12.5px; color: var(--subtext0); line-height: 1.5; }
.impact { list-style: none; margin: 18px 0 0; padding: 0; }
.impact li { font-size: 13.5px; color: var(--subtext1); line-height: 1.5; padding: 5px 0 5px 22px; position: relative; }
.impact li::before { content: "▹"; position: absolute; left: 0; color: var(--green); }

/* ---------- sunset event ---------- */
.sunset {
  border: 1px solid var(--surface1); border-radius: 14px;
  padding: 28px 30px;
  background:
    radial-gradient(120% 140% at 100% 0, color-mix(in srgb, var(--peach) 16%, transparent), transparent 55%),
    radial-gradient(120% 140% at 0 100%, color-mix(in srgb, var(--mauve) 14%, transparent), transparent 55%),
    var(--mantle);
}
.sunset-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.sunset-head h3 { margin: 0; font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -0.02em; }
.sunset-live { font-size: 12.5px; color: var(--peach); letter-spacing: 0.04em; }

/* ---------- research paper ---------- */
.paper {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--surface1); border-radius: 14px;
  padding: 26px 30px;
  background:
    radial-gradient(120% 160% at 100% 0, color-mix(in srgb, var(--blue) 13%, transparent), transparent 55%),
    var(--mantle);
  transition: border-color .15s, transform .15s;
}
.paper:hover { border-color: var(--blue); transform: translateY(-2px); }
.paper-tag { font-size: 11.5px; letter-spacing: 0.12em; color: var(--sky); text-transform: uppercase; }
.paper-title { margin: 12px 0 0; font-size: clamp(20px, 3vw, 27px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; color: var(--text); }
.paper-abs { margin: 14px 0 0; font-size: 14px; color: var(--subtext1); line-height: 1.65; max-width: 760px; }
.paper-cta { display: inline-block; margin-top: 16px; font-size: 13.5px; color: var(--blue); }
.paper:hover .paper-cta { color: var(--mauve); }

.club-logo {
  width: 220px; height: 220px; border-radius: 14px;
  border: 1px solid var(--line); overflow: hidden;
}
.club-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 20px; }
.club-stat { background: var(--mantle); padding: 18px 20px; }
.club-stat .big { font-size: 30px; font-weight: 800; color: var(--accent2); letter-spacing: -0.02em; }
.club-stat .lbl { font-size: 12px; color: var(--subtext0); margin-top: 3px; }
.todo-note {
  margin-top: 16px; padding: 12px 16px; border-radius: 8px;
  border: 1px dashed var(--peach); background: color-mix(in srgb, var(--peach) 10%, var(--mantle));
  color: var(--peach); font-size: 12.5px; line-height: 1.55;
}

/* ---------- contact ---------- */
.contact-list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-width: 620px; }
.contact-row {
  background: var(--mantle); padding: 18px 22px;
  display: flex; align-items: center; gap: 16px;
  transition: background .15s; color: inherit;
}
.contact-row:hover { background: var(--surface0); }
.contact-row .ckey { color: var(--accent); font-size: 13px; min-width: 110px; }
.contact-row .cval { color: var(--text); font-size: 14.5px; }
.contact-row .arr { margin-left: auto; color: var(--overlay1); }
.contact-row:hover .arr { color: var(--mauve); }

/* ---------- footer ---------- */
.foot {
  max-width: var(--maxw); margin: 0 auto;
  padding: 22px var(--pad) 40px;
  border-top: 1px solid var(--surface0);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 11.5px; color: var(--overlay0); letter-spacing: 0.06em;
}
.foot a { color: var(--subtext0); }
.foot a:hover { color: var(--mauve); }

/* ---------- image placeholder helper ---------- */
image-slot { display: block; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .manbar .mb-c { display: none; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .skillcols { grid-template-columns: 1fr; gap: 22px; }
  .res-row { grid-template-columns: 1fr; gap: 8px; }
  .club { grid-template-columns: 1fr; gap: 24px; }
  .club-logo, .club-logo-wrap { width: 180px; height: 180px; }
  .club-stats { grid-template-columns: 1fr 1fr; }
  .opt-year { margin-left: 0; width: 100%; }
}
