/* Amar Kulkarni — site styles. Editorial field-notes design. */

:root {
  --paper: #f1ede4;
  --paper-2: #e8e2d5;
  --ink: #141414;
  --ink-2: #57554f;
  --ink-3: #8a867c;
  --line: #d6cfbf;
  --red: #e0401c;
  --night: #0f1211;
  --night-2: #1a1f1d;
  --night-ink: #ece8df;
  --night-dim: #9a978f;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --wrap: 1360px;
  --measure: 64ch;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: var(--red); color: #fff; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; }
.red { color: var(--red); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 50; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1; margin: 0; letter-spacing: -.01em; }
em, .it { font-style: italic; }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { font-family: var(--serif); font-size: 1.55rem; text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--red); }
.nav { display: flex; gap: 32px; }
.nav a { font-family: var(--mono); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; opacity: .75; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.nav-toggle { display: none; background: none; border: 0; color: inherit; font: inherit; font-family: var(--mono); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; padding: 8px 0; }

.is-dark .site-header { position: absolute; inset: 0 0 auto 0; color: var(--night-ink); }

@media (max-width: 760px) {
  .nav-toggle { display: block; position: relative; z-index: 31; }
  .nav { position: fixed; inset: 0; z-index: 30; flex-direction: column; justify-content: center; gap: 8px; padding: 0 var(--gutter); background: var(--night); color: var(--night-ink); transform: translateY(-100%); transition: transform .45s var(--ease); }
  .nav.open { transform: none; }
  .nav a { font-family: var(--serif); font-size: 3rem; text-transform: none; letter-spacing: 0; opacity: 1; }
  body.menu-open { overflow: hidden; }
  body.menu-open .nav-toggle { color: var(--night-ink); }
}

/* ---------- Home hero ---------- */
.hero { position: relative; min-height: min(100svh, 980px); background: var(--night); color: var(--night-ink); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.collage { position: absolute; inset: -6% -4%; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); gap: 14px; animation: drift 60s linear infinite alternate; }
.collage img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.6) contrast(1.05); opacity: .42; }
.collage img:nth-child(1) { grid-column: 1 / 3; grid-row: 1 / 2; }
.collage img:nth-child(2) { grid-column: 3 / 4; grid-row: 1 / 3; }
.collage img:nth-child(3) { grid-column: 4 / 5; grid-row: 1 / 2; }
.collage img:nth-child(4) { grid-column: 1 / 2; grid-row: 2 / 4; }
.collage img:nth-child(5) { grid-column: 2 / 3; grid-row: 2 / 4; }
.collage img:nth-child(6) { grid-column: 3 / 5; grid-row: 3 / 4; }
.collage img:nth-child(7) { grid-column: 4 / 5; grid-row: 2 / 3; }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1.02); } to { transform: translate3d(-3%, -4%, 0) scale(1.08); } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,18,17,.55) 0%, rgba(15,18,17,.15) 35%, rgba(15,18,17,.92) 100%); }
.hero-inner { position: relative; z-index: 2; width: 100%; padding-bottom: clamp(32px, 6vw, 72px); }
.hero .kicker { color: var(--night-dim); margin-bottom: 22px; }
.hero h1 { font-size: clamp(3.4rem, 12vw, 11.5rem); line-height: .86; max-width: 11ch; }
.hero h1 em { color: var(--red); }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-top: clamp(28px, 4vw, 48px); flex-wrap: wrap; }
.hero-foot p { max-width: 44ch; margin: 0; font-size: 1.08rem; color: #cfcac0; }
.cycle { font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--night-dim); display: flex; gap: 10px; align-items: center; }
.cycle .words { position: relative; display: inline-block; height: 1.4em; width: 11ch; overflow: hidden; color: var(--night-ink); }
.cycle .words span { position: absolute; left: 0; top: 0; opacity: 0; animation: cycle 12.5s infinite; }
.cycle .words span:nth-child(2) { animation-delay: 2.5s; }
.cycle .words span:nth-child(3) { animation-delay: 5s; }
.cycle .words span:nth-child(4) { animation-delay: 7.5s; }
.cycle .words span:nth-child(5) { animation-delay: 10s; }
@keyframes cycle { 0% { opacity: 0; transform: translateY(100%); } 4%, 18% { opacity: 1; transform: none; } 22%, 100% { opacity: 0; transform: translateY(-100%); } }

