:root {
  --bg: #ffffff;
  --bg-alt: #f4f6f7;
  --ink: #16211f;
  --ink-dim: #5b6b6c;
  --teal: #1a8f7d;
  --teal-dim: #cfe9e3;
  --line: #e2e7e6;
  --font-head: "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-head); letter-spacing: -0.01em; margin: 0; }
a { color: inherit; text-decoration: none; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 10px;
}

.lede { color: var(--ink-dim); font-size: 17px; max-width: 640px; }
.pipeline-disclaimer { color: var(--ink-dim); font-size: 12.5px; font-style: italic; max-width: 640px; margin: 6px 0 0; }

.btn {
  display: inline-block; padding: 12px 20px; border-radius: 3px;
  font-weight: 600; font-size: 14px; border: 1px solid transparent;
  text-align: center;
}
.btn-primary { background: var(--teal); color: #ffffff; }
.btn-primary:hover { background: #157c6c; }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-block { display: block; width: 100%; }

/* App shell */
.app { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.avatar {
  width: 84px; height: 84px; border-radius: 50%;
  object-fit: cover; object-position: center 15%;
  border: 1px solid var(--line); margin-bottom: 18px; display: block;
}

.about-photo {
  width: 220px; height: 220px; border-radius: 8px;
  object-fit: cover; object-position: center 15%;
  border: 1px solid var(--line); margin: 8px 0 28px; display: block;
}

.inline-link { color: var(--teal); font-weight: 600; }
.inline-link:hover { text-decoration: underline; }

.sidebar-top h1 { font-size: 20px; margin-bottom: 4px; }
.sidebar-top .role { color: var(--ink-dim); font-size: 13px; margin: 0; }

.side-nav { display: flex; flex-direction: column; gap: 2px; margin: 28px 0; }
.side-nav a {
  padding: 9px 12px; border-radius: 4px; color: var(--ink-dim);
  font-size: 14px; font-weight: 500;
}
.side-nav a:hover { color: var(--ink); }
.side-nav a.active { background: var(--teal-dim); color: var(--teal); font-weight: 700; }

.sidebar-links { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 20px; }

.sidebar .footer-version {
  display: block; opacity: 0.45; font-size: 10px; font-family: var(--font-mono);
  margin-top: 20px;
}

.content { flex: 1; min-width: 0; padding: 64px 56px; }

.panel { display: none; max-width: 760px; }
.panel.active { display: block; }
.panel h2 { font-size: clamp(26px, 3.5vw, 34px); margin-bottom: 18px; }

.about-name { font-family: var(--font-head); font-size: clamp(40px, 6vw, 64px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
.about-role { font-size: 20px; font-weight: 600; color: var(--teal); margin: 8px 0 0; }
.about-tagline { margin: 4px 0 24px; font-size: 19px; color: var(--ink); font-style: italic; font-weight: 500; max-width: 640px; }

/* Skills */
.skills-interactive { margin-top: 40px; }
.skills-tab-list { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }
.skills-tab-list button {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  padding: 12px 20px; border-radius: 999px; cursor: pointer; line-height: 1.3;
}
.skills-tab-list button:hover { border-color: var(--teal); }
.skills-tab-list button.active { background: var(--teal); border-color: var(--teal); color: #ffffff; }
.tab-icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--teal); display: inline-flex; }
.tab-icon svg { width: 100%; height: 100%; display: block; }
.skills-tab-list button.active .tab-icon { color: #ffffff !important; }
.skill-detail-card { border: 1px solid var(--line); border-radius: 4px; padding: 26px; min-height: 132px; }
.skill-detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.skill-detail-icon { width: 22px; height: 22px; color: var(--teal); }
.skill-detail-card h3 { font-size: 15px; color: var(--teal); margin: 0; text-transform: uppercase; letter-spacing: 0.04em; }
.skill-detail-card p { color: var(--ink-dim); margin: 0; font-size: 15px; line-height: 1.7; }
.skill-detail-card .skill-note {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
  color: var(--teal); font-size: 13px; font-style: italic;
}
.skill-detail-images { margin-top: 20px; }
.media-hero {
  width: 100%; max-width: 520px; aspect-ratio: 4 / 3; background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: zoom-in;
}
.media-hero img { width: 100%; height: 100%; object-fit: contain; display: block; }
.media-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.media-thumbs button {
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink-dim); font-family: var(--font-mono);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.media-thumbs button:hover { border-color: var(--teal); color: var(--ink); }
.media-thumbs button.active { background: var(--teal); border-color: var(--teal); color: #ffffff; }
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(10, 14, 13, 0.88); z-index: 999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 48px; cursor: zoom-out;
}
.lightbox-overlay img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 4px; }
.lightbox-source-link {
  color: #ffffff; font-size: 13px; text-decoration: underline; cursor: pointer;
  opacity: 0.85;
}
.lightbox-source-link:hover { opacity: 1; }
.skill-detail-attachments { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.attachment-link { font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.attachment-link::before { content: "\2193"; font-family: var(--font-mono); }

/* Tools & Software */
.tool-grid { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 24px; }
.tool-chip { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 72px; text-align: center; }
.tool-icon { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.tool-icon svg, .tool-icon img { width: 100%; height: 100%; object-fit: contain; }
.tool-chip span { font-size: 11.5px; color: var(--ink-dim); font-weight: 600; line-height: 1.3; }

/* Expandable detail (used across timeline items, project cards, etc.) */
.expand-toggle {
  display: inline-block; margin-top: 10px; background: none; border: none;
  color: var(--teal); font-family: var(--font-mono); font-size: 12px;
  font-weight: 700; letter-spacing: 0.04em; cursor: pointer; padding: 0;
}
.expand-toggle:hover { text-decoration: underline; }
.expand-body { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.expand-body.open { display: block; }
.expand-body ul { margin: 0; padding-left: 18px; color: var(--ink-dim); font-size: 15px; line-height: 1.7; }
.expand-body p { margin: 0; color: var(--ink-dim); font-size: 14.5px; line-height: 1.7; }
.expand-body li { margin-bottom: 6px; }

/* Experience timeline */
.company-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 8px; }
.company-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 700; font-size: 13.5px;
  letter-spacing: -0.01em; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px;
  text-decoration: none;
}
.company-logo { height: 18px; width: 24px; object-fit: contain; flex-shrink: 0; }
.company-chip-text { display: flex; flex-direction: column; line-height: 1.25; }
.company-chip-name { font-family: var(--font-head); font-weight: 700; font-size: 13.5px; letter-spacing: -0.01em; }
.company-chip-year { font-family: var(--font-mono); font-weight: 500; font-size: 10px; color: var(--ink-dim); }
a.company-chip { cursor: pointer; }
a.company-chip:hover { border-color: var(--teal); background: var(--teal-dim); }
a.company-chip:hover .company-chip-name { color: var(--teal); }
.timeline { margin-top: 40px; display: flex; flex-direction: column; gap: 36px; }
.timeline-item { border-left: 2px solid var(--teal-dim); padding-left: 24px; position: relative; transition: background-color 0.4s ease; }
.timeline-item.flash-highlight { background-color: var(--teal-dim); border-radius: 4px; }
.timeline-item::before {
  content: ""; position: absolute; left: -6px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--teal);
}
.timeline-role { font-size: 18px; font-weight: 700; margin-bottom: 2px; display: flex; align-items: center; gap: 10px; }
.timeline-logo { height: 20px; width: 30px; object-fit: contain; object-position: left center; flex-shrink: 0; }
.timeline-meta { color: var(--ink-dim); font-family: var(--font-mono); font-size: 13px; margin-bottom: 12px; }
.timeline-item ul { margin: 0; padding-left: 18px; color: var(--ink-dim); font-size: 15px; line-height: 1.7; }
.timeline-item li { margin-bottom: 6px; }

/* Project cards */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; margin-top: 40px;
}
.project-card { border: 1px solid var(--line); border-radius: 4px; padding: 26px; background: var(--bg); }
.project-card h3 { font-size: 18px; margin-bottom: 10px; }
.project-card p { color: var(--ink-dim); font-size: 14.5px; margin: 0 0 14px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 11px; color: var(--teal);
  border: 1px solid var(--teal-dim); border-radius: 20px; padding: 3px 10px;
}

/* Builds */
.video-embed { position: relative; width: 100%; max-width: 420px; aspect-ratio: 16 / 9; margin-top: 20px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-caption { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-dim); font-style: italic; max-width: 420px; }
.project-context { margin: 14px 0 0; font-size: 14.5px; color: var(--ink-dim); line-height: 1.7; max-width: 640px; }

.project-cover-image {
  width: 100%; max-width: 320px; margin: 20px 0 0; border-radius: 8px;
  border: 1px solid var(--line); cursor: zoom-in; display: block;
}

/* Static process chart (all steps visible at once, start to finish) */
.process-chart {
  display: flex; flex-wrap: wrap; align-items: flex-start; margin-top: 24px;
}
.process-step {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 150px; flex: 0 0 auto;
}
.process-step-media {
  width: 96px; height: 96px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.process-step-media img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.process-step-media.is-icon { color: var(--flow-accent, var(--teal)); }
.process-step-media.is-icon svg { width: 40px; height: 40px; }
.process-step h4 { font-size: 13px; margin: 10px 0 4px; color: var(--ink); }
.process-step p { font-size: 12px; color: var(--ink-dim); line-height: 1.4; margin: 0; }
.process-connector {
  flex: 0 0 auto; width: 28px; height: 96px; margin-top: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--flow-accent, var(--teal));
}
.process-connector svg { width: 20px; height: 20px; }

/* Pipeline flow chart (click-through roller) */
#projects-detail-pipelines { margin-top: 24px; }
.pipeline-eventlist {
  margin: 24px 0 0; padding-left: 20px; color: var(--ink-dim); font-size: 15px; line-height: 1.8;
}
.pipeline-eventlist li { margin-bottom: 8px; }
.pipeline-eventlist li strong { color: var(--ink); font-weight: 700; }
.pipeline-block + .pipeline-block { margin-top: 36px; }
.pipeline-title { font-size: 15px; color: var(--flow-accent, var(--teal)); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 4px; }
.pipeline-note {
  margin: 12px 0 0 !important; padding-top: 12px; border-top: 1px dashed var(--line);
  color: var(--flow-accent, var(--teal)) !important; font-size: 13px !important; font-style: italic;
}
.flow-chart { --flow-accent: var(--teal); margin-top: 12px; }
.flow-stage { display: flex; align-items: center; gap: 14px; }
.flow-arrow-btn {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink-dim); display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.flow-arrow-btn svg { width: 20px; height: 20px; }
.flow-arrow-btn.flow-prev svg { transform: scaleX(-1); }
.flow-arrow-btn:hover:not(:disabled) { border-color: var(--flow-accent); color: var(--flow-accent); }
.flow-arrow-btn:disabled { opacity: 0.3; cursor: default; }
.flow-panel {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: row; align-items: center;
  text-align: left; gap: 24px;
  border: 1px solid var(--line); border-radius: 8px; padding: 24px; background: var(--bg);
  min-height: 240px;
}
.flow-panel-media { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.flow-panel-media.is-icon {
  width: 64px; height: 64px; border-radius: 50%; color: var(--flow-accent);
  background: color-mix(in srgb, var(--flow-accent) 14%, transparent);
}
.flow-panel-media.is-icon svg { width: 32px; height: 32px; }
.flow-panel-media.is-photo {
  width: 220px; max-width: 220px; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; cursor: zoom-in; background: var(--bg-alt);
}
.flow-panel-media.is-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.flow-panel-text { flex: 1 1 auto; min-width: 0; max-width: 380px; }
.flow-step-count {
  display: block; font-family: var(--font-mono); font-size: 12px; color: var(--flow-accent);
  font-weight: 700; letter-spacing: 0.04em; margin-bottom: 6px;
}
.flow-panel-text h4 { font-family: var(--font-head); font-size: 19px; margin: 0 0 6px; letter-spacing: -0.01em; }
.flow-panel-text p { margin: 0; font-size: 14.5px; color: var(--ink-dim); line-height: 1.6; }
.flow-dots { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.flow-dots button {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink-dim); font-family: var(--font-mono);
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.flow-dots button:hover { border-color: var(--flow-accent); color: var(--ink); }
.flow-dots button.active { background: var(--flow-accent); border-color: var(--flow-accent); color: #ffffff; }
@media (max-width: 620px) {
  .flow-panel { flex-direction: column; text-align: center; padding: 20px; min-height: 0; }
  .flow-panel-media.is-photo { width: 100%; max-width: 260px; }
}

.build-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; margin-top: 40px;
}
.build-block { border: 1px solid var(--line); border-radius: 4px; padding: 26px; background: var(--bg); }
.build-block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.build-block-head h3 { margin-bottom: 0; }
.build-block h3 { font-size: 18px; }
.build-block p { color: var(--ink-dim); font-size: 14.5px; margin: 0 0 14px; line-height: 1.7; }
.block-image { display: block; width: 100%; max-width: 420px; border-radius: 6px; border: 1px solid var(--line); margin: 0 0 14px; cursor: zoom-in; }
.inline-logo { width: 14px; height: 14px; display: inline-flex; flex-shrink: 0; }
.build-block-head .inline-logo { width: 24px; height: 24px; }
.inline-logo svg, .inline-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.block-link { margin: 12px 0 0; font-size: 13px; }
.block-logo svg, .block-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* 3D viewer */
.fusion-badge-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.fusion-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 0;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 8px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-dim);
}
.fusion-badge-logo { width: 20px; height: 20px; object-fit: contain; }
.viewer-wrap { margin-top: 24px; max-width: 460px; }
.viewer-roller { display: flex; align-items: center; gap: 12px; }
.viewer-roller .viewer-prev svg { transform: scaleX(-1); }
.viewer-stage {
  flex: 1 1 auto; min-width: 0;
  aspect-ratio: 1 / 1; background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; user-select: none; -webkit-user-select: none;
}
.viewer-stage img {
  width: 100%; height: 100%; object-fit: contain; pointer-events: none;
  -webkit-touch-callout: none;
}
.viewer-title { margin: 14px 0 0; font-weight: 700; font-size: 15px; }
.viewer-desc { margin: 4px 0 0; color: var(--ink-dim); font-size: 14px; }
.model-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.model-list button {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-dim);
  font-size: 12px; padding: 7px 12px; border-radius: 16px; cursor: pointer;
  font-family: var(--font-body);
}
.model-list button:hover { border-color: var(--teal); color: var(--ink); }
.model-list button.active { background: var(--teal-dim); border-color: var(--teal); color: var(--teal); font-weight: 700; }
.gallery-item strong { color: var(--ink); font-size: 14px; }

/* Education */
.edu-list { margin-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.edu-item { display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.edu-logo { height: 34px; width: 60px; object-fit: contain; object-position: left center; flex-shrink: 0; }
.edu-logo-round { border-radius: 50%; object-fit: cover; width: 34px; }
.edu-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.edu-item .name { font-weight: 600; }
.edu-item .meta { color: var(--ink-dim); font-family: var(--font-mono); font-size: 13px; }

/* Contact */
.contact-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 32px; }

@media (max-width: 860px) {
  .sidebar { width: 240px; padding: 32px 20px; }
  .content { padding: 48px 32px; }
}

/* Phones: collapse sidebar to a top bar automatically */
@media (max-width: 600px) {
  .app { flex-direction: column; }
  .sidebar {
    width: auto; height: auto; position: static;
    flex-direction: row; align-items: center; flex-wrap: wrap;
    padding: 20px 24px; border-right: none; border-bottom: 1px solid var(--line);
  }
  .sidebar-top { display: flex; align-items: center; gap: 12px; margin-right: auto; }
  .avatar { width: 44px; height: 44px; margin-bottom: 0; }
  .sidebar-top h1 { font-size: 16px; }
  .sidebar-top .role { display: none; }
  .side-nav {
    order: 3; width: 100%; flex-direction: row; overflow-x: auto;
    margin: 16px 0 0; gap: 6px;
  }
  .side-nav a { white-space: nowrap; }
  .sidebar-links { flex-direction: row; margin-top: 0; padding-top: 0; }
  .sidebar-links .btn { padding: 9px 14px; font-size: 13px; }
  .sidebar .footer-version { display: none; }
  .content { padding: 40px 24px; }
}
