/* Aryaman Saraogi — personal site.
   Warm off-white paper, graphite ink, terracotta accent, Inter throughout. */

:root {
  --surface: #f8f6f1;
  --surface-sunk: #efebe3;
  --primary: #514a44;
  --secondary: #514a44b3;
  --heading: #221f1c;
  --accent: #c25b3f;
  --accent-strong: #9e4129;
  --divider: #514a4417;
  --divider-strong: #514a442b;
  --reel: #e7e2da;
  --step: 60ms;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; background: var(--surface); }

body {
  font-family: var(--font-sans);
  font-weight: 450;
  font-feature-settings: "calt" 1, "ss08" 1;
  color: var(--primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}

a { color: inherit; text-decoration: none; }
img, video, svg { display: block; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- page shell ---------- */

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
  padding: 80px 20px 40px;
  min-height: 100vh;
}
.page--entry { align-items: stretch; padding: 64px 20px; }
.page--list { padding-top: 40px; }

.text-body { font-size: 14px; font-weight: 450; letter-spacing: -0.02em; line-height: 1.45; }
.text-sub { font-size: 12px; font-weight: 450; letter-spacing: -0.02em; line-height: 1.25; }

.link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transition: text-decoration-color .3s ease-out;
}
.link:hover { text-decoration-color: var(--accent-strong); }
button.link {
  appearance: none; margin: 0; padding: 0; border: 0; background: none;
  font: inherit; letter-spacing: inherit; cursor: pointer;
}

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

.head { display: flex; flex-direction: column; gap: 12px; width: 100%; padding-bottom: 22px; }

.masthead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; width: 100%; }
.wordmark {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.035em;
  color: var(--heading);
}
.greet { font-size: 26px; letter-spacing: -0.04em; white-space: nowrap; }
.caret {
  display: inline-block; width: 2px; height: .9em; margin-left: 3px;
  vertical-align: -0.08em; border-radius: 1px; background: var(--accent);
  animation: caret-blink 1.05s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.masthead-note { font-size: 12px; letter-spacing: -0.01em; color: var(--secondary); white-space: nowrap; }

.intro { margin: 0; color: var(--primary); text-wrap: pretty; }

/* ---------- sections & rows ---------- */

.sections { display: flex; flex-direction: column; gap: 24px; width: 100%; }
.section { display: flex; flex-direction: column; gap: 4px; width: 100%; }

.h2 {
  display: flex; align-items: baseline; gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--heading);
}
.h2 a { text-underline-offset: 3px; text-decoration-color: var(--accent); }
.h2-count { font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--secondary); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; } }

.rows { display: flex; flex-direction: column; width: 100%; }

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 8px 0;
  cursor: pointer;
}
.row:focus-visible { outline: 2px solid var(--heading); outline-offset: 2px; border-radius: 4px; }
.row-title { flex: 1; color: var(--primary); min-width: 0; }
.row-date {
  display: flex; flex-shrink: 0; align-items: center; gap: 8px;
  white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--secondary);
}

.divider::after {
  content: "";
  position: absolute; bottom: 0; left: 0;
  width: 100%; height: 1.25px; border-radius: 9999px;
  background: linear-gradient(to right, var(--divider), transparent);
  transition: opacity .35s ease-out;
}

/* the little stack of photos at the start of each row */
.pile { position: relative; flex-shrink: 0; width: 60px; height: 36px; }
.pile-card {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transform: translate(var(--pile-tx), var(--pile-ty)) rotate(var(--pile-tilt));
  transition: transform .35s cubic-bezier(.34, 1.4, .64, 1);
}
.pile-top { position: relative; display: flex; align-items: center; justify-content: center; width: 60px; height: 36px; }

.polaroid {
  position: relative;
  width: 57px; height: 34px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 5px;
  background-color: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14), 0 2px 6px -2px rgba(0, 0, 0, .12);
  pointer-events: none;
  user-select: none;
  transform: rotate(var(--rot-to));
  transition: transform .35s cubic-bezier(.34, 1.4, .64, 1), scale .25s;
  animation: polaroid-pop .35s cubic-bezier(.22, .03, .26, 1) backwards;
  animation-delay: calc(.15s + var(--stagger, 0) * var(--step) + 60ms);
}
.polaroid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.polaroid::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 1px .5px rgba(0, 0, 0, .1); }
.polaroid--icon { display: flex; align-items: center; justify-content: center; color: var(--heading); }
.polaroid--icon svg { width: 15px; height: 15px; }

@keyframes polaroid-pop {
  from { transform: rotate(var(--rot-from)) scale(.85); opacity: 0; }
  to { transform: rotate(var(--rot-to)) scale(1); opacity: 1; }
}

.stagger {
  animation: fade-up .4s cubic-bezier(.22, 1, .36, 1) backwards;
  animation-delay: calc(.1s + var(--stagger, 0) * var(--step));
}
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }

/* Hover: the row's title darkens and a small arrow slides in; the photo stack
   fans out. `data-hover-cold` is removed on the first real mouse move so a
   cursor resting on the list during load doesn't trigger it. */
