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

:root {
  --bg:          oklch(16% 0.014 264);
  --text:        oklch(93% 0.006 264);
  --muted:       oklch(70% 0.02 264);
  --dim:         oklch(60% 0.02 264);
  --border:      oklch(93% 0.006 264 / 0.12);
  --border-hi:   oklch(93% 0.006 264 / 0.24);
  --accent:      oklch(74% 0.11 258);
  --accent-ink:  oklch(19% 0.03 258);
  --serif:       'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:        'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono:        ui-monospace, 'SF Mono', Menlo, monospace;
  --content:     760px;
  --sider-w:     260px;
  --r:           8px;
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }
::selection { background: oklch(74% 0.11 258 / .3); }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

a:focus-visible, button:focus-visible, summary:focus-visible, dialog:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px;
}

p { color: var(--muted); }

/* ══ MOTION (scroll reveal) ══ */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease-out-quint), transform .7s var(--ease-out-quint);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ══ SIDEBAR ══ */
.sidebar {
  position: fixed; top: 0; left: 0; width: var(--sider-w); height: 100vh;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 32px; border-right: 1px solid var(--border);
  overflow-y: auto;
}
.side-name {
  font-family: var(--serif); font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em; text-decoration: none; display: block;
}
.side-status { font-size: 12.5px; color: var(--dim); line-height: 1.6; margin-top: 10px; }
.side-nav { margin-top: 40px; display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; color: var(--muted); text-decoration: none;
  padding: 6px 0; transition: color .15s;
}
.side-nav a svg { flex-shrink: 0; opacity: .75; transition: opacity .15s; }
.side-nav a:hover { color: var(--text); }
.side-nav a:hover svg { opacity: 1; }
.side-nav a.active { color: var(--accent); font-weight: 500; }
.side-nav a.active svg { opacity: 1; }
.side-social { display: flex; flex-direction: column; gap: 10px; }
.side-social a {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  text-decoration: none; transition: color .15s;
}
.side-social a svg { flex-shrink: 0; opacity: .8; transition: opacity .15s; }
.side-social a:hover { color: var(--text); }
.side-social a:hover svg { opacity: 1; }

/* ══ MOBILE TOP BAR (hidden on desktop) ══ */
.topbar { display: none; }

/* ══ TOP-RIGHT ACTIONS ══ */
.top-actions {
  position: fixed; top: 28px; right: 32px; z-index: 60;
  display: flex; gap: 10px;
}
.top-actions a {
  font-size: 13px; font-weight: 600; text-decoration: none;
  padding: 8px 14px; border-radius: var(--r);
  transition: border-color .15s, color .15s, background-color .15s, opacity .15s;
}
.top-actions .ta-contact { color: var(--muted); border: 1px solid var(--border); }
.top-actions .ta-contact:hover { color: var(--text); border-color: var(--border-hi); }
.top-actions .ta-resume { color: var(--accent-ink); background: var(--accent); border: 1px solid transparent; }
.top-actions .ta-resume:hover { opacity: .9; }

/* ══ MAIN ══ */
.main { margin-left: var(--sider-w); min-height: 100vh; display: flex; flex-direction: column; }

/* ══ HERO ══ */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
#hero .tagline, #hero .role-line, #hero .lede, #hero .highlight-card {
  animation: heroIn .7s var(--ease-out-quint) both;
}
#hero .tagline        { animation-delay: 0s; }
#hero .role-line       { animation-delay: .12s; }
#hero .lede            { animation-delay: .24s; }
#hero .highlight-card  { animation-delay: .36s; }

.highlight-card {
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 18px 20px; margin-top: 32px;
}
.highlight-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.highlight-name { font-family: var(--serif); font-weight: 600; font-size: 15px; }
.highlight-live { font-size: 12px; color: var(--dim); text-decoration: none; transition: color .15s; }
.highlight-live:hover { color: var(--accent); }
.highlight-card .audio { margin: 0; border: none; padding: 0; }
.highlight-card .entry-link { margin-top: 16px; }

