/* Shared style for every page on uiuxanjali.com */
:root {
  color-scheme: light;
  --bg: #fbfaf8;
  --ink: #1c1b1a;
  --mut: #74726e;
  --faint: #a8a6a1;
  --rule: #ebe9e5;
  --hover: #f3f1ed;
  --accent: #5a54c7;
  --wash: linear-gradient(135deg, #fbe3e6 0%, #efe6f7 45%, #dfeaf6 75%, #e3f1ea 100%);
  --serif: "Newsreader", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: var(--bg); }
img { max-width: 100%; }
p, ul, ol { margin: 0 0 14px; text-wrap: pretty; }
ul, ol { padding-left: 20px; }
li { margin-bottom: 4px; }
a { color: inherit; }
b, strong { font-weight: 500; }
.s { font-family: var(--serif); font-style: italic; font-size: 1.1em; letter-spacing: -.005em; }
.mut { color: var(--mut); }

/* underlined links inside text */
.prose a, p a, li a {
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color .15s;
}
.prose a:hover, p a:hover, li a:hover { text-decoration-color: var(--ink); }

/* ---------- top pill nav ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; gap: 2px; padding: 4px;
  background: rgba(255,255,255,.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--rule); border-radius: 999px;
  font-size: 13.5px; white-space: nowrap;
}
.nav a { text-decoration: none; color: var(--mut); padding: 5px 12px; border-radius: 999px; transition: background .15s, color .15s; }
.nav a:hover { color: var(--ink); background: var(--hover); }
.nav a[aria-current] { color: var(--ink); font-weight: 500; }

/* ---------- page shell ---------- */
main { max-width: 640px; margin: 0 auto; padding: 120px 20px 64px; }
main.wide { max-width: 980px; }
@media (max-width: 600px) { main { padding-top: 92px; } }

h1 { font-size: 30px; line-height: 1.15; font-weight: 500; letter-spacing: -.02em; margin: 0 0 18px; text-wrap: balance; }
@media (max-width: 600px) { h1 { font-size: 25px; } }
h2 { font-size: 15px; font-weight: 500; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 500; margin: 24px 0 6px; }
.label { display: block; color: var(--mut); font-size: 14px; margin: 0 0 14px; }
.label.accent { color: var(--accent); font-weight: 500; }
section { margin-top: 64px; }

/* ---------- home: intro ---------- */
.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.hello img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; }
.hello span { color: var(--mut); font-size: 14px; line-height: 1.35; }
.hello b { display: block; color: var(--ink); font-weight: 500; font-size: 15px; }

/* ---------- home: featured work ---------- */
.work { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; margin-bottom: 28px; }
.work .big { grid-column: 1 / -1; }
@media (max-width: 640px) { .work { grid-template-columns: 1fr; } }
.card { display: block; text-decoration: none; }
.frame {
  background: var(--wash); border-radius: 14px; padding: 18px 18px 0;
  overflow: hidden; aspect-ratio: 16 / 11; display: flex; align-items: flex-end;
}
.big .frame { aspect-ratio: 16 / 9; padding: 26px 30px 0; }
.frame img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center;
  border-radius: 8px 8px 0 0; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 30px -12px rgba(40,30,80,.25);
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.card:hover .frame img { transform: translateY(-4px); }
.card .t { display: block; margin-top: 12px; font-weight: 500; }
.card .d { display: block; color: var(--mut); }

/* ---------- rows (list with right meta) ---------- */
.list { list-style: none; margin: 0 0 14px; padding: 0; }
.list li { margin: 0; }
.row {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 20px;
  padding: 9px 0; border-top: 1px solid var(--rule); text-decoration: none; position: relative;
}
.list li:last-child .row { border-bottom: 1px solid var(--rule); }
a.row::before { content: ""; position: absolute; inset: 0 -10px; background: var(--hover); border-radius: 6px; opacity: 0; transition: opacity .15s; z-index: -1; }
a.row:hover::before { opacity: 1; }
.row .t { font-weight: 500; }
.row .t.plain { font-weight: 400; }
.row .d { color: var(--mut); grid-column: 1; }
.row .m { color: var(--mut); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; grid-row: 1; grid-column: 2; }
.row .m.ink { color: var(--ink); font-weight: 500; }
@media (max-width: 560px) { .row .m { white-space: normal; max-width: 55vw; } }

