
:root {
  --accent: #6F4BFF; --on-accent: #FFFFFF; --pop: #FFD23F; --on-pop: #1A1400;
  --paper: color-mix(in srgb, var(--accent) 7%, #FFFFFF);
  --card: #FFFFFF;
  --ink: color-mix(in srgb, var(--accent) 22%, #0D0B1A);
  --muted: color-mix(in srgb, var(--accent) 18%, #585470);
  --hairline: color-mix(in srgb, var(--accent) 16%, #DAD7E6);
  --dots: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-text: var(--accent);
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: color-mix(in srgb, var(--accent) 10%, #0B0A12);
    --card: color-mix(in srgb, var(--accent) 9%, #15141D);
    --ink: #EEEBFF; --muted: #ABA6C4;
    --hairline: color-mix(in srgb, var(--accent) 28%, #2A2838);
    --dots: color-mix(in srgb, var(--accent) 22%, transparent);
    --accent-text: color-mix(in srgb, var(--accent) 55%, white);
  }
}
:root[data-theme="dark"] {
  --paper: color-mix(in srgb, var(--accent) 10%, #0B0A12);
  --card: color-mix(in srgb, var(--accent) 9%, #15141D);
  --ink: #EEEBFF; --muted: #ABA6C4;
  --hairline: color-mix(in srgb, var(--accent) 28%, #2A2838);
  --dots: color-mix(in srgb, var(--accent) 22%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 55%, white);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body {
  min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dots) 1px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 400 1rem/1.55 "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: max(3rem, env(safe-area-inset-top)) 1.25rem max(3rem, env(safe-area-inset-bottom));
}
main { max-width: 46rem; margin: 0 auto; }
.links, .bio, .now { max-width: 30rem; }

/* intro */
.header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.share {
  min-height: 44px; padding: 0 1.1rem; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  font: 600 0.9375rem/1 "Instrument Sans", system-ui, sans-serif; cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.share:active { transform: translate(1px, 1px); }
.avatar-wrap { position: relative; width: 6rem; height: 6rem; }
.avatar {
  width: 100%; height: 100%; border-radius: 50%;
  border: 3px solid var(--ink); object-fit: cover; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  font: 800 1.9rem/1 var(--display);
}
.sticker {
  position: absolute; left: 4.25rem; bottom: -0.35rem; white-space: nowrap;
  background: var(--pop); color: var(--on-pop);
  border: 2px solid var(--ink); border-radius: 8px; padding: 0.3rem 0.55rem;
  font: 700 0.85rem/1 "Instrument Sans", system-ui, sans-serif;
  transform: rotate(-7deg); box-shadow: 2px 2px 0 var(--ink);
  animation: slap 420ms cubic-bezier(.2, 1.6, .4, 1) 350ms both;
}
@keyframes slap {
  from { opacity: 0; transform: rotate(-22deg) scale(1.9); }
  to { opacity: 1; transform: rotate(-7deg) scale(1); }
}
h1 {
  font-family: var(--display); font-weight: 800; font-stretch: 78%;
  font-size: clamp(3.5rem, 17vw, 7.5rem); line-height: 0.86; letter-spacing: -0.035em;
  margin: 1.5rem 0 1.25rem;
  text-shadow: 0.045em 0.045em 0 var(--accent);
}
h1 span { display: block; }
.hats { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hats li {
  font-size: 0.8125rem; font-weight: 600; padding: 0.3rem 0.7rem;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card);
}
.bio { font-size: 1.0625rem; margin: 0 0 1rem; }
.now { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 2.25rem; color: var(--muted); font-size: 0.9375rem; }
.now::before { content: ""; flex: none; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #2DA44E; box-shadow: 0 0 0 3px color-mix(in srgb, #2DA44E 25%, transparent); }
.now strong { color: var(--ink); font-weight: 600; }

/* availability */
.availability { margin: 0 0 1rem; max-width: 30rem; }
.availability a, .availability > span {
  display: inline-flex; align-items: center; gap: 0.55rem; min-height: 44px; padding: 0 1rem;
  border-radius: 999px; border: 2px dashed var(--ink); background: var(--card); color: var(--ink);
  font-weight: 600; font-size: 0.9375rem; text-decoration: none;
}
.availability i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 25%, transparent); }
.availability-open { --dot: #2DA44E; }
.availability-limited { --dot: #D4A72C; }
.availability-closed { --dot: #8C959F; }

/* links */
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.875rem; }
.links a {
  display: block; padding: 1rem 1.125rem;
  background: var(--card); color: var(--ink); text-decoration: none;
  border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: 0 0 0 var(--accent);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.links a:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--accent); }
.links a.featured { background: var(--accent); color: var(--on-accent); }
.link-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.title { font-weight: 600; font-size: 1.0625rem; }
.tag {
  flex: none; font-size: 0.75rem; font-weight: 600; line-height: 1; padding: 0.3rem 0.5rem;
  border-radius: 6px; background: var(--pop); color: var(--on-pop);
}
.desc { display: block; font-size: 0.9375rem; margin-top: 0.125rem; color: var(--muted); }
.featured .desc { color: inherit; opacity: 0.85; }

/* businesses */
.businesses { margin-top: 4rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
h2 { font: 800 clamp(1.75rem, 6vw, 2.25rem)/1 var(--display); font-stretch: 85%; letter-spacing: -0.02em; margin: 0; }
.section-head a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border-radius: 999px;
  border: 1.5px solid var(--hairline); background: var(--card);
  color: var(--accent-text); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.section-sub { color: var(--muted); margin: 0.5rem 0 1.25rem; }
.biz-subhead { font: 700 1.125rem/1.2 var(--display); font-stretch: 85%; margin: 2rem 0 0.875rem; color: var(--muted); }
.biz-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.875rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.biz {
  height: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon top" "desc desc" "meta meta";
  grid-template-rows: auto auto 1fr; column-gap: 0.75rem; row-gap: 0.5rem;
  padding: 1rem 1.125rem; background: var(--card); color: var(--ink); text-decoration: none;
  border: 1.5px solid var(--hairline); border-radius: 12px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.biz { position: relative; }
.biz:active:not(:has(.biz-share:active)) { transform: translate(1px, 1px); border-color: var(--ink); }
/* The name link covers the whole card, so tapping anywhere still opens the business */
.biz-link { color: var(--accent-text); text-decoration: none; }
.biz-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.biz:has(.biz-link:focus-visible) { outline: 3px solid var(--pop); outline-offset: 3px; }
.biz-link:focus-visible { outline: none; }
.biz-share {
  position: absolute; top: 0.625rem; right: 0.625rem; z-index: 2;
  width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer;
  border-radius: 999px; border: 1.5px solid var(--ink); background: var(--card); color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink); transition: transform 120ms ease, box-shadow 120ms ease;
}
.biz-share:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.biz:not(.has-shot) .biz-top { padding-right: 2.75rem; }

/* Share menu (desktop) */
.share-menu {
  position: fixed; z-index: 30; min-width: 13.5rem; padding: 0.375rem;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--accent);
}
.share-menu[hidden] { display: none; }
.share-menu-head { margin: 0; padding: 0.5rem 0.75rem 0.375rem; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.share-menu [role="menuitem"] {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 0.75rem;
  border: 0; border-radius: 8px; background: none; color: inherit; cursor: pointer;
  font: 600 0.9375rem/1 "Instrument Sans", system-ui, sans-serif; text-decoration: none; text-align: left;
}
.share-menu [role="menuitem"]:hover, .share-menu [role="menuitem"]:focus-visible { background: color-mix(in srgb, var(--accent) 12%, var(--card)); outline: none; }
.biz.has-shot { grid-template-areas: "shot shot" "icon top" "desc desc" "meta meta"; grid-template-rows: auto auto auto 1fr; padding-top: 0.75rem; }
.biz-shot {
  grid-area: shot; display: block; margin: 0 -0.375rem 0.25rem; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: 8px; border: 1.5px solid var(--hairline); background: color-mix(in srgb, var(--accent) 8%, var(--card));
}
.biz-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.biz-shot.fit-contain img { object-fit: contain; object-position: center; padding: 0.5rem 0 0; }

.biz-icon {
  grid-area: icon; width: 2.5rem; height: 2.5rem; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.3rem;
  background: color-mix(in srgb, var(--pop) 30%, var(--card)); border: 1.5px solid var(--hairline);
}
.biz-top { grid-area: top; align-self: center; display: flex; align-items: center; gap: 0.25rem 0.5rem; flex-wrap: wrap; min-width: 0; }
.biz-name { color: var(--accent-text); font-weight: 700; font-size: 1.0625rem; }

.status {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: 0.75rem; line-height: 1; padding: 0.25rem 0.5rem;
  border: 1px solid var(--hairline); border-radius: 999px; color: var(--muted);
}
.badge-new {
  font-size: 0.7rem; font-weight: 700; line-height: 1; padding: 0.3rem 0.5rem; border-radius: 6px;
  background: var(--pop); color: var(--on-pop); letter-spacing: 0.02em;
}
.also-on { color: var(--ink); font-weight: 600; }
.biz-app {
  grid-column: 1 / -1; position: relative; z-index: 2; justify-self: start; margin-top: 0.25rem;
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0 1rem;
  border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 0.875rem; text-decoration: none;
}
.biz-app:active { transform: translate(1px, 1px); }
.biz-grid > li:has(.biz:not(.has-shot)) { align-self: start; }
.status i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--dot); }
.status-live { --dot: #2DA44E; }
.status-in-build { --dot: #D4A72C; }
.status-parked { --dot: #8C959F; }
.biz-desc { grid-area: desc; font-size: 0.9375rem; color: var(--muted); margin: 0; }
.biz-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.8125rem; color: var(--muted); align-self: end; overflow-wrap: anywhere; }

/* outro */
.socials { list-style: none; padding: 0; margin: 3.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.625rem; }
.socials a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none;
}
.socials a:active, .section-head a:active { transform: translate(1px, 1px); }
footer { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1.5px dashed var(--hairline); font-size: 0.8125rem; color: var(--muted); max-width: 36rem; }
footer code { font-size: 0.8rem; padding: 0.1rem 0.35rem; border-radius: 4px; background: var(--card); border: 1px solid var(--hairline); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--pop); outline-offset: 3px; }

/* Hover effects only on devices that can hover, so taps don't leave cards stuck "lifted". */
@media (hover: hover) {
  .links a:hover { transform: translate(-3px, -3px); box-shadow: 4px 4px 0 var(--accent); }
  .links a.featured:hover { box-shadow: 4px 4px 0 var(--ink); }
  .biz:hover { border-color: var(--ink); transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--accent); }
  .biz:hover .biz-name { text-decoration: underline; text-underline-offset: 0.2em; }
  .biz-share:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--accent); }
  .biz-app:hover { box-shadow: 3px 3px 0 var(--accent); transform: translate(-1px, -1px); }
  .share:hover, .socials a:hover, .availability a:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--accent); }
  .section-head a:hover { border-color: var(--accent-text); }
}

/* Phones */
@media (max-width: 480px) {
  body { padding-top: max(1.75rem, env(safe-area-inset-top)); padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
  h1 { margin: 1.25rem 0 1rem; }
  .hats { gap: 0.375rem; }
  .hats li { font-size: 0.75rem; padding: 0.25rem 0.6rem; }
  .bio { font-size: 1rem; }
  .now { margin-bottom: 1.75rem; }
  .links { gap: 0.75rem; }
  .links a { padding: 0.9rem 1rem; }
  .link-top { display: block; }
  .link-top .tag { display: inline-block; margin-left: 0.4rem; vertical-align: 0.12em; }
  .businesses { margin-top: 3rem; }
  .biz { padding: 0.9rem 1rem; }
  .socials { margin-top: 2.75rem; }
}
/* Mini bar (mobile only, shown by app.js after the name scrolls away) */
.minibar { display: none; }
.swipe-hint { display: none; }

/* ---------- Desktop: two columns, full width ---------- */
@media (min-width: 1024px) {
  body { padding-left: clamp(2rem, 4vw, 4rem); padding-right: clamp(2rem, 4vw, 4rem); }
  .page {
    max-width: 92rem;
    display: grid; column-gap: clamp(2.5rem, 4vw, 5rem);
    grid-template-columns: minmax(19rem, 24rem) minmax(0, 1fr);
    grid-template-areas: "me work" "avail work" "links work" "socials work" "foot work";
    grid-template-rows: auto auto auto auto 1fr;
  }
  .page > header { grid-area: me; }
  .page > .availability { grid-area: avail; }
  .page > .links { grid-area: links; max-width: none; }
  .page > .socials { grid-area: socials; margin-top: 2rem; }
  .page > footer { grid-area: foot; align-self: start; }
  .page > .businesses { grid-area: work; margin-top: 0; padding-top: 0.5rem; }
  .bio, .now { max-width: none; }
  h1 { font-size: clamp(4.5rem, 5.6vw, 6.25rem); }
  h2 { font-size: clamp(2.25rem, 3.2vw, 3rem); }
  .biz-grid { grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; }
}

/* ---------- A card left alone on the last row stretches into a wide card ---------- */
.biz-grid > li.wide-slot .biz.has-shot {
  grid-template-columns: minmax(0, 1.25fr) auto minmax(0, 1fr);
  grid-template-areas: "shot icon top" "shot desc desc" "shot meta meta";
  grid-template-rows: auto auto 1fr; column-gap: 1rem; padding-top: 1rem;
}
.biz-grid > li.wide-slot .biz-shot { margin: 0 0.25rem 0 -0.375rem; align-self: start; }
@media (min-width: 641px) and (max-width: 1023px) {
  .biz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .biz-grid > li:last-child:nth-child(2n+1) { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .businesses { container: work / inline-size; }
  @container work (min-width: 32rem) and (max-width: 48.49rem) {
    .biz-grid > li:last-child:nth-child(2n+1) { grid-column: 1 / -1; }
  }
  @container work (min-width: 48.5rem) and (max-width: 64.99rem) {
    .biz-grid > li:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
  }
  @container work (min-width: 65rem) {
    .biz-grid > li:last-child:nth-child(4n+1) { grid-column: 1 / -1; }
  }
}

/* ---------- Phones: app-like ---------- */
@media (max-width: 640px) {
  .minibar {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    position: fixed; top: 0; left: 0; right: 0; z-index: 10;
    padding: calc(env(safe-area-inset-top) + 0.5rem) max(1rem, env(safe-area-inset-right)) 0.5rem max(1rem, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--hairline);
    transform: translateY(-100%); transition: transform 200ms ease;
  }
  .minibar.show { transform: none; }
  html { scroll-padding-top: calc(env(safe-area-inset-top) + 4rem); }
  .minibar-name { font: 800 1.25rem/1 var(--display); font-stretch: 85%; letter-spacing: -0.02em; }
  .share-sm { min-height: 40px; padding: 0 0.95rem; font-size: 0.875rem; }
  .biz-share { width: 44px; height: 44px; }

  /* Businesses become a swipeable row with the next card peeking in */
  .swipe-hint { display: block; margin: -0.75rem 0 0.75rem; font-size: 0.8125rem; font-weight: 600; color: var(--accent-text); }
  .biz-grid {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    scroll-padding-inline: 1rem; padding: 0.25rem 1rem 1rem; margin: 0 -1rem;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .biz-grid::-webkit-scrollbar { display: none; }
  .biz-grid > li { scroll-snap-align: start; }
  .biz-grid > li:has(.biz:not(.has-shot)) { align-self: stretch; }

  /* Bigger, thumb-friendly rows; socials share the width evenly */
  .links a { padding: 1rem 1.1rem; border-radius: 16px; }
  .socials { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .socials li { display: flex; }
  .socials a { flex: 1; justify-content: center; min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .minibar { transition: none; }
  .sticker { animation: none; }
  .links a, .biz, .share { transition: none; }
  .links a:hover, .biz:hover, .share:hover, .socials a:hover { transform: none; }
}