.tagline {
  font-family: var(--serif);
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.role-line { font-size: 16px; color: var(--muted); margin-top: 14px; }
.role-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.role-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.lede { font-size: 16px; color: var(--muted); line-height: 1.75; margin-top: 24px; max-width: 62ch; }

/* ══ SECTIONS ══ */
section { padding-top: 96px; border-top: 1px solid var(--border); }
.main > section:first-child { border-top: none; padding-top: 72px; }
.main > section:last-of-type { padding-bottom: 96px; }

.sec-head { margin-bottom: 48px; }
h2 {
  font-family: var(--serif);
  font-size: clamp(23px, 3vw, 28px);
  font-weight: 600; letter-spacing: -0.01em;
}
.sec-sub { font-size: 14.5px; color: var(--dim); margin-top: 8px; }

/* ══ WORK / EXPERIENCE ENTRIES ══ */
.job {
  padding: 24px; border: 1.5px solid var(--border); border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.job:hover { border-color: var(--border-hi); background: oklch(93% 0.006 264 / 0.02); }
.job + .job { margin-top: 16px; }

.entry-title, .job-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
h3 {
  font-family: var(--serif); font-size: 19px; font-weight: 600;
  letter-spacing: -0.005em; color: var(--text);
}
.status { font-weight: 400; font-size: 14px; color: var(--dim); }
.job-when { font-size: 13px; color: var(--dim); white-space: nowrap; }

.entry-kicker, .job-role { font-size: 13px; color: var(--dim); margin-top: 8px; }

.entry-desc, .job-hi { font-size: 15px; color: var(--muted); line-height: 1.75; margin-top: 16px; max-width: 62ch; }
.entry-meta, .job-meta { font-size: 13.5px; color: var(--dim); margin-top: 16px; }
.entry-stack { font-size: 13px; color: var(--dim); margin-top: 8px; }
.entry-note { font-size: 14px; font-style: italic; color: var(--text); line-height: 1.7; margin-top: 16px; max-width: 60ch; }

.entry-shot, .hero-shot {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  margin: 24px 0;
}
.entry-shot img, .hero-shot img { display: block; width: 100%; height: auto; }

.audio {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px;
  margin: 18px 0;
}
.audio-play {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: transparent; border: 1px solid var(--border-hi); color: var(--text);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.audio-play:hover { border-color: var(--accent); color: var(--accent); }
.audio-info { flex: 1; min-width: 0; }
.audio-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.audio-title { font-size: 13px; color: var(--muted); }
.audio-time { font-size: 12px; color: var(--dim); }
.audio-track { height: 3px; background: var(--border); border-radius: 2px; cursor: pointer; overflow: hidden; }
.audio-fill { height: 100%; width: 0%; background: var(--accent); }
.audio-meta { font-size: 12px; color: var(--dim); margin-top: 10px; }

a.entry-link {
  position: relative; display: inline-block; font-size: 13.5px; font-weight: 500;
  color: var(--accent); text-decoration: none; margin-top: 18px;
}
a.entry-link::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1px; background: currentColor;
  transition: width .25s var(--ease-out-quart);
}
a.entry-link:hover::after { width: 100%; }
.live-link { position: relative; color: var(--accent); text-decoration: none; }
.live-link::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1px; background: currentColor;
  transition: width .25s var(--ease-out-quart);
}
.live-link:hover::after { width: 100%; }

.entry-links-row { display: flex; gap: 20px; flex-wrap: wrap; }
.entry-links-row .entry-link { margin-top: 0; }

/* ══ JOB DETAIL PANEL (slide-over, replaces old inline disclosure) ══ */
.job-detail-trigger {
  position: relative; cursor: pointer; font-size: 13.5px; font-weight: 500;
  color: var(--accent); background: none; border: none; padding: 0;
  margin-top: 20px; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.job-detail-trigger::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1px; background: currentColor;
  transition: width .25s var(--ease-out-quart);
}
.job-detail-trigger:hover::after { width: 100%; }

dialog#job-panel {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  height: 100vh; width: min(420px, 90vw);
  max-width: none; max-height: none;
  border: none; border-left: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  padding: 48px 32px; overflow-y: auto;
  transform: translateX(100%);
  transition: transform .35s var(--ease-out-quart);
}
dialog#job-panel[open] { transform: translateX(0); }
dialog#job-panel::backdrop { background: oklch(10% 0.01 264 / 0.5); }

.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-title { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: -0.005em; }
.panel-when { font-size: 13px; color: var(--dim); margin-top: 4px; }
.panel-close {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: none; border: 1px solid var(--border-hi); color: var(--text);
  cursor: pointer; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s;
}
.panel-close:hover { border-color: var(--accent); color: var(--accent); }

.panel-body { margin-top: 28px; padding-left: 0; list-style: none; }
.panel-body li {
  font-size: 14.5px; color: var(--muted); line-height: 1.7;
  padding: 14px 0; border-top: 1px solid var(--border);
}
.panel-body li:first-child { border-top: none; padding-top: 0; }
.panel-body li b { color: var(--text); font-weight: 600; }

/* ══ PROJECT DETAIL PAGES ══ */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--dim); text-decoration: none;
  margin-bottom: 28px; transition: color .15s;
}
.back-link:hover { color: var(--text); }