/* ---------- home: three columns (Projects / Writing / More) ---------- */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 28px; }
.cols.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .cols, .cols.two { grid-template-columns: 1fr; gap: 36px; } }
.cols h2 { color: var(--mut); font-weight: 400; margin-bottom: 16px; }
.item { display: block; margin-bottom: 18px; text-decoration: none; }
.item .t { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color .15s; }
.item:hover .t { text-decoration-color: var(--ink); }
.item .out { color: var(--faint); margin-left: 3px; display: inline-block; transition: transform .15s, color .15s; }
.item:hover .out { transform: translate(2px, -2px); color: var(--mut); }
.item .d { display: block; color: var(--mut); }

/* ---------- photos ---------- */
.photos { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 0 0 14px; }
.photos figure { margin: 0; }
.photos img { display: block; width: 100%; aspect-ratio: 4 / 5; object-position: 50% 30%; object-fit: cover; border-radius: 6px; background: var(--hover); border: 0; }
.photos figcaption { font-size: 13px; color: var(--mut); margin-top: 6px; line-height: 1.4; }
@media (max-width: 520px) {
  .photos { grid-template-columns: 1fr 1fr; }
  .photos figure:first-child { grid-column: 1 / -1; }
  .photos figure:first-child img { aspect-ratio: 3 / 2; }
}

/* ---------- case study ---------- */
.cs-head { max-width: 680px; }
.cs-head .sub { color: var(--accent); font-weight: 500; font-size: 14px; margin: 0 0 10px; }
.tldr { max-width: 680px; }
.tldr .label { margin-bottom: 4px; }
.hero { margin: 36px 0 0; background: var(--wash); border-radius: 18px; padding: clamp(16px, 4vw, 40px); }
.hero img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 16px 40px -18px rgba(40,30,80,.3); }
.hero.narrow img { max-width: 340px; margin: 0 auto; }
.hero figcaption { text-align: center; margin-top: 12px; }

.cs-body { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 56px; margin-top: 56px; }
.cs-body > aside { align-self: stretch; }
.cs-body.tabs > aside { position: sticky; top: 90px; align-self: start; }
.cs-body > aside .toc { position: sticky; top: 90px; }
.cs-body > aside .list { margin: 0; }
.cs-body > aside .row { grid-template-columns: 1fr; padding: 8px 0; gap: 0; }
.cs-body > aside .row .m { grid-row: auto; grid-column: 1; text-align: left; white-space: normal; color: var(--ink); font-weight: 400; max-width: none; }
.cs-body > aside .row .t { color: var(--mut); font-weight: 400; font-size: 13.5px; }
.cs-main { counter-reset: sec; max-width: 660px; }
.cs-main > section:first-child { margin-top: 0; }
.tldr + .cs-main { margin-top: 56px; }
.cs-main > section { margin-top: 56px; }
.cs-main > section > h2 { color: var(--accent); }
.cs-main > section > h2::before { counter-increment: sec; content: counter(sec, decimal-leading-zero) " / "; }
.tabs .cs-main > section > h2::before { content: none; }
.tabs .cs-main > section { margin-top: 0; }
.cs-body.tabs > aside .row .t { color: var(--ink); font-weight: 500; font-size: 15px; }
.cs-body.tabs > aside .row .m { color: var(--mut); }
.cs-body.tabs > aside a.row[aria-current]::before { opacity: 1; }
.cs-body.tabs > aside a.row[aria-current] .t { color: var(--accent); }
@media (max-width: 820px) {
  .cs-body { grid-template-columns: 1fr; gap: 40px; }
  .cs-body > aside, .cs-body.tabs > aside { position: static; }
  .cs-body > aside .list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
}