.row-title { display: inline-flex; align-items: baseline; gap: 6px; transition: color .2s ease-out; }
.row-title::after {
  content: "→"; color: var(--accent); opacity: 0; transform: translateX(-4px);
  transition: opacity .2s ease-out, transform .25s cubic-bezier(.22, 1, .36, 1);
}
@media (hover: hover) {
  body:not([data-hover-cold]) .has-pile:hover .row-title { color: var(--heading); }
  body:not([data-hover-cold]) .has-pile:hover .row-title::after { opacity: 1; transform: none; }
  body:not([data-hover-cold]) .has-pile:hover .polaroid { transform: rotate(calc(var(--rot-to) + var(--hover-tilt))) scale(1.04); }
  body:not([data-hover-cold]) .has-pile:hover .pile-card { transform: translate(var(--pile-fan-tx), var(--pile-fan-ty)) rotate(var(--pile-fan-tilt)); }
}
.row:active .polaroid { scale: .94; }

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

.socials {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  width: 100%; padding-top: 32px; color: var(--secondary);
}

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

.back {
  position: fixed; top: 92px; left: max(16px, calc(50% - 275px - 62px)); z-index: 20;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 200px;
  background: #fff; color: var(--heading);
  box-shadow: 0 1px 2px rgba(67, 40, 24, .1), 0 4px 12px rgba(67, 40, 24, .06);
  transition: transform .25s cubic-bezier(.22, .03, .26, 1), box-shadow .25s ease-out, opacity .22s ease-out;
}
.back--scrolling { opacity: 0; pointer-events: none; }
@media (hover: hover) {
  .back:hover { transform: translateX(-2px); box-shadow: 0 1px 2px rgba(67, 40, 24, .12), 0 6px 18px rgba(67, 40, 24, .1); }
}
@media (max-width: 780px) { .back { top: 20px; left: 16px; } .page--entry { padding-top: 72px; } .page--list { padding-top: 72px; } }

.hero {
  position: relative; z-index: 21; overflow: hidden;
  border: 10px solid #fff; border-radius: 14px; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 10px 24px -10px rgba(34, 31, 28, .28);
}
.hero::after { content: ""; position: absolute; inset: 0; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); pointer-events: none; }
.hero > img, .hero > video, .hero > .views { border-radius: 4px; }
.hero img, .hero video { width: 100%; height: auto; }
.hero video { aspect-ratio: var(--ar, 1.6); object-fit: cover; object-position: var(--focus, 50% 50%); background: var(--reel); }
.hero--frame { aspect-ratio: 16 / 10; }
.hero--frame img { width: 100%; height: 100%; object-fit: var(--fit, cover); object-position: var(--focus, 50% 50%); }
.hero--icon {
  aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center;
  color: var(--heading); background: var(--surface-sunk);
}
.hero--icon::after { box-shadow: inset 0 0 0 1px rgba(85, 70, 64, .35); }
.hero--icon svg { width: 72px; height: 72px; }
.hero--svg { background: var(--surface); }
.hero--svg svg { width: 100%; height: auto; }

.entry-title {
  margin: 30px 0 0;
  font-weight: 650;
  font-size: 32px; line-height: 1.12; letter-spacing: -0.04em;
  color: var(--heading); text-wrap: balance;
}
.entry .entry-title:first-child { margin-top: 0; }
.entry-year {
  margin: 8px 0 0;
  font-size: 13.5px; letter-spacing: -0.015em; color: var(--secondary);
}
.entry-links {
  margin: 14px 0 0; padding-left: 1.05em; list-style: disc;
  font-size: 14px; letter-spacing: -0.02em; line-height: 1.6; color: var(--secondary);
}
.entry-links li { margin-top: 2px; }
.entry-links li::marker { color: color-mix(in srgb, var(--secondary) 45%, transparent); }

.blocks { display: flex; flex-direction: column; gap: 20px; width: 100%; padding-top: 28px; }

.prose { margin: 0; font-size: 14px; letter-spacing: -0.02em; line-height: 1.6; color: var(--primary); text-wrap: pretty; }
.prose strong { font-weight: 600; color: var(--heading); }
.prose code, .formula { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; letter-spacing: 0; }

.h3 {
  margin: 14px 0 -6px;
  font-weight: 600;
  font-size: 15px; line-height: 1.25; letter-spacing: -0.02em;
  color: var(--heading);
}

.steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; }
.steps li { padding-left: 4px; }
.steps li::marker { color: var(--secondary); font-variant-numeric: tabular-nums; font-size: 12px; }

/* key/value table, ruled like the home rows */
.specs { width: 100%; margin: 0; border-collapse: collapse; font-size: 13px; letter-spacing: -0.02em; line-height: 1.45; }
.specs th, .specs td { position: relative; padding: 7px 0; text-align: left; vertical-align: top; font-weight: 450; }
.specs th { width: 34%; padding-right: 16px; color: var(--secondary); }
.specs td { color: var(--primary); }
.specs tr { position: relative; }
.specs tr + tr th, .specs tr + tr td { border-top: 1.25px solid var(--divider-strong); }
.specs strong { font-weight: 600; color: var(--heading); }

