/* ============================================================
   adityajhunjhunwala.com
   Brand system: Cream / Navy / Gold / Teal
   Typography: DM Serif Display (headings) + Inter (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Inter:wght@400;500;600&display=swap');

/* --- Variables --- */
:root {
  --cream:      #F8F6F0;
  --cream-dark: #EEE9DC;
  --navy:       #1A1A2E;
  --navy-mid:   #16213E;
  --navy-light: #2A2A4A;
  --gold:       #D4A843;
  --gold-light: #F0D78C;
  --teal:       #0F9B8E;
  --teal-light: #5EEAD4;
  --text:       #1A1A2E;
  --text-muted: #5A5A7A;
  --border:     #DDD8C8;

  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;

  --measure:    680px;
  --gutter:     1.5rem;
  --nav-height: 60px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Base --- */
body {
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;   /* 17px */
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* --- Nav --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}
.site-nav__inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.site-nav__logo {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav__logo:hover { text-decoration: none; color: var(--gold); }
.site-nav__links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  align-items: center;
}
.site-nav__links a {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--navy-mid);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.site-nav__links a:hover { color: var(--gold); text-decoration: none; }
.site-nav__links a.nav-subscribe {
  background: var(--gold);
  color: var(--navy);
  padding: 0.375rem 1rem;
  border-radius: 2px;
  font-weight: 600;
}
.site-nav__links a.nav-subscribe:hover { background: var(--gold-light); }

/* Hamburger — mobile */
.site-nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.site-nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  transition: transform 0.2s;
}

/* --- Page wrapper --- */
.page-wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3rem var(--gutter) 5rem;
}
.page-wrap--wide {
  max-width: 1000px;
}

/* --- Gold rule accent --- */
.gold-rule {
  display: block;
  width: 48px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 2rem;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  color: var(--navy);
}
h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

/* --- Prose (letter/article body) --- */
.prose {
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--text);
}
.prose h1, .prose h2, .prose h3 { margin-top: 2.5rem; margin-bottom: 0.75rem; }
.prose p { margin-bottom: 1.375rem; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: 0.375rem; }
.prose blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 1.75rem 0;
  color: var(--text-muted);
  font-style: italic;
}
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}
.prose a { color: var(--teal); }
.prose a:hover { color: var(--gold); }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose img, .prose .letter-image {
  max-width: 100%;
  border-radius: 2px;
  margin: 2rem auto;
}
/* Separator lines from letters */
.prose p:has(> br:only-child),
.prose p:empty { display: none; }

/* --- HOME PAGE --- */
.home-hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border);
  max-width: var(--measure);
  margin: 0 auto;
}
.home-hero__eyebrow {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.home-hero__name {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  line-height: 1.05;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.home-hero__tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.home-hero__bio {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  max-width: 560px;
  margin-bottom: 2rem;
}
.home-hero__cta {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  display: inline-block;
  padding: 0.625rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--gold);
  color: var(--navy);
}
.btn-primary:hover { background: var(--gold-light); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }

/* Home sections */
.home-section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
  max-width: var(--measure);
  margin: 0 auto;
}
.home-section__label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
}
.home-section__title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
}

/* Latest letter card on home */
.latest-letter {
  border-left: 3px solid var(--gold);
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  background: var(--cream-dark);
  border-radius: 0 2px 2px 0;
}
.latest-letter__number {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.375rem;
}
.latest-letter__title {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.latest-letter__excerpt {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}
.latest-letter__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}
.latest-letter__link:hover { color: var(--gold); }

/* Body of work stats on home */
.bow-stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.bow-stat__num {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  color: var(--navy);
  line-height: 1;
}
.bow-stat__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* What I do blocks */
.what-i-do {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.what-i-do__block {
  padding: 1.25rem 1.25rem 1.25rem 1rem;
  border-left: 2px solid var(--teal);
}
.what-i-do__who {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.375rem;
}
.what-i-do__desc {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.6;
}

/* Book card */
.book-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem;
  background: var(--cream-dark);
  border-radius: 2px;
  margin-top: 1.25rem;
}
.book-card__cover {
  width: 80px;
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: 2px 3px 10px rgba(0,0,0,0.15);
}
.book-card__title { font-family: var(--font-serif); font-size: 1.125rem; margin-bottom: 0.25rem; }
.book-card__sub { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.75rem; }

