/* Switzer (Fontshare / ITF license) — Regular for body, Medium for titles,
   Italic for emphasis, Semibold available for strong accents */
@font-face {
  font-family: "Switzer";
  src: url("/assets/fonts/Switzer-Regular.woff2") format("woff2"),
       url("/assets/fonts/Switzer-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Switzer";
  src: url("/assets/fonts/Switzer-Italic.woff2") format("woff2"),
       url("/assets/fonts/Switzer-Italic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Switzer";
  src: url("/assets/fonts/Switzer-Medium.woff2") format("woff2"),
       url("/assets/fonts/Switzer-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Switzer";
  src: url("/assets/fonts/Switzer-Semibold.woff2") format("woff2"),
       url("/assets/fonts/Switzer-Semibold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --bg: #fafafa;
  --text: #333333;
  --muted: #828286;
  --max-w: 640px;
  --pad-x: 20px;
  --font: "Switzer", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  /* Fluid type — sizes interpolate with the viewport between 320px and
     680px (where the 640px column maxes out), then lock. Same idea as the
     Utopia-style scale on the eleventy site, condensed into clamp(). */
  --size: clamp(18px, calc(18px + (100vw - 320px) / 180), 20px);      /* 18 → 20 */
  --size-h1: clamp(30px, calc(30px + (100vw - 320px) / 36), 40px);    /* 30 → 40 */
  --size-h2: clamp(22px, calc(22px + (100vw - 320px) / 72), 27px);    /* 22 → 27 */
  --line: 1.75;

  /* Spacing scale — 4px base. Every vertical gap uses one of these. */
  --space-1: 4px;   /* micro: title → date */
  --space-2: 8px;   /* related lines: subnav items */
  --space-3: 12px;  /* image → its caption/title */
  --space-6: 24px;  /* cover → title */
  --space-8: 32px;  /* section gap: feed images, date → body, title → body */
  --space-10: 40px; /* header → content, under back link */
  --space-12: 48px; /* between notes in the list */
  --space-16: 64px; /* major break: → read on, → footer, page top */
  --space-20: 80px; /* page bottom */

  --pad-top: var(--space-16);
}

/* Hide scrollbars (scrolling still works) so the layout is always
   perfectly centered and never shifts between short and long pages */
html::-webkit-scrollbar {
  display: none;
}

html {
  scrollbar-width: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--size);
  font-weight: 400;
  line-height: var(--line);
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--text);
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--pad-top) var(--pad-x) var(--space-20);
}

/* ── Header ── */

header {
  margin-bottom: var(--space-10);
}

.tagline {
  margin-bottom: var(--space-8);
  text-wrap: pretty;
}

nav {
  display: flex;
  gap: 28px;
}

nav a {
  text-decoration: none;
}

nav a:hover {
  opacity: 0.6;
}

/* ── Notes list ── */

.notes-list {
  list-style: none;
}

.notes-list li {
  margin-bottom: var(--space-12);
}

.notes-list a {
  display: block;
  text-decoration: none;
}

.notes-list a:hover .note-img {
  opacity: 0.9;
}

.note-img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.15s;
}

.note-title-text {
  display: block;
  margin-top: var(--space-3);
  text-wrap: balance;
}

/* ── Note detail ── */

.back-link {
  display: inline-block;
  margin-bottom: var(--space-10);
  text-decoration: none;
}

.back-link:hover {
  opacity: 0.6;
}

.note-cover {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: var(--space-6);
}

.note-title {
  font-size: var(--size-h1);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: var(--space-2);
  text-wrap: balance;
}

/* Pages without a date under the title (About subpages, generic pages):
   give the body the same breathing room the date row provides on notes */
.note-title + .note-body {
  margin-top: var(--space-8);
}

.note-date {
  display: block;
  color: var(--muted);
  margin-bottom: var(--space-8);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.note-body {
  max-width: 100%;
}

.note-body p {
  margin-bottom: 1.2em;
  text-wrap: pretty;
}

.note-body h2,
.note-body h3 {
  font-weight: 500;
  line-height: 1.2;
  margin: 1.8em 0 0.5em;
  text-wrap: balance;
}

.note-body h2 {
  font-size: var(--size-h2);
}

.note-body h3 {
  font-size: var(--size);
}

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

.note-body ul,
.note-body ol {
  margin-bottom: 1.2em;
  padding-left: 1.2em;
}

.note-body li {
  text-wrap: pretty;
}

/* ── Note next ── */

.note-next {
  display: block;
  margin-top: var(--space-16);
  text-decoration: none;
}

.note-next:hover .note-next-title {
  opacity: 0.6;
}

.note-next-label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.note-next-title {
  display: block;
  margin-bottom: var(--space-1);
  transition: opacity 0.15s;
  text-wrap: balance;
}

.note-next-date {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ── Note CTA ── */

.note-cta {
  margin-top: var(--space-16);
}

.note-cta p {
  margin-bottom: 0.5em;
  text-wrap: pretty;
}

.note-cta p:first-child {
  font-weight: 500;
  margin-bottom: 0.5em;
}

/* Same style as the main navigation */
.note-cta a {
  display: inline-block;
  text-decoration: none;
}

.note-cta a:hover {
  opacity: 0.6;
}

/* ── Projects feed ── */

.projects-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.projects-feed img {
  display: block;
  width: 100%;
  height: auto;
}

/* ── About ── */

.about-body p {
  margin-bottom: 1.2em;
}

.about-subnav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-8);
}

/* Same style as the main navigation */
.about-subnav a,
.about-body a {
  text-decoration: none;
}

.about-body a:hover {
  opacity: 0.6;
}

.about-subnav a:hover {
  opacity: 0.6;
}

/* ── Site footer ── */

.site-footer {
  margin-top: var(--space-16);
}

/* Nav layout, but in the size and colour of the dates */
.footer-nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
}

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

.footer-nav a:hover {
  opacity: 0.6;
}

/* ── Mobile ── */

@media (max-width: 600px) {
  :root {
    --pad-top: var(--space-10);
    --pad-x: 16px;
  }

  .container {
    padding-bottom: var(--space-16);
  }

  nav {
    gap: 24px;
  }
}
