/* ---------------------------------------------------------
   Mukaram Hussain — one-page portfolio
   Design system extracted from a reference editorial portfolio:
   warm off-white / near-black ink, a restrained sans for reading
   copy, a small-caps monospace for structure (nav, labels, rows),
   a 12-column grid, and hairline rules instead of boxes or shadows.
   Light + dark themes, toggled and remembered by the visitor.
--------------------------------------------------------- */

:root {
  --bg:   #f2f2f0;
  --ink:  #0a0a0a;
  --mute: #8a8a86;
  --rule: #dcdcd6;

  /* The surface the paper rests on — always a shade removed from the
     paper itself, so the sheet reads as an object lifted off a table
     rather than a flat background. */
  --backdrop: #d9d6cd;
  /* drop-shadow (not box-shadow) so the shadow follows the sheet's
     actual torn silhouette instead of its rectangular box. */
  --sheet-shadow: drop-shadow(0 20px 24px rgba(20, 18, 12, 0.3)) drop-shadow(0 2px 6px rgba(20, 18, 12, 0.12));

  --font-display: 'Instrument Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'Atkinson Hyperlegible Mono', ui-monospace, Menlo, Consolas, monospace;

  --pad-x: clamp(20px, 3.2vw, 44px);
  --row-gap: clamp(40px, 7vh, 76px);
  --col-gap: clamp(16px, 1.8vw, 28px);

  /* Sticky-note palette for the hover/focus info notes — five pastel
     paper stocks, cycled across Experience, Products, and Plugins so
     each row's extra detail reads as its own note, not a tooltip. */
  --note-1: #fbeec3; --note-1-ink: #4a3c10;
  --note-2: #f8dde3; --note-2-ink: #4a2029;
  --note-3: #d9e7f6; --note-3-ink: #1b3049;
  --note-4: #dcefda; --note-4-ink: #1e3a1c;
  --note-5: #e7ddf4; --note-5-ink: #2c1f42;
}

html.dark {
  --bg:   #111113;
  --ink:  #e4e4e0;
  --mute: #686864;
  --rule: #2a2a2e;
  --backdrop: #07070a;
  --sheet-shadow: drop-shadow(0 20px 24px rgba(0, 0, 0, 0.6)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));

  --note-1: #3a3011; --note-1-ink: #f3e4ab;
  --note-2: #3a1e24; --note-2-ink: #f5cdd6;
  --note-3: #182838; --note-3-ink: #c9deef;
  --note-4: #1a2e19; --note-4-ink: #c6e8c2;
  --note-5: #261c38; --note-5-ink: #dbc9f2;
}

/* ---------- Self-hosted fonts ---------- */

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/instrument-sans-latin-400-normal.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 500;
  src: url('fonts/instrument-sans-latin-500-normal.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 600;
  src: url('fonts/instrument-sans-latin-600-normal.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-weight: 500;
  src: url('fonts/atkinson-hyperlegible-mono-latin-500-normal.woff2') format('woff2');
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  font-family: var(--font-display);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--backdrop);
  color: var(--ink);
}

body {
  min-height: 100vh;
  padding: clamp(16px, 4vw, 48px) clamp(10px, 3vw, 32px);
  transition: background 200ms ease, color 150ms ease;
}

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

/* ---------- The paper ---------- */
/* A single sheet, lifted off the backdrop by its own shadow, with a
   faint fibrous grain and a torn edge where the print ends. Everything
   else in the layout lives inside it. */