/* Subscribe CTA block */
.subscribe-cta {
  background: var(--navy);
  color: var(--cream);
  padding: 3rem 2rem;
  border-radius: 2px;
  text-align: center;
  margin-top: 4rem;
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}
.subscribe-cta h2 {
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}
.subscribe-cta p { color: rgba(248,246,240,0.75); margin-bottom: 1.5rem; font-size: 0.9375rem; }

/* --- LETTER / ARTICLE PAGE --- */
.post-header {
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.post-header__meta {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.post-header__title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  line-height: 1.15;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.post-header__date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Letter nav (prev/next) */
.letter-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}
.letter-nav a { color: var(--teal); font-weight: 500; }
.letter-nav a:hover { color: var(--gold); }
.letter-nav__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); display: block; margin-bottom: 0.25rem; }

/* Post subscribe nudge */
.post-subscribe {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--cream-dark);
  border-left: 3px solid var(--gold);
  border-radius: 0 2px 2px 0;
}
.post-subscribe p { font-size: 0.9375rem; color: var(--text-muted); margin-bottom: 0.75rem; }

/* --- LIST PAGES (letters archive, writing archive) --- */
.archive-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.archive-header__count {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

/* Letter list item */
.letter-list { list-style: none; }
.letter-item {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}
.letter-item__num {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  min-width: 42px;
  flex-shrink: 0;
}
.letter-item__title {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  color: var(--navy);
  flex: 1;
}
.letter-item__title a { color: var(--navy); }
.letter-item__title a:hover { color: var(--gold); text-decoration: none; }
.letter-item__date {
  font-size: 0.775rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Article card grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.article-card {
  padding: 1.5rem;
  background: var(--cream-dark);
  border-radius: 2px;
  border-top: 2px solid var(--border);
  transition: border-color 0.15s;
}
.article-card:hover { border-color: var(--gold); }
.article-card__title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}
.article-card__title a { color: var(--navy); }
.article-card__title a:hover { color: var(--gold); text-decoration: none; }
.article-card__excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- WORK HUB --- */
.work-rooms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.work-room {
  padding: 2rem 1.5rem;
  background: var(--cream-dark);
  border-radius: 2px;
  border-left: 3px solid var(--border);
  text-decoration: none;
  transition: border-color 0.15s;
  display: block;
}
.work-room:hover { border-color: var(--gold); text-decoration: none; }
.work-room__count {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.work-room__label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.5rem;
}
.work-room__desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.work-room--phased { opacity: 0.55; }
.work-room--phased:hover { border-color: var(--border); }

/* --- SEARCH --- */
.search-wrap {
  margin-bottom: 2rem;
}
#search { width: 100%; }

/* --- FOOTER --- */
.site-footer {
  background: var(--navy);
  color: rgba(248,246,240,0.65);
  padding: 3rem var(--gutter);
  margin-top: 6rem;
  font-size: 0.875rem;
}
.site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-end;
}
.site-footer__name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--cream);
  margin-bottom: 0.25rem;
}
.site-footer__tagline { color: var(--gold); font-style: italic; margin-bottom: 0.5rem; }
.site-footer__links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer__links a { color: rgba(248,246,240,0.55); }
.site-footer__links a:hover { color: var(--gold); text-decoration: none; }
.site-footer__copy { color: rgba(248,246,240,0.35); font-size: 0.775rem; margin-top: 1rem; }

/* --- PAGEFIND SEARCH STYLING --- */
.pagefind-ui {
  --pagefind-ui-font: var(--font-sans);
  --pagefind-ui-primary: var(--gold);
  --pagefind-ui-text: var(--text);
  --pagefind-ui-background: var(--cream);
  --pagefind-ui-border: var(--border);
  --pagefind-ui-border-radius: 2px;
}

/* --- RESPONSIVE --- */
@media (max-width: 680px) {
  :root { --gutter: 1rem; }

  .site-nav__links { display: none; flex-direction: column; }
  .site-nav__links.is-open {
    display: flex;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    padding: 1rem var(--gutter);
    gap: 1rem;
  }
  .site-nav__toggle { display: block; }

  .bow-stats { gap: 1.5rem; }
  .what-i-do { grid-template-columns: 1fr; }
  .book-card { flex-direction: column; }
  .letter-item__date { display: none; }
  .article-grid { grid-template-columns: 1fr; }
  .work-rooms { grid-template-columns: 1fr; }
  .home-hero { padding: 3rem 0 2.5rem; }
}
