/* ============================================================
   Base reset & variables
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --text:       #2c2118;   /* warm dark brown — replaces near-black */
  --subtle:     #7a6860;   /* muted warm brown-grey */
  --border:     #e8d5cc;   /* soft rose-tinted rule */
  --bg:         #fdf8f5;   /* blush off-white */
  --accent:     #9a6060;   /* dusty rose — section labels, active states, hovers */
  --code-bg:    #f2e6e0;   /* warm rose tint for code blocks */
  --max-width:    900px;
  --reading-width: 560px;
  --font-body:  "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono:  "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* ============================================================
   Typography & body
   ============================================================ */
html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  padding: 0 1.5rem;
}

/* ============================================================
   Layout
   ============================================================ */
.site-header,
main,
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-header {
  padding: 2.5rem 0 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

main {
  padding-bottom: 4rem;
}

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--subtle);
  margin-top: 4rem;
}

/* ============================================================
   Navigation
   ============================================================ */
.site-name {
  font-size: 1rem;
  font-weight: normal;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text);
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  font-size: 0.9rem;
  color: var(--subtle);
  text-decoration: none;
  letter-spacing: 0.01em;
}

nav a:hover,
nav a.active {
  color: var(--accent);
}

/* ============================================================
   Home page sections
   ============================================================ */

/* Shared section label — uppercase tracked label used throughout */
.section-label,
.currently h2,
.featured-writing h2,
.featured-projects h2 {
  font-size: 0.75rem;
  font-weight: normal;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

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

.hero-name {
  font-size: 2rem;
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--subtle);
  line-height: 1.6;
  max-width: 520px;
}

.hero-block {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3rem;
  align-items: flex-start;
}

.hero-kicker {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-intro {
  font-size: 1.1rem;
  max-width: 42rem;
}

.hero-image {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--code-bg); /* warm rose placeholder until image is added */
  border: 2px solid var(--border);
}

.hero-image img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  color: transparent; /* hide broken-image icon while src is empty */
}

@media (max-width: 600px) {
  .hero {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 1.25rem;
  }
  .hero-image {
    width: 90px;
    height: 90px;
  }
}

.about-section {
  margin-top: 3rem;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  color: #b36b85;
}

.section-heading svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.about-list {
  padding-left: 1.2rem;
  line-height: 1.8;
}

.mini-card {
  border: 1px solid #ead7de;
  background: #fcf7f9;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.mini-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.65rem;
}

.mini-card-header p {
  margin: 0.15rem 0 0;
  color: #7c6b72;
  font-size: 0.95rem;
}

.mini-emoji {
  font-size: 1.35rem;
  line-height: 1;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border: 1px solid #ead7de;
  background: #fcf7f9;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
}

.social-links svg {
  width: 16px;
  height: 16px;
}

.footer-links {
  justify-content: center;
  margin-top: 2rem;
}

@media (max-width: 700px) {
  .hero-block {
    flex-direction: column;
  }

  .hero-kicker {
    font-size: 1.6rem;
  }
}
/* ── Bio ──────────────────────────────────────────────────── */
.bio {
  margin-bottom: 3rem;
  padding: 0 0 3rem 1.25rem;
  border-left: 2px solid var(--accent);
  border-bottom: 1px solid var(--border);
}

.bio p {
  font-size: 1rem;
  line-height: 1.8;
  max-width: 540px;
}

/* ── Currently ────────────────────────────────────────────── */
.currently {
  margin-bottom: 3rem;
}

.currently ul {
  list-style: none;
  border-top: 1px solid var(--border);
}

.currently li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--subtle);
  line-height: 1.5;
}

.currently-marker {
  flex-shrink: 0;
  font-size: 0.85rem;
  line-height: 1;
  /* Nudge the emoji/symbol down slightly to align with text baseline */
  position: relative;
  top: 0.05em;
}

/* ── Featured writing and projects ───────────────────────── */
.featured-writing,
.featured-projects {
  margin-bottom: 3rem;
}

/* "All writing →" / "All projects →" links */
.section-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--subtle);
  text-decoration: none;
  margin-top: 1.25rem;
}

.section-link:hover {
  color: var(--accent);
}

/* ── Project grid (homepage featured only) ───────────────── */
/* .project-grid overrides the default vertical list layout
   used on projects.html, turning 2 items into a side-by-side pair. */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2rem;
  border-top: 1px solid var(--border);
  padding-top: 0.25rem;
}

.project-grid li {
  border-top: none;
  border-bottom: none;
  padding: 1rem 0 0.5rem;
}

.project-grid li:first-child {
  border-top: none;
}

@media (max-width: 540px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-grid li + li {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
  }
}

/* ============================================================
   Post lists (home + writing index)
   ============================================================ */
.post-list {
  list-style: none;
}

.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

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

.post-list a {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
}

.post-list a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--subtle);
  margin-top: 0.2rem;
  font-family: var(--font-mono);
}

/* ============================================================
   Projects
   ============================================================ */
.project-list {
  list-style: none;
}

.project-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

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

.project-title {
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

.project-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--subtle);
  margin-top: 0.3rem;
}

.project-tags {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--subtle);
  border: 1px solid var(--border);
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
}

