/* Ketu Shah personal site. Warm paper, ink, one red. Chapters, not one long page. */

:root {
  --bg: #f3eee1;
  --bg-deep: #e9e1cc;
  --ink: #2c2419;
  --body: #4a4132;
  --muted: #7c7261;
  --faint: #a89a80;
  --rule: #d8cdb2;
  --accent: #7c4f26;
  --accent-deep: #5e3a1b;
  --grid-line: #ddd2b6;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --body-serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* faint paper tooth */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

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

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--accent); }

/* ---------- views ---------- */

.view { display: none; }
.view.active {
  display: block;
  animation: viewIn .42s ease-out;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- nav ---------- */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase;
}
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-name { color: var(--ink); }
.nav-links { display: flex; gap: 26px; }
.nav-toggle { display: none; background: none; border: none; color: var(--ink); font-size: 20px; cursor: pointer; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 150px 32px 30px;
}
/* faint street grid, fading out: a nod to walking the city */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='76' height='76'%3E%3Cpath d='M76 0H0v76' fill='none' stroke='%23d9cdae' stroke-width='1'/%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 95%);
  mask-image: linear-gradient(to bottom, black 30%, transparent 95%);
  opacity: .55;
}
.hero > * { position: relative; }

.edge {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.edge::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--rule);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  font-size: clamp(60px, 9.5vw, 124px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-bottom: 30px;
}

.hero-copy {
  max-width: 640px;
  font-family: var(--body-serif);
  font-size: 19px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 56px;
}

.hero-photo { margin: 0 0 10px; }
.hero-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
}
.hero-photo figcaption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 12px 2px 0;
}
.frame-no { color: var(--accent); margin-right: 10px; }

/* ---------- chapters index ---------- */

.chapters-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 32px 40px;
}
.chapters { border-top: 1px solid var(--rule); }
.chapter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 30px 4px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.chapter-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}
.chapter-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 40px);
  color: var(--ink);
  line-height: 1.2;
  transition: color .18s ease;
}
.chapter-go {
  font-family: var(--serif);
  font-size: 34px;
  color: var(--faint);
  flex-shrink: 0;
  transition: transform .22s ease, color .18s ease;
}
.chapter:hover { background: var(--bg-deep); }
.chapter:hover .chapter-title { color: var(--accent-deep); }
.chapter:hover .chapter-go { transform: translateX(10px); color: var(--accent); }

/* ---------- pages ---------- */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 150px 32px 40px;
  min-height: 70vh;
}

.page h2 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  font-size: clamp(42px, 5.8vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.005em;
  margin-bottom: 36px;
  max-width: 16em;
}

.section-note {
  font-family: var(--body-serif);
  font-size: 18px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 620px;
  margin: -20px 0 44px;
}

.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 1020px;
  margin-bottom: 20px;
}
.cols p {
  font-family: var(--body-serif);
  font-size: 18px;
  line-height: 1.8;
}

.proof { max-width: 1020px; margin-top: 44px; }
.proof p {
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  font-family: var(--body-serif);
  font-size: 18px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 760px;
}
.proof p:last-child { border-bottom: 1px solid var(--rule); }
.proof strong { color: var(--ink); font-weight: 600; }

.closer {
  font-family: var(--body-serif);
  font-size: 19px;
  line-height: 1.8;
  color: var(--body);
  max-width: 760px;
  margin-top: 44px;
}

.back { margin-top: 70px; }
.back a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}
.back a:hover { color: var(--accent); }

/* ---------- instagram embeds ---------- */

.ig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: start;
}
.ig-grid .instagram-media {
  margin: 0 auto !important;
  min-width: 0 !important;
  width: 100% !important;
}

/* ---------- essays ---------- */

.essay { max-width: 700px; margin-bottom: 72px; }
.essay h3 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  font-size: 32px;
  margin-bottom: 20px;
}
.essay p {
  font-family: var(--body-serif);
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 20px;
}
.essay p.drop::first-letter {
  font-family: var(--serif);
  font-size: 3.4em;
  float: left;
  line-height: .86;
  padding-right: 12px;
  padding-top: 4px;
  color: var(--ink);
}

/* ---------- contact ---------- */

.contact-rows { max-width: 640px; }
.contact-rows p {
  display: flex;
  align-items: baseline;
  gap: 26px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  font-size: 20px;
}
.contact-rows p:last-child { border-bottom: 1px solid var(--rule); }
.contact-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--faint);
  min-width: 130px;
}

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

footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 90px 32px 60px;
  border-top: 1px solid var(--rule);
  margin-top: 70px;
  background: linear-gradient(to bottom, var(--bg-deep), var(--bg) 90%);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* ---------- responsive ---------- */

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

@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 720px) {
  .nav { padding: 16px 20px; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--rule);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 16px 20px; border-top: 1px solid var(--rule); }
  .nav a.active { box-shadow: none; }
  .nav-toggle { display: block; }
  .hero { padding: 120px 20px 20px; }
  .chapters-wrap { padding: 40px 20px 30px; }
  .page { padding: 120px 20px 30px; }
  .hero-photo img { aspect-ratio: 4 / 3; }
  .chapter { padding: 24px 2px; }
  footer { padding: 60px 20px 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .view.active { animation: none; }
  .chapter-go, .chapter-title { transition: none; }
  html { scroll-behavior: auto; }
}
