:root {
  color-scheme: dark;
  --gutter: 20px;
  --content-width: 600px;
  --section-gap: 80px;
  --bg: #111;
  --text: #f5f5f5;
  --muted: #898989;
  --edge: rgba(245, 245, 245, .1);
  --dock: rgba(32, 32, 32, .72);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa;
  --text: #151515;
  --muted: #a0a0a0;
  --edge: rgba(0, 0, 0, .08);
  --dock: rgba(255, 255, 255, .72);
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    color-scheme: light;
    --bg: #fafafa;
    --text: #151515;
    --muted: #a0a0a0;
    --edge: rgba(0, 0, 0, .08);
    --dock: rgba(255, 255, 255, .72);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font: 14px/1.6 Inter, Arial, sans-serif; letter-spacing: -.012em; transition: color .2s ease, background .2s ease; }
button, a { color: inherit; font: inherit; }
a { text-underline-offset: 2px; }
button { cursor: pointer; }

.article, .site-footer { width: min(var(--content-width), calc(100% - (var(--gutter) * 2))); margin: 0 auto; }
.article { padding: 0 0 140px; }
.site-footer { padding: 0 0 112px; }
.masthead { display: flex; align-items: center; justify-content: space-between; height: 96px; margin-bottom: 42px; }
.wordmark, .brand-mark { color: var(--text); line-height: 1; opacity: .78; text-decoration: none; }
.wordmark { font-size: 16px; font-weight: 400; letter-spacing: -.06em; }
.brand-mark { font-size: 16px; font-weight: 400; }
.intro, .section { width: 100%; }
.section { margin-top: var(--section-gap); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 14px; font-weight: 400; letter-spacing: -.02em; }
h2 { margin-bottom: 22px; font-size: 14px; font-weight: 400; letter-spacing: -.02em; }

.role { margin-bottom: 22px; color: var(--muted); }
.intro > p:not(.role):not(.contact-actions) { max-width: 680px; margin-bottom: 16px; }
.contact-actions { display: flex; gap: 16px; margin: 22px 0 0; }
.contact-actions button { padding: 0; border: 0; background: transparent; text-decoration: underline; text-underline-offset: 2px; }

