@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/newsreader-normal.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: 300 700;
  font-display: swap;
  src: url('fonts/newsreader-italic.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;
}

/* ── Color tokens ───────────────────────────────────── */

:root {
  --bg:        #f0eee6;
  --text:      #1f1e1d;
  --text-2:    #5e5d59;
  --text-3:    #87867f;
  --text-4:    #a09e97;
  --gold:      #b8924a;
  --gold-2:    #c9b98a;
  --border:    #d8d5cc;
  --border-2:  #e4e1d8;
  --sep:       #b0aea5;
  --hover-bg:  rgba(184, 146, 74, 0.06);
  --active-bg: rgba(184, 146, 74, 0.1);
}

[data-theme="dark"] {
  --bg:        #1c1b18;
  --text:      #e5e3db;
  --text-2:    #9e9c94;
  --text-3:    #7a7871;
  --text-4:    #605e58;
  --gold:      #c49a52;
  --gold-2:    #7d6535;
  --border:    #2e2c28;
  --border-2:  #2a2825;
  --sep:       #3a3834;
  --hover-bg:  rgba(196, 154, 82, 0.08);
  --active-bg: rgba(196, 154, 82, 0.14);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  color-scheme: light dark;
  overflow-x: hidden; /* prevent horizontal scroll on mobile */
  scroll-behavior: smooth;
}

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

/* ── Animations ─────────────────────────────────────── */

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

@keyframes line-expand {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Newsreader', 'Times New Roman', serif;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.6;
  font-optical-sizing: auto;
  font-variation-settings: 'opsz' 24;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: currentColor;
  transition: color 0.15s;
}

a:hover {
  color: var(--text-2);
}

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Container ──────────────────────────────────────── */

.container {
  max-width: 40rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Wider reading column on writing posts (~72-char measure) */
.writing-post .container {
  max-width: 48rem;
}

/* ── Header ─────────────────────────────────────────── */

header {
  padding-top: 24px;
  padding-bottom: 20px;
  margin-bottom: 8px;
  animation: fadein 0.4s ease-out both;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.2em;
}

.header-name-link {
  text-decoration: none;
  color: var(--text);
}

.header-name-link:hover { color: var(--text); }

.header-name {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  margin: 0;
}

nav .nav-link {
  font-size: 0.9rem;
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: currentColor;
  transition: color 0.15s;
}

nav .nav-link:hover {
  color: var(--text);
}

.nav-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.nav-sub {
  font-size: 0.7rem;
  color: var(--text-4);
  line-height: 1;
}

/* ── Theme toggle ───────────────────────────────────── */

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  border-radius: 4px;
}

.theme-toggle:hover {
  color: var(--text);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.icon-sun { display: none; }
.icon-moon { display: block; }

[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ── Main ───────────────────────────────────────────── */

main {
  animation: fadein 0.45s ease-out 0.05s both;
}

/* ── Monogram ───────────────────────────────────────── */

.monogram {
  display: flex;
  align-items: center;
  gap: 0.75em;
  margin-top: 12px;
  margin-bottom: 0;
  color: var(--gold);
}

.monogram::before,
.monogram::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--gold-2);
}

.monogram::before {
  transform-origin: right center;
  animation: line-expand 0.6s ease-out 0.3s both;
}

.monogram::after {
  transform-origin: left center;
  animation: line-expand 0.6s ease-out 0.3s both;
}

.monogram-text {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  font-family: 'Newsreader', 'Times New Roman', serif;
}

/* ── Footer parade ──────────────────────────────────── */

.footer-parade {
  position: relative;
  height: 32px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.footer-parade::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 32px;
  width: calc(100% + 640px);
  opacity: 0.4;
  background-repeat: repeat-x;
  background-size: 640px 32px;
  background-position: 0 center;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 32' fill='none' stroke='%23b8924a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='40' cy='7' r='4'/><line x1='40' y1='11' x2='40' y2='21'/><line x1='40' y1='15' x2='33' y2='10'/><line x1='40' y1='15' x2='47' y2='10'/><line x1='40' y1='21' x2='34' y2='29'/><line x1='40' y1='21' x2='46' y2='29'/><circle cx='120' cy='7' r='4'/><line x1='120' y1='11' x2='122' y2='20'/><line x1='121' y1='15' x2='114' y2='17'/><line x1='121' y1='15' x2='127' y2='11'/><line x1='122' y1='20' x2='115' y2='28'/><line x1='122' y1='20' x2='128' y2='27'/><path d='M200 22 C196 17 188 12 190 7 C192 3 197 4 200 8 C203 4 208 3 210 7 C212 12 204 17 200 22Z'/><circle cx='280' cy='16' r='5'/><line x1='280' y1='7' x2='280' y2='4'/><line x1='280' y1='25' x2='280' y2='28'/><line x1='269' y1='16' x2='266' y2='16'/><line x1='291' y1='16' x2='294' y2='16'/><line x1='273' y1='9' x2='271' y2='7'/><line x1='287' y1='23' x2='289' y2='25'/><line x1='287' y1='9' x2='289' y2='7'/><line x1='273' y1='23' x2='271' y2='25'/><circle cx='360' cy='7' r='4'/><line x1='360' y1='11' x2='360' y2='21'/><line x1='360' y1='15' x2='351' y2='15'/><line x1='360' y1='15' x2='369' y2='15'/><line x1='360' y1='21' x2='354' y2='29'/><line x1='360' y1='21' x2='366' y2='29'/><circle cx='440' cy='6' r='4'/><line x1='440' y1='10' x2='440' y2='19'/><line x1='440' y1='13' x2='433' y2='9'/><line x1='440' y1='13' x2='447' y2='9'/><line x1='440' y1='19' x2='429' y2='29'/><line x1='440' y1='19' x2='451' y2='29'/><ellipse cx='524' cy='21' rx='10' ry='5'/><circle cx='511' cy='17' r='4'/><line x1='515' y1='16' x2='515' y2='17'/><line x1='517' y1='24' x2='515' y2='29'/><line x1='521' y1='25' x2='520' y2='29'/><line x1='527' y1='25' x2='527' y2='29'/><line x1='532' y1='24' x2='534' y2='29'/><line x1='533' y1='18' x2='537' y2='14'/><path d='M600 16 C600 16 598 11 602 9 C606 7 609 11 608 15 C607 18 604 20 600 20 C596 20 594 16 596 12 C598 8 602 6 606 5'/></svg>");
  animation: parade 26s linear infinite;
  will-change: transform;
}

