/* ============================================================
   Paul Choi — Portfolio
   Modern / minimal theme. Single accent color, generous
   whitespace, system+Inter type, subtle motion.
   ============================================================ */

:root {
  --bg: #10151c;
  --bg-alt: #151b23;
  --surface: #1a212b;
  --text: #e8ecf1;
  --text-muted: #a3adba;
  --text-faint: #6b7684;
  --border: #2a3340;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-text: #a5b4fc;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --header-bg: rgba(16, 21, 28, 0.75);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 1px 1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.45);
  --maxw: 1100px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0 0 1em; color: var(--text-muted); }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
code { font-family: var(--mono); font-size: 0.85em; }
section { scroll-margin-top: 84px; }

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

/* ---------- Scroll progress bar ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav-desktop { display: flex; gap: 32px; }
.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 8px 24px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-mobile.open { display: flex; }
.nav-mobile .nav-link { padding: 12px 0; border-bottom: 1px solid var(--border); }
.nav-mobile .nav-link:last-child { border-bottom: none; }
.nav-link-resume { color: var(--accent-text); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--text-faint); transform: translateY(-1px); }
.btn-ghost {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.btn-ghost:hover { border-color: var(--text-faint); background: var(--surface); }

.text-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-text);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.text-link:hover { border-color: currentColor; }

/* ---------- Hero ---------- */
.hero {
  padding: 130px 0 90px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -140px; right: -160px;
  width: 520px; height: 520px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}