.sheet {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 0;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* A real serrated cut, not a decorative overlay: the sheet's own
     silhouette is notched top and bottom (72 small triangular teeth,
     7px deep), so the backdrop shows straight through the gaps and
     the drop-shadow below hugs that exact torn outline. */
  clip-path: polygon(0.0000% 0px, 0.6944% 7px, 1.3889% 0px, 2.0833% 7px, 2.7778% 0px, 3.4722% 7px, 4.1667% 0px, 4.8611% 7px, 5.5556% 0px, 6.2500% 7px, 6.9444% 0px, 7.6389% 7px, 8.3333% 0px, 9.0278% 7px, 9.7222% 0px, 10.4167% 7px, 11.1111% 0px, 11.8056% 7px, 12.5000% 0px, 13.1944% 7px, 13.8889% 0px, 14.5833% 7px, 15.2778% 0px, 15.9722% 7px, 16.6667% 0px, 17.3611% 7px, 18.0556% 0px, 18.7500% 7px, 19.4444% 0px, 20.1389% 7px, 20.8333% 0px, 21.5278% 7px, 22.2222% 0px, 22.9167% 7px, 23.6111% 0px, 24.3056% 7px, 25.0000% 0px, 25.6944% 7px, 26.3889% 0px, 27.0833% 7px, 27.7778% 0px, 28.4722% 7px, 29.1667% 0px, 29.8611% 7px, 30.5556% 0px, 31.2500% 7px, 31.9444% 0px, 32.6389% 7px, 33.3333% 0px, 34.0278% 7px, 34.7222% 0px, 35.4167% 7px, 36.1111% 0px, 36.8056% 7px, 37.5000% 0px, 38.1944% 7px, 38.8889% 0px, 39.5833% 7px, 40.2778% 0px, 40.9722% 7px, 41.6667% 0px, 42.3611% 7px, 43.0556% 0px, 43.7500% 7px, 44.4444% 0px, 45.1389% 7px, 45.8333% 0px, 46.5278% 7px, 47.2222% 0px, 47.9167% 7px, 48.6111% 0px, 49.3056% 7px, 50.0000% 0px, 50.6944% 7px, 51.3889% 0px, 52.0833% 7px, 52.7778% 0px, 53.4722% 7px, 54.1667% 0px, 54.8611% 7px, 55.5556% 0px, 56.2500% 7px, 56.9444% 0px, 57.6389% 7px, 58.3333% 0px, 59.0278% 7px, 59.7222% 0px, 60.4167% 7px, 61.1111% 0px, 61.8056% 7px, 62.5000% 0px, 63.1944% 7px, 63.8889% 0px, 64.5833% 7px, 65.2778% 0px, 65.9722% 7px, 66.6667% 0px, 67.3611% 7px, 68.0556% 0px, 68.7500% 7px, 69.4444% 0px, 70.1389% 7px, 70.8333% 0px, 71.5278% 7px, 72.2222% 0px, 72.9167% 7px, 73.6111% 0px, 74.3056% 7px, 75.0000% 0px, 75.6944% 7px, 76.3889% 0px, 77.0833% 7px, 77.7778% 0px, 78.4722% 7px, 79.1667% 0px, 79.8611% 7px, 80.5556% 0px, 81.2500% 7px, 81.9444% 0px, 82.6389% 7px, 83.3333% 0px, 84.0278% 7px, 84.7222% 0px, 85.4167% 7px, 86.1111% 0px, 86.8056% 7px, 87.5000% 0px, 88.1944% 7px, 88.8889% 0px, 89.5833% 7px, 90.2778% 0px, 90.9722% 7px, 91.6667% 0px, 92.3611% 7px, 93.0556% 0px, 93.7500% 7px, 94.4444% 0px, 95.1389% 7px, 95.8333% 0px, 96.5278% 7px, 97.2222% 0px, 97.9167% 7px, 98.6111% 0px, 99.3056% 7px, 100.0000% 0px, 100.0000% 100%, 99.3056% calc(100% - 7px), 98.6111% 100%, 97.9167% calc(100% - 7px), 97.2222% 100%, 96.5278% calc(100% - 7px), 95.8333% 100%, 95.1389% calc(100% - 7px), 94.4444% 100%, 93.7500% calc(100% - 7px), 93.0556% 100%, 92.3611% calc(100% - 7px), 91.6667% 100%, 90.9722% calc(100% - 7px), 90.2778% 100%, 89.5833% calc(100% - 7px), 88.8889% 100%, 88.1944% calc(100% - 7px), 87.5000% 100%, 86.8056% calc(100% - 7px), 86.1111% 100%, 85.4167% calc(100% - 7px), 84.7222% 100%, 84.0278% calc(100% - 7px), 83.3333% 100%, 82.6389% calc(100% - 7px), 81.9444% 100%, 81.2500% calc(100% - 7px), 80.5556% 100%, 79.8611% calc(100% - 7px), 79.1667% 100%, 78.4722% calc(100% - 7px), 77.7778% 100%, 77.0833% calc(100% - 7px), 76.3889% 100%, 75.6944% calc(100% - 7px), 75.0000% 100%, 74.3056% calc(100% - 7px), 73.6111% 100%, 72.9167% calc(100% - 7px), 72.2222% 100%, 71.5278% calc(100% - 7px), 70.8333% 100%, 70.1389% calc(100% - 7px), 69.4444% 100%, 68.7500% calc(100% - 7px), 68.0556% 100%, 67.3611% calc(100% - 7px), 66.6667% 100%, 65.9722% calc(100% - 7px), 65.2778% 100%, 64.5833% calc(100% - 7px), 63.8889% 100%, 63.1944% calc(100% - 7px), 62.5000% 100%, 61.8056% calc(100% - 7px), 61.1111% 100%, 60.4167% calc(100% - 7px), 59.7222% 100%, 59.0278% calc(100% - 7px), 58.3333% 100%, 57.6389% calc(100% - 7px), 56.9444% 100%, 56.2500% calc(100% - 7px), 55.5556% 100%, 54.8611% calc(100% - 7px), 54.1667% 100%, 53.4722% calc(100% - 7px), 52.7778% 100%, 52.0833% calc(100% - 7px), 51.3889% 100%, 50.6944% calc(100% - 7px), 50.0000% 100%, 49.3056% calc(100% - 7px), 48.6111% 100%, 47.9167% calc(100% - 7px), 47.2222% 100%, 46.5278% calc(100% - 7px), 45.8333% 100%, 45.1389% calc(100% - 7px), 44.4444% 100%, 43.7500% calc(100% - 7px), 43.0556% 100%, 42.3611% calc(100% - 7px), 41.6667% 100%, 40.9722% calc(100% - 7px), 40.2778% 100%, 39.5833% calc(100% - 7px), 38.8889% 100%, 38.1944% calc(100% - 7px), 37.5000% 100%, 36.8056% calc(100% - 7px), 36.1111% 100%, 35.4167% calc(100% - 7px), 34.7222% 100%, 34.0278% calc(100% - 7px), 33.3333% 100%, 32.6389% calc(100% - 7px), 31.9444% 100%, 31.2500% calc(100% - 7px), 30.5556% 100%, 29.8611% calc(100% - 7px), 29.1667% 100%, 28.4722% calc(100% - 7px), 27.7778% 100%, 27.0833% calc(100% - 7px), 26.3889% 100%, 25.6944% calc(100% - 7px), 25.0000% 100%, 24.3056% calc(100% - 7px), 23.6111% 100%, 22.9167% calc(100% - 7px), 22.2222% 100%, 21.5278% calc(100% - 7px), 20.8333% 100%, 20.1389% calc(100% - 7px), 19.4444% 100%, 18.7500% calc(100% - 7px), 18.0556% 100%, 17.3611% calc(100% - 7px), 16.6667% 100%, 15.9722% calc(100% - 7px), 15.2778% 100%, 14.5833% calc(100% - 7px), 13.8889% 100%, 13.1944% calc(100% - 7px), 12.5000% 100%, 11.8056% calc(100% - 7px), 11.1111% 100%, 10.4167% calc(100% - 7px), 9.7222% 100%, 9.0278% calc(100% - 7px), 8.3333% 100%, 7.6389% calc(100% - 7px), 6.9444% 100%, 6.2500% calc(100% - 7px), 5.5556% 100%, 4.8611% calc(100% - 7px), 4.1667% 100%, 3.4722% calc(100% - 7px), 2.7778% 100%, 2.0833% calc(100% - 7px), 1.3889% 100%, 0.6944% calc(100% - 7px), 0.0000% 100%);
  filter: var(--sheet-shadow);
  transition: background-color 150ms ease, filter 200ms ease;
}

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