[data-theme="dark"] .footer-parade::before {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 32' fill='none' stroke='%23c49a52' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='40' cy='7' r='4'/><line x1='40' y1='11' x2='40' y2='21'/><line x1='40' y1='15' x2='33' y2='10'/><line x1='40' y1='15' x2='47' y2='10'/><line x1='40' y1='21' x2='34' y2='29'/><line x1='40' y1='21' x2='46' y2='29'/><circle cx='120' cy='7' r='4'/><line x1='120' y1='11' x2='122' y2='20'/><line x1='121' y1='15' x2='114' y2='17'/><line x1='121' y1='15' x2='127' y2='11'/><line x1='122' y1='20' x2='115' y2='28'/><line x1='122' y1='20' x2='128' y2='27'/><path d='M200 22 C196 17 188 12 190 7 C192 3 197 4 200 8 C203 4 208 3 210 7 C212 12 204 17 200 22Z'/><circle cx='280' cy='16' r='5'/><line x1='280' y1='7' x2='280' y2='4'/><line x1='280' y1='25' x2='280' y2='28'/><line x1='269' y1='16' x2='266' y2='16'/><line x1='291' y1='16' x2='294' y2='16'/><line x1='273' y1='9' x2='271' y2='7'/><line x1='287' y1='23' x2='289' y2='25'/><line x1='287' y1='9' x2='289' y2='7'/><line x1='273' y1='23' x2='271' y2='25'/><circle cx='360' cy='7' r='4'/><line x1='360' y1='11' x2='360' y2='21'/><line x1='360' y1='15' x2='351' y2='15'/><line x1='360' y1='15' x2='369' y2='15'/><line x1='360' y1='21' x2='354' y2='29'/><line x1='360' y1='21' x2='366' y2='29'/><circle cx='440' cy='6' r='4'/><line x1='440' y1='10' x2='440' y2='19'/><line x1='440' y1='13' x2='433' y2='9'/><line x1='440' y1='13' x2='447' y2='9'/><line x1='440' y1='19' x2='429' y2='29'/><line x1='440' y1='19' x2='451' y2='29'/><ellipse cx='524' cy='21' rx='10' ry='5'/><circle cx='511' cy='17' r='4'/><line x1='515' y1='16' x2='515' y2='17'/><line x1='517' y1='24' x2='515' y2='29'/><line x1='521' y1='25' x2='520' y2='29'/><line x1='527' y1='25' x2='527' y2='29'/><line x1='532' y1='24' x2='534' y2='29'/><line x1='533' y1='18' x2='537' y2='14'/><path d='M600 16 C600 16 598 11 602 9 C606 7 609 11 608 15 C607 18 604 20 600 20 C596 20 594 16 596 12 C598 8 602 6 606 5'/></svg>");
}

@keyframes parade {
  from { transform: translateX(0); }
  to   { transform: translateX(-640px); }
}

@media (prefers-reduced-motion: reduce) {
  .footer-parade::before { animation: none; }
}

/* ── Author photo (bottom) ──────────────────────────── */

.author-photo-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
  margin-bottom: 0;
}

.author-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  opacity: 0.82;
  transition: opacity 0.3s ease;
}

.author-photo:hover {
  opacity: 1;
}

/* ── Bio ────────────────────────────────────────────── */

.bio {
  margin-bottom: 2rem;
}

.bio p {
  font-size: 1.15rem;
  line-height: 1.5;
  margin-bottom: 1em;
}

.bio p:last-child { margin-bottom: 0; }