.hero-inner { max-width: 780px; }
.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 10px;
}
.hero-tagline {
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  font-weight: 600;
  margin-bottom: 20px;
}
.highlight {
  position: relative;
  color: var(--accent-text);
}
.hero-sub {
  font-size: 1.08rem;
  max-width: 620px;
  margin-bottom: 32px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* ---------- Section shared ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  margin-bottom: 16px;
}
.section-lede {
  max-width: 620px;
  font-size: 1.02rem;
}
.projects-lede { max-width: 900px; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  align-items: start;
}
.photo-placeholder {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: var(--radius);
  border: 1.5px dashed var(--border);
  background: var(--bg-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-faint);
  text-align: center;
  padding: 24px;
}
.photo-placeholder svg { width: 40px; height: 40px; }
.photo-placeholder span { font-size: 0.8rem; line-height: 1.5; }
.photo-placeholder code {
  display: inline-block;
  margin-top: 4px;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.fill-img { display: none; }
.photo-placeholder.has-image {
  border-style: solid;
  padding: 0;
  overflow: hidden;
}
.photo-placeholder.has-image .fill-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-placeholder.has-image svg,
.photo-placeholder.has-image > span { display: none; }
.about-copy p { max-width: 640px; }
.about-note { font-style: italic; color: var(--text-faint); font-size: 0.92rem; }
.about-links { display: flex; gap: 24px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-top: 48px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.project-card-trigger {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: none;
  margin: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.project-card-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.project-image {
  aspect-ratio: 16 / 10;
  width: 100%;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.project-image .fill-img { transition: transform 0.4s ease; }
.project-card:hover .project-image .fill-img { transform: scale(1.05); }
.project-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 20px;
  background-image: repeating-linear-gradient(
    45deg, var(--border), var(--border) 1px, transparent 1px, transparent 14px
  );
}
.project-image.placeholder code {
  display: inline-block;
  margin-top: 4px;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.project-image.has-image {
  background-image: none;
  padding: 0;
}
.project-image.has-image .fill-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-image.has-image span { display: none; }
.project-summary { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.project-date { font-size: 0.8rem; color: var(--text-faint); font-weight: 600; }
.project-tag-featured {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
}
.project-summary h3 { font-size: 1.15rem; margin-bottom: 8px; }
.project-teaser {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-expand-hint {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease;
}
.project-card:hover .project-expand-hint { gap: 9px; }
.project-detail > p { font-size: 0.95rem; }
.project-points { margin-bottom: 16px; }
.project-points li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.project-points li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.project-links { display: flex; gap: 18px; margin-top: auto; padding-top: 16px; flex-wrap: wrap; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.tag {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
}

/* ---------- Project detail gallery (inside modal) ---------- */
.detail-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.detail-gallery .project-image {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  border-bottom: none;
}
.detail-gallery .project-image.has-image {
  cursor: zoom-in;
}
.detail-gallery .project-image.has-image:hover .fill-img {
  transform: scale(1.06);
}

/* ---------- Project detail demo videos (inside modal) ---------- */
.detail-videos { margin-bottom: 22px; }
.project-video {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  overflow: hidden;
}
.project-video.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 20px;
  border: 1.5px dashed var(--border);
  background-image: repeating-linear-gradient(
    45deg, var(--border), var(--border) 1px, transparent 1px, transparent 14px
  );
}
.project-video.placeholder code {
  display: inline-block;
  margin-top: 4px;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.fill-video { display: none; }
.project-video.has-video {
  background-image: none;
  border: none;
  padding: 0;
}
.project-video.has-video .fill-video {
  display: block;
  width: 100%;
  height: 100%;
}
.project-video.has-video span { display: none; }

/* ---------- Lightbox (fullscreen photo viewer) ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 7, 0.92);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-overlay[hidden] { display: none; }
.lightbox-image {
  max-width: 88vw;
  max-height: 84vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.lightbox-close,
.lightbox-nav {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.18); }
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1rem;
}
.lightbox-close:hover { transform: rotate(90deg); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
}
.lightbox-nav[hidden] { display: none; }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-info {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.lightbox-caption {
  color: #fff;
  font-size: 0.95rem;
  background: rgba(3, 4, 7, 0.6);
  padding: 6px 16px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.lightbox-caption:empty { display: none; }
.lightbox-counter {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- Project detail modal ---------- */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 11, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 20px;
  overflow-y: auto;
  z-index: 300;
}
.modal-overlay[hidden] { display: none; }
.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  padding: 36px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.modal-close:hover { border-color: var(--text-faint); transform: rotate(90deg); }
.modal-body h2 {
  font-size: 1.4rem;
  margin: 6px 40px 14px 0;
}
.modal-body .project-meta { margin-bottom: 8px; }
.modal-body .project-links { margin-top: 4px; }

/* ---------- CAD viewer modal ---------- */
.cad-modal-dialog { max-width: 880px; }
.cad-modal-intro p { color: var(--text-faint); margin-bottom: 20px; }
.cad-modal-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.cad-viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}
.cad-viewer-frame { width: 100%; height: 100%; border: none; display: block; }
.cad-viewer-download {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.cad-viewer-download:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ---------- Timeline (Experience) ---------- */
.timeline {
  margin-top: 48px;
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 44px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -34px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 2px;
}
.timeline-head h3 { font-size: 1.1rem; }
.timeline-date { font-size: 0.82rem; color: var(--text-faint); font-weight: 600; }
.timeline-org { font-size: 0.9rem; color: var(--accent-text); font-weight: 600; margin-bottom: 10px; }
.timeline-content ul { max-width: 680px; }
.timeline-content li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  font-size: 0.94rem;
  color: var(--text-muted);
}
.timeline-content li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px 48px;
  margin-top: 48px;
}
.skill-group h3 {
  font-size: 0.95rem;
  margin-bottom: 14px;
  color: var(--text);
}

/* ---------- Education ---------- */
.edu-card {
  margin-top: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  max-width: 680px;
}
.edu-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}
.edu-head h3 { font-size: 1.15rem; }

/* ---------- Contact ---------- */
.section-contact { text-align: center; }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.section-contact .section-lede { margin: 0 auto 36px; }
.contact-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-bottom: 28px; }
.section-contact .about-links { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .photo-placeholder { max-width: 220px; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: flex; }
  .header-actions .btn-ghost { display: none; }
  .hero { padding: 110px 0 64px; }
  .section { padding: 72px 0; }
  .detail-gallery { grid-template-columns: repeat(2, 1fr); }
  .modal-overlay { padding: 56px 12px; }
  .modal-dialog { padding: 26px 20px 30px; }
  .lightbox-nav { width: 40px; height: 40px; font-size: 1.25rem; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-image { max-width: 94vw; max-height: 76vh; }
}
