:root {
  --paper: #eceef4;
  --mist: #e2e6f0;
  --surface: #f6f7fb;
  --ink: #1a2230;
  --ink-soft: #4a5568;
  --ink-faint: rgba(26, 34, 48, 0.42);
  --sage: #6b8f9c;
  --sage-deep: #3d5a66;
  --sage-mist: rgba(107, 143, 156, 0.2);
  --horizon: #c4a574;
  --horizon-mist: rgba(196, 165, 116, 0.28);
  --world-a: rgba(99, 132, 168, 0.35);
  --world-b: rgba(107, 143, 156, 0.25);
  --world-c: rgba(196, 165, 116, 0.22);
  --slate-mist: rgba(38, 48, 58, 0.09);
  --gold-leaf: rgba(198, 162, 88, 0.18);
  --gold-leaf-deep: rgba(168, 132, 58, 0.12);
  --gold-sheen: rgba(232, 214, 168, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 20px;
  --nav-h: 4.25rem;
  --section-jump-bar-h: 2.75rem;
  --anchor-offset: calc(var(--nav-h) + 6.35rem);
  /* Dark thumb accents (gallery previews stay cinematic) */
  --proto-cyan: rgba(0, 229, 255, 0.35);
  --proto-green: rgba(61, 154, 120, 0.25);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}
body {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(ellipse 95% 72% at 50% 108%, var(--slate-mist), transparent 52%),
    radial-gradient(ellipse 55% 48% at 4% 92%, rgba(44, 54, 66, 0.07), transparent 46%),
    radial-gradient(ellipse 50% 44% at 96% 8%, rgba(58, 68, 82, 0.06), transparent 44%),
    linear-gradient(168deg, #e4e7ee 0%, var(--paper) 48%, #eef0f5 100%);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 52% 44% at 14% 78%, var(--gold-leaf), transparent 58%),
    radial-gradient(ellipse 38% 48% at 91% 32%, var(--gold-leaf-deep), transparent 54%),
    radial-gradient(ellipse 30% 36% at 58% 91%, var(--gold-sheen), transparent 50%),
    radial-gradient(ellipse 22% 28% at 72% 18%, rgba(212, 178, 95, 0.14), transparent 46%),
    radial-gradient(circle 42vw at 12% 22%, var(--world-a), transparent 58%),
    radial-gradient(circle 38vw at 92% 18%, var(--world-b), transparent 55%),
    radial-gradient(ellipse 90% 55% at 50% 108%, var(--horizon-mist), transparent 50%),
    radial-gradient(circle 28vw at 78% 78%, var(--world-c), transparent 52%),
    radial-gradient(ellipse 70% 50% at 40% 0%, rgba(99, 132, 168, 0.12), transparent 45%);
  animation: field-drift 36s var(--ease) infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.52;
  mix-blend-mode: soft-light;
  background:
    repeating-linear-gradient(
      92deg,
      transparent 0,
      transparent 3px,
      rgba(35, 44, 54, 0.04) 3px,
      rgba(35, 44, 54, 0.04) 4px
    ),
    repeating-linear-gradient(
      -3deg,
      transparent,
      transparent 11px,
      rgba(28, 36, 46, 0.045) 11px,
      rgba(28, 36, 46, 0.045) 12px
    ),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.032' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E");
  background-size: auto, auto, 480px 480px;
}

@keyframes field-drift {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
  100% { transform: translate(1.5%, -2%) scale(1.035) rotate(0.8deg); opacity: 0.93; }
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.042;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--sage-deep);
  color: var(--paper);
  z-index: 10000;
}

.scroll-indicator {
  position: fixed;
  top: 0;
  right: 0;
  width: max(10px, 0.55vw);
  height: 100vh;
  height: 100dvh;
  z-index: 10050;
  pointer-events: auto;
  background: rgba(26, 34, 48, 0.07);
  cursor: pointer;
  touch-action: none;
}
.scroll-indicator.is-dragging {
  cursor: grabbing;
}
.scroll-indicator__fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 0;
  border-radius: 0 0 0 4px;
  background: linear-gradient(180deg, var(--sage-deep), var(--horizon));
  box-shadow: 0 0 12px rgba(61, 90, 102, 0.35);
  cursor: grab;
  pointer-events: auto;
}
.scroll-indicator.is-dragging .scroll-indicator__fill {
  cursor: grabbing;
}