.say-hi-link {
  display: inline-block;
  margin-top: 0.85em;
  padding: 2px 10px;
  font-size: 0.9em;
  font-family: 'Newsreader', 'Times New Roman', serif;
  color: var(--gold);
  border: 1px solid var(--border);
  border-radius: 3px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.say-hi-link:hover {
  color: var(--text);
  border-color: var(--text-3);
}

/* ── Divider ────────────────────────────────────────── */

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-top: 0;
  margin-bottom: 2rem;
  transition: border-color 0.25s ease;
}

/* ── Sections ───────────────────────────────────────── */

section {
  margin-bottom: 2rem;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  margin-top: 0;
  margin-bottom: 0.85em;
  font-family: 'Newsreader', 'Times New Roman', serif;
}

/* ── Bullet list (Projects) ─────────────────────────── */

ul {
  list-style: none;
  padding: 0;
}

.bullet-list {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

.bullet-list li {
  padding-left: 1.1em;
  text-indent: -1.1em;
  line-height: 1.4;
}

.bullet-list li::before {
  content: '• ';
  color: var(--gold);
  font-size: 0.9em;
}

.bullet-list li a {
  text-indent: 0;
}

/* ── Project subsections ────────────────────────────── */

.project-subsection {
  margin-bottom: 1.6em;
}

.project-subsection:last-child {
  margin-bottom: 0;
}

.subsection-label {
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Newsreader', 'Times New Roman', serif;
  margin-top: 0;
  margin-bottom: 0.2em;
  letter-spacing: 0;
  line-height: 1.2;
}

.subsection-desc {
  font-size: 0.85em;
  color: var(--text-3);
  margin-top: 0;
  margin-bottom: 0.75em;
  line-height: 1.4;
}

/* ── Atlas-connected project entry ──────────────────── */

.atlas-related-project {
  margin-top: 1rem;
  padding-top: 1rem;
  margin-bottom: 2rem;
  border-top: 1px solid var(--divider);
}

.atlas-related-project .meta:first-of-type {
  margin-top: 0.5em;
}

.meta a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.meta a:hover {
  color: var(--text-2);
}

.meta-links a {
  color: var(--gold);
}

.meta-links a:hover {
  color: var(--text-2);
}

.meta {
  display: block;
  text-indent: 0;
  padding-left: 1.1em;
  color: var(--text-3);
  font-size: 0.9em;
  line-height: 1.4;
  margin-top: 0.15em;
  transition: color 0.25s ease;
}

/* ── Writing / Talks list ───────────────────────────── */

.writing-list {
  display: flex;
  flex-direction: column;
}

.writing-list li {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5em;
  padding-top: 0.55em;
  padding-bottom: 0.55em;
  border-bottom: 1px solid var(--border-2);
  line-height: 1.4;
  font-size: 0.975rem;
  transition: background-color 0.15s ease, border-color 0.25s ease;
  margin-left: -12px;
  margin-right: -12px;
  padding-left: 12px;
  padding-right: 12px;
}

.writing-list li:hover {
  background-color: var(--hover-bg);
}

.writing-list li:active {
  background-color: var(--active-bg);
}

.writing-list li:first-child {
  border-top: 1px solid var(--border-2);
}

.writing-list li a,
.writing-list li span:first-child {
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.writing-list li a {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-size: 0% 1px;
  background-repeat: no-repeat;
  transition: background-size 0.25s ease, color 0.15s;
}

.writing-list li a:hover {
  background-size: 100% 1px;
  color: var(--text);
}

.date {
  color: var(--text-4);
  font-size: 0.875rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.25s ease;
}

/* ── Footer ─────────────────────────────────────────── */

footer {
  margin-top: 3rem;
  padding-bottom: 3rem;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6em;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--text); }

.sep {
  color: var(--sep);
  user-select: none;
}

.footer-ornament {
  color: var(--gold);
  font-size: 0.8rem;
  margin-top: 0.25em;
}

.footer-visitor {
  font-size: 0.8rem;
  color: var(--text-4);
  margin: 0.5em 0 0.15em;
  min-height: 1em;
  opacity: 0;
  transition: opacity 0.6s ease, color 0.25s ease;
}

.footer-visitor.is-loaded {
  opacity: 1;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-4);
  transition: color 0.25s ease;
}

/* ── Progress bar ───────────────────────────────────── */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--gold);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 100;
  opacity: 0.65;
  pointer-events: none;
}

/* ── Scroll-in ──────────────────────────────────────── */

.js-hidden {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 767px) {
  .js-hidden {
    transform: translateY(20px);
  }

  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .bio p {
    font-size: 1.05rem;
  }

  .writing-list li {
    flex-direction: column;
    gap: 0.15em;
    padding-top: 0.7em;
    padding-bottom: 0.7em;
  }

  .date {
    font-size: 0.8rem;
  }
}

@media (max-width: 479px) {
  body {
    font-size: 1rem;
  }

  header {
    padding-top: 16px;
  }

  .header-name {
    font-size: 1.1rem;
  }

  .bio p {
    font-size: 1rem;
    line-height: 1.5;
  }

  h2 {
    font-size: 0.95rem;
  }

  footer {
    padding-bottom: 2rem;
    margin-top: 2rem;
  }
}

