/* Inter — self-hosted */
@font-face {
  font-display: optional;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  src: url('assets/inter-400.woff2') format('woff2');
}
@font-face {
  font-display: optional;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  src: url('assets/inter-500.woff2') format('woff2');
}
@font-face {
  font-display: optional;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  src: url('assets/inter-600.woff2') format('woff2');
}

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

/* === Custom Properties === */
:root {
  color-scheme: light dark;
  --bg: #fff;
  --text: #000;
  --text-dim: #999;
  --link: #000;
  --code-bg: #f4f4f2;
  /* Legacy vars used by interactive post components */
  --lesslight: #ddd;
  --dark: #000;
  --moredark: #000;
}

/* === Base === */
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--text);
  background: var(--bg);
  padding: 0 2em 6em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: inherit;
  font-weight: 500;
  font-size: 1em;
  line-height: 1.5;
  letter-spacing: inherit;
}

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

a {
  color: var(--link);
  text-decoration: none;
  transition: opacity 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.tagline a,
.post-content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: currentColor;
}

/* Reference behaviour: any link (and each post row) dims to 50% on hover */
a:hover { opacity: 0.5; }

strong { font-weight: 600; }

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.6em 0;
}

video {
  width: 100%;
  height: auto;
  display: block;
  margin: 1.6em 0;
  border: 1px solid #ededed;
}

figure {
  margin: 1.6em 0;
}
figure img {
  margin: 0;
  border: 1px solid #ededed;
}
figcaption {
  margin-top: 0.6em;
  color: var(--text-dim);
}

blockquote {
  border-left: 2px solid currentColor;
  padding-left: 1.1em;
  margin: 1.6em 0;
  opacity: 0.5;
}

hr {
  border: none;
  border-top: 1px solid #ededed;
  margin: 2.4em 0;
}

ol, ul {
  padding-left: 1.3em;
  margin-bottom: 1.5em;
}

li { margin-bottom: 0.3em; }

::selection {
  background: var(--text);
  color: var(--bg);
}

/* === Header: triangle logo + Contact === */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2em 0;
}

.logo {
  display: inline-block;
  line-height: 0;
  color: var(--text);
}
.logo svg { display: block; }

.contact-link { color: var(--text); }

/* === Homepage: Intro === */
.intro {
  padding: 2em 0;
  max-width: 26em;
}

.intro h1 { color: var(--text); font-size: 1.35rem; font-weight: 600; }
.intro .role { opacity: 0.5; }
.intro .tagline { color: var(--text); margin-top: 2em; margin-bottom: 0; }

/* === Homepage: Posts === */
.posts {
  padding: 2em 0;
}

.post-row {
  display: block;
  width: fit-content;
  margin-bottom: 1.5em;
  color: var(--text);
}
.post-row:last-child { margin-bottom: 0; }

.post-title { display: block; }

.post-row time {
  display: block;
  opacity: 0.5;
}

/* === Single Post === */
.post-header {
  padding-top: 2em;
  margin-bottom: 4em;
  max-width: 34em;
}

.post-header h1 { color: var(--text); font-size: 1.35rem; font-weight: 600; }

.post-header time {
  display: block;
  opacity: 0.5;
}

.post-content {
  color: var(--text);
  max-width: 40em;
}

/* Headings within post body (markdown ##, ###) */
.post-content h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
}

.post-content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-top: 1.6em;
  margin-bottom: 0.35em;
}

.post-content h4,
.post-content h5,
.post-content h6 {
  font-weight: 600;
  margin-top: 1.4em;
  margin-bottom: 0.3em;
}

.discuss {
  margin-top: 2.5em;
  opacity: 0.5;
}

.video-embed {
  margin: 1.6em 0;
  aspect-ratio: 16 / 9;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* === Code === */
pre {
  background: var(--code-bg);
  padding: 1.1em 1.3em;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.6em 0;
  font-size: 0.85rem;
  line-height: 1.6;
  letter-spacing: 0;
}

code {
  font-family: 'SF Mono', 'JetBrains Mono', 'Fira Mono', ui-monospace, monospace;
  font-size: 0.85em;
  letter-spacing: 0;
  background: var(--code-bg);
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* === Syntax highlighting: Atom One Light === */
.hljs { color: #383a42; }
.hljs-comment, .hljs-quote { color: #a0a1a7; font-style: italic; }
.hljs-doctag, .hljs-keyword, .hljs-formula { color: #a626a4; }
.hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst { color: #e45649; }
.hljs-literal { color: #0184bb; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta .hljs-string { color: #50a14f; }
.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class,
.hljs-selector-attr, .hljs-selector-pseudo, .hljs-number { color: #986801; }
.hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title { color: #4078f2; }
.hljs-built_in, .hljs-title.class_, .hljs-class .hljs-title { color: #c18401; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: bold; }
.hljs-link { text-decoration: underline; }

/* === Dark Mode === */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --text: #fff;
    --text-dim: #777;
    --link: #fff;
    --code-bg: #161616;
    --lesslight: #333;
    --dark: #fff;
    --moredark: #fff;
  }

  .tagline a, .post-content a { text-decoration-color: #444; }
  blockquote { border-left-color: #333; }
  hr { border-top-color: #222; }
  figure img { border-color: #222; }
  video { border-color: #222; }

  /* Atom One Dark */
  .hljs { color: #abb2bf; background: var(--code-bg); }
  .hljs-comment, .hljs-quote { color: #5c6370; font-style: italic; }
  .hljs-doctag, .hljs-keyword, .hljs-formula { color: #c678dd; }
  .hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst { color: #e06c75; }
  .hljs-literal { color: #56b6c2; }
  .hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta .hljs-string { color: #98c379; }
  .hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class,
  .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number { color: #d19a66; }
  .hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title { color: #61aeee; }
  .hljs-built_in, .hljs-title.class_, .hljs-class .hljs-title { color: #e6c07b; }
  .hljs-emphasis { font-style: italic; }
  .hljs-strong { font-weight: bold; }
  .hljs-link { text-decoration: underline; }
}

/* === Responsive === */
@media (max-width: 600px) {
  body { padding: 0 24px 4em; }
  .intro { padding-top: 48px; }
  .post-header { padding-top: 48px; }
}

/* === Legacy component styles (used by interactive posts) === */
.seq {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.seq > * {
  margin: 5px 0;
}
@media (max-width: 600px) {
  .seq { flex-direction: column; }
}

button, input[type=submit] {
  display: inline-block;
  background-color: var(--dark);
  color: var(--bg);
  text-align: center;
  padding: .5em 1em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9em;
}

button:hover, input[type=submit]:hover {
  opacity: 0.85;
}

/* === Print === */
@media print {
  .site-header { display: none; }
  body { max-width: 100%; }
}