.project-head h1 {
  font-family: var(--serif); font-size: clamp(26px, 4vw, 36px); font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.15;
}
.project-tagline { font-size: 16px; color: var(--muted); margin-top: 10px; max-width: 60ch; }
.project-byline { font-size: 12.5px; color: var(--dim); margin-top: 14px; }

.project-body { margin-top: 32px; }
.project-body h3 {
  font-size: 16px; font-weight: 600; margin: 32px 0 10px;
}
.project-body h3:first-child { margin-top: 0; }
.project-body p { font-size: 15px; line-height: 1.75; max-width: 64ch; }
.project-body p + p { margin-top: 12px; }
.project-body ul { margin-top: 12px; padding-left: 0; list-style: none; max-width: 64ch; }
.project-body li {
  font-size: 15px; color: var(--muted); line-height: 1.7;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.project-body li:first-child { border-top: none; padding-top: 0; }
.project-body li b { color: var(--text); font-weight: 600; }

.project-meta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0; }
.project-meta-row .pm {
  font-size: 13px; flex: 1; min-width: 140px;
  border: 1.5px solid var(--border); border-radius: 8px; padding: 14px 16px;
}
.project-meta-row .pm .n { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--text); display: block; }
.project-meta-row .pm .l { color: var(--dim); margin-top: 2px; }

/* ══ FLOW DIAGRAM (icon-card pipeline, no fake screenshots) ══ */
.flow {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 2px; flex-wrap: nowrap; overflow-x: auto;
  border: 1.5px solid var(--border); border-radius: 12px;
  padding: 32px 16px; margin: 24px 0;
}
.flow-step {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 10px; width: 104px; flex-shrink: 0;
}
.flow-icon {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border-hi); color: var(--text);
  background: oklch(93% 0.006 264 / 0.03);
}
.flow-step--accent .flow-icon {
  border-color: var(--accent); color: var(--accent);
  background: oklch(74% 0.11 258 / 0.1);
}
.flow-text { display: flex; flex-direction: column; gap: 3px; }
.flow-label { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.flow-sub { font-size: 11px; color: var(--dim); }
.flow-connector {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 42px; margin-top: 20px; flex-shrink: 0;
  color: var(--dim);
}
.diagram-caption { font-size: 12.5px; color: var(--dim); margin-top: 12px; text-align: center; }

.weight-bars { display: flex; flex-direction: column; gap: 10px; margin: 24px 0; }
.weight-bar-row { display: flex; align-items: center; gap: 14px; }
.weight-bar-label { font-size: 12.5px; color: var(--dim); width: 80px; flex-shrink: 0; text-align: right; }
.weight-bar-track { flex: 1; height: 22px; background: oklch(93% 0.006 264 / 0.05); border-radius: 4px; overflow: hidden; }
.weight-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.weight-bar-val { font-family: var(--mono); font-size: 12px; color: var(--text); width: 32px; flex-shrink: 0; }

/* ══ WORK LIST (short cards, link out to detail pages) ══ */
.work-card {
  display: flex; align-items: center; gap: 28px; text-decoration: none;
  padding: 24px; border: 1.5px solid var(--border); border-radius: 10px;
  transition: border-color .15s, background-color .15s;
}
.work-card + .work-card { margin-top: 16px; }
.work-card:hover { border-color: var(--border-hi); background: oklch(93% 0.006 264 / 0.02); }
.work-card-body { flex: 1; min-width: 0; }
.work-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.work-card-top h3 { transition: color .15s; }
.work-card:hover .work-card-top h3 { color: var(--accent); }
.work-card-desc { font-size: 14.5px; color: var(--muted); line-height: 1.7; margin-top: 10px; max-width: 62ch; }
.work-card-stack { font-size: 13px; color: var(--dim); margin-top: 10px; }
.work-card-visual {
  flex-shrink: 0; width: 112px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: color .15s;
}
.work-card:hover .work-card-visual { color: var(--text); }
.work-card-visual .accent { color: var(--accent); }
@media (max-width: 640px) {
  .work-card { gap: 16px; }
  .work-card-visual { width: 56px; height: 44px; }
  .work-card-visual svg { width: 48px; height: auto; }
}

/* ══ HOME TEASERS ══ */
.teaser-list { display: flex; flex-direction: column; }
.teaser {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; text-decoration: none;
  padding: 18px 20px; border: 1.5px solid var(--border); border-radius: 10px;
  transition: border-color .15s, background-color .15s;
}
.teaser + .teaser { margin-top: 12px; }
.teaser:hover { border-color: var(--border-hi); background: oklch(93% 0.006 264 / 0.02); }
.teaser-name { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--text); transition: color .15s; }
.teaser:hover .teaser-name { color: var(--accent); }
.teaser-tag { font-size: 13.5px; color: var(--dim); margin-top: 3px; }
.teaser-arrow { font-size: 14px; color: var(--dim); flex-shrink: 0; }