/* ---------- Places marquee ---------- */
.marquee { background: var(--red); color: #fff; overflow: hidden; white-space: nowrap; border-block: 1px solid rgba(0,0,0,.15); }
.marquee .track { display: inline-flex; gap: 48px; padding: 14px 0; animation: marquee 50s linear infinite; }
.marquee span { font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.marquee b { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; letter-spacing: 0; text-transform: none; margin-right: 10px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 10vw, 140px) 0; }
.section-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { font-size: clamp(2.6rem, 6.5vw, 5.5rem); }
.section-head .mono { color: var(--ink-3); }
.lede { font-family: var(--serif); font-size: clamp(1.5rem, 2.8vw, 2.2rem); line-height: 1.2; max-width: 30ch; margin: 0; }

/* ---------- Field index (project list) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; background: transparent; color: var(--ink); border: 1px solid var(--ink); border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: background .2s, color .2s; }
.filters button:hover { background: var(--paper-2); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.index li { border-bottom: 1px solid var(--line); }
.index li[hidden] { display: none; }
.index a { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 15rem 7rem 2rem; align-items: baseline; gap: 20px; padding: 26px 0; text-decoration: none; position: relative; transition: padding .35s var(--ease); }
.index a::before { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.index a:hover { padding-left: 14px; }
.index a:hover::before { transform: scaleX(1); }
.index .n { font-family: var(--mono); font-size: .8rem; color: var(--red); }
.index .t { font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 3rem); line-height: 1.02; }
.index .t small { display: block; font-family: var(--sans); font-size: .92rem; line-height: 1.45; color: var(--ink-2); margin-top: 10px; max-width: 52ch; }
.index .where, .index .when { font-family: var(--mono); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.index .where i { display: block; font-style: normal; color: var(--ink-3); margin-top: 4px; }
.index .arrow { font-size: 1.3rem; transition: transform .35s var(--ease), color .2s; }
.index a:hover .arrow { transform: translateX(6px); color: var(--red); }
.index .thumb { display: none; }

.preview { position: fixed; z-index: 15; left: 0; top: 0; width: 340px; aspect-ratio: 4 / 3; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.9) rotate(-2deg); transition: opacity .25s, transform .35s var(--ease); }
.preview.on { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
.preview img { width: 100%; height: 100%; object-fit: cover; box-shadow: 0 24px 60px rgba(0,0,0,.25); }

@media (max-width: 900px) {
  .index a { grid-template-columns: 3rem minmax(0, 1fr); gap: 6px 14px; }
  .index .where, .index .when { grid-column: 2; }
  .index .arrow { display: none; }
  .index .thumb { display: block; grid-column: 2; margin-top: 12px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
  .preview { display: none; }
}

/* ---------- Quote band ---------- */
.quote { background: var(--paper-2); }
.quote blockquote { margin: 0; font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 5.2rem); line-height: 1.02; max-width: 18ch; }
.quote blockquote::before { content: "“"; color: var(--red); }
.quote blockquote::after { content: "”"; color: var(--red); }
.quote figcaption { margin-top: 28px; }
.quote figcaption a { text-decoration-color: var(--red); }