/* ── AI Atlas NYC embed ─────────────────────────────── */

.atlas-section-header {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin-bottom: 0;
}

.atlas-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  top: -1px;
  opacity: 0.7;
}

.atlas-stats-line {
  font-size: 0.82rem;
  color: var(--text-4);
  margin-top: 0.35em;
  margin-bottom: 1.1em;
  transition: color 0.25s ease;
  letter-spacing: 0.01em;
}

/* Company list */
.atlas-companies {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 0;
  margin: 0 -12px;
}

.atlas-company {
  display: flex;
  align-items: flex-start;
  gap: 0.65em;
  padding: 0.55em 12px;
  border-bottom: 1px solid var(--border-2);
  transition: background-color 0.15s ease, border-color 0.25s ease;
  cursor: default;
}

.atlas-company:first-child { border-top: 1px solid var(--border-2); }

.atlas-company:hover { background-color: var(--hover-bg); }

.atlas-logo-wrap {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 3px;
}

.atlas-logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--border-2);
}

.atlas-logo-fallback {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-3);
  font-size: 0.55rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0;
  transition: background 0.25s ease, color 0.25s ease;
}

.atlas-company-info {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.atlas-company-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.atlas-company-name:hover { color: var(--gold); }

.atlas-company-hook {
  display: block;
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: 1px;
  transition: color 0.25s ease;
}

.atlas-company-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.atlas-badge {
  font-size: 0.68rem;
  color: var(--text-4);
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: color 0.25s ease;
}

.atlas-badge-signal {
  color: var(--gold);
  font-size: 0.68rem;
}

/* Category chips */
.atlas-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-top: 1.2em;
}

.atlas-cat-chip {
  font-size: 0.76rem;
  color: var(--text-3);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 8px;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
  white-space: nowrap;
}

.atlas-cat-chip:hover {
  color: var(--text);
  border-color: var(--text-3);
  background: var(--hover-bg);
}

/* Signals */
.atlas-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 0.5em;
  margin-top: 1.4em;
  transition: color 0.25s ease;
}

.atlas-signal-list {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  list-style: none;
  padding: 0;
}

.atlas-signal-item {
  font-size: 0.82rem;
  color: var(--text-3);
  line-height: 1.4;
  transition: color 0.25s ease;
}

.atlas-signal-item a {
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.atlas-signal-item a:hover { color: var(--gold); }

.atlas-signal-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
  border: 1px solid var(--border-2);
  border-radius: 2px;
  padding: 0 4px;
  vertical-align: middle;
  margin-right: 4px;
  position: relative;
  top: -1px;
  transition: color 0.25s ease, border-color 0.25s ease;
}

/* Patterns */
.atlas-pattern-list {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  list-style: none;
  padding: 0;
}

.atlas-pattern-item {
  font-size: 0.85rem;
  line-height: 1.4;
}

.atlas-pattern-item a {
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s;
}

.atlas-pattern-item a:hover { color: var(--gold); }

/* Ask Atlas button */
.atlas-ask-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-top: 1.4em;
  font-family: 'Newsreader', 'Times New Roman', serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gold);
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 5px 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
  text-decoration: none;
}

.atlas-ask-btn:hover {
  color: var(--text);
  border-color: var(--gold);
  background: var(--hover-bg);
}

.atlas-load-more-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 0.8em;
  margin-bottom: 0.2em;
  font-family: 'Newsreader', 'Times New Roman', serif;
  font-size: 0.83rem;
  color: var(--text-3);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
}

.atlas-load-more-btn:hover {
  color: var(--text);
}

.atlas-loading-text {
  font-size: 0.85rem;
  color: var(--text-4);
  font-style: italic;
}

/* ── Ask Atlas modal ───────────────────────────────── */

.atlas-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 8, 0.72);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.atlas-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.atlas-modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(8px);
  transition: transform 0.2s ease, background-color 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 8px 48px rgba(0,0,0,0.28);
}

.atlas-modal-overlay.open .atlas-modal {
  transform: translateY(0);
}

.atlas-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-2);
  flex-shrink: 0;
  transition: border-color 0.25s ease;
}

.atlas-modal-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5em;
  transition: color 0.25s ease;
}

.atlas-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 1.2rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 3px;
  transition: color 0.15s, background-color 0.15s;
  font-family: inherit;
}

.atlas-modal-close:hover {
  color: var(--text);
  background: var(--hover-bg);
}

.atlas-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Conversation messages */
.atlas-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.atlas-msg-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
  transition: color 0.25s ease;
}

.atlas-msg-label.user { color: var(--gold); opacity: 0.75; }

.atlas-msg-text {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  transition: color 0.25s ease;
}

.atlas-msg-text.streaming {
  border-left: 2px solid var(--gold);
  padding-left: 10px;
  margin-left: -12px;
}

/* Company cards in modal */
.atlas-modal-companies {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.atlas-modal-company-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 8px 10px;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}

.atlas-modal-company-card:hover {
  background: var(--hover-bg);
  border-color: var(--border);
}

