/* ------------------------------------------------------------------
   nothl.ing — landing page styles
   ------------------------------------------------------------------ */

/* Self-hosted variable fonts (latin subsets). Newsreader is only used for
   italic <em>, so the browser skips it unless one is on the page. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/inter-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Fallback faces with metrics matched to Inter / Newsreader so the
   page doesn't shift if the web fonts are late. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22.5%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Newsreader Fallback";
  src: local("Georgia");
  size-adjust: 96%;
  ascent-override: 96%;
  descent-override: 28%;
  line-gap-override: 0%;
}

:root {
  --body-bg: #fdfdfc;
  --body-color: #111;
  --muted: rgba(0, 0, 0, 0.54); /* brief said .4; .54 is the minimum that passes WCAG AA (4.59:1) */
  --rule: #f2f2f2;
  --rule-strong: #ededed;
  --link-underline: #d9d9d9;
  --link-underline-hover: #666;
  --accent: #d90090; /* brief said rgb(255,0,170); darkened to pass WCAG AA (4.74:1) */
  --font-primary: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-secondary: "Newsreader", "Newsreader Fallback", Georgia, serif;
  --spacing-xxs: 0.5rem;
  --spacing-xs: 1rem;
  --spacing-sm: 1.5rem;
  --spacing-md: 2rem;
  --spacing-lg: 2.5rem;
  --spacing-xl: 3rem;
  --spacing-xxl: 3.5rem;
  --gutter: 6.75rem; /* year-label gutter in the writing list */
}

/* ---- Reset (minireset-style) ------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body,
p,
ol,
ul,
li,
dl,
dt,
dd,
blockquote,
figure,
fieldset,
legend,
textarea,
pre,
iframe,
hr,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  padding: 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: 100%;
  font-weight: 400;
}
ul {
  list-style: none;
}
button,
input,
select,
textarea {
  margin: 0;
}
img,
video {
  height: auto;
  max-width: 100%;
}
iframe {
  border: 0;
}

/* ---- Global ----------------------------------------------------- */
html {
  background: var(--body-bg);
  color: var(--body-color);
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-primary);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: scroll;
  text-rendering: optimizeLegibility;
}
a {
  color: inherit;
  text-decoration: none;
}
::selection {
  background: var(--rule-strong);
  color: #111;
}
:focus-visible {
  outline: 2px solid rgba(0, 122, 255, 0.5);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Thin scrollbar: transparent thumb until hover */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}
:hover::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.15);
}
@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
  }
}

/* ---- Top fade --------------------------------------------------- */
.top-fade {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 8rem;
  z-index: 9;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(253, 253, 252, 1) 0%,
    rgba(253, 253, 252, 0.987) 8.1%,
    rgba(253, 253, 252, 0.951) 15.5%,
    rgba(253, 253, 252, 0.896) 22.5%,
    rgba(253, 253, 252, 0.825) 29%,
    rgba(253, 253, 252, 0.741) 35.3%,
    rgba(253, 253, 252, 0.648) 41.2%,
    rgba(253, 253, 252, 0.55) 47.1%,
    rgba(253, 253, 252, 0.45) 52.9%,
    rgba(253, 253, 252, 0.352) 58.8%,
    rgba(253, 253, 252, 0.259) 64.7%,
    rgba(253, 253, 252, 0.175) 71%,
    rgba(253, 253, 252, 0.104) 77.5%,
    rgba(253, 253, 252, 0.049) 84.5%,
    rgba(253, 253, 252, 0.013) 91.9%,
    rgba(253, 253, 252, 0) 100%
  );
}
@media (max-width: 768px) {
  .top-fade {
    height: 2.5rem;
  }
}

/* ---- Container -------------------------------------------------- */
.container {
  max-width: 36.375rem;
  margin: 0 auto;
  padding: 5rem 1rem 2.5rem;
}
@media (max-width: 768px) {
  .container {
    padding: 2rem 1.5rem 2.5rem;
  }
}

/* ---- Article ---------------------------------------------------- */
.article > header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.5rem;
}
.article > header .avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  background: var(--rule-strong);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.article > header h1 {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.00563rem;
  color: #111;
}
.article > header .back {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 460;
  color: var(--muted);
  padding-bottom: 0.75rem;
}
.article > header time {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 460;
  color: var(--muted);
}
.article > p {
  padding-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 460;
  letter-spacing: -0.00563rem;
}
.article strong {
  font-weight: 600;
}
.article em {
  font-family: var(--font-secondary);
  font-style: italic;
  font-size: 0.9375rem;
  font-weight: 430;
  letter-spacing: 0.01rem;
  color: #000;
}

