:root, :root[data-theme="dark"] {
  --metal: #1A1D21;
  --panel: #22262B;
  --ink: #E4E5E0;
  --muted: #A0A49D;
  --rule: #343A41;
  --link: #8DB4DE;
  --led-off: #424850;
  --led-on: #F2C230;
  --ring: rgba(242, 194, 48, 0.24);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --metal: #E4E5E0;
  --panel: #EDEEE9;
  --ink: #1B1E22;
  --muted: #565A55;
  --rule: #C6C8C1;
  --link: #2F5E8C;
  --led-off: #B4B6AE;
  --ring: rgba(242, 194, 48, 0.4);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--metal);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; text-wrap: balance; }

h1 {
  font-size: clamp(2.5rem, 6.4vw, 5.25rem);
  font-weight: 760;
  font-stretch: 78%;
  line-height: 0.98;
  letter-spacing: -0.025em;
  max-width: 15ch;
}

h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  font-weight: 720;
  font-stretch: 80%;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.5rem;
  font-weight: 680;
  font-stretch: 85%;
  line-height: 1.2;
}

p { margin: 0 0 1em; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }

a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1120px; margin-inline: auto; padding-inline: clamp(20px, 5vw, 64px); box-sizing: content-box; }

.skip { position: absolute; left: 12px; top: -100px; padding: 10px 14px; background: var(--panel); color: var(--ink); border: 1px solid var(--rule); border-radius: 6px; z-index: 10; }

.skip:focus { top: 12px; }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-block: 20px; }

.mark { margin-right: auto; color: var(--ink); text-decoration: none; font-size: 1.375rem; font-weight: 800; font-stretch: 75%; letter-spacing: -0.01em; }

.bar ul { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding: 0; list-style: none; }

.bar nav a { color: var(--muted); text-decoration: none; }

.bar nav a:hover, .bar nav a[aria-current] { color: var(--ink); text-decoration: underline; }

.theme { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--rule); border-radius: 50%; background: var(--panel); color: var(--ink); cursor: pointer; }

.theme:hover { border-color: var(--muted); }

:root[data-theme="dark"] .moon, :root[data-theme="light"] .sun { display: none; }

.hero { padding-block: clamp(48px, 9vw, 112px) clamp(56px, 8vw, 96px); }

.lede { margin-top: 28px; max-width: 46ch; color: var(--muted); font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.5; }

.stack { margin: clamp(40px, 6vw, 64px) 0 0; padding: clamp(20px, 3vw, 32px); background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; }

.stack ol { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; list-style: none; }

.stack li { position: relative; padding-right: 16px; }

.stack li:not(:last-child)::after { content: ""; position: absolute; left: 6px; top: 5px; width: 100%; height: 2px; background: var(--rule); }

.stack strong { display: block; margin-top: 18px; font-size: 1.125rem; font-weight: 680; font-stretch: 85%; }

.stack li span:last-child { color: var(--muted); font-size: 0.9375rem; }

.led { position: relative; z-index: 1; display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--led-off); animation: led-on 0.2s ease-out calc(0.5s + var(--i) * 0.38s) forwards; }

.stack ol::after { content: ""; position: absolute; z-index: 2; top: 1px; left: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--led-on); box-shadow: 0 0 10px 2px var(--ring); opacity: 0; animation: packet 1.52s linear 0.5s both, packet-out 0.3s ease-out 2.1s forwards; }

.stack figcaption { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9375rem; }

@keyframes led-on { to { background: var(--led-on); box-shadow: 0 0 0 4px var(--ring); } }

@keyframes packet { from { left: 1px; opacity: 1; } to { left: calc(80% + 1px); opacity: 1; } }

@keyframes packet-out { to { opacity: 0; } }

@media (max-width: 759px) {
  .stack ol { grid-template-columns: 1fr; }
  .stack li { display: grid; grid-template-columns: 12px 1fr; column-gap: 16px; padding: 10px 0; }
  .stack li:not(:last-child)::after { left: 5px; top: 21px; width: 2px; height: 100%; }
  .led { grid-row: 1 / span 2; margin-top: 5px; }
  .stack strong { margin-top: 0; }
  .stack ol::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .led { animation: none; background: var(--led-on); box-shadow: 0 0 0 4px var(--ring); }
  .stack ol::after { display: none; }
}

