/* =========================================================
   Jerry Ku — Engineering Portfolio
   Layout: fixed left sidebar + one scrolling column of projects
   (light + dark themes; Illini Orange as the single accent)
   ========================================================= */

:root {
  --bg: #ffffff;
  --side: #fafafa;
  --ink: #141414;
  --ink-2: #4a4a4a;
  --ink-3: #8c8c8c;
  --line: #ececec;
  --chip: #f2f2f2;
  --accent: #FF5F05;       /* Illini Orange */
  --blue: #13294B;         /* Illini Blue   */
  --radius: 12px;
  --side-w: 270px;
  --serif: "Manrope", system-ui, sans-serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
}
html.dark {
  --bg: #111214;
  --side: #17181b;
  --ink: #f2f2f2;
  --ink-2: #c4c4c4;
  --ink-3: #7d7d7d;
  --line: #26272b;
  --chip: #222327;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 19px; line-height: 1.65; -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.caps { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- SIDEBAR ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
  background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 28px 22px 26px;
  transition: transform .3s ease, background .3s;
}
.side .name { font-family: var(--serif); font-weight: 600; font-size: 20px; text-decoration: none; }
.side .tag { font-size: 11.5px; letter-spacing: .06em; white-space: nowrap; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
.side nav { margin-top: 52px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.side nav a {
  font-size: 16px; color: var(--ink-3); text-decoration: none; padding: 5px 0 5px 12px;
  border-left: 2px solid transparent; transition: color .2s, border-color .2s;
}
.side nav a:hover { color: var(--ink); }
.side nav a.active { color: var(--ink); font-weight: 600; border-left-color: var(--accent); }
.side .foot { margin-top: auto; padding-top: 24px; display: flex; gap: 16px; }
.side .foot a { font-size: 13.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; text-underline-offset: 4px; }
.side .foot a:hover { color: var(--accent); }
body.collapsed .side { transform: translateX(-100%); }

/* ---------- TOP BAR ---------- */
.topbar {
  position: fixed; top: 0; left: var(--side-w); right: 0; height: 52px; z-index: 30;
  display: flex; align-items: center; gap: 6px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); transition: left .3s ease, background .3s;
}
body.collapsed .topbar { left: 0; }
.icon-btn { width: 34px; height: 34px; border: 0; background: transparent; color: var(--ink-2); border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--chip); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.topbar .mobile-name { display: none; font-weight: 600; margin-left: 4px; }

/* ---------- MAIN ---------- */
main { margin-left: var(--side-w); padding-top: 52px; transition: margin-left .3s ease; }
body.collapsed main { margin-left: 0; }
.col { max-width: 980px; margin: 0 auto; padding: 0 48px; }

/* hero */
.hero { min-height: calc(100vh - 52px); min-height: calc(100svh - 52px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(56px, 8vw, 100px); line-height: 1; letter-spacing: -.035em; }
.hero .sub { display: flex; align-items: center; gap: 10px; margin-top: 22px; font-size: 15px; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-2); }
.hero .sub .mini { height: 18px; width: auto; }
.logos { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 46px; }
.logos > * { box-sizing: border-box; width: 108px; height: 52px; padding: 0 14px; display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--line); }
.logos > *:first-child { border-left: 0; }
.logos img { height: 52px; object-fit: contain; }
.logos .wordmark { text-align: center; white-space: normal; line-height: 1.2; }
.logos .wordmark { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.scroll-cue { position: absolute; bottom: 40px; left: 0; right: 0; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.scroll-cue svg { width: 14px; color: var(--ink-3); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%,100% { transform: translateY(0) } 50% { transform: translateY(5px) } }

/* about */
.about { display: grid; grid-template-columns: 150px 1fr; gap: 40px; align-items: center; padding: 72px 0; border-top: 1px solid var(--line); }
.about .shot-h { width: 150px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--chip); }
.about .shot-h img { width: 100%; height: 100%; object-fit: cover; }
.about p { color: var(--ink-2); }
.about .clear { margin-top: 12px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }

/* project section */
.proj { padding: 84px 0; border-top: 1px solid var(--line); transition: opacity .45s ease; }
.proj.dim { opacity: .38; }
.proj-head { display: flex; gap: 18px; align-items: flex-start; }
.org-logo { flex: none; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; background: var(--ink); color: var(--bg); display: grid; place-items: center; margin-top: 6px; }
.org-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.org-logo span { font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.proj h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.15; letter-spacing: -.025em; }
.proj .role { color: var(--ink-3); font-size: 17px; margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin-top: 12px; }
.chips li { font-size: 14px; font-weight: 600; padding: 3px 10px; border-radius: 6px; background: var(--chip); color: var(--ink-2); }
.proj-body { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; margin-top: 34px; align-items: start; }
.proj-body.text-only { grid-template-columns: 1fr; max-width: 640px; }
.proj-body .text p { color: var(--ink-2); margin-bottom: 18px; }
.proj-body .text p strong { color: var(--ink); font-weight: 600; }
.proj-body .text .nda { font-style: italic; color: var(--ink-3); }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 600; text-decoration: none; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink); transition: border-color .2s, color .2s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }

