/* ============================================================
   priyamraj.com — the ledger
   Loaded by index.html only. Inner pages keep style.css.
   ============================================================ */

:root {
  --paper: #faf9f5;
  --ink: #1a1a1c;
  --ink-soft: #5c5c62;
  --ink-faint: #8f8f95;
  --hairline: rgba(26, 26, 28, 0.12);
  --hairline-soft: rgba(26, 26, 28, 0.07);
  --oxide: #a1341c;
  --serif: "Fraunces", "Iowan Old Style", ui-serif, Georgia, serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

/* dark: same ledger, lights off. Warm dark paper, not pure black. */
:root[data-theme="dark"] {
  --paper: #151412;
  --ink: #e7e4dd;
  --ink-soft: #a29f97;
  --ink-faint: #7b786f;
  --hairline: rgba(231, 228, 221, 0.16);
  --hairline-soft: rgba(231, 228, 221, 0.09);
  --oxide: #c7603a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 240ms ease, color 240ms ease;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--oxide); color: var(--paper); }

img, video { display: block; max-width: 100%; }

.page {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 32px);
}

/* ---------- masthead ---------- */

.mast {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 14px;
  border-bottom: 1px solid var(--hairline);
}

.mast .brand {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}

.mast nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mast nav a { color: var(--ink-faint); transition: color 140ms ease; }
.mast nav a:hover { color: var(--ink); }

.theme-toggle {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--oxide);
  transition: color 140ms ease;
}

.theme-toggle:hover { color: var(--ink); }

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

.intro {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: start;
  padding: 44px 0 40px;
  border-bottom: 1px solid var(--hairline);
}

.intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 4.6vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.015em;
}

/* one sentence per line */
.intro h1 span { display: block; }

.intro h1 em { font-style: italic; font-weight: 400; }

.intro .intro-note {
  margin: 14px 0 0;
  max-width: 52ch;
  color: var(--ink-soft);
  font-size: 15px;
}

.intro .intro-note a { border-bottom: 1px solid var(--hairline); }
.intro .intro-note a:hover { border-color: var(--ink); }

/* receipts, up front */
.intro-stats {
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 2;
}

.intro-stats span { color: var(--oxide); margin: 0 7px; }

.intro figure { margin: 0; }

.intro img {
  width: 180px;
  height: 225px;
  object-fit: cover;
  object-position: 50% 26%;
  cursor: zoom-in;
}

/* the portrait occasionally tears into another universe */
.intro img.glitching {
  animation: heroGlitch 0.3s steps(2) 1;
  object-position: 55% 38%;
}

@keyframes heroGlitch {
  0% {
    filter: drop-shadow(-5px 0 0 rgba(0, 255, 255, 0.75)) drop-shadow(5px 0 0 rgba(255, 0, 90, 0.75));
  }
  60% {
    filter: drop-shadow(4px 0 0 rgba(0, 255, 255, 0.55)) drop-shadow(-4px 0 0 rgba(255, 0, 90, 0.55));
  }
  100% {
    filter: none;
  }
}

.intro figcaption {
  margin-top: 10px;
  width: 180px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ---------- sections ---------- */

section { padding: 44px 0 48px; border-bottom: 1px solid var(--hairline); }
section:last-of-type { border-bottom: 0; }

.sec-label {
  margin: 0 0 26px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sec-label::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 1px;
  background: var(--oxide);
  vertical-align: middle;
  margin-right: 10px;
}

.sec-label em { font-style: normal; color: var(--oxide); }

/* entry numbers; the oxide tick yields to them when present */
.sec-label .idx { color: var(--oxide); margin-right: 9px; }
.sec-label:has(.idx)::before { display: none; }

/* ---------- ledger ---------- */

.ledger {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ledger li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline-soft);
}

.ledger li:first-child { border-top: 0; padding-top: 0; }

/* timeline spine — opt-in via .ledger.spine */
.ledger.spine { position: relative; }

.ledger.spine li { grid-template-columns: 88px 1fr; gap: 30px; }

.ledger.spine::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 97px;
  width: 1px;
  background: var(--hairline);
}