/* ---- Inline links ----------------------------------------------- */
.basic-link {
  position: relative;
  display: inline;
  color: inherit;
  transition: all 0.2s ease;
}
.basic-link::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  border-radius: 2px;
  background: var(--link-underline);
  transition: background 0.2s ease;
}
.basic-link:hover::before {
  background: var(--link-underline-hover);
}

/* ---- Writing list ----------------------------------------------- */
.post-list {
  padding-top: 3rem;
}
.post-list-title {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 460;
  color: var(--muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.post-list > ul {
  display: flex;
  flex-direction: column;
}
.post-group {
  border-bottom: 1px solid var(--rule);
}
.post-group:last-child {
  border-bottom: none;
}
.post-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.735rem 0 0.735rem var(--gutter);
}
.post-row::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: var(--gutter);
  right: 0;
  border-bottom: 1px solid var(--rule);
}
.post-group li:last-child .post-row::after {
  display: none;
}
.post-row h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  line-height: 1.2;
  font-weight: 460;
  color: #111;
  letter-spacing: -0.00563rem;
}
.post-row time {
  display: contents;
  font-size: 0.875rem;
  line-height: 1.2;
  font-weight: 460;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.post-row .post-year {
  position: absolute;
  left: 0;
  top: 0.735rem;
  visibility: hidden;
}
.post-group li:first-child .post-year {
  visibility: visible;
}
.post-row .post-sep {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.post-row .post-day {
  flex-shrink: 0;
}
.post-badge {
  margin-left: 0.5rem;
  color: var(--accent);
}
@media (max-width: 520px) {
  :root {
    --gutter: 3rem;
  }
}

/* Hover: dim every row, restore the hovered one. Year labels stay put. */
@media (min-width: 520px) and (hover: hover) {
  .post-row h3,
  .post-row .post-day {
    transition: opacity 0.14s ease;
  }
  .post-list > ul:hover .post-row h3,
  .post-list > ul:hover .post-row .post-day {
    opacity: 0.3;
  }
  .post-list > ul:hover .post-row:hover h2,
  .post-list > ul:hover .post-row:hover .post-day {
    opacity: 1;
  }
}

/* ---- Footer ----------------------------------------------------- */
.site-footer {
  padding: 2.5rem 0 5rem;
}
.site-footer::before {
  content: "";
  display: block;
  height: 1px;
  width: 3.125rem;
  background: var(--rule-strong);
  margin-bottom: 2.375rem;
}
.site-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-footer .clock {
  font-size: 0.8125rem;
  line-height: 1.25rem;
  font-weight: 460;
  letter-spacing: -0.0025rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.site-footer .clock.is-ready {
  opacity: 1;
}
.site-mark {
  display: inline-flex;
  width: 32px;
  height: 32px;
  color: rgba(0, 0, 0, 0.3);
  transition: color 0.2s ease;
}
.site-mark:hover {
  color: #111;
}
.site-mark svg {
  width: 100%;
  height: 100%;
}

/* ---- First-visit stagger ---------------------------------------- */
@keyframes staggerIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html:not(.home-visited) .article > *,
  html:not(.home-visited) .post-list,
  html:not(.home-visited) .site-footer {
    animation: staggerIn 0.5s ease both;
  }
  html:not(.home-visited) .article > :nth-child(1) { animation-delay: 0s; }
  html:not(.home-visited) .article > :nth-child(2) { animation-delay: 0.05s; }
  html:not(.home-visited) .article > :nth-child(3) { animation-delay: 0.1s; }
  html:not(.home-visited) .article > :nth-child(4) { animation-delay: 0.15s; }
  html:not(.home-visited) .article > :nth-child(5) { animation-delay: 0.2s; }
  html:not(.home-visited) .article > :nth-child(6) { animation-delay: 0.25s; }
  html:not(.home-visited) .article > :nth-child(7) { animation-delay: 0.3s; }
  html:not(.home-visited) .article > :nth-child(8) { animation-delay: 0.35s; }
  html:not(.home-visited) .article > :nth-child(n + 9) { animation-delay: 0.4s; }
  html:not(.home-visited) .post-list { animation-delay: 0.45s; }
  html:not(.home-visited) .site-footer { animation-delay: 0.55s; }
}
