@font-face {
  font-family: 'SuisseIntlMono';
  src: url('/assets/fonts/SuisseIntlMono-Regular-WebS.woff2') format('woff2'),
       url('/assets/fonts/SuisseIntlMono-Regular-WebS.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── Variables ──────────────────────── */

:root {
  --bg:    #ffffff;
  --fg:    #000000;
  --muted: #7c7c7c;
  --faint: #b8b5b0;
}

/* ── Base ───────────────────────────── */

html {
  background: var(--bg);
  color: var(--fg);
  font-family: 'SuisseIntlMono', 'SFMono-Regular', 'Consolas', monospace;
  font-size: clamp(15px, 0.25vw + 13.4px, 16px);
  line-height: 1.7;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

body {
  padding: clamp(2rem, 8vw, 5rem) clamp(1.25rem, 5vw, 2.5rem);
}

@media (min-width: 640px) {
  body {
    padding-left: clamp(2.5rem, 10vw, 5rem);
    padding-right: clamp(2.5rem, 10vw, 5rem);
  }
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
}

em {
  font-style: italic;
}

p {
  margin-bottom: 1rem;
}

h1, h2, h3, h4 {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 1rem;
}

/* ── Image toggle ───────────────────── */

.img-toggle {
  display: none;
}

@media (min-width: 640px) {
  .img-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    color: var(--muted);
    padding: 0;
  }
}

.img-toggle__track {
  width: 2.5rem;
  height: 1.25rem;
  border: 1px solid var(--faint);
  border-radius: 0.625rem;
  position: relative;
}

.img-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(1.25rem - 8px);
  height: calc(1.25rem - 8px);
  background: var(--faint);
  border-radius: 50%;
  transition: transform 0.15s, background 0.15s;
}

.wide-images .img-toggle__track {
  border-color: var(--muted);
}

.wide-images .img-toggle__thumb {
  transform: translateX(1.25rem);
  background: var(--muted);
}

/* ── Site header ────────────────────── */

.site-header {
  max-width: 65ch;
  margin-bottom: 4.5rem;
}

.site-name {
  display: block;
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-bottom: 0.25rem;
}

.site-desc {
  color: var(--muted);
}

/* ── Entries ────────────────────────── */

.entries {
  display: flex;
  flex-direction: column;
  gap: calc(4 * 1.7rem);
}

.entry-meta {
  max-width: 65ch;
  color: var(--muted);
}

.tag {
  color: var(--muted);
  text-decoration: none;
}

.tag:hover {
  color: var(--fg);
}

.tag::before {
  content: ' · ';
  color: var(--faint);
}

.entry-title {
  max-width: 65ch;
  font-size: 1rem;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
  margin-bottom: calc(2 * 1.7rem);
}

.entry-title a {
  text-decoration: none;
}

.entry-body > * {
  max-width: 65ch;
}

.entry-body > figure {
  max-width: 65ch;
}

.wide-images .entry-body > figure {
  max-width: 108ch;
}

@media (max-width: 639px) {
  .entry-body > figure {
    max-width: 100%;
  }
}

.entry-body p + p {
  margin-top: 1rem;
}

.read-more {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}

.read-more:hover {
  color: var(--fg);
}

/* ── Figure ─────────────────────────── */

figure {
  margin: calc(2 * 1.7rem) 0;
  display: flex;
  flex-direction: column;
}

figure img {
  display: block;
  width: 100%;
  border-radius: 4px;
}

.img--double {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 600px) {
  .img--double {
    flex-direction: column;
  }
}

figure.bg--dark img {
  background-color: var(--fg);
  aspect-ratio: 3 / 2;
  object-fit: contain;
  padding-top: 1rem;
  padding-bottom: 1rem;
  box-sizing: border-box;
}

figure.bg--light img {
  background-color: var(--faint);
  aspect-ratio: 3 / 2;
  object-fit: contain;
  padding-top: 1rem;
  padding-bottom: 1rem;
  box-sizing: border-box;
}

figure.bg--dark-pad img {
  background-color: var(--fg);
  padding: 1rem;
  box-sizing: border-box;
}

figure.bg--light-pad img {
  background-color: var(--faint);
  padding: 1rem;
  box-sizing: border-box;
}

figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Footer ─────────────────────────── */

footer {
  max-width: 65ch;
  margin-top: calc(8 * 1.7rem);
  padding-top: calc(2 * 1.7rem);
  border-top: 1px solid var(--faint);
  color: var(--faint);
}

footer a {
  color: var(--muted);
}
