/* Imperfect — Kaustubh Deshmukh
   Palette: warm paper #fbf9f5 · ink #1a1f28 · muted #4f5866 · amber accent #b4661a
   Type: Instrument Serif (headings) · Karla (body) · Caveat (wordmark, sign-off) */

:root {
  --paper: #fbf9f5;
  --ink: #1a1f28;
  --muted: #4f5866;
  --accent: #b4661a;
  --line: #ece6da;
  --hairline: #ddd5c6;
  --maxw: 1120px;
  --pad: clamp(20px, 5vw, 48px);
  --portrait: 64px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Karla", Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: inherit; text-underline-offset: 5px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

.skip {
  position: absolute;
  left: 16px;
  top: -200px;
  z-index: 20;
  padding: 14px 18px;
  background: var(--paper);
  border: 1px solid #e5dfd3;
}
.skip:focus { top: 16px; }

/* ---------- shared ---------- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.rule { border-top: 1px solid var(--line); }

.label {
  font-size: 15px;
  color: var(--accent);
  margin: 0 0 14px;
}

.wordmark {
  font-family: Caveat, "Segoe Script", cursive;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}
.wordmark span { color: var(--accent); }

h1, h2, h3 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  margin-top: 0;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 249, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-top: clamp(14px, 2.2vw, 20px);
  padding-bottom: clamp(14px, 2.2vw, 20px);
}

.site-header .wordmark { font-size: clamp(29px, 3.6vw, 36px); }

.brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.brand-name {
  font-size: 14px;
  line-height: 1.2;
  color: var(--accent);
}

.nav-link {
  margin-top: 6px;
  font-size: 15px;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 2px;
}
.nav-link:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- intro ---------- */

.intro {
  padding-top: clamp(28px, 4.5vw, 56px);
  padding-bottom: clamp(32px, 5vw, 56px);
}

.intro h1 {
  color: var(--accent);
  font-size: clamp(44px, 7.4vw, 92px);
  line-height: 1.02;
  letter-spacing: -1.4px;
  margin: 0 0 clamp(20px, 3vw, 28px);
  max-width: 17ch;
  text-wrap: pretty;
}

.intro .label { margin-bottom: clamp(20px, 3vw, 28px); }

.belief {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.7;
}

/* ---------- project ---------- */

.project { padding-bottom: clamp(44px, 7vw, 84px); }

.project-grid {
  padding-top: clamp(36px, 5vw, 56px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  align-items: center;
  gap: clamp(28px, 4.5vw, 60px);
}

.project-grid > * { min-width: 0; }

.cover {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 18px 40px -22px rgba(26, 31, 40, 0.35);
}

.project h2 {
  font-size: clamp(38px, 5.2vw, 62px);
  line-height: 1.04;
  letter-spacing: -1px;
  margin: 0 0 14px;
}

.subtitle {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: clamp(21px, 2.6vw, 26px);
  line-height: 1.4;
  max-width: 320px;
  margin: 0 0 12px;
}

.byline, .listen-note { color: var(--muted); font-size: 15px; margin: 0; }
.byline { font-size: 14.5px; line-height: 1.5; }
.listen-note { margin-top: 12px; }

.listen {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding: 14px 26px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border-radius: 999px;
}
.listen:hover { background: var(--ink); color: #fff; }

/* ---------- story ---------- */

.chapter {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 4vw, 64px);
  padding-top: clamp(38px, 6vw, 58px);
  padding-bottom: clamp(38px, 6vw, 58px);
}

.chapter-head { flex: 1 1 220px; min-width: 0; }

.chapter-num {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 20px;
  color: var(--accent);
  margin: 0 0 8px;
}

.chapter-head h3 {
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin: 0;
}

.chapter-body {
  flex: 2.2 1 400px;
  min-width: 0;
  max-width: 690px;
}

.chapter-body p { margin: 0 0 24px; }
.chapter-body p:last-child { margin-bottom: 0; }

.closing {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: clamp(22px, 2.9vw, 30px);
  line-height: 1.35;
  margin-top: clamp(26px, 4vw, 36px) !important;
}

/* ---------- credits ---------- */

.credits {
  padding-top: clamp(38px, 6vw, 62px);
  padding-bottom: clamp(44px, 7vw, 76px);
}

.credits .label { margin-bottom: 12px; }

.credits h3 {
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.6px;
  margin: 0 0 clamp(26px, 4vw, 40px);
}

.credits dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(20px, 2.6vw, 28px) clamp(32px, 5vw, 64px);
}

.person {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.portrait {
  flex: 0 0 auto;
  width: var(--portrait);
  height: var(--portrait);
  border-radius: 50%;
  object-fit: cover;
}

.person dt { font-size: 17px; font-weight: 600; line-height: 1.35; }
.person dd { margin: 2px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.person dt a { text-decoration: none; border-bottom: 1px solid var(--hairline); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-top: clamp(26px, 4vw, 36px);
  padding-bottom: clamp(44px, 6vw, 60px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
}

.site-footer .wordmark { font-size: 30px; }

.signoff {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.signoff-photo {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.signoff-text {
  font-family: Caveat, "Segoe Script", cursive;
  color: var(--muted);
  font-size: 23px;
  line-height: 1.2;
}