/* ---------- 12-column grid ---------- */

.row12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--col-gap);
}

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

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding: 18px var(--pad-x) 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  align-items: center;
}

.topnav .c1 {
  grid-column: 1 / 5;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topnav .nav-name {
  color: var(--ink);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 2px;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  flex-shrink: 0;
}

.topnav .c3 {
  grid-column: 7 / 13;
}

.nav-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topnav a:hover {
  opacity: 0.55;
}

/* Two exceptions to the plain-text nav, both hairline-bordered so
   they read as actionable without introducing color or weight the
   rest of the system doesn't use. Book a call is the filled/primary
   action; Things I've Made stays outline-only, a step quieter. */
.nav-cta,
.nav-btn {
  display: inline-block;
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 5px 10px;
  margin: -5px 0;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease, opacity 150ms ease;
}

.topnav a.nav-cta:hover {
  opacity: 1;
  background: var(--ink);
  color: var(--bg);
}

.topnav a.nav-btn:hover {
  opacity: 0.55;
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  color: var(--ink);
  display: flex;
  align-items: center;
  opacity: 1;
  transition: opacity 150ms ease;
  flex-shrink: 0;
}

#theme-toggle:hover {
  opacity: 0.55;
}

#theme-toggle svg {
  display: block;
}

html.dark #theme-toggle svg {
  transform: scaleX(-1);
}