.work-list, .timeline, .thought-list { padding: 0; margin: 0; list-style: none; }
.work-list { display: grid; gap: 32px; }
.work-item { display: grid; grid-template-columns: 144px minmax(0, 1fr); gap: 24px; }
.work-item time, .timeline time, .thought-list time, .photo-note time, .tool-row > span { color: var(--muted); }
.work-item time { padding-top: 1px; white-space: nowrap; }
.project-link { display: inline-block; margin-bottom: 2px; font-weight: 400; }
.work-item p { margin-bottom: 8px; }
.preview-trigger { display: block; width: 160px; height: 90px; padding: 0; overflow: hidden; border: 0; border-radius: 7px; background: #2b2b2b; text-align: left; }
.preview-trigger img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.preview-trigger:hover img, .preview-trigger:focus-visible img { transform: scale(1.04); }

.timeline { display: grid; gap: 13px; }
.timeline li { display: grid; grid-template-columns: 144px minmax(0, 1fr); column-gap: 24px; }
.timeline p { margin: 0; }
.timeline small { grid-column: 2; color: var(--muted); font-size: inherit; }
.thought-list li { display: grid; grid-template-columns: 144px minmax(0, 1fr); gap: 24px; }

.photo-note { display: grid; grid-template-columns: 144px minmax(0, 1fr); gap: 24px; margin-bottom: 20px; }
.photo-note p { margin: 0; }
.photo-strip { display: flex; gap: 7px; width: 100%; padding: 2px 0 10px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-behavior: smooth; scroll-snap-type: x mandatory; cursor: grab; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.photo-strip::-webkit-scrollbar { display: none; }
.photo-strip.is-dragging { cursor: grabbing; scroll-behavior: auto; scroll-snap-type: none; user-select: none; }
.photo { position: relative; flex: 0 0 168px; height: 224px; margin: 0; overflow: hidden; border-radius: 7px; background: #2d343c; scroll-snap-align: start; }
.photo-preview-trigger { display: block; width: 100%; padding: 0; border: 0; color: inherit; text-align: left; cursor: zoom-in; }
.photo-preview-trigger:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.photo img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .3s ease; }
.photo span { position: absolute; right: 8px; bottom: 7px; color: white; font-size: 10px; opacity: .78; }
.photo:hover img { transform: scale(1.07); }
.photo-gallery-controls { display: flex; align-items: center; gap: 6px; }
.photo-gallery-hint { margin-right: auto; color: var(--muted); font-size: 11px; }
.photo-scroll { display: grid; width: 28px; height: 28px; padding: 0; border: 1px solid var(--edge); border-radius: 50%; background: transparent; color: var(--muted); place-items: center; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.photo-scroll:hover, .photo-scroll:focus-visible { border-color: var(--text); background: var(--text); color: var(--bg); }
.photo-scroll:disabled { cursor: default; opacity: .35; }


.site-footer p { margin: 0; }
.status-art { position: relative; display: inline-block; width: 40px; height: 24px; margin-left: 8px; vertical-align: -7px; color: var(--text); }
.bird { position: absolute; inset: 0; display: block; width: 40px; height: 24px; image-rendering: pixelated; }
.bird--awake { display: none; }
.bird--asleep { animation: bird-doze 1.8s steps(4, end) infinite; }
.bird-zzz { position: absolute; top: 0; left: 24px; width: 0; height: 0; }
.bird-zzz span { position: absolute; display: block; color: var(--text); font: 700 10px/1 Inter, sans-serif; opacity: 0; animation: bird-z 7.2s ease-out infinite; }
.bird-zzz span:nth-child(1) { animation-delay: 0s; }
.bird-zzz span:nth-child(2) { animation-delay: 2.4s; }
.bird-zzz span:nth-child(3) { animation-delay: 4.8s; }
.status-art.is-working .bird--asleep, .status-art.is-working .bird-zzz { display: none; }
.status-art.is-working .bird--awake { display: block; animation: bird-hover .8s steps(2, end) infinite; }
.status-art.is-working .bird-wing { animation: bird-wing .5s steps(2, end) infinite; transform-origin: 17px 14px; }
@keyframes bird-doze { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(1px); } }
@keyframes bird-z { 0% { opacity: 0; transform: translate(0, 0) scale(.55); } 18% { opacity: 1; } 78% { opacity: .85; } 100% { opacity: 0; transform: translate(8px, -14px) scale(1.12); } }
@keyframes bird-hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes bird-wing { 50% { transform: translateY(-3px) rotate(-7deg); } }

.dock { position: fixed; z-index: 4; bottom: 20px; left: 50%; display: flex; align-items: center; gap: 7px; transform: translateX(-50%); }
.dock-pill, .dock-icon, .theme-control, .language-control { height: 44px; border: 1px solid var(--edge); border-radius: 999px; background: var(--dock); box-shadow: 0 4px 24px rgba(0, 0, 0, .08); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.dock-pill { display: flex; align-items: center; gap: 2px; padding: 4px 6px; }
.dock-pill a { min-height: 34px; padding: 7px 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; text-decoration: none; white-space: nowrap; }
.dock-pill a:hover, .dock-pill a:focus-visible, .dock-pill a.is-active { background: var(--text); color: var(--bg); }
.language-control { width: 44px; padding: 0; color: var(--muted); font-size: 11px; }
.language-control:hover, .language-control:focus-visible { color: var(--text); border-color: var(--text); }
.dock-icon { min-width: 40px; padding: 0 11px; color: var(--muted); font-size: 14px; }
.dock-icon:hover, .dock-icon:focus-visible { color: var(--text); border-color: var(--text); }
.theme-control { display: flex; align-items: center; justify-content: center; width: 44px; padding: 0; color: var(--muted); }
.theme-control:hover, .theme-control:focus-visible { color: var(--text); border-color: var(--text); }
.theme-toggle-icons { position: relative; display: block; width: 16px; height: 16px; }
.theme-icon { position: absolute; inset: 0; display: block; width: 16px; height: 16px; fill: none; opacity: 0; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; transition: opacity .2s cubic-bezier(.23, 1, .32, 1); }
.theme-control[data-theme-choice="system"] .theme-icon--monitor,
.theme-control[data-theme-choice="light"] .theme-icon--sun,
.theme-control[data-theme-choice="dark"] .theme-icon--moon { opacity: 1; }
.theme-control.is-switching .theme-icon--active { animation: theme-icon-pop .2s cubic-bezier(.23, 1, .32, 1); }
@keyframes theme-icon-pop { 0% { opacity: 0; transform: scale(.88) rotate(-8deg); } 55% { opacity: 1; transform: scale(1.09) rotate(8deg); } 100% { opacity: 1; transform: none; } }

.preview-dialog { width: min(580px, calc(100% - 32px)); padding: 0; overflow: hidden; border: 1px solid var(--edge); border-radius: 10px; background: var(--bg); color: var(--text); box-shadow: 0 24px 80px rgba(0, 0, 0, .4); }
.preview-dialog::backdrop { background: rgba(0, 0, 0, .58); backdrop-filter: blur(3px); }
.preview-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--edge); }
.preview-head p { margin: 0; font-size: 12px; }
.preview-head button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 20px; }
.preview-window { display: block; color: inherit; text-decoration: none; }
.preview-window img { display: block; width: 100%; height: min(50vh, 350px); object-fit: cover; object-position: top; background: #f5f5f5; }
.preview-window span { display: block; padding: 12px 14px; border-top: 1px solid var(--edge); font-size: 12px; }

.toast { position: fixed; z-index: 6; bottom: 65px; left: 50%; padding: 8px 11px; border: 1px solid var(--edge); border-radius: 5px; background: var(--text); color: var(--bg); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 7px); transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

@media (max-width: 640px) {
  :root { --gutter: 18px; --section-gap: 64px; }
  .article { padding-bottom: 112px; }
  .masthead { height: 72px; margin-bottom: 38px; }
  .section { margin-top: 64px; }
  .work-item, .timeline li, .thought-list li, .photo-note { grid-template-columns: 1fr; gap: 5px; }
  .timeline small { grid-column: auto; }
  .photo-strip { margin-right: -12px; width: calc(100% + 12px); }
  .photo { flex-basis: 150px; height: 200px; }
  .dock { bottom: 10px; width: calc(100% - 20px); gap: 5px; }
  .dock-pill { flex: 1; min-width: 0; max-width: none; overflow: visible; }
  .dock-pill a { flex: 1; min-width: 0; padding: 7px 4px; font-size: 10px; text-align: center; }
  .dock-icon { display: none; }
  .theme-control, .language-control { flex: 0 0 36px; width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .bird--asleep { animation-duration: 1.8s !important; }
  .bird-zzz span { animation-duration: 7.2s !important; }
}
