@font-face {
  font-family: 'Space Mono';
  src: url('/fonts/SpaceMono-Regular.woff2') format('woff2'),
       url('/fonts/SpaceMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  src: url('/fonts/SpaceMono-Bold.woff2') format('woff2'),
       url('/fonts/SpaceMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* =========================
   base/tokens
   ========================= */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root{
  --bg: #ffffff;
  --text: #111111;
  --muted: #5a5a5a;
  --link: #111111;
  --link-hover: #000000;
  --content-width: 760px;
  --side-pad: clamp(16px, 5vw, 64px);
  --row-gap: clamp(28px, 6vw, 56px);

  /* font stack */
  --mono-stack: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

body{
  font-family: var(--mono-stack);
  line-height: 1.6;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* defaults for posterity */
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

/* helper for screen-reader only text */
.visually-hidden{
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,1px,1px);
  white-space: nowrap; border: 0;
}

/* ========================= nav ========================= */
.site-nav{
  padding-block: 14px;
  margin: 50px;
}
.nav-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand{
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  color: var(--text);
}
.nav-links{
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a{
  color: var(--muted);
  text-decoration: none;
}
.nav-links a:hover,
.nav-links a:focus{
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ========================= hamburger (mobile) ========================= */
/* hide the checkbox */
.menu-toggle{ display: none; }

/* hamburger button */
.hamburger{
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

/* icon */
.hamburger-box{
  position: relative;
  width: 22px; height: 14px; display: inline-block;
}
.hamburger-line,
.hamburger-line::before,
.hamburger-line::after{
  position: absolute; left: 0; right: 0;
  height: 2px; background: currentColor; content: "";
  transition: transform .2s ease, opacity .2s ease;
}
.hamburger-line{ top: 6px; }
.hamburger-line::before{ top: -6px; }
.hamburger-line::after{ top: 6px; }

/* nav menu panel (off-canvas on small screens) */
.nav-menu{
  /* desktop default: inline */
}

/* when menu is open (checkbox checked) ---> animate icon into an “X” */
.menu-toggle:checked + .hamburger .hamburger-line{ transform: rotate(45deg); }
.menu-toggle:checked + .hamburger .hamburger-line::before{ transform: rotate(90deg) translateX(-6px); }
.menu-toggle:checked + .hamburger .hamburger-line::after{ opacity: 0; transform: translateY(6px); }

/* =========================
   layout
   ========================= */
.site-header,
.posts{
  max-width: var(--content-width);
  margin: 0 auto;
  padding-left: var(--side-pad);
  padding-right: var(--side-pad);
}

.site-header{
  padding-top: clamp(32px, 8vh, 96px);
  padding-bottom: clamp(8px, 2vh, 16px);
}

/* =========================
   typography
   ========================= */
h1{
  font-size: clamp(32px, 5.2vw, 48px);
  font-weight: 700;
  margin: 0 0 8px 0;
}

.tagline{
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 2.4vw, 20px);
  font-weight: 500;
  font-style: italic;
}

.tagline-body{
  margin: 0;
  color: var(--muted);
  font-size: clamp(10px, 2.2vw, 18px);
}

.site-header hr{
  margin-top: 16px;
  border: 0;
  border-top: 1px solid #e6e6e6;
}

/* =========================
   posts
   ========================= */
.posts{
  padding-top: clamp(8px, 2vh, 16px);
  padding-bottom: clamp(48px, 10vh, 128px);
}

.post{ margin-top: var(--row-gap); }

.post h2{
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 700;
  margin: 0 0 8px 0;
  text-transform: none;
}

.post .excerpt{
  margin: 0;
  color: var(--muted);
  max-width: 65ch;
}

/* =========================
   links & focus
   ========================= */
a{
  color: var(--link);
  text-decoration: none;
}
a:hover,
a:focus{
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--link-hover);
  outline: none;
}
a:focus-visible{
  outline: 2px dashed #888;
  outline-offset: 2px;
}

/* =========================
   small screens
   ========================= */
@media (max-width: 768px){
  /* show hamburger */
  .hamburger{ display: inline-flex; }
  .site-nav{ margin: clamp(12px, 4vw, 24px); }

  .nav-menu{
    position: fixed;
    top: 0; right: -100%;
    width: 80%; max-width: 320px; height: 100%;
    background: var(--bg);
    border-left: 1px solid #e6e6e6;
    box-shadow: -10px 0 30px rgba(0,0,0,.08);
    padding: 80px var(--side-pad) 24px;
    transition: right .25s ease-in-out;
    z-index: 999;
  }

  /* slide in when checked */
  .menu-toggle:checked ~ .nav-menu{ right: 0; }

  .nav-links{
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .nav-links a{ padding: 6px 2px; }

  .nav-inner{ gap: 10px; }
}

@media (max-width: 480px){
  body { font-size: 17px; }
  .nav-links { gap: 18px; }
}