/* media grid (6 columns: s6 = full, s3 = half, s2 = third) */
.media { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px 14px; align-items: start; }
.media figure { grid-column: span 3; margin: 0; }
.media .s6 { grid-column: span 6; }
.media .s2 { grid-column: span 2; }
.media .frame { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--chip); aspect-ratio: 1; cursor: zoom-in; }
.media .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.media .frame:hover img { transform: scale(1.03); }
.media .contain .frame { background: #fff; }
.media .contain .frame img { object-fit: contain; }
.media .top .frame img { object-position: top; }
.media .top-ish .frame img { object-position: 50% 35%; }
.media figcaption { font-size: 14px; color: var(--ink-3); margin-top: 6px; line-height: 1.4; }

/* video thumbnails (click to play inline) */
.media a.video { display: block; text-decoration: none; }
.media a.video .frame { cursor: pointer; }
.play { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: transform .2s; }
.play::after { content: ""; position: absolute; left: 22px; top: 17px; border-style: solid; border-width: 11px 0 11px 17px; border-color: transparent transparent transparent #141414; }
a.video:hover .play { transform: scale(1.08); }
.yt-frame { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: #000; }
.yt-frame iframe, .yt-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* skills */
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 34px; }
.skills h4 { font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.skills ul { list-style: none; }
.skills li { font-size: 17px; padding: 3px 0; color: var(--ink-2); }

/* contact */
.contact-list { list-style: none; margin-top: 28px; }
.contact-list li { border-top: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 1px solid var(--line); }
.contact-list a { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; text-decoration: none; font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: -.015em; }
.contact-list a span:last-child { font-family: var(--sans); font-size: 15.5px; color: var(--ink-3); }
.contact-list a:hover { color: var(--accent); }
.seeking { color: var(--ink-2); margin-top: 14px; }

footer { display: flex; justify-content: space-between; align-items: center; padding: 40px 0 56px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--accent); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,10,10,.9); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 40px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 8px; }
.lightbox p { color: #ddd; font-size: 14px; margin-top: 12px; }

/* ---------- MOBILE ---------- */
@media (max-width: 900px) {
  .side { transform: translateX(-100%); }
  body.menu-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .topbar, body.collapsed .topbar { left: 0; }
  main, body.collapsed main { margin-left: 0; }
  .topbar .mobile-name { display: block; }
  .col { padding: 0 22px; }
  .proj-body { grid-template-columns: 1fr; gap: 26px; }
  .proj.dim { opacity: 1; }
  .skills { grid-template-columns: 1fr 1fr; }
  .about { grid-template-columns: 1fr; gap: 22px; }
  .logos { max-width: 340px; margin-left: auto; margin-right: auto; row-gap: 18px; }
  .logos > * { width: 33.33%; padding: 0 12px; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .proj { transition: none; } .scroll-cue svg { animation: none; } }
