/* ---------- Fonts ---------- */
@font-face {
  font-family: "Satoshi";
  src: url("/fonts/Satoshi-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("/fonts/Satoshi-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("/fonts/Satoshi-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens (light only — always) ---------- */
:root {
  color-scheme: only light;

  --bg-start: #e6ecf3;
  --bg-end:   #dae2ec;
  --text:     #2a2f38;
  --text-soft:#6b7480;
  --rule:     rgba(20, 30, 45, 0.09);
  --link:     #4a7a98;
  --link-hover: #2f5b78;

  --cloud-opacity: 0.22;

  --content-max: 620px;
  --content-pad-x: clamp(24px, 5vw, 48px);
}

/* Secondary pages: clouds recede a bit */
body.page-secondary {
  --cloud-opacity: 0.15;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { display: block; max-width: 100%; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.72;
  font-weight: 400;
  letter-spacing: -0.005em;
  background:
    linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

/* ---------- Cloud layer (single, faster, smoother) ---------- */
.clouds {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.cloud-layer {
  position: absolute;
  top: -12%;
  left: -12%;
  width: 124%;
  height: 124%;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: var(--cloud-opacity);
  will-change: transform;
  backface-visibility: hidden;
  /* default cloud — used by writing/about/contact */
  background-image: url("/images/cloud-1.webp");
  animation: drift 26s ease-in-out infinite alternate;
}

/* Landing page uses the other cloud */
body.page-home .cloud-layer {
  background-image: url("/images/cloud-2.webp");
}

@keyframes drift {
  0%   { transform: translate3d(-28px, -10px, 0) scale(1.05); }
  100% { transform: translate3d( 28px,  10px, 0) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .cloud-layer { animation: none; }
}

/* ---------- Page frame ---------- */
.page {
  max-width: var(--content-max);
  margin: 0;
  padding: clamp(36px, 8vh, 80px) var(--content-pad-x) 96px;
}

/* ---------- Nav ---------- */
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 18px 28px;
  font-size: 15px;
  margin-bottom: clamp(40px, 7vh, 72px);
}

.nav .name {
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.nav .name:hover { color: var(--text); }

.nav a {
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 140ms ease, border-color 140ms ease;
}
.nav a:hover {
  color: var(--text);
  border-bottom-color: var(--rule);
}
.nav a[aria-current="page"] { color: var(--text); }

/* ---------- Typography ---------- */
p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
a:hover {
  color: var(--link-hover);
  border-bottom-color: currentColor;
}

em, i { font-style: italic; }
strong, b { font-weight: 400; } /* no bold in body */

h1, h2, h3 {
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.3;
  color: var(--text);
}
h1 { font-size: 19px; margin: 0 0 1.5em; }
h2 { font-size: 17px; margin: 2.4em 0 0.6em; }
h3 { font-size: 16px; margin: 1.8em 0 0.4em; color: var(--text-soft); }

/* ---------- Writing list (citations + essays) ---------- */
.writing-section-label {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
  margin: 2.6em 0 1em;
}

.writing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.writing-list li {
  margin-bottom: 0.95em;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-soft);
}
.writing-list li:last-child { margin-bottom: 0; }

.writing-list li strong {
  font-weight: 500;
  color: var(--text);
}
.writing-list li em { font-style: italic; }

/* ---------- Essay (long-form post) ---------- */
.essay-header { margin-bottom: clamp(28px, 5vh, 44px); }
.essay-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 0 0 6px;
}
.essay-date {
  font-size: 14px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.essay-body p { margin: 0 0 1.15em; }
.essay-body h2 {
  font-size: 18px;
  font-weight: 500;
  margin: 2em 0 0.6em;
}
.essay-body blockquote {
  margin: 1.4em 0;
  padding-left: 18px;
  border-left: 2px solid var(--rule);
  color: var(--text-soft);
  font-style: italic;
}
.essay-body ul, .essay-body ol {
  margin: 0 0 1.15em;
  padding-left: 22px;
}
.essay-body li { margin-bottom: 0.4em; }
.essay-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2em 0;
}

.essay-back {
  display: inline-block;
  margin-top: clamp(40px, 6vh, 64px);
  font-size: 14px;
  color: var(--text-soft);
}
.essay-back:hover { color: var(--text); }

