:root {
  color-scheme: dark;
  --bg: #0b1117;
  --surface: #121c25;
  --surface-hover: #182530;
  --line: #2b3945;
  --text: #ecf2f5;
  --secondary: #a7b6c2;
  --muted: #94a5b3;
  --accent: #83dec0;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
svg { width: 20px; height: 20px; flex-shrink: 0; }
::selection { background: #83dec0; color: #0b1117; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 20px; top: -100px; z-index: 200; padding: 12px 20px; background: var(--accent); color: var(--bg); }
.skip-link:focus { top: 12px; }
.app-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.timeline-header { padding: 28px 36px 22px; border-bottom: 1px solid var(--line); }
.brand-section { display: flex; flex-direction: row-reverse; align-items: flex-start; justify-content: space-between; gap: 24px; }
.brand-text h1 { margin: 0; font-size: clamp(22px, 2.2vw, 30px); font-weight: 650; line-height: 1.2; letter-spacing: -.035em; }
.brand-text p { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 10px 0 0; font-size: 13px; color: var(--secondary); }
.header-date { font-variant-numeric: tabular-nums; }
.header-divider { color: #526574; }
.nav-crossroad-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; color: var(--secondary); font-size: 13px; text-decoration: none; white-space: nowrap; }
.nav-crossroad-btn svg { width: 16px; transform: rotate(180deg); }
.nav-crossroad-btn:hover { color: var(--text); }
.header-controls { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 26px; }
.filter-pills { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--secondary); font-size: 13px; transition: background 150ms ease, color 150ms ease, border-color 150ms ease; }
.filter-btn:hover { background: var(--surface); color: var(--text); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.badge-count { font-size: 11px; font-variant-numeric: tabular-nums; padding: 2px 5px; border-radius: 4px; background: #ffffff0d; }
.active .badge-count { background: #0b111714; }
.timeline-language-switcher { flex-shrink: 0; }
.language-select { min-height: 40px; padding: 0 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; color: var(--secondary); font-size: 13px; }
.timeline-navigation { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 10px 36px; border-bottom: 1px solid var(--line); }
.time-anchors { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.time-anchors::-webkit-scrollbar { display: none; }
.time-btn { flex-shrink: 0; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.time-btn:hover:not(:disabled) { color: var(--text); background: var(--surface); }
.time-btn[aria-pressed="true"] { background: #83dec016; color: var(--accent); }
.year-nav-count { font-size: 11px; color: var(--muted); }
.latest-btn { gap: 6px; color: var(--accent); }
.latest-btn svg { width: 16px; }
.canvas-nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.navigation-hint { color: var(--muted); font-size: 12px; margin-right: 8px; }
.nav-arrow-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text); }
.nav-arrow-btn:hover:not(:disabled) { background: var(--surface-hover); }
#btn-scroll-left svg { transform: rotate(180deg); }
.timeline-viewport { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #566c7a var(--bg); overscroll-behavior: contain; cursor: grab; }
.timeline-viewport.is-dragging { cursor: grabbing; user-select: none; }
.timeline-viewport::-webkit-scrollbar { width: 8px; height: 8px; }
.timeline-viewport::-webkit-scrollbar-thumb { background: #566c7a; border: 2px solid var(--bg); border-radius: 4px; }
.timeline-canvas { display: flex; gap: 48px; width: max-content; min-width: 100%; padding: 28px 36px 36px; }
.year-group { flex-shrink: 0; }
.year-group-heading { display: flex; align-items: baseline; gap: 5px; margin-bottom: 22px; color: var(--muted); font-size: 12px; }
.year-group-heading h2 { margin: 0 12px 0 0; font-size: 42px; line-height: 1.1; font-weight: 500; letter-spacing: -.04em; color: var(--text); font-variant-numeric: tabular-nums; }
.projects-grid { --columns: 1; position: relative; display: grid; grid-auto-flow: column; grid-template-columns: repeat(var(--columns), 292px); grid-template-rows: 236px 236px; gap: 64px 20px; }
.projects-grid::before { content: ""; position: absolute; top: 50%; left: 0; right: -48px; height: 1px; background: var(--line); pointer-events: none; }
.year-group:last-child .projects-grid::before { right: 0; }
.project-pin-item { --project-color: #83dec0; --project-tint: #83dec011; position: relative; min-width: 0; }
.project-pin-item[data-category="hardware"] { --project-color: #f2b483; --project-tint: #f2b48311; }
.project-pin-item[data-category="ai-vision"] { --project-color: #8bc9eb; --project-tint: #8bc9eb11; }
.project-pin-item[data-category="research"] { --project-color: #c8b1ed; --project-tint: #c8b1ed11; }
.project-pin-pill { display: flex; flex-direction: column; align-items: flex-start; width: 100%; height: 100%; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; transition: background 180ms ease, border-color 180ms ease; }
.project-pin-pill:hover { background: var(--surface-hover); border-color: var(--project-color); }
.project-pin-pill:focus-visible { outline-color: var(--project-color); }
.project-meta { display: flex; justify-content: space-between; align-items: baseline; width: 100%; gap: 8px; margin-bottom: 12px; }
.pin-date { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--secondary); white-space: nowrap; }
.project-category { font-size: 11px; line-height: 1.3; color: var(--project-color); text-align: right; }
.pin-title { display: block; font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; text-wrap: pretty; }
.popover-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.6; color: var(--secondary); margin-top: 10px; }
.project-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding-top: 12px; margin-top: auto; }
.project-badge { font-size: 11px; line-height: 1.4; color: var(--project-color); }
.project-bottom svg { width: 16px; height: 16px; color: var(--project-color); }
.project-stem-down { position: absolute; height: 32px; width: 1px; left: 25px; background: var(--project-color); opacity: .45; bottom: -32px; }
.project-node-axis { position: absolute; width: 7px; height: 7px; left: 22px; bottom: -35px; border-radius: 50%; background: var(--project-color); }
.project-pin-item[data-row="bottom"] .project-stem-down { top: -32px; bottom: auto; }
.project-pin-item[data-row="bottom"] .project-node-axis { top: -36px; bottom: auto; }
.timeline-footer { display: flex; justify-content: space-between; gap: 16px; padding: 16px 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
#timeline-status { color: var(--secondary); font-variant-numeric: tabular-nums; }
.inspector-overlay { position: fixed; inset: 0; z-index: 90; background: #02070dcc; }
.inspector-drawer { position: fixed; inset: 0 0 0 auto; width: min(600px, 100%); z-index: 100; display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--line); box-shadow: -24px 0 60px #00000040; animation: drawer-enter 240ms cubic-bezier(.16,1,.3,1); }
@keyframes drawer-enter { from { transform: translateX(40px); opacity: .5; } to { transform: translateX(0); opacity: 1; } }
.drawer-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 30px; border-bottom: 1px solid var(--line); }
.drawer-meta { margin: 0 0 12px; font-size: 12px; color: var(--accent); }
.drawer-header h2 { font-size: 25px; line-height: 1.3; font-weight: 600; letter-spacing: -.025em; margin: 0; }
.drawer-close-btn { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; background: transparent; color: var(--secondary); border: 1px solid var(--line); border-radius: 8px; }
.drawer-close-btn:hover { background: var(--surface); color: var(--text); }
.drawer-content { display: flex; flex-direction: column; gap: 32px; flex: 1; min-height: 0; overflow: auto; overscroll-behavior:contain; padding: 30px; scrollbar-width: thin; scrollbar-color: #566c7a var(--bg); }
.drawer-section { display: flex; flex-direction: column; gap: 12px; }
.drawer-section-title { font-size: 16px; color: var(--text); font-weight: 600; }
.drawer-section p, .project-summary { font-size: 15px; line-height: 1.75; color: var(--secondary); margin: 0; max-width:65ch; overflow-wrap:anywhere; }
.drawer-section strong { color: var(--text); }
.feature-grid { display: grid; gap: 22px; }
.feature-box { padding-top: 18px; border-top: 1px solid var(--line); }
.feature-box strong { display: block; font-size: 14px; margin-bottom: 6px; }
.project-product-list { margin: 0; padding-left: 20px; color: var(--secondary); font-size: 15px; line-height: 1.9; }
.drawer-actions { margin-top: auto; padding-top: 12px; }
.btn-primary { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 12px 18px; border-radius: 8px; background: var(--accent); color: var(--bg); text-decoration: none; font-size: 13px; font-weight: 600; }
.btn-primary:hover { background: #a0e9d1; }
@media (max-width: 1100px) { .navigation-hint { display: none; } }
@media (min-width: 761px) and (max-height: 900px) {
  .timeline-canvas { padding-top: 20px; padding-bottom: 20px; }
  .year-group-heading h2 { font-size: 36px; }
  .year-group-heading { margin-bottom: 18px; }
  .projects-grid { grid-template-rows: 216px 216px; row-gap: 48px; }
  .popover-desc { -webkit-line-clamp: 2; }
  .project-stem-down { height: 24px; bottom: -24px; }
  .project-node-axis { bottom: -27px; }
  .project-pin-item[data-row="bottom"] .project-stem-down { top: -24px; }
  .project-pin-item[data-row="bottom"] .project-node-axis { top: -28px; }
}
@media (max-width: 760px) {
  .timeline-header { position: relative; padding: 18px 20px 16px; }
  .brand-section { flex-direction: column; gap: 12px; }
  .nav-crossroad-btn { min-height: 24px; font-size: 12px; }
  .brand-text h1 { max-width: 340px; font-size: 24px; }
  .brand-text p { font-size: 11px; gap: 8px; margin-top: 8px; }
  .header-controls { display: block; margin-top: 18px; }
  .timeline-language-switcher { position: absolute; top: 14px; right: 20px; }
  .filter-pills { flex-wrap: wrap; gap: 6px; padding: 4px; margin-left: -4px; scrollbar-width: none; }
  .filter-pills::-webkit-scrollbar { display: none; }
  .filter-btn { white-space: nowrap; flex-shrink: 0; min-height: 40px; font-size: 12px; padding: 8px 10px; gap: 6px; }
  .language-select { max-width: 82px; padding: 0 6px; font-size: 11px; }
  .timeline-navigation { padding: 8px 16px; gap: 8px; }
  .time-btn { min-height: 40px; padding: 8px; font-size: 12px; gap: 4px; }
  .year-nav-count { display: none; }
  .canvas-nav-actions { display: none; }
  .timeline-viewport { cursor: auto; scroll-padding-top: 20px; }
  .timeline-canvas { display: block; width: auto; padding: 24px 20px 40px; }
  .year-group { margin-bottom: 36px; }
  .year-group:last-child { margin-bottom: 0; }
  .year-group-heading { margin-bottom: 18px; }
  .year-group-heading h2 { font-size: 32px; }
  .projects-grid { display: flex; flex-direction: column; gap: 16px; padding-left: 18px; }
  .projects-grid::before { top: 0; bottom: 0; height: auto; width: 1px; left: 0; right: auto; }
  .project-pin-pill { padding: 18px; min-height: 190px; }
  .project-meta { margin-bottom: 10px; }
  .pin-title { font-size: 18px; }
  .popover-desc { -webkit-line-clamp: initial; font-size: 13px; }
  .project-bottom { margin-top: 16px; padding-top: 0; }
  .project-stem-down, .project-pin-item[data-row="bottom"] .project-stem-down { width: 18px; height: 1px; top: 26px; left: -18px; bottom: auto; }
  .project-node-axis, .project-pin-item[data-row="bottom"] .project-node-axis { top: 23px; left: -21px; bottom: auto; }
  .timeline-footer { padding: 12px 20px; font-size: 11px; }
  .footer-help { display: none; }
  .drawer-header { padding: 24px 20px; }
  .drawer-header h2 { font-size: 23px; }
  .drawer-content { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Portfolio keeps its own palette and scrollable timeline. */
.filter-btn,.time-btn,.language-select,.nav-crossroad-btn{min-height:44px}
.nav-arrow-btn,.drawer-close-btn{width:44px;height:44px}
.brand-text,.header-controls,.drawer-header h2{min-width:0}
.drawer-header h2,.pin-title,.project-badge{overflow-wrap:anywhere}
.project-pin-pill{scroll-margin:20px}
.timeline-footer{align-items:center}
.project-category,.project-badge,.badge-count,.brand-text p,.timeline-footer{font-size:12px;line-height:1.5}
@media(max-width:760px){.timeline-header{padding:18px 16px 14px}.header-controls{gap:12px;margin-top:18px}.filter-pills{gap:6px}.filter-btn{padding:8px 10px}.timeline-footer{gap:8px;flex-wrap:wrap}.drawer-header{padding:20px 16px}.drawer-content{padding:24px 16px}.time-anchors{padding:4px}.inspector-drawer{height:100dvh}.project-meta{flex-wrap:wrap}.project-category{text-align:left}}
@media(max-width:380px){.brand-section{gap:12px;flex-wrap:wrap}.brand-text h1{font-size:22px}.header-controls{align-items:flex-start;gap:8px}.filter-pills{flex:1}.filter-btn{font-size:12px}.timeline-language-switcher .language-select{max-width:90px}.timeline-canvas{padding-inline:16px}}