/* ---------- Film band ---------- */
.film { background: var(--night); color: var(--night-ink); }
.film-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
.film img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.film h2 { font-size: clamp(2.8rem, 6vw, 5rem); margin: 14px 0 22px; }
.film p { color: #c9c4ba; max-width: 42ch; }
.film .mono { color: var(--night-dim); }
.link-arrow { display: inline-flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 4px; }
.link-arrow:hover { color: var(--red); }
@media (max-width: 820px) { .film-grid { grid-template-columns: 1fr; } }

/* ---------- Writing list ---------- */
.notes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--ink); }
.notes li { border-right: 1px solid var(--line); }
.notes li:last-child { border-right: 0; }
.notes a { display: flex; flex-direction: column; gap: 14px; height: 100%; padding: 26px 26px 36px 0; text-decoration: none; }
.notes li + li a { padding-left: 26px; }
.notes .mono { color: var(--ink-3); }
.notes h3 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.05; }
.notes a:hover h3 { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.notes p { margin: 0; color: var(--ink-2); font-size: .95rem; }
@media (max-width: 860px) {
  .notes { grid-template-columns: 1fr; }
  .notes li { border-right: 0; border-bottom: 1px solid var(--line); }
  .notes li + li a { padding-left: 0; }
}

.notes.stack { grid-template-columns: 1fr; }
.notes.stack li { border-right: 0; border-bottom: 1px solid var(--line); }
.notes.stack a { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 8px 28px; padding: 30px 0; }
.notes.stack li + li a { padding-left: 0; }
.notes.stack h3 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); }
.notes.stack p { grid-column: 2; max-width: 60ch; }
@media (max-width: 640px) { .notes.stack a { grid-template-columns: 1fr; } .notes.stack p { grid-column: 1; } }

/* ---------- Contact ---------- */
.contact { background: var(--ink); color: var(--paper); }
.contact .mono { color: var(--night-dim); }
.contact a.big { display: inline-block; font-family: var(--serif); font-size: clamp(2.6rem, 9vw, 8.5rem); line-height: 1; text-decoration: none; margin-top: 18px; word-break: break-word; }
.contact a.big span { color: var(--red); display: inline-block; transition: transform .35s var(--ease); }
.contact a.big:hover span { transform: translateX(12px); }
.contact p { color: #bdb8ae; max-width: 46ch; margin-top: 24px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--night-dim); border-top: 1px solid #2a2a2a; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 36px; }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--paper); }

/* ---------- Page heads (index pages) ---------- */
.page-head { padding: clamp(48px, 9vw, 120px) 0 clamp(32px, 5vw, 64px); }
.page-head h1 { font-size: clamp(3.6rem, 12vw, 10rem); line-height: .9; }
.page-head h1 em { color: var(--red); }
.page-head .lede { margin-top: 26px; color: var(--ink-2); }

/* ---------- Project pages ---------- */
.p-hero { position: relative; min-height: min(88svh, 900px); background: var(--night); color: var(--night-ink); display: flex; align-items: flex-end; overflow: hidden; }
.p-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .62; }
.p-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,18,17,.5) 0%, rgba(15,18,17,0) 30%, rgba(15,18,17,.9) 100%); }
.p-hero .wrap { position: relative; z-index: 2; width: 100%; padding-bottom: clamp(32px, 5vw, 64px); }
.p-hero .mono { color: #d2cdc3; }
.p-hero .mono .red { color: #ff7a55; }
.p-hero h1 { font-size: clamp(3rem, 9vw, 8rem); line-height: .9; max-width: 14ch; margin-top: 18px; }
.p-hero .standfirst { font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 1.9rem); line-height: 1.2; max-width: 34ch; margin: 22px 0 0; color: #e4dfd5; }
.p-hero.plain { min-height: min(70svh, 720px); }
.p-hero figcaption { position: absolute; z-index: 2; right: var(--gutter); top: 96px; font-family: var(--mono); font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; color: rgba(236,232,223,.7); max-width: 30ch; text-align: right; }

.p-meta { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.p-meta div { padding: 22px 20px 22px 0; }
.p-meta div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.p-meta dt { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.p-meta dd { margin: 0; font-size: .95rem; }
@media (max-width: 760px) {
  .p-meta { grid-template-columns: 1fr 1fr; }
  .p-meta div:nth-child(3) { padding-left: 0; border-left: 0; }
  .p-meta div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

.p-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--measure)) minmax(0, 1fr); padding: clamp(48px, 7vw, 100px) var(--gutter); }
.p-body > * { grid-column: 2; }
.p-body > .bleed { grid-column: 1 / -1; margin: clamp(40px, 6vw, 80px) calc(var(--gutter) * -1); }
.p-body > .wide { grid-column: 1 / -1; max-width: 1180px; width: 100%; justify-self: center; margin: clamp(32px, 5vw, 64px) 0; }

.prose p, .prose li { font-size: 1.08rem; line-height: 1.7; }
.prose > p:first-of-type::first-letter { float: left; font-family: var(--serif); font-size: 5.4rem; line-height: .82; padding: 6px 12px 0 0; color: var(--red); }
.prose h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.05; margin: 1.6em 0 .55em; }
.prose h3 { font-size: 1.7rem; margin: 1.4em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--red); }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 1.4em 0; font-family: var(--serif); font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.1; border: 0; padding: 0; }
.prose blockquote::before { content: "“"; color: var(--red); }
.prose blockquote::after { content: "”"; color: var(--red); }
.prose a { text-decoration-color: var(--red); }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; display: block; overflow-x: auto; margin: 1.6em 0; }
.prose caption { text-align: left; font-family: var(--mono); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 10px; }
.prose th, .prose td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 400; color: var(--ink-2); white-space: nowrap; }
.prose .note { font-size: .82rem; color: var(--ink-3); }
.prose .refs li { font-size: .86rem; color: var(--ink-2); word-break: break-word; }
.no-dropcap > p:first-of-type::first-letter { float: none; font: inherit; padding: 0; color: inherit; }

