/* ryantish.com — clean rebuild (migrated off Cargo) */

:root {
  --bg: #f7f6f2;
  --text: #1a1a1a;
  --muted: #8a857b;
  --rule: #e3e2dc;
  --accent: #1a1a1a;
  --link-underline: rgba(26, 26, 26, 0.35);
  --card: #ffffff;
  --book: #4a4a45;
  --fav: #111111;
  --maxw: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100f0e;
    --text: #ece9e3;
    --muted: #8f8a80;
    --rule: #2a2825;
    --accent: #ece9e3;
    --link-underline: rgba(236, 233, 227, 0.32);
    --card: #1a1815;
    --book: #b8b3a9;
    --fav: #ffffff;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05" 1, "cv11" 1;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 24px 96px;
  animation: rise 0.5s cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Inline links (essay body): persistent, subtle underline */
a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--link-underline);
  transition: text-decoration-color 0.15s ease;
}
a:hover { text-decoration-color: var(--accent); }

/* Nav-style links (home rows, back, footer): animated slide-in underline */
.rows a,
.footer a,
.back {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  padding-bottom: 2px;
  transition: background-size 0.28s ease, color 0.15s ease;
}
.rows a:hover,
.footer a:hover,
.back:hover { background-size: 100% 1px; }

/* Section labels (BACKGROUND / WRITINGS / PROJECTS / essay headings) */
.label {
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 600;
  margin: 0 0 14px;
}

/* Home */
.name {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 48px;
}

.block { margin: 0 0 44px; }

.rows { display: grid; gap: 6px; }
.row {
  display: flex;
  gap: 14px;
  align-items: baseline;
  transition: opacity 0.2s ease;
}
/* Spotlight the hovered row, dim the rest */
.rows:hover .row { opacity: 0.5; }
.rows:hover .row:hover { opacity: 1; }
.row .date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 138px;
  font-size: 15px;
}
.row .what { flex: 1; font-size: 15px; }
.muted-line { color: var(--muted); font-size: 15px; margin-top: 4px; }

/* Project one-line description (sub-line under the title, within rows) */
.what .desc {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 2px;
}
/* Non-linked project title (matches the row link titles) */
.what .project-name { color: var(--text); }

/* Footer */
.footer {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }
.footer .copy { margin-left: auto; }

/* Back link on essay pages */
.back {
  display: inline-block;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 40px;
}
.back:hover { color: var(--text); }

/* Essay */
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.title {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin: 0 0 40px;
}
.essay h2 {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 600;
  margin: 40px 0 12px;
}
.essay p { margin: 0 0 20px; }
.essay figure { margin: 32px 0; }
.essay img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--rule);
  display: block;
}
.essay figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}

/* Book / reading list */
.list-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0 0 32px;
}
.booklist .year {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 36px 0 6px;
}
.booklist .year:first-of-type { margin-top: 0; }
.booklist ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.booklist li {
  color: var(--book);
  line-height: 1.85;
}
/* All-time favorites — marked with a trailing asterisk + legend up top */
.booklist li.fav::after {
  content: "*";
  color: var(--text);
  font-weight: 600;
  margin-left: 3px;
}
.booklist .title { margin-bottom: 10px; }
.fav-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 24px;
}
.fav-star { color: var(--text); font-weight: 600; }

/* Subscribe */
.subscribe-form { display: flex; gap: 10px; margin-top: 24px; max-width: 420px; }
.subscribe-form input[type="email"] {
  flex: 1;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}
.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: var(--text);
}
.subscribe-form button {
  padding: 12px 22px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  cursor: pointer;
}
.subscribe-form button:hover { opacity: 0.88; }
.form-msg { margin-top: 16px; color: var(--muted); font-size: 15px; display: none; }
.form-msg.show { display: block; }

@media (max-width: 560px) {
  .wrap { padding: 48px 20px 72px; }
  .row { flex-direction: column; gap: 0; }
  .row .date { min-width: 0; font-size: 14px; }
  .title { font-size: 24px; }
  .subscribe-form { flex-direction: column; }
  /* On touch there's no hover, so don't dim rows */
  .rows:hover .row { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .wrap { animation: none; }
  * { transition: none !important; }
}