.atlas-modal-company-card .atlas-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.atlas-modal-company-card .atlas-logo-fallback {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.atlas-modal-card-info { flex: 1; min-width: 0; }

.atlas-modal-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  display: block;
  transition: color 0.25s ease;
}

.atlas-modal-card-hook {
  font-size: 0.75rem;
  color: var(--text-3);
  display: block;
  transition: color 0.25s ease;
}

.atlas-modal-card-arrow {
  color: var(--text-4);
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: color 0.25s ease;
}

/* Thinking indicator */
.atlas-thinking {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.atlas-thinking span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.4;
  animation: atlas-bounce 1.2s ease-in-out infinite;
}

.atlas-thinking span:nth-child(2) { animation-delay: 0.15s; }
.atlas-thinking span:nth-child(3) { animation-delay: 0.3s; }

@keyframes atlas-bounce {
  0%, 80%, 100% { opacity: 0.4; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* Error */
.atlas-modal-error {
  font-size: 0.82rem;
  color: #c0392b;
  padding: 8px 12px;
  border: 1px solid rgba(192, 57, 43, 0.25);
  border-radius: 4px;
  background: rgba(192, 57, 43, 0.05);
}

/* Input area */
.atlas-modal-input-area {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-2);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.25s ease;
}

.atlas-modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.atlas-modal-chip {
  font-family: 'Newsreader', 'Times New Roman', serif;
  font-size: 0.78rem;
  color: var(--text-3);
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 10px;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.atlas-modal-chip:hover {
  color: var(--text);
  border-color: var(--text-3);
  background: var(--hover-bg);
}

.atlas-modal-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 12px;
  font-family: 'Newsreader', 'Times New Roman', serif;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  resize: none;
  min-height: 60px;
  outline: none;
  transition: border-color 0.15s, background-color 0.25s, color 0.25s;
  line-height: 1.5;
}

.atlas-modal-textarea:focus { border-color: var(--gold); }
.atlas-modal-textarea::placeholder { color: var(--text-4); }

.atlas-modal-submit {
  font-family: 'Newsreader', 'Times New Roman', serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--gold);
  border: none;
  border-radius: 3px;
  padding: 7px 16px;
  cursor: pointer;
  align-self: flex-end;
  transition: opacity 0.15s, background-color 0.25s;
}

.atlas-modal-submit:hover { opacity: 0.85; }
.atlas-modal-submit:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 479px) {
  .atlas-modal-overlay { padding: 0; align-items: flex-end; }
  .atlas-modal { max-height: 90vh; border-radius: 6px 6px 0 0; }
}

/* ── Career timeline ────────────────────────────────── */

.tl-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.tl-year {
  min-width: 76px;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-4);
  padding-top: 6px;
  flex-shrink: 0;
  font-style: italic;
  letter-spacing: 0.01em;
}

.tl-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tl-icon.tl-icon-fallback::after {
  content: attr(data-initials);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.03em;
}

.tl-body {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
}

.tl-org {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.3em;
  color: var(--text);
}

.tl-org a {
  text-decoration: none;
  color: inherit;
}

.tl-org a:hover { color: var(--text-2); }

.tl-body p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0;
}

.tl-body p a {
  color: var(--text-2);
}

.tl-now {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-top: 0.5rem;
  margin-bottom: 0.85em;
  padding-left: 88px;
}

/* ── GitHub heatmap ─────────────────────────────────── */

:root {
  --heatmap-0: var(--border-2);
  --heatmap-1: rgba(184, 146, 74, 0.22);
  --heatmap-2: rgba(184, 146, 74, 0.45);
  --heatmap-3: rgba(184, 146, 74, 0.70);
  --heatmap-4: var(--gold);
}

[data-theme="dark"] {
  --heatmap-0: #2a2825;
  --heatmap-1: rgba(196, 154, 82, 0.22);
  --heatmap-2: rgba(196, 154, 82, 0.45);
  --heatmap-3: rgba(196, 154, 82, 0.70);
  --heatmap-4: var(--gold);
}

section[aria-label="GitHub contributions"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.github-heatmap-meta {
  display: flex;
  align-items: baseline;
  gap: 0.9em;
  flex-wrap: wrap;
  justify-content: center;
}

.github-heatmap-total {
  font-size: 0.78rem;
  color: var(--text-3);
}

.github-heatmap-link {
  font-size: 0.75rem;
  color: var(--text-4);
  text-decoration: none;
  transition: color 0.15s;
}

.github-heatmap-link:hover { color: var(--text-3); }

.github-heatmap-scroll {
  cursor: default;
}

.github-heatmap-months {
  display: grid;
  grid-template-columns: repeat(7, 22px);
  gap: 4px;
  margin-bottom: 4px;
}

.github-heatmap-day-label {
  font-size: 0.6rem;
  color: var(--text-4);
  text-align: center;
  line-height: 1;
}

.github-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 22px);
  gap: 4px;
}

.github-heatmap-day {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background-color: var(--heatmap-0);
  transition: background-color 0.25s ease, opacity 0.15s;
}

