@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

@font-face {
  font-family: "PixelFont14";
  src: url("/fonts/PixelFontNewYork14.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "PixelFont18";
  src: url("/fonts/PixelFontNewYork18.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "PixelFont20";
  src: url("/fonts/PixelFontNewYork20.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "PixelFont25";
  src: url("/fonts/PixelFontNewYork25.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "PixelFont31";
  src: url("/fonts/PixelFontNewYork31.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "PixelFont47";
  src: url("/fonts/PixelFontNewYork47.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "SelectricCentury";
  src: url("/fonts/SelectricCentury-09Medium.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Triplicate Code";
  src: url("/fonts/Triplicate B Code Regular.otf") format("opentype");
  font-display: swap;
}


/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --font-family-default: "Inter", sans-serif;
  --font-family-code:    "JetBrains Mono", monospace;

  --font-weight-regular:  400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;

  --font-size-tiny:     0.75rem;
  --font-size-small:    0.9rem;
  --font-size-regular:  1rem;
  --font-size-medium:   1.125rem;
  --font-size-large:    1.5rem;
  --font-size-x-large:  2rem;
  --font-size-xx-large: 3rem;

  --hue: 125;

  /* backgrounds */
  --color-bg-default:   oklch(0.99 0.013 var(--hue));
  --color-bg-highlight: oklch(0.957 0.021 var(--hue));

  /* foregrounds */
  --color-fg-contrast:     oklch(0.25 0.107 var(--hue));
  --color-fg-low-contrast: oklch(0.20 0.102 var(--hue));
  --color-fg-dim:          oklch(0.480 0.051 var(--hue));
  --color-fg-emphasized:   oklch(0.622 0.207 var(--hue));

  /* fills */
  --color-fill-secondary: oklch(0.622 0.207 var(--hue));
  --color-fill-separator: oklch(0.96 0.02 var(--hue));
  --color-fill-ghost:     oklch(0.946 0.027 var(--hue));

  /* borders */
  --color-border-hint:    oklch(0.903 0.049 var(--hue));
  --color-border-focus:   oklch(0.674 0.176 var(--hue));
  --color-border-default: var(--color-fg-dim);

  /* text selection */
  --color-yellow: oklch(0.979 0.119 108.4 / 0.5);
}

::selection {
  background-color: var(--color-yellow);
}


/* ── Reset ─────────────────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}

html {
  font-family: var(--font-family-default);
  font-feature-settings: "zero";
  font-size: 16px;
  font-weight: var(--font-weight-regular);
  line-height: 1.6;
  color: var(--color-fg-contrast);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 600px) {
  html { font-size: 14px; }
}

body {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  background-color: var(--color-bg-default);
  display: flex;
  flex-direction: column;
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ── Header ────────────────────────────────────────────────────────────────── */
header {
  width: 100%;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color-bg-default);
}

header a {
  display: flex;
  align-items: center;
}

.title {
  align-items: stretch;
  justify-self: start;
}

.title img {
  width: 1.75rem;
  height: 1.75rem;
}

.title span {
  color: var(--color-fg-dim);
  margin-left: 0.5rem;
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
}

.title:hover span {
  color: var(--color-fg-emphasized);
}


/* ── Layout ─────────────────────────────────────────────────────────────────── */
main,
footer {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

main {
  flex: 1;
  padding-top: 0;
  padding-bottom: 8rem;
}

footer {
  max-width: 100%;
  padding-bottom: 3rem;
  color: var(--color-fg-dim);
  font-weight: 300;
  font-family: var(--font-family-code);
}

footer p {
  width: 100%;
  display: flex;
  font-size: var(--font-size-tiny);
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0 0;
  gap: 0.75rem;
}

footer a {
  font-size: var(--font-size-tiny);
  color: var(--color-fg-dim);
  border-bottom: none !important;
}

footer a:hover {
  color: var(--color-fg-emphasized);
}

@media (max-width: 600px) {
  main, footer, header {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}


/* ── Headings ──────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-family-default);
}

h1 {
  font-size: var(--font-size-x-large);
  font-weight: var(--font-weight-semibold);
  margin: 4rem 0 0.5rem;
  line-height: 1.25;
  font-family: "PixelFont18", monospace;
}

h2 {
  font-size: var(--font-size-large);
  font-weight: var(--font-weight-semibold);
  margin: 3.75rem 0 0.5rem;
}

h3 {
  font-size: var(--font-size-large);
  font-weight: var(--font-weight-semibold);
  margin: 2rem 0 1.5rem;
}

h4 {
  font-size: var(--font-size-medium);
  font-weight: var(--font-weight-semibold);
  margin: 1.5rem 0 1rem;
}

h5 {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  margin: 1rem 0 0.25rem;
}


/* ── Body text ─────────────────────────────────────────────────────────────── */
strong {
  font-weight: 600;
}

a {
  color: unset;
  text-decoration: unset;
}

li a,
p a {
  border-bottom: 1px solid var(--color-fg-dim);
}

p a:hover {
  border-bottom-color: var(--color-fg-contrast);
}

p, ol, ul, table, pre {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

ol, ul {
  padding-left: 2rem;
}

li {
  padding-left: 0.5rem;
}


/* ── Code ──────────────────────────────────────────────────────────────────── */
pre,
code {
  line-height: 1.5;
  color: var(--color-fg-low-contrast);
  font-family: var(--font-family-code);
}

pre {
  background-color: var(--color-fill-separator) !important;
  overflow-x: auto;
  font-size: 0.875rem;
  border-radius: 4px;
  padding: 1rem;
  margin: 0 0 1rem;
}

pre code {
  background: none !important;
  padding: 0;
}

p code,
ul code,
ol code,
aside code {
  padding: 1px 4px;
  border-radius: 2px;
  word-spacing: -2px;
  background-color: var(--color-fill-separator);
}

p code    { font-weight: 400; }
strong code { font-weight: 600 !important; }
aside code  { font-weight: normal; color: var(--color-fg-dim); }

code[data-name]::before {
  content: attr(data-name);
  display: block;
  font-family: var(--font-family-code);
  font-size: var(--font-size-tiny);
  color: var(--color-fg-dim);
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-fill-separator);
}


/* ── Blockquote ────────────────────────────────────────────────────────────── */
blockquote {
  color: var(--color-fg-low-contrast);
  background: var(--color-bg-highlight);
  padding: 1rem;
  margin: 1rem 0;
  border-left: 2px solid var(--color-border-focus);
}

p + blockquote { margin-top: 1rem; }
blockquote + p { margin-top: 1rem; }

blockquote pre {
  background-color: var(--color-fill-separator);
}


/* ── Table ─────────────────────────────────────────────────────────────────── */
table {
  font-size: 0.875rem;
  border-collapse: collapse;
  background-color: var(--color-bg-highlight);
  width: 100%;
}

table td {
  vertical-align: top;
  padding: 0.5rem;
}

table td:first-child {
  white-space: nowrap;
  padding-right: 1rem;
}

table th {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-regular);
  background-color: var(--color-fill-separator);
  padding: 0.5rem;
  text-align: left;
}

table tr {
  border-bottom: 1px solid var(--color-fill-separator);
}

table tr:last-child {
  border-bottom: none;
}

table code {
  font-weight: normal;
}


/* ── HR ────────────────────────────────────────────────────────────────────── */
hr {
  width: 100%;
  border: none;
  border-top: 1px solid var(--color-fill-separator);
  margin: 0;
}


/* ── Images / figures ──────────────────────────────────────────────────────── */
main figure,
main img {
  margin: 1rem 0 2rem 0;
}

main img,
main object {
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  max-width: 100%;
}

figure {
  width: 100%;
}

figure pre { margin: 0; }

li pre {
  margin-top: 1rem;
  margin-right: 1rem;
  padding: 0.75rem;
}

figure img,
figure object {
  display: block;
  margin: 0 auto;
}

figure object + figcaption {
  margin-top: 1rem;
}

figcaption,
aside {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--color-fg-dim);
}

figcaption {
  margin-top: 0.5rem;
  width: 100%;
  white-space: nowrap;
  overflow-x: hidden;
  text-align: center;
  text-overflow: ellipsis;
}


/* ── Aside ─────────────────────────────────────────────────────────────────── */
aside {
  display: none;
}

aside p      { margin-bottom: 1em; }
aside.span-2 { grid-row: span 2; }
aside.span-3 { grid-row: span 3; }
aside.span-4 { grid-row: span 4; }
aside.span-5 { grid-row: span 5; }

aside a {
  text-decoration: none !important;
  border-bottom: 1px dotted var(--color-fg-dim);
}

aside.kicker  { grid-column: kicker; }
aside.diagram { margin-top: 1.5rem; }


/* ── Post meta ─────────────────────────────────────────────────────────────── */
.first {
  margin-top: 60px;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--color-fg-dim);
  margin: 0;
}

.author {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  text-align: right;
  margin: 0 0 3rem;
  color: var(--color-fg-dim);
  font-size: var(--font-size-tiny);
  font-family: var(--font-family-code);
}

.author a {
  text-decoration: none !important;
  border-bottom: none !important;
}

.post-tags {
  margin-left: 0.4rem;
  font-family: var(--font-family-code);
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: baseline;
}

.post-tags a {
  font-size: 0.7rem;
  color: var(--color-fg-emphasized);
  background-color: oklch(from var(--color-fg-emphasized) l c h / 0.08);
  border: 1px solid oklch(from var(--color-fg-emphasized) l c h / 0.18) !important;
  border-radius: 2px;
  padding: 0.15rem 0.4rem;
  letter-spacing: 0.02em;
}

.post-tags a:hover {
  background-color: oklch(from var(--color-fg-emphasized) l c h / 0.15);
  color: var(--color-fg-emphasized);
}


/* ── Table of contents ─────────────────────────────────────────────────────── */
.toc {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem !important;
  margin: 2rem 0 3rem 0;
  padding: 0;
  max-height: 18rem;
}

.toc + hr {
  margin-bottom: 3rem;
}

.toc a {
  border-bottom-width: 1px;
  border-bottom-style: none;
}

.toc a:hover {
  border-bottom-style: solid;
}

.toc code {
  font-size: 0.75rem;
}

.toc li,
.toc ul {
  padding: 0;
  margin: 0;
  list-style-type: none;
}

.toc-h2 > a  { font-weight: bold !important; }
.toc-h2 > ul { margin-left: 0.5rem; }
.toc-h3 > ul { margin-left: 1rem; }
.toc-h3 > a,
.toc-h4 > a,
.toc-h5 > a  { color: var(--color-fg-dim); }


/* ── Landing page ──────────────────────────────────────────────────────────── */
.home-intro {
  margin-top: 60px;
  margin-bottom: 3rem;
}

.home-name {
  font-size: var(--font-size-x-large);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 0.5rem;
  line-height: 1.2;
  font-family: "PixelFont18", monospace;
}

.home-content {
  font-size: var(--font-size-small);
  color: var(--color-fg-low-contrast);
  margin-top: 0.75rem;
}

.home-content p {
  margin: 0;
}

/* CTA link */
.home-content a {
  font-weight: var(--font-weight-medium);
  color: var(--color-fg-emphasized);
  border-bottom: 1px solid oklch(0.622 0.207 var(--hue) / 0.35);
}

.home-content a:hover {
  border-bottom-color: var(--color-fg-emphasized);
}

/* Icon links */
.home-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}

.home-links a {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: var(--color-fg-dim);
  transition: background-color 0.15s;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.home-links a:hover {
  background-color: var(--color-fg-contrast);
}

.home-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-bottom: 1rem;
}


/* ── Post list ─────────────────────────────────────────────────────────────── */
.post-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-fill-separator);
}

.post-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-fill-separator);
}