/* ══ SKILLS ══ */
#skills .wrap { max-width: 920px; }
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 40px; }
.skill-group h4 { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.skill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-pill {
  font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px;
  transition: border-color .15s, color .15s, background-color .15s;
}
.skill-pill:hover { border-color: var(--border-hi); color: var(--text); background: oklch(93% 0.006 264 / 0.03); }

/* ══ CONTACT ══ */
#contact .lede { margin-top: 16px; }
.contact-note { font-size: 14px; color: var(--muted); margin-top: 32px; }
.contact-methods { display: flex; flex-direction: column; margin-top: 16px; }
.contact-method {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  padding: 16px 18px; border: 1.5px solid var(--border); border-radius: 10px;
  transition: border-color .15s, background-color .15s;
}
.contact-method + .contact-method { margin-top: 12px; }
.contact-method:hover { border-color: var(--border-hi); background: oklch(93% 0.006 264 / 0.02); }
.contact-method-icon {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border-hi); color: var(--text);
  transition: border-color .15s, color .15s;
}
.contact-method:hover .contact-method-icon { border-color: var(--accent); color: var(--accent); }
.contact-method-text { display: flex; flex-direction: column; gap: 2px; }
.contact-method-label { font-size: 14.5px; font-weight: 600; color: var(--text); }
.contact-method-sub { font-size: 13px; color: var(--dim); }

/* ══ FOOTER ══ */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 32px 0 64px;
  font-size: 13px; color: var(--dim);
}

/* ══ RESPONSIVE ══ */
@media (max-width: 880px) {
  .sidebar { display: none; }
  .main { margin-left: 0; min-height: 0; }
  .topbar {
    display: block; position: sticky; top: 0; z-index: 50;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 16px 24px;
  }
  .topbar .wordmark {
    font-family: var(--serif); font-weight: 600; font-size: 16px;
    text-decoration: none; letter-spacing: -0.01em;
  }
  .topbar-inner { position: relative; justify-content: flex-start; gap: 14px; }
  .nav-toggle {
    order: -1;
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 1px solid var(--border-hi); color: var(--text);
    cursor: pointer; transition: border-color .15s, color .15s;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
  .topbar-nav-panel {
    position: absolute; top: calc(100% + 10px); left: 24px;
    display: flex; flex-direction: column; gap: 2px;
    width: min(230px, calc(100vw - 48px));
    background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 10px; box-shadow: 0 12px 32px oklch(10% 0.01 264 / 0.35);
    max-height: 0; opacity: 0; transform: translateY(-6px);
    overflow: hidden; pointer-events: none;
    transition: max-height .3s var(--ease-out-quart), opacity .2s ease, transform .25s var(--ease-out-quart);
  }
  .topbar-nav-panel.is-open {
    max-height: 320px; opacity: 1; transform: none; pointer-events: auto;
  }
  .topbar-nav-panel a {
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; color: var(--muted); text-decoration: none;
    padding: 10px; border-radius: 8px; transition: color .15s, background-color .15s;
  }
  .topbar-nav-panel a svg { flex-shrink: 0; opacity: .75; transition: opacity .15s; }
  .topbar-nav-panel a:hover, .topbar-nav-panel a.active { color: var(--text); background: oklch(93% 0.006 264 / 0.05); }
  .topbar-nav-panel a:hover svg, .topbar-nav-panel a.active svg { opacity: 1; }
  .top-actions { top: 78px; right: 16px; gap: 8px; }
  .top-actions a { font-size: 12px; padding: 6px 10px; }
}

/* Scroll/load animation only on project detail pages; main pages render instantly. */
body:not(:has(.project-body)) [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
#hero .tagline, #hero .role-line, #hero .lede, #hero .highlight-card {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
@media (max-width: 560px) {
  .skills { grid-template-columns: 1fr; }
  section { padding-top: 64px; }
  .main > section:last-of-type { padding-bottom: 64px; }
  .entry, .job { padding: 36px 0; }
  .project-meta-row { gap: 20px; }
  .flow { flex-direction: column; }
  .flow-step { width: 100%; }
  .flow-connector { width: 42px; height: 20px; margin-top: 0; }
  .flow-connector svg { transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
}