/* ---------- Intro ---------- */

main {
  padding: 0 var(--pad-x);
}

.intro {
  padding-top: clamp(24px, 4vh, 48px);
  padding-bottom: clamp(28px, 5vh, 52px);
  align-items: start;
}

.intro .c1 {
  grid-column: 1 / 8;
}

.intro .c2 {
  grid-column: 8 / 13;
  padding-top: 6px;
}

.intro h1 {
  font: inherit;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: pretty;
  font-weight: 400;
}

.intro .c2 p {
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--mute);
  margin: 0;
}

/* Mobile-only mirror of the nav buttons — see @media (max-width: 560px)
   below, where these show and the header's own copies hide. */
.intro-buttons {
  display: none;
}

/* ---------- Info (Experience) ---------- */

.info {
  padding-top: 28px;
  padding-bottom: var(--row-gap);
  border-top: 1px dashed var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.info h2 {
  font: inherit;
  margin: 0 0 18px;
  letter-spacing: 0.06em;
  color: var(--mute);
}

/* ---------- Receipt-style line items (Experience, Products, Plugins) ---------- */
/* One shared leader rule so the dotted connector reads identically
   across every itemized section of the page. */

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

.receipt-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
}

.receipt-list .item {
  color: var(--ink);
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Invisible flex spacer between the label and the value in Experience,
   Products, and Plugins rows — pushes the price/description to the
   right without a visible rule down the middle of the row. Only the
   dashed rules framing each section (top/bottom) remain visible. */
.leader {
  flex: 1 1 auto;
  min-width: 10px;
}

.receipt-list .price {
  flex-shrink: 0;
  white-space: nowrap;
  text-align: right;
}

/* Rows carrying a hover note get a small raised mark and a "there's
   more here" cursor, and stay visible via a hairline outline while
   focused with a keyboard. */
.receipt-list li[data-note] {
  cursor: help;
  outline: none;
  border-radius: 2px;
  transition: opacity 150ms ease;
}

.receipt-list li[data-note] .item::after {
  content: '\00b7';
  margin-left: 3px;
  color: var(--mute);
  opacity: 0.7;
}

.receipt-list li[data-note]:hover,
.receipt-list li[data-note]:focus-visible {
  opacity: 0.6;
}

.receipt-list li[data-note]:focus-visible {
  box-shadow: 0 0 0 1px var(--rule);
}

/* ---------- Work index (products / plugins) ---------- */

.work-index {
  padding-top: 28px;
  padding-bottom: var(--row-gap);
  border-top: 1px dashed var(--rule);
}

.work-index .eyebrow {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

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

.pi-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-top: 1px dashed var(--rule);
  padding: 13px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: opacity 150ms ease;
}

.pi-table li:last-child {
  border-bottom: 1px dashed var(--rule);
}

.pi-row:hover {
  opacity: 0.5;
}

.pi-name {
  color: var(--ink);
  flex-shrink: 0;
  white-space: nowrap;
}

.pi-desc {
  color: var(--mute);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Hover / focus sticky note ---------- */
/* A single cursor-following (or, on keyboard focus, element-anchored)
   note — styled like a scrap of coloured paper stuck to the sheet,
   carrying the extra line of context each row hides by default:
   CV detail for Experience, a fetched blurb for Products/Plugins. */

#hover-note {
  position: fixed;
  top: 0;
  left: 0;
  width: 224px;
  padding: 14px 16px 15px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  background: var(--note-1);
  color: var(--note-1-ink);
  box-shadow: 0 14px 26px -12px rgba(20, 18, 12, 0.35), 0 2px 8px rgba(20, 18, 12, 0.16);
  transition: opacity 180ms ease, background-color 150ms ease, color 150ms ease;
  will-change: transform, opacity;
}

#hover-note.is-visible {
  opacity: 1;
}

#hover-note.hover-note-color-1 { background: var(--note-1); color: var(--note-1-ink); }
#hover-note.hover-note-color-2 { background: var(--note-2); color: var(--note-2-ink); }
#hover-note.hover-note-color-3 { background: var(--note-3); color: var(--note-3-ink); }
#hover-note.hover-note-color-4 { background: var(--note-4); color: var(--note-4-ink); }
#hover-note.hover-note-color-5 { background: var(--note-5); color: var(--note-5-ink); }

