:root {
  color-scheme: light dark;
  --bg: #fff;
  --text: #050505;
  --muted: #565656;
  --line: #dedede;
  --soft: #f6f6f6;
  --panel: #fff;
  --topbar: rgba(255,255,255,.92);
  --shot-bg: #f1f1f1;
  --badge-bg: rgba(255,255,255,.92);
  --badge-line: rgba(0,0,0,.18);
  --scrim: rgba(0,0,0,.68);
  --accent: #dc2626;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  --bg: #0d0d0d;
  --text: #f4f4f4;
  --muted: #b8b8b8;
  --line: #303030;
  --soft: #1a1a1a;
  --panel: #121212;
  --topbar: rgba(13,13,13,.92);
  --shot-bg: #191919;
  --badge-bg: rgba(18,18,18,.92);
  --badge-line: rgba(255,255,255,.2);
  --scrim: rgba(0,0,0,.78);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 22px 0;
  background: var(--topbar);
  backdrop-filter: blur(12px);
}
.topbar-inner {
  width: min(1280px, calc(100% - 64px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { font-size: 24px; font-weight: 800; letter-spacing: 0; }
nav { display: flex; align-items: center; gap: 34px; margin-left: auto; font-size: 14px; font-weight: 700; }
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding-bottom: 12px;
  border-bottom: 2px solid transparent;
}
nav a.active { border-bottom-color: var(--accent); }
.theme-toggle {
  position: relative;
  width: 28px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 0;
  margin-bottom: 12px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.theme-toggle::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 1px solid var(--text);
  border-radius: 50%;
  background: linear-gradient(90deg, var(--text) 0 50%, transparent 50% 100%);
}
:root[data-theme="dark"] .theme-toggle::before {
  background: var(--text);
  box-shadow: 0 0 0 3px var(--panel), 0 0 0 4px var(--text);
  transform: scale(.62);
}

main { width: min(1280px, calc(100% - 64px)); margin: 0 auto; }
.hero {
  min-height: 390px;
  display: grid;
  grid-template-columns: .88fr 1.12fr;
  gap: 56px;
  align-items: center;
  padding: 10px 0 38px;
  border-bottom: 1px solid var(--line);
}
h1 { margin: 0; font-size: 76px; line-height: .95; letter-spacing: 0; }
.role { margin: 24px 0 20px; font-size: 20px; font-weight: 800; }
.intro { max-width: 570px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.8; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 36px; }
.button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--text);
  font-size: 14px;
  font-weight: 800;
  background: var(--panel);
}

.focus-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  overflow: hidden;
}
.focus-panel h2 {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 14px;
}
.focus-panel article { min-width: 0; min-height: 150px; padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.focus-panel article:nth-child(3), .focus-panel article:nth-child(5) { border-right: 0; }
.focus-panel article:nth-child(4), .focus-panel article:nth-child(5) { border-bottom: 0; }
.focus-panel h3 { margin: 0 0 12px; font-size: 18px; }
.focus-panel p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }

.section { padding: 34px 0; border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h2 { margin: 0 0 22px; font-size: 22px; line-height: 1.2; }
.section-head a { color: var(--accent); font-size: 13px; font-weight: 800; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.project-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}
.project-card h3, .highlight-grid h3, .stack-grid h3 { margin: 0 0 10px; font-size: 16px; }
.project-card p, .highlight-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.project-shot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 18px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--shot-bg);
  cursor: zoom-in;
}
.project-shot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.project-shot span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 7px;
  border: 1px solid var(--badge-line);
  background: var(--badge-bg);
  font-size: 11px;
  font-weight: 800;
}
.tags, .stack-grid p { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags span, .stack-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: var(--soft);
  font-size: 11px;
  color: var(--text);
}
.project-links { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--accent); }
.highlight-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.highlight-grid article { border-left: 1px solid var(--line); padding-left: 20px; }
.stack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
footer { width: min(1280px, calc(100% - 64px)); margin: 0 auto; padding: 26px 0 34px; color: var(--muted); text-align: center; font-size: 12px; }
.shot-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}
.shot-dialog::backdrop { background: var(--scrim); }
.shot-dialog img {
  width: 100%;
  max-height: calc(100vh - 120px);
  display: block;
  object-fit: contain;
}
.shot-dialog p { margin: 12px 52px 0; text-align: center; color: var(--muted); font-size: 12px; }
.dialog-close, .dialog-nav {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
}
.dialog-nav {
  position: absolute;
  top: 50%;
  width: 38px;
  height: 46px;
  transform: translateY(-50%);
}
.dialog-nav.prev { left: 12px; }
.dialog-nav.next { right: 12px; }
.dialog-nav[hidden] { display: none; }

@media (max-width: 900px) {
  .topbar { position: static; padding: 22px 0; }
  .topbar-inner { width: 100%; max-width: 720px; padding-left: 16px; padding-right: 16px; align-items: flex-start; gap: 18px; }
  nav { flex-wrap: wrap; justify-content: flex-end; gap: 16px; }
  main, footer { width: 100%; max-width: 720px; padding-left: 16px; padding-right: 16px; }
  .hero { min-height: 0; grid-template-columns: 1fr; gap: 32px; padding-top: 28px; }
  h1 { font-size: 54px; }
  .project-grid, .highlight-grid, .stack-grid, .focus-panel { grid-template-columns: 1fr; }
  .focus-panel article, .focus-panel article:nth-child(3), .focus-panel article:nth-child(5) { border-right: 0; border-bottom: 1px solid var(--line); }
  .focus-panel article:last-child { border-bottom: 0; }
  .hero-copy, .focus-panel, .project-card { min-width: 0; }
  .project-card { min-height: 0; }
  .intro { max-width: none; }
}

@media (max-width: 560px) {
  .topbar-inner {
    width: calc(100vw - 32px);
    padding-left: 0;
    padding-right: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 18px 14px;
  }
  .brand { grid-column: 1; grid-row: 1; }
  nav { grid-column: 1 / -1; grid-row: 2; margin: 0; justify-content: flex-start; gap: 18px; font-size: 13px; }
  .theme-toggle { grid-column: 2; grid-row: 1; justify-self: end; margin-bottom: 0; }
  main, footer { width: calc(100vw - 32px); padding-left: 0; padding-right: 0; }
  h1 { font-size: 46px; }
  .role { font-size: 17px; }
  .intro { max-width: 32ch; }
  .actions { display: grid; }
  .button, .focus-panel, .project-card { width: 100%; max-width: calc(100vw - 32px); }
  .focus-panel { display: block; }
  .focus-panel article { width: 100%; max-width: 100%; padding: 20px; }
  .project-card { padding: 20px; gap: 16px; }
  .project-shot { margin-bottom: 16px; }
  .project-links { padding-top: 12px; }
  .focus-panel p, .project-card p, .highlight-grid p { max-width: 32ch; }
  .button { justify-content: center; text-align: center; }
  .shot-dialog { padding: 12px; }
  .shot-dialog p { margin-left: 44px; margin-right: 44px; }
}