.post-row-title {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-light);
  color: var(--color-fg-contrast);
  border-bottom: none;
  font-family: var(--font-family-code);
}

.post-row-title:hover {
  color: var(--color-fg-emphasized);
}

.post-row-date {
  font-family: var(--font-family-code);
  font-size: var(--font-size-tiny);
  color: var(--color-fg-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.post-row-tags {
  font-family: var(--font-family-code);
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: baseline;
  flex-shrink: 0;
}

.post-row-tags a {
  font-size: 0.65rem;
  color: var(--color-fg-emphasized);
  background-color: oklch(from var(--color-fg-emphasized) l c h / 0.08);
  border: 1px solid oklch(from var(--color-fg-emphasized) l c h / 0.18) !important;
  border-radius: 2px;
  padding: 0.1rem 0.35rem;
  letter-spacing: 0.02em;
}

.post-row-tags a:hover {
  background-color: oklch(from var(--color-fg-emphasized) l c h / 0.15);
  color: var(--color-fg-emphasized);
}

.post-row-more .post-row-title {
  color: var(--color-fg-dim);
}

.post-row-more .post-row-title:hover {
  color: var(--color-fg-emphasized);
}


/* ── Utilities ─────────────────────────────────────────────────────────────── */
span.highlight           { color: var(--color-fg-emphasized); }
span.highlight-secondary { color: #229944; }

.banner {
  border-radius: 4px;
  width: 100%;
}

.hue-dice {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: oklch(0.622 0.207 var(--hue));
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s;
}

.hue-dice:hover {
  transform: scale(1.4);
}

mark {
  background: oklch(0.99 0.18 var(--hue) / 0.8);
  color: var(--color-fg-contrast);
  padding: 0 0.2em;
  border-radius: 2px;
}


/* ── Timeline ──────────────────────────────────────────────────────────────── */
.timeline-section h2 {
  margin-bottom: 0.75rem;
}

.timeline {
  position: relative;
  padding-left: 88px;
  margin-top: 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--color-fill-separator);
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 0 16px;
  padding-bottom: 1.75rem;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item::before {
  content: '';
  position: absolute;
  left: -81px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--color-fg-dim);
  background: var(--color-bg-default);
  box-sizing: border-box;
  transform: translateX(-3px);
}

.tl-item.active::before {
  border-color: oklch(0.622 0.207 var(--hue));
  background: oklch(0.622 0.207 var(--hue));
  width: 8px;
  height: 8px;
  top: 5.5px;
  transform: translateX(-3.5px);
}

.tl-date {
  font-family: var(--font-family-code);
  font-size: var(--font-size-tiny);
  color: var(--color-fg-dim);
  white-space: nowrap;
  padding-top: 0.15rem;
  line-height: 1.4;
  text-align: right;
}

.tl-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.tl-company {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-fg-contrast);
  font-family: var(--font-family-code);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem;
  line-height: 1.4;
}

.tl-sep {
  color: var(--color-fg-dim);
  font-size: var(--font-size-tiny);
  font-weight: var(--font-weight-regular);
}

.tl-role {
  font-size: var(--font-size-tiny);
  font-weight: var(--font-weight-regular);
  color: var(--color-fg-dim);
  font-family: var(--font-family-code);
}

.tl-location {
  font-size: var(--font-size-tiny);
  color: var(--color-fg-dim);
  font-family: var(--font-family-code);
  margin-left: auto;
}

.tl-desc {
  font-size: var(--font-size-small);
  color: var(--color-fg-dim);
  margin: 0.15rem 0 0;
  line-height: 1.55;
}

.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.tl-tags span {
  font-family: var(--font-family-code);
  font-size: 0.7rem;
  color: var(--color-fg-emphasized);
  background-color: oklch(from var(--color-fg-emphasized) l c h / 0.08);
  border: 1px solid oklch(from var(--color-fg-emphasized) l c h / 0.18);
  border-radius: 2px;
  padding: 0.05rem 0.4rem;
  letter-spacing: 0.02em;
}

@media (max-width: 500px) {
  .timeline {
    padding-left: 48px;
  }

  .tl-item {
    grid-template-columns: 36px 1fr;
  }

  .tl-item::before {
    left: -41px;
  }

  .tl-location {
    margin-left: 0;
  }
}
