/* ---------- design tokens ---------- */
:root {
  --bg:        #313338;
  --surface:   #2b2d31;
  --text:      #dbdee1;
  --muted:     #949ba4;
  --line:      #3f4147;
  --accent:    #5865f2;
  --nav-bg:    rgba(32, 34, 37, 0.82);
  --radius:    6px;
  --maxw:      980px;
  --sidebar-w: 184px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #313338;
    --surface: #2b2d31;
    --text:    #dbdee1;
    --muted:   #949ba4;
    --line:    #3f4147;
    --accent:  #5865f2;
    --nav-bg:  rgba(32, 34, 37, 0.82);
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  margin-left: var(--sidebar-w);
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 'Onest', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 760px) {
  body { margin-left: 0; padding-top: 56px; }
}
a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: 24px; }

/* ---------- sidebar nav (button list) ---------- */
.nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 14px;
  background: rgba(20, 20, 20, 0.92);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: visible;
}
.nav.is-stuck,
.nav.is-idle {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  background: rgba(20, 20, 20, 0.92);
}

/* "Eliezer Cho" reads as the primary button, the rest as secondary buttons */
.nav__name {
  display: block;
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform .15s ease;
}
.nav__name:hover { transform: translateY(-1px); }

.nav__links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav__links > a,
.nav__trigger,
.nav__contact {
  display: block;
  padding: 8px 12px;
  border-radius: 5px;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform .15s ease, border-color .2s ease, background-color .2s ease;
}
.nav__links > a,
.nav__trigger {
  border: 1px solid transparent;
  background: transparent;
}
.nav__contact {
  border: 1px solid var(--line);
  background: var(--surface);
}
.nav__links > a:hover,
.nav__trigger:hover,
.nav__contact:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--surface);
}
.nav__links > a.is-active,
.nav__trigger.is-active,
.nav__contact.is-active {
  border-color: var(--accent);
  background: rgba(88, 101, 242, 0.14);
}

/* pinned to the very bottom of the sidebar, independent of how much the dropdowns above expand */
.nav__contact { margin-top: auto; flex-shrink: 0; }

/* Portfolio/Skills expand in place, pushing whatever follows them further down */
.nav__dropdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-top: 0;
  transition: max-height .22s ease, opacity .18s ease, padding-top .22s ease;
  transition-delay: 2s; /* lingers before closing so a stray mouse move off the button doesn't instantly hide it */
}
.nav__item:hover .nav__dropdown,
.nav__item:focus-within .nav__dropdown {
  transition-delay: 0s; /* opens immediately */
  max-height: 220px;
  opacity: 1;
  padding-top: 6px;
}
.nav__dropdown a {
  display: block;
  padding: 6px 12px 6px 24px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s ease;
}
.nav__dropdown a:hover { color: var(--text); }

@media (max-width: 760px) {
  .nav {
    inset: 0 0 auto 0;
    width: 100%;
    height: 56px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 16px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    transition: opacity .45s ease, transform .45s ease;
  }
  .nav.is-idle { opacity: 0; transform: translateY(-8px); pointer-events: none; background: rgba(20, 20, 20, 0.92); }
  .nav.is-stuck { background: rgba(15, 15, 15, 0.92); }

  .nav__name,
  .nav__contact { flex-shrink: 0; }
  .nav__name {
    padding: 6px 10px;
    font-size: 13px;
  }
  .nav__contact {
    margin-top: 0;
    padding: 6px 10px;
    font-size: 13px;
  }
  .nav__links {
    flex-direction: row;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
  }
  .nav__links > a,
  .nav__trigger {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 13px;
  }

  .nav__item { position: relative; }
  .nav__dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    max-height: none;
    overflow: visible;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px;
    min-width: 172px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease, pointer-events .18s ease;
    transition-delay: 2s;
  }
  .nav__item:hover .nav__dropdown,
  .nav__item:focus-within .nav__dropdown {
    transition-delay: 0s;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav__dropdown a { width: auto; padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav { transition: none; }
  .nav.is-idle { opacity: 1; transform: none; pointer-events: auto; }
}

/* ---------- buttons ---------- */
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  transition: transform .15s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- sections (used on inner pages) ---------- */
section { padding-block: 72px; scroll-margin-top: 72px; }
section + section { border-top: 1px solid var(--line); }
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
h2 {
  margin: 0 0 28px;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -.02em;
  font-weight: 650;
}
h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- home page (name + about) ---------- */
.home {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
  min-height: 100svh;
  padding-block: 40px;
}
.home h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 5.5vw, 50px);
  line-height: 1.08;
  letter-spacing: -.03em;
  font-weight: 650;
}
.home__tagline {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(15px, 2vw, 17.5px);
  color: var(--muted);
}
.home__about { margin-top: 30px; }
.home__about p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 54ch;
}
.home__about p:last-of-type { margin-bottom: 0; }
.home__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 18px;
}
.home__chips h3 {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 8px;
}
.home__photo {
  aspect-ratio: 3 / 4;
  width: 100%;
  max-height: 62vh;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  padding: 20px;
  justify-self: center;
}
@media (max-width: 760px) {
  .home {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-block: 32px 48px;
  }
  .home__photo { order: -1; max-width: 260px; max-height: none; margin: 0 auto; }
}

/* ---------- cards (portfolio) ---------- */
.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: transform .18s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 6px 12px;
}
.tag-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tag-dot--tools     { background: #5865f2; }
.tag-dot--machines  { background: #23a55a; }
.tag-dot--code      { background: #9c6dff; }
.tag-dot--design    { background: #5865f2; }
.tag-dot--machining { background: #f0b232; }
.tag-dot--controls  { background: #23a55a; }
.tag-dot--software  { background: #eb459e; }
.tag-dot--languages { background: #9c6dff; }

/* ---------- timeline entries (education / club experience) ---------- */
.job {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 4px 28px;
  padding-block: 22px;
  border-top: 1px solid var(--line);
}
.job__when { color: var(--muted); font-size: 14px; padding-top: 2px; }
.job__where { color: var(--muted); font-size: 14.5px; margin: 0 0 8px; }
.job ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.job li { margin-bottom: 4px; }
@media (max-width: 640px) {
  .job { grid-template-columns: 1fr; gap: 6px; }
  .job__when { order: -1; font-size: 13px; }
}
.subhead {
  margin: 40px 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.subhead:first-of-type { margin-top: 0; }

/* ---------- project detail page ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 22px;
}
.back-link:hover { color: var(--text); }
.project__title { margin: 0 0 10px; }
.project__media {
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13.5px;
  margin: 24px 0 40px;
}
.project__body h3 { margin-top: 32px; }
.project__body h3:first-child { margin-top: 0; }
.project__body p, .project__body li { color: var(--muted); font-size: 15px; }
.project__body ul { padding-left: 18px; margin: 0; }

/* ---------- contact + footer ---------- */
.contact p { max-width: 52ch; color: var(--muted); margin-top: 0; }
.contact__links { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.contact__links a {
  font-size: 16px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
  width: fit-content;
}
.contact__links a:hover { text-decoration-color: var(--accent); }