.github-heatmap-day[data-level="1"] { background-color: var(--heatmap-1); }
.github-heatmap-day[data-level="2"] { background-color: var(--heatmap-2); }
.github-heatmap-day[data-level="3"] { background-color: var(--heatmap-3); }
.github-heatmap-day[data-level="4"] { background-color: var(--heatmap-4); }

.github-heatmap-day:hover { opacity: 0.75; }

.github-heatmap-tooltip {
  position: fixed;
  background: var(--text);
  color: var(--bg);
  font-family: 'Newsreader', 'Times New Roman', serif;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.1s;
}

.writing-more-btn {
  margin-top: 0.75em;
  background: none;
  border: none;
  padding: 0;
  font-family: 'Newsreader', 'Times New Roman', serif;
  font-size: 0.88rem;
  color: var(--text-3);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: currentColor;
  transition: color 0.15s;
}

.writing-more-btn:hover { color: var(--text); }

.writing-list li.writing-hidden {
  display: none;
}

.github-heatmap-loading {
  font-size: 0.85rem;
  color: var(--text-4);
  font-style: italic;
}

/* ── Thesis block ───────────────────────────────────── */

.tl-thesis {
  padding-top: 0.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
  transition: border-color 0.25s ease;
}

.tl-thesis .tl-thesis-quote {
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--text);
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.01em;
  margin: 0 0 0.55em 0;
}

.tl-thesis .tl-thesis-sub {
  font-size: 0.975rem;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0 0 0.85em 0;
  transition: color 0.25s ease;
}

.tl-thesis .tl-thesis-role {
  font-size: 0.8rem;
  color: var(--text-4);
  letter-spacing: 0.06em;
  margin: 0;
  transition: color 0.25s ease;
}

.tl-thesis .tl-thesis-now {
  font-size: 0.975rem;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0.9em 0 0 0;
  transition: color 0.25s ease;
}

@media (max-width: 479px) {
  .tl-thesis .tl-thesis-quote { font-size: 1.1rem; }
}

/* ── Collapsible timeline ───────────────────────────── */

/* Override existing display:flex — entries are now block containers */
.tl-entry {
  display: block;
  margin-bottom: 0;
}

/* Header row replicates the original flat flex layout */
.tl-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  padding-left: 8px;
  padding-right: 8px;
  margin-left: -8px;
  margin-right: -8px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.15s ease;
  outline: none;
}

.tl-header:hover  { background-color: var(--hover-bg); }
.tl-header:active { background-color: var(--active-bg); }

.tl-header:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Chevron icon on timeline headers */
.tl-chevron {
  flex-shrink: 0;
  color: var(--text-4);
  margin-top: 10px;
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.15s ease;
}

.tl-header:hover .tl-chevron { opacity: 1; }

.tl-entry[data-open="true"]  .tl-chevron { transform: rotate(0deg); }
.tl-entry[data-open="false"] .tl-chevron { transform: rotate(-90deg); }

@media (max-width: 767px) {
  .tl-chevron { opacity: 0.4; }
}

/* Collapsible content area */
.tl-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
  padding-left: 136px; /* year(76) + gap(12) + icon(36) + gap(12) */
}

.tl-entry[data-open="true"] .tl-content {
  grid-template-rows: 1fr;
}

.tl-content-inner {
  overflow: hidden;
}

/* Paragraphs inside tl-content (override tl-body p { margin:0 }) */
.tl-content-inner p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-2);
  margin-bottom: 0.75em;
  transition: color 0.25s ease;
}

.tl-content-inner p:last-child {
  margin-bottom: 0.8rem;
}

.tl-content-inner p a { color: var(--text-2); }

/* Mobile: remove indent so description text uses full width */
@media (max-width: 767px) {
  .tl-content { padding-left: 0; padding-top: 0.15rem; }
  /* Tighten gap on very small screens so org name doesn't wrap */
  .tl-header { gap: 8px; }
}

/* ── Collapsible sections ───────────────────────────── */

.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  padding: 3px 8px;
  margin-left: -8px;
  margin-right: -8px;
  border-radius: 4px;
  margin-bottom: 0.85em; /* replaces h2's own margin-bottom */
  transition: background-color 0.15s ease;
  outline: none;
}

.section-header:hover  { background-color: var(--hover-bg); }
.section-header:active { background-color: var(--active-bg); }

.section-header:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Remove h2's own bottom margin when it's inside a section-header */
.section-header h2 { margin-bottom: 0; }

.section-count {
  font-size: 0.76rem;
  color: var(--text-4);
  font-weight: 400;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  transition: color 0.25s ease;
}

.section-chevron {
  flex-shrink: 0;
  color: var(--text-4);
  margin-left: auto;
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.15s ease;
}

.section-header:hover .section-chevron { opacity: 1; }

.collapsible-section[data-open="true"]  .section-chevron { transform: rotate(0deg); }
.collapsible-section[data-open="false"] .section-chevron { transform: rotate(-90deg); }

@media (max-width: 767px) {
  .section-chevron { opacity: 0.4; }
}

.section-content {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.22s ease;
}

.collapsible-section[data-open="false"] .section-content {
  grid-template-rows: 0fr;
}