header.site {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  background: linear-gradient(to bottom, rgba(232, 235, 242, 0.94), rgba(236, 238, 244, 0.76), transparent);
  backdrop-filter: blur(14px);
}

em { color: var(--sage-deep); }

.mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}
.mark-logo {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(28%) sepia(15%) saturate(680%) hue-rotate(152deg) brightness(94%) contrast(90%);
}

nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
nav a:hover { color: var(--sage-deep); text-decoration: none; }

.site-header__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.85rem, 2.2vw, 1.65rem);
  flex-wrap: wrap;
  row-gap: 0.35rem;
}

.site-header__divider {
  display: block;
  width: 1px;
  height: 2.35rem;
  flex-shrink: 0;
  align-self: center;
  background: rgba(26, 34, 48, 0.22);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.35);
}

.nav-chicago-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.25;
  min-width: 0;
  max-width: 14rem;
}

.nav-chicago-widget__label {
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.nav-chicago-widget__weather {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--sage-deep);
  letter-spacing: 0.04em;
}

.nav-chicago-widget__wx-icon {
  font-size: 1.05em;
  line-height: 1;
  filter: grayscale(0.15);
}

.nav-chicago-widget__temp {
  font-variant-numeric: tabular-nums;
}

.nav-chicago-widget__clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.06rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.nav-chicago-widget__clock #chi-date {
  font-weight: 500;
  letter-spacing: 0.05em;
}

.nav-chicago-widget__clock time {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
}

@media (max-width: 720px) {
  :root {
    --nav-h: 5.5rem;
    --section-jump-bar-h: 2.75rem;
    --anchor-offset: calc(var(--nav-h) + var(--section-jump-bar-h) + max(0.35rem, env(safe-area-inset-top, 0px)));
  }

  header.site {
    height: auto;
    min-height: var(--nav-h);
    align-items: center;
    padding-top: max(0.35rem, env(safe-area-inset-top, 0px));
    padding-bottom: 0.35rem;
  }

  .section-jump {
    flex-direction: row;
    flex-wrap: nowrap;
    border-top: 1px solid rgba(92, 117, 104, 0.22);
  }

  .section-jump-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    text-align: center;
    padding: 0.5rem 0.2rem;
    border-top: none;
    border-bottom: none;
    border-right: 1px solid rgba(92, 117, 104, 0.22);
    font-size: 0.56rem;
    letter-spacing: 0.1em;
  }

  .section-jump-btn:last-child {
    border-right: none;
  }

  .section-jump-btn:first-child {
    border-top: none;
  }
}

@media (max-width: 480px) {
  :root {
    --nav-h: 6.35rem;
    --section-jump-bar-h: 2.9rem;
    --anchor-offset: calc(var(--nav-h) + var(--section-jump-bar-h) + max(0.35rem, env(safe-area-inset-top, 0px)));
  }
}

@media (max-width: 540px) {
  .nav-chicago-widget {
    font-size: 0.55rem;
    max-width: 11rem;
  }
  .site-header__right {
    gap: 0.65rem;
  }
}

.section-jump {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}
.section-jump-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 0.5rem clamp(1rem, 4vw, 2.5rem);
  border-radius: 0;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  line-height: 1.2;
  color: var(--ink-soft);
  background: rgba(246, 247, 251, 0.82);
  border: none;
  border-bottom: 1px solid rgba(92, 117, 104, 0.22);
  backdrop-filter: blur(10px);
  box-shadow: none;
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.section-jump-btn.is-active {
  color: var(--sage-deep);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(61, 90, 102, 0.35);
  box-shadow: inset 3px 0 0 var(--sage-deep);
}
.section-jump-btn:first-child {
  border-top: 1px solid rgba(92, 117, 104, 0.22);
}
.section-jump-btn:hover {
  color: var(--sage-deep);
  border-color: rgba(61, 90, 102, 0.35);
  background: rgba(255, 255, 255, 0.92);
  text-decoration: none;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: calc(var(--anchor-offset) + clamp(1rem, 3vw, 1.75rem)) clamp(1rem, 4vw, 2rem) 3.5rem;
}

.kicker {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 0.65rem;
}

h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 0.85rem;
  max-width: 24ch;
  color: var(--ink);
  font-variation-settings: "SOFT" 100, "WONK" 0.5;
}