.ledger.spine li { position: relative; }

.ledger.spine li::after {
  content: "";
  position: absolute;
  left: 94px;
  top: 21px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--ink-faint);
  z-index: 1;
  transition: background 160ms ease, border-color 160ms ease;
}

.ledger.spine li:first-child::after { top: 9px; }

.ledger.spine li:hover::after {
  background: var(--oxide);
  border-color: var(--oxide);
}

.ledger .when {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  padding-top: 3px;
  white-space: nowrap;
  transition: color 160ms ease;
}

.ledger li:hover .when { color: var(--oxide); }

.ledger .what { min-width: 0; }

.ledger p { margin: 0; font-size: 14.5px; color: var(--ink); }

.ledger p .quiet { color: var(--ink-soft); }

.ledger .what a:not(.rcpt) { border-bottom: 1px solid var(--hairline); }
.ledger .what a:not(.rcpt):hover { border-color: var(--ink); }

.rcpt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--oxide);
  white-space: nowrap;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: background-size 180ms ease;
}

.rcpt:hover { background-size: 100% 1px; }

/* ---------- receipts (the numbers, dotted leaders) ---------- */

.receipts { margin: 0; }

.r-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--hairline-soft);
}

.r-row:first-child { border-top: 0; padding-top: 0; }

.receipts dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
  transition: color 160ms ease;
}

.r-row:hover dt { color: var(--oxide); }

.receipts .lead {
  flex: 1 1 24px;
  min-width: 24px;
  border-bottom: 1px dotted var(--hairline);
  transform: translateY(-4px);
}

.receipts dd {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  text-align: right;
}

.receipts-note {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.9;
}

.receipts-note a { color: var(--oxide); }
.receipts-note a:hover { text-decoration: underline; }

.ledger .thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.ledger .thumbs img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  filter: grayscale(1);
  cursor: zoom-in;
  transition: filter 160ms ease;
}

.ledger .thumbs img:hover { filter: none; }

.ledger .inline-figure { margin: 10px 0 2px; }

.ledger .inline-figure img {
  width: 100%;
  max-height: 210px;
  object-fit: cover;
  object-position: 50% 42%;
  cursor: zoom-in;
}

.ledger .inline-figure figcaption {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- archive grid ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 16px;
}

.gallery figure { margin: 0; }

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  cursor: zoom-in;
  filter: saturate(0.82);
  transition: filter 200ms ease;
}

.gallery img:hover { filter: saturate(1); }

.gallery figcaption {
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.55;
}

.archive-note {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.archive-note a { color: var(--oxide); }
.archive-note a:hover { text-decoration: underline; }

/* ---------- pause (video) ---------- */

.pause blockquote {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(17px, 2.6vw, 20px);
  line-height: 1.45;
  color: var(--ink);
  max-width: 44ch;
}

.pause blockquote cite {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.pause video { width: 100%; background: #000; }

.pause figure { margin: 0; }

.pause figcaption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- now ---------- */

.now {
  margin: 0;
  padding: 0;
  list-style: none;
}

.now li { border-top: 1px solid var(--hairline-soft); }
.now li:first-child { border-top: 0; }

.now a, .now .row {
  display: grid;
  grid-template-columns: 108px 1fr auto;
  gap: 18px;
  align-items: baseline;
  padding: 12px 0;
}

.now h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.now p { margin: 0; font-size: 14px; color: var(--ink-soft); }

.now .arrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  transition: color 140ms ease;
}

.now a:hover .arrow { color: var(--oxide); }
.now a:hover h3 { color: var(--oxide); }

.now-foot {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.now-foot a { color: var(--ink); border-bottom: 1px solid var(--hairline); }
.now-foot a:hover { border-color: var(--ink); }

/* ---------- lore / principles (about page) ---------- */

.lore-text {
  margin: 0;
  max-width: 56ch;
  font-size: 15px;
  color: var(--ink-soft);
}

.principles {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
}

.principles li {
  padding: 16px 0;
  border-top: 1px solid var(--hairline-soft);
}

.principles li:first-child { border-top: 0; padding-top: 0; }

.principles h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.principles p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

/* ---------- buttons + faq (reviewed) ---------- */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 20px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  background: var(--oxide);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 3px;
  transition: background 140ms ease;
}

.btn:hover { background: #82290f; }

.btn-ghost {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oxide);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 2px;
}

.btn-ghost:hover { border-color: var(--oxide); }

.cap-note {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.faq { display: grid; gap: 0; }

.faq details {
  border-top: 1px solid var(--hairline-soft);
  padding: 12px 0;
}

.faq details:first-child { border-top: 0; padding-top: 0; }

.faq summary {
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--ink-faint);
}

.faq details[open] summary::after { content: "\2013"; }

.faq details p {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* ---------- footnotes ---------- */

.footnotes ol {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
  display: grid;
  gap: 8px;
}

.footnotes .press-links { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; margin-left: 4px; }

.footnotes .press-links a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--oxide);
}

.footnotes .press-links a:hover { text-decoration: underline; }

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

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 22px 0 44px;
  border-top: 1px solid var(--hairline);
}