/* A strip of "tape" pinning the note down — plain translucent white
   in both themes, since real tape doesn't recolor with the page. */
.hover-note-tape {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 52px;
  height: 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.65);
  transform: translateX(-50%) rotate(-3deg);
  box-shadow: 0 1px 3px rgba(20, 18, 12, 0.15);
}

html.dark .hover-note-tape {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.hover-note-img {
  display: none;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 18px;
  margin: 2px 0 8px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}

html.dark .hover-note-img {
  background: rgba(0, 0, 0, 0.18);
}

#hover-note.has-image .hover-note-img {
  display: block;
}

.hover-note-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 12.5px;
  line-height: 1.55;
  letter-spacing: 0;
}

@media (hover: none), (pointer: coarse) {
  #hover-note {
    display: none;
  }
}

/* ---------- Footer ---------- */

footer {
  background: transparent;
  padding: 40px var(--pad-x) 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  border-top: 1px dashed var(--rule);
}

.footer-line {
  margin: 0 0 14px;
}

/* A row of bars standing in for a receipt's barcode — purely
   decorative, closing the page the way a printed receipt closes. */
.barcode {
  width: 132px;
  height: 30px;
  margin: 0 0 16px;
  opacity: 0.8;
  background-image: repeating-linear-gradient(
    90deg,
    var(--ink), var(--ink) 2px,
    transparent 2px, transparent 4px,
    var(--ink) 4px, var(--ink) 5px,
    transparent 5px, transparent 9px,
    var(--ink) 9px, var(--ink) 12px,
    transparent 12px, transparent 14px,
    var(--ink) 14px, var(--ink) 15px,
    transparent 15px, transparent 18px
  );
}

.footer-links {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  row-gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-links a {
  color: var(--mute);
  transition: color 150ms ease;
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-links a + a::before {
  content: '\00b7';
  margin: 0 10px;
  color: var(--rule);
}

/* ---------- Load-in animation ---------- */
/* The page's content feeds out from under the nav on load, like a
   receipt printing out of a slot, and the sheet's shadow deepens as
   it settles flat onto the backdrop. */

@keyframes feed-in {
  from { transform: translateY(-18px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes settle {
  from { filter: drop-shadow(0 4px 8px rgba(20, 18, 12, 0.15)) drop-shadow(0 0 0 rgba(20, 18, 12, 0)); }
  to   { filter: var(--sheet-shadow); }
}

.sheet {
  animation: settle 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

main,
footer {
  animation: feed-in 640ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

main { animation-delay: 40ms; }
footer { animation-delay: 90ms; }

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

@media (prefers-reduced-motion: reduce) {
  body,
  #theme-toggle,
  .topnav a,
  .pi-row,
  footer a,
  #hover-note {
    transition-duration: 0.01ms !important;
  }

  .sheet,
  main,
  footer {
    animation: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .topnav .c1 { grid-column: 1 / 6; }
  .topnav .c3 { grid-column: 6 / 13; }

  .intro .c1 { grid-column: 1 / 13; }
  .intro .c2 { grid-column: 1 / 13; padding-top: 16px; }

  .pi-row { flex-wrap: wrap; row-gap: 3px; }
  .pi-row .leader { display: none; }
  .pi-desc { flex-basis: 100%; white-space: normal; color: var(--mute); }
}

@media (max-width: 560px) {
  :root { --col-gap: 12px; --pad-x: 18px; --row-gap: 40px; }

  .topnav .c1 span.nav-name { display: none; }
  .topnav .c1 { grid-column: 1 / 4; gap: 8px; }
  .avatar { width: 24px; height: 24px; }
  .topnav .c3 { grid-column: 4 / 13; }
  .nav-cta, .nav-btn { padding: 4px 8px; font-size: 10px; }

  /* Below 560px the CTAs move out of the header and into the intro,
     right under the intro paragraph, so the header stays uncluttered. */
  .nav-buttons { display: none; }
  .intro-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
  }
  .intro-buttons .nav-cta,
  .intro-buttons .nav-btn { margin: 0; }

  .receipt-list li { flex-wrap: wrap; row-gap: 2px; }
  .receipt-list .leader { display: none; }
  .receipt-list .price {
    flex-basis: 100%;
    flex-shrink: 1;
    width: 100%;
    box-sizing: border-box;
    padding-left: 24px;
    margin-left: 0;
    color: var(--mute);
  }
}