.section-content-inner {
  overflow: hidden;
}


/* ── View toggle (me · friends!) ───────────────────────── */
.view-toggle {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3em;
  margin-top: 1.1rem;
  margin-bottom: 1rem;
}

.view-toggle--friends {
  margin-top: 0;
  margin-bottom: 2.5rem;
}

.view-tab {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-4);
  transition: color 0.15s;
  letter-spacing: 0.01em;
}

.view-tab:hover { color: var(--text-2); }

.view-tab--active {
  color: var(--text);
  font-style: italic;
}

.view-tab-sep {
  font-size: 0.85rem;
  color: var(--text-4);
  user-select: none;
}

/* ── Friends view ───────────────────────────────────────── */
.friends-view {
  display: none;
  min-height: 60vh;
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.friends-container {
  max-width: 540px;
}

.friends-intro {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 2.5rem;
  font-style: italic;
}

.friends-block {
  margin-bottom: 2rem;
}

.friends-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 0.75rem;
}

.friends-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.friends-list li {
  font-size: 0.97rem;
  color: var(--text-2);
  line-height: 1.4;
}

.friends-list em {
  font-style: italic;
  color: var(--text);
}

.friends-song {
  font-size: 0.95rem;
  color: var(--text-2);
}

.friends-link {
  color: var(--gold);
  text-decoration: none;
  transition: opacity 0.15s;
}

.friends-link:hover { opacity: 0.75; }

/* ── Rotating "tinkering on" word ────────────────────────── */
.working-link {
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--gold-2);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: opacity 0.45s ease, color 0.15s ease;
}

.working-link.is-fading { opacity: 0; }

/* ── Friends track swipe card ───────────────────────────── */
.friends-track-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.friends-track-wrap {
  position: relative;
  flex: 1;
  min-width: 140px;
  max-width: 320px;
}

.friends-track-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  will-change: transform;
}

.friends-track-card:active { cursor: grabbing; }

.friends-track-thumb {
  width: 100%;
  display: block;
  border-radius: 8px;
}

.friends-track-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 10px 14px;
  background: linear-gradient(135deg, transparent 60%, rgba(0,0,0,0.45));
  border-radius: 8px;
  pointer-events: none;
}

.friends-track-hint {
  color: rgba(255,255,255,0.85);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.friends-track-player {
  display: none;
  border-radius: 8px;
  overflow: hidden;
  max-width: 320px;
}

.friends-track-player--active { display: block; }

.friends-track-player iframe {
  display: block;
  border-radius: 8px;
}

.friends-text {
  font-size: 0.97rem;
  color: var(--text-2);
}

.friends-dog {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  display: block;
  margin-top: 0.5rem;
}

.friends-book-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border);
  transition: text-decoration-color 0.15s;
}

.friends-book-link:hover {
  text-decoration-color: var(--text-3);
  color: inherit;
}

/* ── Friends hero (two-column) ──────────────────────────── */
.friends-hero {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  margin-bottom: 0.5rem;
}

.friends-hero-text {
  flex: 1;
  min-width: 0;
}

.friends-hero-photo {
  flex-shrink: 0;
  width: 160px;
  margin: 0;
  position: relative;
  aspect-ratio: 3 / 4;
}

.friends-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
  border-radius: 8px;
  overflow: hidden;
}

.friends-slide--active {
  opacity: 1;
  z-index: 1;
}

.friends-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#friends-slide-caption {
  position: absolute;
  bottom: -1.5rem;
  left: 0; right: 0;
  font-size: 0.65rem;
  color: var(--text-4);
  text-align: center;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friends-mobile-carousel { display: none; }
.friends-camera-roll-label { display: none; }

@media (max-width: 600px) {
  .friends-hero { flex-direction: column; gap: 1.25rem; }
  .friends-hero-photo { display: none; }

  .friends-camera-roll-label {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-4);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .friends-mobile-carousel {
    display: block;
    overflow: hidden;
    overflow-x: clip;
    margin: 0 -24px 2rem;
    max-width: calc(100% + 48px);
  }

  .friends-mobile-track {
    display: flex;
    gap: 10px;
    padding: 0 24px;
    width: max-content;
    animation: friends-scroll 30s linear infinite;
  }

  .friends-mobile-track img {
    height: 110px;
    width: auto;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
  }
}

@keyframes friends-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ═══════════════════════════════════════════════════════
   WRITING — long-form article / blog post
   Shares all color tokens, fonts, and the reading column
   width with the rest of the site. Used by /writing/<slug>/.
   ═══════════════════════════════════════════════════════ */

.post-main {
  animation: fadein 0.45s ease-out 0.05s both;
}

/* Back link above the article */
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.9rem;
  color: var(--text-3);
  text-decoration: none;
  margin-bottom: 2.25rem;
  transition: color 0.15s, gap 0.15s ease;
}

.post-back:hover {
  color: var(--text);
  gap: 0.6em;
}

.post-back svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Article header ─────────────────────────────────── */

.article-header {
  margin-bottom: 2.5rem;
}