.site-foot .fine {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-foot nav a { color: var(--ink-faint); }
.site-foot nav a:hover { color: var(--ink); }

/* ---------- player ---------- */

.player {
  position: relative;
  margin: 0;
}

.player video {
  width: 100%;
  display: block;
  background: #000;
  border-radius: 4px;
  box-shadow: 0 18px 44px rgba(26, 26, 28, 0.16);
}

.player .play-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.38));
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background 180ms ease;
}

.player .play-btn:hover { background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.3)); }

.player .play-ring {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(250, 249, 245, 0.65);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #faf9f5;
  font-size: 17px;
  padding-left: 4px;
  transition: transform 180ms ease, background 180ms ease;
}

.player .play-btn:hover .play-ring { transform: scale(1.06); background: rgba(0, 0, 0, 0.5); }

.player .play-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250, 249, 245, 0.85);
}

.player.playing .play-btn { display: none; }

/* ---------- lightbox ---------- */

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(92vw, 1080px);
  max-height: 92vh;
}

.lightbox::backdrop {
  background: rgba(12, 12, 14, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lightbox figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(92vh - 60px);
  object-fit: contain;
}

.lightbox figcaption {
  padding: 14px 4px 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 249, 245, 0.75);
  text-align: center;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(250, 249, 245, 0.3);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: rgba(250, 249, 245, 0.9);
  font-size: 13px;
  cursor: pointer;
  transition: background 140ms ease;
}

.lightbox-close:hover { background: rgba(0, 0, 0, 0.7); }

/* ---------- dark adjustments ---------- */

:root[data-theme="dark"] .gallery img { filter: saturate(0.78) brightness(0.86); }
:root[data-theme="dark"] .gallery img:hover { filter: saturate(1) brightness(1); }
:root[data-theme="dark"] .intro img { filter: brightness(0.92); }
:root[data-theme="dark"] .ledger .thumbs img { filter: grayscale(1) brightness(0.85); }
:root[data-theme="dark"] .ledger .thumbs img:hover { filter: none; }
:root[data-theme="dark"] .player video { box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55); }

/* ---------- reveal + motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 640ms ease, transform 640ms cubic-bezier(0.22, 0.61, 0.36, 1);
  }

  .reveal.is-seen { opacity: 1; transform: none; }

  .lightbox[open] { animation: lb-in 220ms ease; }
  .lightbox[open]::backdrop { animation: lb-fade 220ms ease; }

  @keyframes lb-in { from { opacity: 0; transform: scale(0.985); } }
  @keyframes lb-fade { from { opacity: 0; } }
}

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

@media (max-width: 620px) {
  .intro { grid-template-columns: 1fr; gap: 20px; }
  .intro figure { order: -1; }
  .ledger li { grid-template-columns: 64px 1fr; gap: 12px; }
  .ledger.spine::before,
  .ledger.spine li::after { display: none; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
  .now a, .now .row { grid-template-columns: 1fr; gap: 3px; }
  .now .arrow { display: none; }
}
