*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

:root {
  --fg: #1a1a1a;
  --muted: #888;
  --faint: #bbb;
  --border: #e4e4e4;
  --bg: #fff;
  --nav-width: 130px;
  --content-max: 680px;
}

[data-theme="dark"] {
  --fg: #dedede;
  --muted: #888;
  --faint: #555;
  --border: #2a2a2a;
  --bg: #111;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
}

a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--muted); }

/* ─────────────────────────────────────
   LANDING PAGE
───────────────────────────────────── */

body.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.landing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}

.landing-logo {
  width: auto;
  height: 72px;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.landing-content h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.landing-content .tagline {
  font-size: 0.875rem;
  color: var(--muted);
}

.landing-nav {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
}

.landing-nav a {
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.15s;
}

.landing-nav a:hover { color: var(--fg); }

.landing-social {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.25rem;
}

.landing-social a {
  font-size: 0.8rem;
  color: var(--faint);
  transition: color 0.15s;
}

.landing-social a:hover { color: var(--muted); }


/* ─────────────────────────────────────
   INNER PAGES — SIDENAV
───────────────────────────────────── */

#sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--bg);
}

#sidenav a {
  font-size: 0.75rem;
  color: var(--faint);
  letter-spacing: 0.02em;
}

#sidenav a:hover { color: var(--muted); }
#sidenav a.active { color: var(--fg); }

#theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--faint);
  padding: 0;
  z-index: 200;
  transition: color 0.15s;
  line-height: 1;
}

#theme-toggle:hover { color: var(--muted); }

/* ─────────────────────────────────────
   INNER PAGES — MAIN
───────────────────────────────────── */

.page {
  margin-left: var(--nav-width);
  max-width: calc(var(--nav-width) + var(--content-max));
  padding: 4rem 3rem 5rem 2.5rem;
}

.page-header {
  margin-bottom: 3.5rem;
}

.page-header h1 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

.page-header .sub {
  font-size: 0.875rem;
  color: var(--muted);
}

.page-header .sub a {
  color: var(--muted);
}

.page-header .sub a:hover { color: var(--fg); }

section {
  padding: 2.25rem 0;
  border-top: 1px dotted var(--border);
}

section:last-of-type {
  border-bottom: 1px dotted var(--border);
}

h2 {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1.1rem;
}

p { font-size: 0.95rem; margin-bottom: 0.4rem; }

/* ─────────────────────────────────────
   PORTFOLIO
───────────────────────────────────── */

.project {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px dotted var(--border);
}

.project:last-child { border-bottom: none; }

.project-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.project-body { flex: 1; }

.project-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.project-title a {
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: border-color 0.15s, color 0.15s;
}

.project-title a:hover {
  color: var(--muted);
  border-color: var(--muted);
}

.project-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.project-stack {
  font-size: 0.78rem;
  color: var(--muted);
}

.project-details {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.portfolio-intro {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0;
}

/* ─────────────────────────────────────
   RESUME
───────────────────────────────────── */

.role { margin-bottom: 2rem; }
.role:last-child { margin-bottom: 0; }

.role-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.1rem;
}

.role-title strong { font-size: 0.95rem; }

.tenure {
  font-size: 0.8rem;
  color: var(--muted);
}

.role-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.role-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

ul {
  padding-left: 1.1rem;
}

ul li {
  font-size: 0.9rem;
  color: var(--fg);
  margin-bottom: 0.2rem;
}

.skill-list {
  display: flex;
  flex-direction: column;
}

.skill-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dotted var(--border);
  font-size: 0.9rem;
}

.skill-row:last-child { border-bottom: none; }

.skill-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.resume-download {
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.resume-download:hover {
  color: var(--fg);
  border-color: var(--muted);
}

/* ─────────────────────────────────────
   CONTACT
───────────────────────────────────── */

.contact-label {
  font-size: 0.78rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.email-copy {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  user-select: none;
}

.email-copy span {
  font-size: 0.95rem;
  color: var(--fg);
}

.email-copy .copy-label {
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  border: 1px dotted var(--border);
  padding: 0.15rem 0.5rem;
  color: var(--faint);
}

.copy-confirm {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--faint);
  min-height: 1.2em;
}

/* ─────────────────────────────────────
   FOOTER
───────────────────────────────────── */

footer {
  margin-top: 3rem;
  font-size: 0.78rem;
  color: var(--faint);
}

/* ─────────────────────────────────────
   PRINT
───────────────────────────────────── */

@media print {
  #sidenav { display: none; }
  .page { margin-left: 0; padding: 1.5rem 2rem; max-width: 100%; }
  .page-header { margin-bottom: 1.5rem; }
  section { padding: 1rem 0; }
  h2 { margin-bottom: 0.5rem; }
  .role { margin-bottom: 1rem; }
  ul li { margin-bottom: 0.1rem; }
  .skill-row { padding: 0.25rem 0; }
  footer { margin-top: 1.5rem; }
}

/* ─────────────────────────────────────
   MOBILE
───────────────────────────────────── */

@media (max-width: 620px) {
  #sidenav { display: none; }
  .page { margin-left: 0; padding: 2.5rem 1.5rem 4rem; }
  .role-title { flex-direction: column; }
  .skill-row { grid-template-columns: 1fr; gap: 0.1rem; }
  .skill-label { margin-top: 0.5rem; }
  .project { flex-direction: column; }
}