.row { display: flex; flex-wrap: wrap; gap: 20px 48px; padding-block: clamp(40px, 6vw, 72px); border-top: 1px solid var(--rule); }

.row > h2 { flex: 1 1 220px; }

.row > .body { flex: 999 1 480px; min-width: 0; max-width: 62ch; margin: 0; }

.body > :last-child { margin-bottom: 0; }

.work + .work { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--rule); }

.work h3 { margin-bottom: 8px; }

.work p { margin-bottom: 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

.tags li { padding: 2px 9px; border: 1px solid var(--rule); border-radius: 4px; color: var(--muted); font-size: 0.875rem; }

.skills > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 24px; padding-block: 12px; border-top: 1px solid var(--rule); }

.skills > div:first-child { padding-top: 0; border-top: 0; }

.skills dt { font-weight: 650; }

.skills dd { margin: 0; color: var(--muted); }

.entry + .entry { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--rule); }

.has-thumb { display: grid; grid-template-columns: minmax(0, 1fr) clamp(132px, 30%, 200px); gap: 24px; align-items: start; }

.thumb { grid-column: 2; grid-row: 1; margin-top: 6px; }

.thumb img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; }

.entry time, .meta { color: var(--muted); font-size: 0.9375rem; }

.entry h3 { margin: 4px 0 8px; }

.entry h3 a { color: var(--ink); text-decoration-color: var(--rule); }

.entry h3 a:hover { text-decoration-color: currentColor; }

.entry p { margin: 0; color: var(--muted); }

.more { margin-top: 28px; }

.email { color: var(--ink); font-size: clamp(1.6rem, 4.4vw, 3.4rem); font-weight: 760; font-stretch: 78%; line-height: 1.1; letter-spacing: -0.02em; text-decoration-color: var(--led-on); text-decoration-thickness: 0.07em; text-underline-offset: 0.14em; overflow-wrap: anywhere; }

.email:hover { text-decoration-thickness: 0.12em; }

.foot { padding-block: 24px 40px; }

.foot p { margin: 0; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9375rem; }

.page-head, .post-head { padding-block: clamp(48px, 8vw, 96px) clamp(40px, 6vw, 64px); }

.post-head h1 { font-size: clamp(2.25rem, 5.2vw, 4rem); max-width: 18ch; }

.post-head .meta { margin: 20px 0 0; }

.cover { max-width: 66ch; margin: 0 0 clamp(36px, 5vw, 56px); font-size: 1.125rem; }

.cover img, .figure img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 10px; }

.post { padding-bottom: 24px; }

.prose { max-width: 66ch; font-size: 1.125rem; line-height: 1.7; }

.prose p { margin-bottom: 1.3em; }

.prose > p:first-child { font-size: 1.25rem; line-height: 1.6; }

.prose h2 { margin: 2.4em 0 0.7em; font-size: clamp(1.6rem, 2.6vw, 2rem); }

.figure { margin: 2.2em 0; }

.figure figcaption { margin-top: 12px; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }

.prose h3 { margin: 1.8em 0 0.5em; font-size: 1.3rem; }

.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.4em; }

.prose li + li { margin-top: 0.3em; }

.prose strong { font-weight: 700; }

.prose blockquote { margin: 1.5em 0; padding-left: 1.1em; border-left: 3px solid var(--led-off); color: var(--muted); }

.prose hr { margin: 2.5em 0; border: 0; border-top: 1px solid var(--rule); }

.prose img { max-width: 100%; height: auto; border-radius: 8px; }

.prose code { padding: 0.1em 0.35em; background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }

.prose pre { margin: 1.5em 0; padding: 16px 18px; overflow-x: auto; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; line-height: 1.5; }

.prose pre code { padding: 0; background: none; border: 0; }

.prose table { display: block; max-width: 100%; overflow-x: auto; margin: 1.5em 0; border-collapse: collapse; font-size: 1rem; }

.prose th, .prose td { padding: 8px 14px 8px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }

.comments { max-width: 66ch; font-size: 1.125rem; margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--rule); }

.comments h2 { margin-bottom: 24px; }

.back { padding-block: 40px 24px; }

@media (max-width: 560px) {
  .bar nav { order: 3; flex-basis: 100%; }
  .skills > div { display: block; }
  .has-thumb { grid-template-columns: 1fr; gap: 14px; }
  .thumb { grid-column: 1; margin-top: 0; }
}