/* ============================================================
   About page
   ============================================================ */
.about-content h2 {
  font-size: 0.75rem;
  font-weight: normal;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 2.75rem 0 0.85rem;
  color: var(--accent);
}

.about-content p {
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.8;
}

.about-content a {
  color: var(--text);
  text-underline-offset: 3px;
}

.about-content a:hover {
  color: var(--accent);
}

/* ============================================================
   Writing index
   ============================================================ */
.writing-heading {
  font-size: 0.75rem;
  font-weight: normal;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.writing-intro {
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
  color: var(--subtle);
  max-width: 520px;
}

/* Filter bar — hidden until JS signals a successful fetch via .js-enabled.
   This prevents the "all" button rendering as orphaned UI on JS failure. */
.filter-bar {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.js-enabled .filter-bar {
  display: flex;
}

/* Filter buttons — match .tag visually but are interactive <button> elements */
.filter-btn {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--subtle);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  cursor: pointer;
  line-height: 1.6;
  -webkit-appearance: none;
  appearance: none;
}

.filter-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Active state: dusty rose fill */
.filter-btn.active,
.filter-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Optional one-line excerpt shown beneath post title in the listing */
.post-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--subtle);
  margin-top: 0.25rem;
  font-style: italic;
}

/* Empty state — shown when a category filter returns no posts,
   or when the fetch fails. Uses body font, not mono. */
.post-list-empty {
  padding: 1rem 0;
  color: var(--subtle);
  font-size: 0.9rem;
  font-family: var(--font-body);
  list-style: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   Post / essay page
   ============================================================ */
.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  font-size: 1.6rem;
  font-weight: normal;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.post-body {
  font-size: 1rem;
}

.post-body p {
  margin-bottom: 1.25rem;
}

.post-body h2 {
  font-size: 1.1rem;
  font-weight: normal;
  font-style: italic;
  margin: 2.5rem 0 0.75rem;
  color: var(--subtle);
}

.post-body h3 {
  font-size: 1rem;
  font-weight: bold;
  margin: 2rem 0 0.5rem;
}

.post-body blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--subtle);
  font-style: italic;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--code-bg);
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
}

.post-body pre {
  background: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 3px;
  margin: 1.5rem 0;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.post-body a {
  color: var(--text);
  text-underline-offset: 3px;
}

.post-body ul,
.post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.post-body li {
  margin-bottom: 0.4rem;
}

/* Opening deck / subtitle — slightly larger, muted */
.post-kicker {
  font-size: 1.05rem;
  color: var(--subtle);
  line-height: 1.7;
  margin-bottom: 2rem;
  font-style: italic;
}

/* Closing line — visually set apart from the body */
.post-closing {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-style: italic;
  color: var(--subtle);
}

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--subtle);
  text-decoration: none;
  margin-bottom: 3.5rem;
}

.back-link:hover {
  color: var(--accent);
}

/* ============================================================
   Homepage — hero (revised)
   ============================================================ */
.hero-sentence {
  font-size: 1rem;
  line-height: 1.7;
  max-width: var(--reading-width);
  margin-bottom: 0.6rem;
}

.hero-current {
  font-size: 0.9rem;
  color: var(--subtle);
  line-height: 1.6;
  max-width: var(--reading-width);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Green-ish dot next to "currently" line */
.status-dot {
  flex-shrink: 0;
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

/* ============================================================
   Homepage — two-column experience + projects grid
   ============================================================ */
.two-col-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 3.5rem;
  align-items: start;
  margin-bottom: 3rem;
}

.two-col-section .experience,
.two-col-section .featured-projects {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .two-col-section {
    grid-template-columns: 1fr;
    gap: 3rem 0;
  }
}

/* ============================================================
   Homepage — selected experience
   ============================================================ */
.experience {
  margin-bottom: 3rem;
}

.experience-list {
  list-style: none;
  border-top: 1px solid var(--border);
}

.experience-entry {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.exp-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
}

.exp-title {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: normal;
}

.exp-date {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--subtle);
  margin-left: auto;
  white-space: nowrap;
}

.exp-org {
  font-size: 0.83rem;
  color: var(--subtle);
  margin-bottom: 0.25rem;
}

.exp-desc {
  font-size: 0.88rem;
  color: var(--subtle);
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   Homepage — about mini
   ============================================================ */
.about-mini {
  margin-bottom: 3rem;
}

.about-mini-body {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-top: 0.25rem;
}

/* Circular profile picture container */
.about-avatar {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background-color: var(--code-bg); /* warm rose placeholder until image is added */
}

.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* hide the broken-image icon while src is empty */
  color: transparent;
}

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

.about-mini p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--subtle);
  margin-bottom: 0.75rem;
}

@media (max-width: 480px) {
  .about-mini-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ============================================================
   Shared section intro (writing, about-mini)
   ============================================================ */
.section-intro {
  font-size: 0.9rem;
  color: var(--subtle);
  line-height: 1.6;
  max-width: 520px;
  margin-bottom: 1.25rem;
  font-style: italic;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  .site-header {
    flex-direction: column;
    gap: 1rem;
  }

  nav {
    gap: 1rem;
  }
}