.lede {
  color: var(--ink-soft);
  font-size: 1.05rem;
  font-weight: 300;
  max-width: 58ch;
  margin: 0 0 2rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gallery > li[hidden] {
  display: none;
}

.gallery-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
  border: 1px dashed rgba(92, 117, 104, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.45);
}
.gallery-empty[hidden] {
  display: none !important;
}

.tile {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid rgba(92, 117, 104, 0.12);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
  box-shadow: 0 12px 36px rgba(44, 51, 46, 0.06);
}
.tile:hover {
  transform: translateY(-4px);
  border-color: rgba(61, 90, 102, 0.28);
  box-shadow: 0 20px 48px rgba(44, 51, 46, 0.12);
}

.tile__thumb {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(92, 117, 104, 0.1);
}
.tile__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, transparent 42%, rgba(26, 34, 48, 0.35) 100%);
  pointer-events: none;
}

.tile__thumb--fcb {
  background:
    radial-gradient(ellipse 70% 60% at 80% 20%, var(--proto-cyan), transparent 50%),
    linear-gradient(165deg, #0a1620 0%, #152028 50%, #1e3040 100%);
}
.tile__thumb--calc {
  background:
    radial-gradient(circle at 20% 80%, var(--proto-green), transparent 45%),
    linear-gradient(145deg, #1a1f28 0%, #242d3a 100%);
}
.tile__thumb--gcc {
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(232, 184, 74, 0.2), transparent 55%),
    linear-gradient(180deg, #161c24 0%, #0f1419 100%);
}
.tile__thumb--manuscript {
  background:
    radial-gradient(ellipse 70% 55% at 20% 85%, rgba(196, 165, 116, 0.22), transparent 50%),
    linear-gradient(165deg, #1a1814 0%, #12100e 100%);
}
.tile__thumb--yaqeen {
  background:
    radial-gradient(ellipse 90% 70% at 50% -15%, rgba(196, 165, 116, 0.18), transparent 48%),
    linear-gradient(165deg, #1c1916 0%, #141210 100%);
}
.tile__thumb--cc {
  background:
    linear-gradient(135deg, rgba(61, 154, 120, 0.2) 0%, transparent 50%),
    linear-gradient(180deg, #121820 0%, #0d1117 100%);
}
.tile__thumb--orbit {
  background:
    radial-gradient(circle at 50% 120%, rgba(181, 74, 42, 0.35), transparent 55%),
    linear-gradient(185deg, #1a1510 0%, #0d0c0a 100%);
}
.tile__thumb--twilight {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(90, 120, 180, 0.35), transparent 50%),
    linear-gradient(180deg, #121824 0%, #0a0d14 100%);
}
.tile__thumb--folio {
  background:
    radial-gradient(ellipse 70% 50% at 20% 85%, rgba(196, 165, 116, 0.22), transparent 50%),
    linear-gradient(165deg, #181612 0%, #0f0e0c 100%);
}
.tile__thumb--ledger {
  background:
    radial-gradient(circle at 85% 15%, rgba(232, 184, 74, 0.2), transparent 45%),
    linear-gradient(145deg, #141a16 0%, #1c2420 100%);
}
.tile__thumb--editorial {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.06) 0%, transparent 45%),
    linear-gradient(180deg, #161920 0%, #10141a 100%);
}
.tile__thumb--signal {
  background:
    radial-gradient(circle at 30% 70%, rgba(0, 229, 255, 0.12), transparent 50%),
    linear-gradient(175deg, #131820 0%, #0e1218 100%);
}
.tile__thumb--pen {
  background:
    radial-gradient(ellipse 70% 55% at 75% 18%, rgba(42, 143, 130, 0.35), transparent 50%),
    radial-gradient(ellipse 55% 45% at 18% 82%, rgba(196, 165, 116, 0.18), transparent 48%),
    linear-gradient(165deg, #1a2830 0%, #152028 52%, #101820 100%);
}
.tile__thumb--pen .tile__icon {
  color: #8ec4bc;
}

.tile__thumb--neu {
  background:
    radial-gradient(ellipse 75% 65% at 25% 15%, rgba(255, 255, 255, 0.42), transparent 52%),
    radial-gradient(ellipse 60% 50% at 85% 88%, rgba(47, 111, 132, 0.22), transparent 50%),
    linear-gradient(155deg, #d4dae2 0%, #a8b8c6 48%, #8fa3b2 100%);
}
.tile__thumb--neu .tile__icon {
  color: #2f6f84;
  filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.5));
}
.tile__thumb--neu-pomodoro {
  background:
    radial-gradient(ellipse 70% 55% at 70% 20%, rgba(45, 106, 79, 0.2), transparent 50%),
    linear-gradient(155deg, #d6dcd4 0%, #a8b4a8 48%, #8e9e92 100%);
}
.tile__thumb--neu-pomodoro .tile__icon {
  color: #2d6a4f;
}

.tile__thumb {
  display: grid;
  place-items: center;
}

.tile__icon,
.tile__icon-img {
  position: relative;
  z-index: 2;
  width: 44%;
  height: 44%;
  max-width: 4.5rem;
  max-height: 4.5rem;
  flex-shrink: 0;
  pointer-events: none;
}

.tile__icon {
  color: rgba(255, 255, 255, 0.94);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.28));
}

.tile__icon-img {
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.28));
}

.tile__body {
  padding: 1.05rem 1.15rem 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, var(--surface) 32%);
}

.tile__badge {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 0.4rem;
}
.tile__badge--tool {
  color: #9a7a3e;
}
.tile__badge--proto {
  color: #4a6b7a;
}

.tile h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.tile p {
  font-size: 0.84rem;
  font-weight: 300;
  color: var(--ink-soft);
  margin: 0;
  flex: 1;
  line-height: 1.5;
}

.tile__cta {
  margin-top: 0.85rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage-deep);
}
.tile:hover .tile__cta {
  color: var(--sage);
}

footer {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(92, 117, 104, 0.12);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

footer a {
  font-weight: 600;
  color: var(--sage-deep);
}

footer code {
  font-size: 0.85em;
  color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.5);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}

.tile,
.tile:hover,
.mark:hover,
.section-jump-btn:hover {
  text-decoration: none;
}
.section-jump-btn.is-active:hover {
  color: var(--sage-deep);
}

/* —— App home screen (mobile / tablet) —— */
.app-home {
  display: none;
  flex-direction: column;
  gap: 0.65rem;
  min-height: min(72vh, 640px);
}

.gallery-shell.is-app-home-ready .app-home {
  display: flex;
}

.gallery-shell.is-app-home-ready > .gallery {
  display: none !important;
}

.app-home__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.15rem;
}

.app-home__label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(26, 34, 48, 0.55);
}

.app-home__edit-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(26, 34, 48, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--sage-deep);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s var(--ease), transform 0.15s ease;
}

