/* Notion-like look. Change colors in :root (light) and the [data-theme="dark"] block below.
   theme.js sets data-theme on <html> (system default, or the visitor's saved choice). */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #37352f;
  --muted: rgba(55, 53, 47, 0.65);
  --faint: rgba(55, 53, 47, 0.45);
  --border: rgba(55, 53, 47, 0.16);
  --hover: rgba(55, 53, 47, 0.06);
  --tag-bg: rgba(227, 226, 224, 0.6);
  --shadow: rgba(15, 15, 15, 0.08) 0 0 0 1px, rgba(15, 15, 15, 0.08) 0 2px 4px;
  --code-bg: rgba(135, 131, 120, 0.15);
  --avatar-filter: none;
  --gutter: 16px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191919;
  --text: rgba(255, 255, 255, 0.85);
  --muted: rgba(255, 255, 255, 0.6);
  --faint: rgba(255, 255, 255, 0.4);
  --border: rgba(255, 255, 255, 0.12);
  --hover: rgba(255, 255, 255, 0.05);
  --tag-bg: rgba(255, 255, 255, 0.08);
  --shadow: rgba(255, 255, 255, 0.09) 0 0 0 1px, rgba(0, 0, 0, 0.3) 0 2px 4px;
  --code-bg: rgba(255, 255, 255, 0.08);
  --avatar-filter: invert(0.88);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;              /* long words/URLs wrap instead of widening the page */
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, color 0.2s;
}

a { color: inherit; }

button, a { touch-action: manipulation; }  /* no double-tap-zoom delay on taps */

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 80px max(var(--gutter), env(safe-area-inset-left)) 40px;
}

.page-title {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 32px;
}

/* ── theme toggle ─────────────────────── */

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.theme-toggle svg { width: 18px; height: 18px; }

/* ── hero ─────────────────────────────── */

.hero {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-bottom: 56px;
}

.hero-text { flex: 1 1 0; min-width: 0; }
.hero-text p { margin: 0 0 10px; font-size: 1.08rem; color: var(--text); }
.hero-text strong { font-weight: 600; }

.greeting {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 12px;
}

.avatar {
  width: 280px;
  max-width: 40%;
  height: auto;
  filter: var(--avatar-filter);
}

.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background 0.15s;
}

/* ── icons ────────────────────────────── */

.icon { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; }
.emoji { width: auto; height: auto; font-size: 1rem; line-height: 1; }

/* ── sections & tabs ──────────────────── */

.section { margin-bottom: 64px; scroll-margin-top: 24px; }

.section h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 16px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 8px;
  margin-bottom: -1px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--faint);
  font: inherit;
  font-size: 1.02rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.tab.active { color: var(--text); border-bottom-color: var(--text); }

.empty { color: var(--faint); }

/* "See all talks (6) →" under a shortened section (set `limit:` in site.yaml). */
.see-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 10px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.see-all .count { color: var(--faint); font-weight: 400; }
.grid + .see-all { margin-top: 16px; }

/* Year headings on a section's own page. */
.group-year {
  margin: 36px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.panel > .group-year:first-child { margin-top: 0; }
.group-year + .list .row:first-child { padding-top: 14px; }

/* ── grids: chips & cards ─────────────── */

.grid { display: grid; gap: 16px; }
.chips { grid-template-columns: repeat(3, 1fr); }
.cards { grid-template-columns: repeat(2, 1fr); gap: 20px; }

.box {
  border-radius: 6px;
  box-shadow: var(--shadow);
  background: var(--bg);
  text-decoration: none;
  transition: background 0.15s;
}

.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  font-weight: 500;
}
.chip span { min-width: 0; }

.card { padding: 16px 16px 14px; min-width: 0; }

/* Card photo: edge-to-edge across the top of the card. */
.card-img {
  display: block;
  aspect-ratio: 16 / 9;
  margin: -16px -16px 14px;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  background: var(--tag-bg);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: none;
}
.card-title span { min-width: 0; }

.desc { margin: 8px 0 0; font-size: 0.95rem; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--tag-bg);
  font-size: 0.85rem;
}

.links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 0.9rem; }
.links a { color: var(--muted); text-decoration: none; }

/* ── list layout ──────────────────────── */

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

.row {
  display: flex;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}
.row:first-child { padding-top: 4px; }

.row-icon { padding-top: 3px; color: var(--muted); }

/* Photo thumbnail (item has `image:`), shown in place of the icon. */
.row-thumb {
  flex-shrink: 0;
  align-self: flex-start;
  width: 168px;
  aspect-ratio: 3 / 2;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--tag-bg);
}
.row-thumb img, .card-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}
.row.has-image { gap: 16px; }
.row-body { flex: 1; min-width: 0; }

