/* ---------- 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;
}

/* Persistent underline for in-content links (keeps nav clean) */
.bio a, .prose a, .writing-list a, .essay-body a {
  border-bottom-color: rgba(74, 122, 152, 0.45);
}
.bio a:hover, .prose a:hover, .writing-list a:hover, .essay-body a: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); }

/* ---------- Contact form ---------- */
.contact-form {
  margin-top: clamp(32px, 6vh, 48px);
  max-width: 480px;
}

.field {
  margin-bottom: clamp(18px, 2.6vh, 24px);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 2.4vw, 20px);
}
.field-row .field {
  flex: 1 1 180px;
  margin-bottom: clamp(18px, 2.6vh, 24px);
}

.contact-form label {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-soft);
  margin-bottom: 9px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  display: block;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px 14px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: rgba(107, 116, 128, 0.6); }

.contact-form input:hover,
.contact-form textarea:hover {
  border-color: rgba(20, 30, 45, 0.16);
  background: rgba(255, 255, 255, 0.6);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--link);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(74, 122, 152, 0.14);
}
.contact-form textarea {
  resize: vertical;
  min-height: 132px;
}

/* Honeypot — visually hidden, kept out of tab order.
   (Inline style on the element is the real guarantee; this is a backup.) */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none;
}

.form-button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--link);
  border: none;
  border-radius: 10px;
  padding: 13px 32px;
  margin-top: 4px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 1px 2px rgba(20, 30, 45, 0.08);
}
.form-button:hover {
  background: var(--link-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(47, 91, 120, 0.22);
}
.form-button:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(20, 30, 45, 0.08); }
.form-button:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

.form-status {
  margin: 18px 0 0;
  font-size: 14px;
  min-height: 1.2em;
}
.form-status.is-success { color: #2f6b4f; }
.form-status.is-error { color: #a23b3b; }

/* ---------- Profile links (subtle footer on About) ---------- */
.profile-links {
  margin-top: clamp(64px, 11vh, 112px);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 11.5px;
  letter-spacing: 0.03em;
}
.profile-links a {
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
.profile-links a:hover {
  color: var(--text);
  border-bottom-color: var(--rule);
}