.app-home__edit-btn:active {
  transform: scale(0.96);
}

.app-home.is-editing .app-home__edit-btn {
  background: var(--sage-deep);
  color: #f7f8fb;
  border-color: transparent;
}

.app-home__viewport {
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  border-radius: 18px;
}

.app-home__viewport::-webkit-scrollbar {
  display: none;
}

.app-home__track {
  display: flex;
  align-items: stretch;
  min-height: 100%;
}

.app-home__page {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  grid-template-columns: repeat(var(--app-cols, 4), minmax(0, 1fr));
  gap: 1.35rem 0.5rem;
  align-content: start;
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.15rem 0.5rem;
  box-sizing: border-box;
}

.app-home__page > li {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 5.25rem;
  margin-inline: auto;
  touch-action: none;
}

.app-home__page > li.is-dragging {
  opacity: 0.35;
}

.app-home__page > li.is-drop-target .tile__thumb {
  box-shadow:
    0 0 0 2px var(--sage-deep),
    0 4px 14px rgba(26, 34, 48, 0.22);
}

.app-home__drag-ghost {
  position: fixed;
  z-index: 20000;
  pointer-events: none;
  margin: 0;
  list-style: none;
  transform: scale(1.08);
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.28));
}

.app-home__drag-ghost .tile {
  pointer-events: none;
}

.app-home.is-editing .app-home__page > li {
  animation: app-jiggle 0.24s ease-in-out infinite alternate;
  animation-delay: var(--jiggle-delay, 0s);
}

.app-home.is-editing .app-home__viewport {
  touch-action: pan-x pinch-zoom;
}

@keyframes app-jiggle {
  0% { transform: rotate(-1.4deg); }
  100% { transform: rotate(1.4deg); }
}

.app-home__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding-top: 0.15rem;
}

.app-home__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 1rem;
}

.app-home__dots[hidden] {
  display: none !important;
}

.app-home__dot {
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(26, 34, 48, 0.22);
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), width 0.2s var(--ease);
}