.grid-table { width: 100%; border-collapse: collapse; font-size: 12.5px; letter-spacing: -0.02em; line-height: 1.4; font-variant-numeric: tabular-nums; }
.grid-table th, .grid-table td { padding: 7px 8px 7px 0; text-align: left; font-weight: 450; vertical-align: top; }
.grid-table thead th { color: var(--secondary); border-bottom: 1.25px solid var(--divider-strong); }
.grid-table tbody tr + tr td { border-top: 1.25px solid var(--divider); }
.table-scroll { width: 100%; overflow-x: auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 0; }
.stat { padding: 12px 12px 10px; border-radius: 14px; background: color-mix(in srgb, var(--primary) 5%, transparent); }
.stat dt { order: 2; font-size: 11.5px; letter-spacing: -0.01em; color: var(--secondary); line-height: 1.3; }
.stat dd {
  margin: 0 0 4px; font-weight: 600; letter-spacing: -0.04em;
  font-size: 22px; line-height: 1.05; color: var(--heading); font-variant-numeric: tabular-nums;
}
.stat { display: flex; flex-direction: column; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 11.5px; color: var(--secondary); }
.tags li { padding: 2px 7px; border: 1px solid var(--divider-strong); border-radius: 9999px; background: color-mix(in srgb, var(--primary) 3%, transparent); }

.formula {
  margin: 0; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 5%, transparent);
  color: var(--heading); overflow-x: auto; white-space: nowrap;
}

/* media inside entries */
.shot { padding: 24px 0 16px; }
@media (min-width: 700px) { .shot--wide { margin-inline: -24px; } }

.print {
  position: relative; margin: 0 auto; overflow: hidden;
  border: clamp(6px, 1.6vw, 9px) solid #fff; border-radius: 12px; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 8px 20px -10px rgba(34, 31, 28, .3);
  transform: scale(.94);
  width: min(100%, calc(min(72vh, 640px) * var(--ar, 1.6)));
}
.print img { width: 100%; height: auto; border-radius: 4px; }
.print a { display: block; }

.reel {
  position: relative; margin-inline: auto; overflow: hidden;
  width: min(100%, calc(min(72vh, 640px) * var(--ar, 1.6)));
  aspect-ratio: var(--ar, 1.6);
  border-radius: 18px; background: var(--reel);
  box-shadow: 0 2px 6px -2px rgba(34, 31, 28, .1), 0 12px 24px -12px rgba(34, 31, 28, .25);
}
.reel video, .reel iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reel video { object-fit: cover; }

.caption {
  margin: 12px auto 0; max-width: 46ch; text-align: center;
  font-size: 12px; letter-spacing: -0.02em; line-height: 1.4; color: var(--secondary); text-wrap: balance;
}

/* six-camera loop: labels laid over the 3 × 2 grid of views */
.views { position: relative; }
.views video { display: block; width: 100%; height: auto; aspect-ratio: var(--ar, 2); object-fit: cover; }
.views-labels {
  position: absolute; inset: 0; display: grid;
  grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr);
  pointer-events: none;
}
.views-labels span {
  align-self: start; justify-self: start; margin: 6px;
  padding: 2px 6px; border-radius: 999px;
  background: rgba(20, 18, 16, .55); color: #f4f1ea;
  font-size: 10px; font-weight: 500; letter-spacing: 0; line-height: 1.4;
  backdrop-filter: saturate(1.2);
}

.placeholder {
  display: flex; align-items: center; justify-content: center; min-height: 180px; padding: 20px;
  border: 1.25px dashed var(--divider-strong); border-radius: 16px;
  font-size: 12.5px; color: var(--secondary); text-align: center;
}

/* ---------- motion ---------- */

@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-out .2s cubic-bezier(.4, 0, 1, 1) both; }
  ::view-transition-new(root) { animation: vt-in .34s cubic-bezier(.22, 1, .36, 1) both; }
  .entry .hero, .entry .entry-title, .entry .entry-year, .entry .entry-links, .entry .block {
    animation: entrance .5s cubic-bezier(.22, 1, .36, 1) backwards;
  }
  .entry .hero { animation-delay: .18s; }
  .entry .entry-title { animation-delay: .24s; }
  .entry .entry-year { animation-delay: .28s; }
  .entry .entry-links { animation-delay: .3s; }
  .entry .block { animation-delay: calc(.32s + min(var(--rung, 0), 8) * var(--step)); }
  .back { animation: back-in .28s ease-out backwards; animation-delay: .34s; }
}
@keyframes entrance { from { opacity: 0; transform: translateY(16px); } }
@keyframes back-in { from { opacity: 0; } }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .polaroid, .stagger, .pile-card, .row-title, .row-title::after { animation: none; transition: none; }
}

@media (max-width: 420px) {
  .row { gap: 14px; }
  .entry-title { font-size: 32px; }
}