.row-title { font-weight: 500; text-decoration: none; }

.meta { font-size: 0.9rem; color: var(--muted); }
.row .desc { margin-top: 4px; }

.row-date {
  flex-shrink: 0;
  font-size: 0.9rem;
  color: var(--faint);
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ── blog post page ───────────────────── */

.post-page { max-width: 720px; }

.back {
  display: inline-block;
  margin-bottom: 32px;
  color: var(--muted);
  text-decoration: none;
}

.post .page-title { margin-bottom: 8px; }
.post-date { display: block; color: var(--faint); margin-bottom: 32px; }

.prose { font-size: 1.05rem; line-height: 1.75; }
.prose h2 { font-size: 1.5rem; line-height: 1.3; margin: 2em 0 0.5em; }
.prose h3 { font-size: 1.2rem; line-height: 1.3; margin: 1.6em 0 0.4em; }
.prose a { text-underline-offset: 3px; }
.prose img, .prose video, .prose iframe { max-width: 100%; height: auto; border-radius: 6px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose blockquote {
  margin: 1.5em 0;
  padding: 2px 16px;
  border-left: 3px solid var(--text);
}
.prose code {
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
}
.prose pre {
  background: var(--code-bg);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prose pre code { background: none; padding: 0; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { padding: 6px 12px; border: 1px solid var(--border); text-align: left; }

/* ── misc ─────────────────────────────── */

.footer {
  margin-top: 40px;
  padding-top: 20px;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
}
.footer a { color: var(--muted); text-underline-offset: 3px; }

.loading { color: var(--faint); }

.error {
  padding: 16px;
  border-radius: 6px;
  background: rgba(235, 87, 87, 0.1);
  color: #d44c47;
}
.error .hint { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }

/* ── hover (mouse/trackpad only, so taps don't leave things stuck highlighted) ── */

@media (hover: hover) {
  .theme-toggle:hover { background: var(--hover); color: var(--text); }
  .button:hover { background: var(--hover); }
  .tab:hover { color: var(--muted); }
  .tab.active:hover { color: var(--text); }
  a.box:hover, .card:hover { background: var(--hover); }
  a.card-title:hover span,
  a.row-title:hover { text-decoration: underline; text-underline-offset: 3px; }
  .links a:hover { color: var(--text); text-decoration: underline; }
  .back:hover, .footer a:hover { color: var(--text); }
  .see-all:hover { background: var(--hover); color: var(--text); }
  .row-thumb:hover img, .card-img:hover img { transform: scale(1.03); }
}

/* Pressed feedback for touch screens. */
.see-all:active, a.box:active, .theme-toggle:active, .links a:active { background: var(--hover); }

/* ── tablet & phone ───────────────────── */

@media (max-width: 720px) {
  .page { padding-top: 40px; padding-bottom: 24px; }

  /* Toggle scrolls away with the page instead of floating over the text. */
  .theme-toggle { position: absolute; top: 40px; right: max(var(--gutter), env(safe-area-inset-right)); }
  .page-title { font-size: 2rem; margin-bottom: 24px; padding-right: 48px; }
  .back { margin-bottom: 24px; padding: 6px 0; }
  .see-all { min-height: 48px; padding: 10px 12px; border: 1px solid var(--border); }
  .group-year { margin-top: 28px; }

  .hero { flex-direction: column-reverse; align-items: flex-start; gap: 20px; margin-bottom: 44px; }
  .avatar { width: 150px; max-width: 45%; }
  .greeting { font-size: 1.5rem; }
  .hero-text p { font-size: 1.02rem; }

  /* Buttons share the row and are tall enough to tap. */
  .button { flex: 1 1 auto; min-height: 44px; padding: 8px 14px; }

  .section { margin-bottom: 48px; }
  .section h2 { font-size: 1.4rem; margin-bottom: 12px; }

  /* Tabs bleed to the screen edges so a scrollable row doesn't look cut off. */
  .tabs { margin: 0 calc(-1 * var(--gutter)) 16px; padding: 0 var(--gutter); }
  .tab { padding: 10px 10px 12px; }

  .chips { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .chip { padding: 12px 14px; }
  .cards { grid-template-columns: 1fr; gap: 14px; }

  /* Card links become small buttons: easier to hit with a thumb. */
  .links { gap: 8px; margin-top: 12px; }
  .links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
  }

  /* Rounder corners on phones. */
  .box, .error { border-radius: 16px; }
  .card-img { border-radius: 16px 16px 0 0; }
  .button, .theme-toggle { border-radius: 12px; }
  .see-all { border-radius: 12px; }
  .tag { border-radius: 8px; }
  .row-thumb, .prose img, .prose video, .prose iframe { border-radius: 12px; }

  .row { flex-wrap: wrap; row-gap: 2px; padding: 14px 0; }
  .row-date { order: -1; width: 100%; padding: 0 0 0 30px; font-size: 0.85rem; }

  /* Photo goes full-width on top, then date, then text. */
  .row.has-image { row-gap: 8px; }
  .row-thumb { order: -2; width: 100%; aspect-ratio: 16 / 9; }
  .row.has-image .row-date { padding-left: 0; }

  .post .page-title { font-size: 1.75rem; }
  .post-date { margin-bottom: 24px; }
  .prose { font-size: 1rem; line-height: 1.7; }
  .prose h2 { font-size: 1.3rem; }
  .prose pre { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); border-radius: 0; }

  .footer { flex-direction: column; margin-top: 24px; }
}

/* ── phone app: bottom tabs, search, date filter ───────────────
   app.js renders it next to the desktop page (.d-page). Above 720px it stays hidden. */

.m-app { display: none; }

@media (max-width: 720px) {
  :root {
    --m-top: calc(52px + env(safe-area-inset-top, 0px));
    --m-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  .page.home { padding: 0; }
  .d-page { display: none; }
  .m-home .theme-toggle { display: none; }   /* the app bar has its own toggle */

  .m-app { display: block; padding: var(--m-top) 0 var(--m-bottom); }
  .m-app [hidden] { display: none !important; }
  .m-app a { text-decoration: none; }

  /* app bar (top) */
  .m-bar {
    position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: var(--m-top);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .m-bar-title { font-size: 1.1rem; font-weight: 700; }
  .m-tools { display: flex; align-items: center; }

  .m-icon-btn {
    position: relative; width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
    border: 0; border-radius: 12px; background: none; color: var(--muted); cursor: pointer;
  }
  .m-icon-btn:active { background: var(--hover); }
  .m-icon-btn.on::after {                         /* dot: a filter is on */
    content: ""; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; box-sizing: content-box;
    border: 2px solid var(--bg); border-radius: 50%; background: #2383e2;
  }

  /* search box: grows out of the icon, covering the title */
  .m-search {
    flex: 1; display: flex; align-items: center; gap: 4px; height: 40px; padding-left: 12px; margin-right: -4px;
    border-radius: 99px; background: var(--tag-bg); color: var(--muted);
    transform-origin: right center; animation: m-expand 0.2s ease-out;
  }
  .m-search .icon { flex: none; }
  .m-search input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text);
    font: inherit; font-size: 1rem;           /* 16px+ stops iOS zooming into the field */
  }
  .m-search input::placeholder { color: var(--faint); }
  .m-search .m-icon-btn { width: 36px; height: 36px; }
  @keyframes m-expand { from { opacity: 0; transform: scaleX(0.25); } to { opacity: 1; transform: scaleX(1); } }

  /* tab bar (bottom) */
  .m-tabs {
    position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex;
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: var(--bg); border-top: 1px solid var(--border);
  }
  .m-tab {
    flex: 1; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 0; border: 0; background: none; color: var(--faint); font: inherit; font-size: 0.72rem; font-weight: 500; cursor: pointer;
  }
  .m-tab .icon { width: 22px; height: 22px; }
  .m-tab.active { color: var(--text); font-weight: 700; }

  /* About: one screen, no scrolling on typical phones */
  .m-about {
    min-height: calc(100vh - var(--m-top) - var(--m-bottom));
    min-height: calc(100dvh - var(--m-top) - var(--m-bottom));
    padding: 16px max(var(--gutter), env(safe-area-inset-right)) 16px max(var(--gutter), env(safe-area-inset-left));
  }
  .m-avatar { display: block; width: clamp(88px, 15vh, 116px); width: clamp(88px, 15dvh, 116px); height: auto; margin-bottom: 14px; filter: var(--avatar-filter); }
  .m-greeting { margin: 0 0 8px; font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
  .m-about > p { margin: 0 0 8px; font-size: 1.02rem; }
  .m-about .footer {
    flex-direction: column; gap: 2px; margin-top: 22px; padding: 0; border: 0; font-size: 0.72rem; line-height: 1.5;
  }

  /* section screens */
  .m-body { padding: 4px max(var(--gutter), env(safe-area-inset-right)) 16px max(var(--gutter), env(safe-area-inset-left)); }

  .m-seg { display: inline-flex; gap: 2px; margin: 12px 0 2px; padding: 3px; border-radius: 12px; background: var(--tag-bg); }
  .m-seg button, .m-seg-link {
    padding: 6px 14px; border: 0; border-radius: 9px; background: none; color: var(--muted);
    font: inherit; font-size: 0.88rem; cursor: pointer;
  }
  .m-seg button.active { background: var(--bg); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

  .m-cards { display: grid; gap: 12px; padding-top: 12px; }
  .m-card { display: flex; gap: 12px; padding: 14px; border-radius: 16px; box-shadow: var(--shadow); background: var(--bg); }
  .m-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--tag-bg); color: var(--muted); }
  .m-card-body { flex: 1; min-width: 0; }

  .m-title { display: block; color: var(--text); font-size: 1rem; font-weight: 600; line-height: 1.35; }
  .m-desc {
    margin: 2px 0 0; font-size: 0.9rem; line-height: 1.45; color: var(--muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .m-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
  .m-meta { min-width: 0; font-size: 0.78rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-links { display: flex; flex: none; gap: 2px; margin-left: auto; }
  .m-links a {
    min-height: 40px; display: inline-flex; align-items: center; padding: 0 10px;
    border-radius: 10px; color: var(--text); font-size: 0.85rem; font-weight: 500;
  }
  .m-links a:active { background: var(--hover); }

  .m-list { list-style: none; margin: 0; padding: 0; }
  .m-row { display: flex; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--border); }
  .m-row:first-child { padding-top: 16px; }
  .m-row:last-child { border-bottom: 0; }
  .m-thumb { flex: none; align-self: flex-start; width: 104px; height: 78px; border-radius: 12px; overflow: hidden; background: var(--tag-bg); }
  .m-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .m-row-body { flex: 1; min-width: 0; }
  .m-line { font-size: 0.8rem; line-height: 1.4; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-row .m-title { margin-top: 6px; font-size: 1.02rem; }
  .m-row .m-desc { margin-top: 6px; }
  .m-row .m-links { margin: 8px 0 -8px -10px; }

  /* active filters */
  .m-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; }
  .m-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0;
    border-radius: 99px; background: var(--tag-bg); color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer;
  }
  .m-chip .icon { width: 14px; height: 14px; }
  .m-count { margin-left: auto; font-size: 0.8rem; color: var(--faint); }
  .m-empty { padding: 56px 24px; text-align: center; color: var(--muted); }
  .m-empty .icon { width: 32px; height: 32px; color: var(--faint); }
  .m-empty p { margin: 8px 0 16px; }

  /* calendar popover: drops from under the app bar; tap outside to close */
  .m-sheet { position: fixed; z-index: 30; left: 0; right: 0; top: var(--m-top); bottom: 0; background: rgba(0, 0, 0, 0.38); animation: m-fade 0.15s ease-out; }
  .m-sheet.still { animation: none; }
  .m-sheet-card {
    max-height: 100%; overflow-y: auto; padding: 16px max(var(--gutter), env(safe-area-inset-right)) 18px max(var(--gutter), env(safe-area-inset-left));
    background: var(--bg); border-radius: 0 0 24px 24px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  }
  .m-sheet-title { font-size: 1.05rem; font-weight: 700; }
  .m-sheet-label { margin: 14px 0 8px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }
  .m-sheet-label span { font-weight: 500; letter-spacing: 0; text-transform: none; }
  .m-opts { display: flex; flex-wrap: wrap; gap: 8px; }
  .m-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .m-opt {
    min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 14px;
    background: none; color: var(--text); font: inherit; font-size: 0.92rem; cursor: pointer;
  }
  .m-opt.active { border-color: var(--text); background: var(--text); color: var(--bg); font-weight: 600; }
  .m-opt:disabled { opacity: 0.32; cursor: default; }
  .m-sheet-actions { display: flex; gap: 8px; margin-top: 16px; }
  .m-primary {
    flex: 1; min-height: 44px; border: 0; border-radius: 14px; background: var(--text); color: var(--bg);
    font: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  }
  @keyframes m-fade { from { opacity: 0; } to { opacity: 1; } }

  @media (prefers-reduced-motion: reduce) {
    .m-search, .m-sheet { animation: none; }
  }
}

/* ── small phones ─────────────────────── */

@media (max-width: 380px) {
  .chips { grid-template-columns: 1fr; }
  .page-title { font-size: 1.75rem; }
}