figure { margin: 0; }
figcaption { font-family: var(--mono); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-top: 12px; }
.bleed img { width: 100%; max-height: 86vh; object-fit: cover; }
.bleed figcaption { padding: 0 var(--gutter); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.duo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.duo figcaption { grid-column: 1 / -1; margin-top: 0; }
@media (max-width: 640px) { .duo { grid-template-columns: 1fr; } }

.next-project { display: block; background: var(--paper-2); text-decoration: none; padding: clamp(48px, 8vw, 110px) 0; border-top: 1px solid var(--line); }
.next-project .mono { color: var(--red); }
.next-project h2 { font-size: clamp(2.6rem, 8vw, 7rem); margin-top: 14px; transition: transform .45s var(--ease); }
.next-project:hover h2 { transform: translateX(14px); }

/* ---------- Article pages ---------- */
.a-head { padding: clamp(56px, 10vw, 140px) 0 clamp(28px, 4vw, 48px); max-width: 1100px; }
.a-head .mono { color: var(--ink-2); }
.a-head .mono .red { color: var(--red); }
.a-head h1 { font-size: clamp(2.8rem, 7vw, 6.2rem); line-height: .95; margin-top: 22px; }
.a-head .standfirst { font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.25; color: var(--ink-2); margin: 24px 0 0; max-width: 36ch; }
.article { border-top: 1px solid var(--ink); }
.back { display: inline-block; margin: 0 0 clamp(56px, 8vw, 96px); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); padding-bottom: clamp(64px, 10vw, 140px); border-top: 1px solid var(--ink); padding-top: clamp(32px, 5vw, 64px); }
.about-grid .statement { font-family: var(--serif); font-size: clamp(1.9rem, 3.4vw, 2.9rem); line-height: 1.1; margin: 0; }
.about-grid .statement em { color: var(--red); }
.elsewhere { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 36px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */
.lost { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.lost h1 { font-size: clamp(4rem, 14vw, 12rem); line-height: .9; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .collage, .marquee .track, .cycle .words span { animation: none; }
  .cycle .words span:first-child { opacity: 1; }
  * { transition: none !important; }
}