.article-eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.article-title {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 2.7rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.7rem;
  text-wrap: balance;
}

.article-dek {
  font-size: 1.28rem;
  line-height: 1.5;
  color: var(--text-2);
  font-weight: 400;
  margin: 0 0 1.4rem;
  text-wrap: pretty;
  transition: color 0.25s ease;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55em;
  font-size: 0.9rem;
  color: var(--text-3);
  transition: color 0.25s ease;
}

.article-meta .sep {
  color: var(--sep);
}

.article-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
  transition: border-color 0.25s ease;
}

/* ── Article body (prose) ───────────────────────────── */

.article-body {
  font-size: 1.3125rem;
  line-height: 1.62;
  color: var(--text);
  text-rendering: optimizeLegibility;
}

.article-body > * + * {
  margin-top: 1.5em;
}

.article-body p {
  text-wrap: pretty;
}

/* Optional decorative drop cap on the opening paragraph */
.article-body .has-dropcap::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.78;
  font-weight: 600;
  padding: 0.04em 0.1em 0 0;
  color: var(--text);
}

.article-body h2 {
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: 2.4em;
  margin-bottom: 0;
}

.article-body h3 {
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0;
}

.article-body h2 + *,
.article-body h3 + * {
  margin-top: 0.7em;
}

/* Body links — plain underline in the text color (Medium-style); the
   underline starts faint and darkens on hover. No accent color. */
.article-body a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-4);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.15s, color 0.15s;
}

.article-body a:hover {
  text-decoration-color: var(--text);
}

.article-body strong { font-weight: 600; }
.article-body em { font-style: italic; }

/* Lists */
.article-body ul,
.article-body ol {
  padding-left: 1.4em;
}

.article-body li + li {
  margin-top: 0.5em;
}

.article-body ul li::marker,
.article-body ol li::marker {
  color: var(--text-3);
}

/* Blockquote — neutral gray rule, Medium-style */
.article-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1.1em;
  margin-left: 0;
  color: var(--text-2);
}

.article-body blockquote p + p {
  margin-top: 1em;
}

/* Pull quote — large, left-aligned with a neutral rule (Medium-style) */
.article-body .pullquote {
  font-size: 1.5rem;
  line-height: 1.4;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  border-left: 3px solid var(--border);
  padding-left: 1.1em;
  margin: 2.2rem 0;
  max-width: none;
  text-wrap: pretty;
  font-style: normal;
}

/* Figures & images */
.article-body figure {
  margin-left: 0;
  margin-right: 0;
}

.article-body img,
.article-body figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border-2);
}

.article-body figcaption {
  margin-top: 0.7em;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-3);
  text-align: left;
  transition: color 0.25s ease;
}

/* Explanatory diagrams (inline SVG, theme-aware via tokens) */
.article-body .fig-diagram svg {
  width: 100%;
  height: auto;
  display: block;
  border: none;
}

.dg-box {
  fill: var(--bg);
  stroke: var(--border);
  stroke-width: 1.5;
}

.dg-box-em {
  fill: var(--active-bg);
  stroke: var(--sep);
  stroke-width: 1.5;
}

.dg-line {
  stroke: var(--text-3);
  stroke-width: 1.5;
  fill: none;
}

.dg-arrow { fill: var(--text-3); }

.dg-text {
  fill: var(--text);
  font-family: 'Newsreader', 'Times New Roman', serif;
}

.dg-muted {
  fill: var(--text-3);
  font-family: 'Newsreader', 'Times New Roman', serif;
}

.dg-eyebrow {
  fill: var(--text-3);
  font-family: 'Newsreader', 'Times New Roman', serif;
  letter-spacing: 0.1em;
}

/* Section break — neutral three-dot rule (Medium-style) */
.article-body hr {
  border: none;
  text-align: center;
  margin: 2.8rem 0;
}

.article-body hr::before {
  content: '• • •';
  color: var(--text-4);
  font-size: 0.9rem;
  letter-spacing: 0.5em;
}

/* Inline code & code blocks */
.article-body code {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--hover-bg);
  padding: 0.12em 0.38em;
  border-radius: 4px;
  border: 1px solid var(--border-2);
}

.article-body pre {
  background: var(--hover-bg);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 1.1em 1.25em;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* Footnotes / endnotes */
.article-footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-2);
}

.article-footnotes ol {
  padding-left: 1.3em;
}

.article-footnotes li + li {
  margin-top: 0.6em;
}

/* ── Article footer ─────────────────────────────────── */

.article-footer {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
}

.article-byline {
  font-size: 0.9rem;
  color: var(--text-3);
  transition: color 0.25s ease;
}

.article-share {
  display: flex;
  align-items: center;
  gap: 1em;
  font-size: 0.875rem;
}

.article-share a {
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}

.article-share a:hover {
  color: var(--text);
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 479px) {
  .article-body {
    font-size: 1.25rem;
    line-height: 1.6;
  }
  .article-dek {
    font-size: 1.18rem;
  }
  .article-body .pullquote {
    font-size: 1.35rem;
  }
  .post-back {
    margin-bottom: 1.75rem;
  }
}