.app-home__dot[aria-selected="true"] {
  width: 1.15rem;
  background: rgba(26, 34, 48, 0.72);
}

.app-home__hint {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26, 34, 48, 0.48);
  text-align: center;
}

/* Tablet & mobile — home-screen app grid */
@media (max-width: 1024px) {
  .lede {
    margin-bottom: 1.35rem;
  }

  .gallery-shell {
    position: relative;
    margin: 0 auto 1.75rem;
    max-width: min(100%, 520px);
    padding: 2.85rem 0.85rem 1.65rem;
    border-radius: clamp(28px, 6vw, 36px);
    background:
      radial-gradient(ellipse 110% 75% at 30% 8%, rgba(255, 255, 255, 0.45), transparent 52%),
      radial-gradient(ellipse 90% 65% at 85% 75%, rgba(196, 165, 116, 0.28), transparent 48%),
      radial-gradient(ellipse 80% 60% at 15% 88%, rgba(107, 143, 156, 0.32), transparent 50%),
      linear-gradient(165deg, #b8c8d4 0%, #9eb0be 42%, #8a9fad 100%);
    box-shadow:
      0 28px 64px rgba(26, 34, 48, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.45),
      0 0 0 1px rgba(255, 255, 255, 0.28);
    min-height: min(78vh, 680px);
    display: flex;
    flex-direction: column;
  }

  .gallery-shell.is-app-home-ready {
    padding-bottom: 1.15rem;
  }

  .gallery-shell::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4.5rem;
    height: 5px;
    border-radius: 999px;
    background: rgba(26, 34, 48, 0.2);
    pointer-events: none;
  }

  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem 0.5rem;
    justify-items: center;
    align-content: start;
  }

  .gallery > li {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 5.25rem;
  }

  .gallery-empty {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--ink);
    border-color: rgba(255, 255, 255, 0.35);
  }

  .tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 4.75rem;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    -webkit-tap-highlight-color: transparent;
  }

  .tile:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
  }

  .tile:focus-visible {
    outline: 2px solid var(--sage-deep);
    outline-offset: 4px;
    border-radius: 14px;
  }

  .tile__thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 22%;
    border: none;
    box-shadow:
      0 4px 14px rgba(26, 34, 48, 0.22),
      0 0 0 0.5px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  }

  .tile__thumb::after {
    background: linear-gradient(165deg, transparent 55%, rgba(26, 34, 48, 0.2) 100%);
  }

  .tile:active .tile__thumb,
  .tile:focus-visible .tile__thumb {
    transform: scale(0.9);
    box-shadow:
      0 2px 8px rgba(26, 34, 48, 0.18),
      0 0 0 0.5px rgba(0, 0, 0, 0.06);
  }

  .tile__icon,
  .tile__icon-img {
    width: 54%;
    height: 54%;
    max-width: 2.75rem;
    max-height: 2.75rem;
  }

  .tile__body {
    width: 100%;
    padding: 0.4rem 0 0;
    align-items: center;
    text-align: center;
    background: transparent;
  }

  .tile__badge,
  .tile p,
  .tile__cta {
    display: none !important;
  }

  .tile h2 {
    font-family: "Outfit", system-ui, sans-serif;
    font-size: 0.625rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  }
}

@media (max-width: 1024px) and (min-width: 520px) {
  .gallery-shell {
    max-width: min(100%, 580px);
    padding-inline: 1.15rem;
  }

  .gallery {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.5rem 0.65rem;
  }

  .gallery > li {
    max-width: 5.5rem;
  }

  .tile {
    max-width: 5rem;
  }

  .tile h2 {
    font-size: 0.65rem;
  }
}

@media (max-width: 1024px) and (min-width: 768px) {
  .gallery-shell {
    max-width: min(100%, 680px);
    padding: 3rem 1.35rem 1.85rem;
  }

  .gallery {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.65rem 0.75rem;
  }

  .gallery > li {
    max-width: 5.75rem;
  }

  .tile {
    max-width: 5.25rem;
  }
}