figure { margin: 24px 0; }
figure img, figure video { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--rule); background: var(--hover); }
.vcrop { overflow: hidden; border-radius: 8px; border: 1px solid var(--rule); background: var(--hover); }
.vcrop video { display: block; width: 100%; height: auto; }
figure.narrow img { max-width: 340px; margin: 0 auto; }
figure.narrow figcaption { text-align: center; }
figure.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
figure.pair figcaption { grid-column: 1 / -1; }
figure.pair img { height: 100%; object-fit: cover; }
@media (max-width: 560px) { figure.pair { grid-template-columns: 1fr; } }
figcaption { font-size: 13px; color: var(--mut); margin-top: 8px; line-height: 1.45; }

.bars { margin: 0 0 14px; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 8px 0; }
.bar .v { font-weight: 500; font-variant-numeric: tabular-nums; }
.bar i { grid-column: 1 / -1; display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #c9c4f2, var(--accent)); }

blockquote { margin: 18px 0; padding: 0 0 0 14px; border-left: 2px solid var(--rule); }
blockquote p { margin-bottom: 4px; }
blockquote cite { font-style: normal; color: var(--mut); font-size: 14px; }

table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 14px; }
th, td { text-align: left; padding: 8px 12px 8px 0; border-top: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 500; }
tr:last-child td { border-bottom: 1px solid var(--rule); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

/* next project + footer */
.cs-foot { margin-top: 80px; }
footer {
  margin-top: 72px; padding-top: 16px; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  color: var(--mut); font-size: 13px; font-variant-numeric: tabular-nums;
}
footer a { color: var(--mut); text-decoration: none; }
footer .social { display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer a:hover { color: var(--ink); }

/* ---------- interactions and small visual touches ---------- */
::selection { background: #e4e0fb; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.prose a:hover, p a:hover, li a:hover { text-decoration-color: var(--accent); }
.item:hover .t { text-decoration-color: var(--accent); }
.s { background: linear-gradient(transparent 58%, #ece6fb 58%, #ece6fb 92%, transparent 92%); padding: 0 2px; border-radius: 2px; }
a.copied { color: var(--accent) !important; }


/* screenshot that follows the cursor on Work rows */
.peek { position: fixed; top: 0; left: 0; z-index: 30; width: 320px; pointer-events: none; border-radius: 10px; overflow: hidden;
  background: var(--wash); padding: 10px 10px 0; opacity: 0; transition: opacity .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 18px 40px -16px rgba(40,30,80,.35); }
.peek.on { opacity: 1; }
.peek img { display: block; width: 100%; height: 190px; object-fit: cover; object-position: top center; border-radius: 6px 6px 0 0; }

/* ---------- designer details ---------- */
/* paper grain over everything, very faint */
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .035; mix-blend-mode: multiply;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* nav: a pill slides under the link you point at */
.nav { position: fixed; }
.nav .pill { position: absolute; top: 4px; left: 0; height: calc(100% - 8px); border-radius: 999px; background: var(--hover); z-index: -1;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), width .35s cubic-bezier(.2,.7,.2,1), opacity .2s; opacity: 0; }
.nav.js a:hover { background: transparent; }

/* lists: point at one row, the rest step back */
.list:has(a.row:hover) a.row:not(:hover) .t,
.list:has(a.row:hover) a.row:not(:hover) .d,
.list:has(a.row:hover) a.row:not(:hover) .m { opacity: .4; }
.row .t, .row .d, .row .m { transition: opacity .25s, transform .25s cubic-bezier(.2,.7,.2,1); }
.cols:has(.item:hover) .item:not(:hover) { opacity: .45; }
.item { transition: opacity .25s; }

/* Lately: three photos fanned like prints on a desk; point to spread them */
@media (min-width: 640px) {
  .photos.stack { position: relative; display: block; height: 330px; margin: 8px 0 24px; }
  .photos.stack figure { position: absolute; top: 20px; width: 230px; padding: 8px 8px 0; background: #fff; border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 14px 30px -16px rgba(40,30,80,.35);
    transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .3s; }
  .photos.stack img { border-radius: 3px; aspect-ratio: 4 / 5; }
  .photos.stack figcaption { padding: 6px 2px 8px; margin: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .photos.stack figure:nth-child(1) { left: 60px; transform: rotate(-7deg); z-index: 1; }
  .photos.stack figure:nth-child(2) { left: 205px; transform: rotate(2deg) translateY(-6px); z-index: 2; }
  .photos.stack figure:nth-child(3) { left: 350px; transform: rotate(8deg); z-index: 1; }
  .photos.stack:hover figure:nth-child(1) { transform: translateX(-60px) rotate(-4deg); }
  .photos.stack:hover figure:nth-child(2) { transform: translateY(-14px) rotate(0deg); }
  .photos.stack:hover figure:nth-child(3) { transform: translateX(60px) rotate(4deg); }
  .photos.stack figure:hover { z-index: 3; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 24px 40px -18px rgba(40,30,80,.45); }
  .photos.stack img:hover { transform: none; box-shadow: none; }
}

/* case studies: reading progress line and live contents list */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 40; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #c9c4f2, var(--accent)); }
.toc { list-style: none; margin: 28px 0 0; padding: 0; font-size: 13.5px; }
.toc .label { margin-bottom: 8px; }
.toc a { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; line-height: 1.4; color: var(--mut); text-decoration: none; transition: color .2s; }
.toc a .n { font-variant-numeric: tabular-nums; color: var(--faint); transition: color .2s; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--accent); }
.toc a.on .n { color: var(--accent); }
.toc a::before { content: ""; width: 10px; height: 1px; background: currentColor; align-self: center; transition: width .3s cubic-bezier(.2,.7,.2,1); }
.toc a.on::before { width: 22px; }
@media (max-width: 820px) { .toc { display: none; } }

/* footer clock: a dot that is warm in the day and cool at night */
.sun { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: #8f9bd6; box-shadow: 0 0 0 3px rgba(143,155,214,.2); }
.sun.day { background: #f2b24a; box-shadow: 0 0 0 3px rgba(242,178,74,.22); }

/* ---------- motion (quiet, once) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* first screen settles in, top to bottom, only on load */
.hello, .prose > p, .cs-head, .tldr, figure.hero, .cs-body > aside {
  animation: rise .7s cubic-bezier(.2,.7,.2,1) both;
}
.hello { animation-delay: .05s; }
.prose > p:nth-child(1), .cs-head { animation-delay: .12s; }
.prose > p:nth-child(2), .tldr { animation-delay: .19s; }
.prose > p:nth-child(3), figure.hero { animation-delay: .26s; }
.prose > p:nth-child(4), .cs-body > aside { animation-delay: .33s; }
.prose > p:nth-child(5) { animation-delay: .40s; }
.prose > p:nth-child(n+6) { animation-delay: .47s; }
.nav { animation: fade .6s ease both; }

/* Lab: the picked project slides in */
.tabs .cs-main > section:not([hidden]) { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }

/* rows: title nudges right on hover */
a.row .t { transition: transform .25s cubic-bezier(.2,.7,.2,1); }
a.row:hover .t { transform: translateX(3px); }

/* images lift a touch on hover (they open full size on click) */
figure img, .photos img { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
figure img:hover, .photos img:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(40,30,80,.35); }
figure.pair img:hover { transform: none; box-shadow: none; }

/* smooth fade between pages (supported browsers) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fade .18s ease reverse both; }
::view-transition-new(root) { animation: fade .28s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}