@media print {
  header.site,
  .section-jump,
  .skip,
  .noise,
  .scroll-indicator {
    display: none !important;
  }
  .wrap {
    padding-top: 1rem !important;
  }
  body::before,
  body::after {
    animation: none !important;
    display: none !important;
  }
  .gallery > li {
    display: block !important;
    break-inside: avoid;
  }
  .gallery-empty {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before { animation: none; transform: none; }
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0a0a0a;
  --mist: #0e0e0e;
  --surface: #121212;
  --ink: #f4f4f4;
  --ink-soft: #c2c2c2;
  --ink-faint: rgba(244, 244, 244, 0.48);
  --sage: #8ec5d1;
  --sage-deep: #6eb0bf;
  --sage-mist: rgba(110, 176, 191, 0.14);
  --horizon: #d4a574;
  --horizon-mist: rgba(212, 165, 116, 0.1);
  --world-a: rgba(110, 176, 191, 0.08);
  --world-b: rgba(255, 255, 255, 0.03);
  --world-c: rgba(212, 165, 116, 0.06);
  --slate-mist: rgba(0, 0, 0, 0.55);
  --gold-leaf: rgba(255, 255, 255, 0.04);
  --gold-leaf-deep: rgba(0, 0, 0, 0.5);
  --gold-sheen: rgba(255, 255, 255, 0.06);
  --theme-meta: #000000;
}

[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 90% 55% at 50% 108%, rgba(110, 176, 191, 0.05), transparent 52%),
    linear-gradient(168deg, #0c0c0c 0%, #080808 48%, #050505 100%);
}

[data-theme="dark"] body::after {
  opacity: 0.12;
}

[data-theme="dark"] .app-home__label,
[data-theme="dark"] .app-home__hint {
  color: rgba(244, 244, 244, 0.45);
}

[data-theme="dark"] .app-home__edit-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: #8ec5d1;
}

[data-theme="dark"] .app-home__dot {
  background: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .app-home__dot[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.82);
}

[data-theme="dark"] .tile,
[data-theme="dark"] .gallery-empty,
[data-theme="dark"] .gallery-shell {
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: 7px 7px 16px rgba(0, 0, 0, 0.88), -5px -5px 14px rgba(255, 255, 255, 0.045);
}

@media (max-width: 768px) {
  :root {
    --nav-h: calc(3.15rem + env(safe-area-inset-top, 0px));
    --footer-fixed-pad: calc(3.85rem + env(safe-area-inset-bottom, 0px));
    --section-jump-bar-h: 2.45rem;
    --anchor-offset: calc(var(--nav-h) + var(--section-jump-bar-h) + 0.15rem);
  }

  header.site {
    height: var(--nav-h);
    min-height: var(--nav-h);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: 0;
  }

  .section-jump {
    border-bottom: 1px solid rgba(92, 117, 104, 0.14);
    box-shadow: 0 8px 18px rgba(26, 34, 48, 0.05);
  }

  .section-jump-btn {
    padding: 0.55rem 0.35rem;
    font-size: 0.52rem;
    letter-spacing: 0.08em;
  }

  .wrap {
    padding: calc(var(--anchor-offset) + 0.65rem) max(0.75rem, env(safe-area-inset-left, 0px)) calc(var(--footer-fixed-pad) + 0.35rem) max(0.75rem, env(safe-area-inset-right, 0px));
  }

  h1 {
    font-size: clamp(1.65rem, 7.5vw, 2.15rem);
  }

  .gallery-shell {
    margin-bottom: 0.85rem;
    max-width: min(100%, 390px);
    padding: 2rem 0.65rem 0.95rem;
    min-height: min(74vh, 640px);
    border-radius: clamp(22px, 5vw, 30px);
  }

  .gallery-shell::before {
    width: 3.5rem;
    height: 4px;
    top: 8px;
  }

  .app-home__toolbar {
    margin-bottom: 0.35rem;
  }

  .app-home__hint {
    display: none;
  }

  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem 0.35rem;
  }

  .gallery > li {
    max-width: 4.85rem;
  }

  .tile {
    max-width: 4.35rem;
  }

  .tile h2 {
    font-size: 0.56rem;
    line-height: 1.15;
  }

  .app-home__page {
    gap: 1rem 0.35rem;
  }

  .nav-chicago-widget {
    flex-shrink: 0;
  }
}

@media (max-width: 380px) {
  .section-jump-btn {
    font-size: 0.48rem;
    letter-spacing: 0.06em;
  }

  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.95rem 0.3rem;
  }

  .gallery-shell {
    max-width: min(100%, 340px);
    padding-inline: 0.55rem;
  }

  .tile h2 {
    font-size: 0.54rem;
  }
}
