.hero { padding-block: clamp(32px, 7vw, 88px) clamp(20px, 4vw, 40px); }

.brand { display: flex; align-items: center; gap: 2px; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand-o {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem;
  background: var(--accent); color: var(--accent-ink);
  border: var(--border); border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
  rotate: -8deg;
}

.hero-title {
  margin-top: clamp(20px, 4vw, 40px);
  font-size: clamp(2.6rem, 1rem + 8vw, 6.5rem);
  font-weight: 900;
  line-height: 1.25; /* Thai stacks vowel and tone marks above the line */
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero-title mark {
  background: var(--lemon);
  color: var(--accent-ink);
  padding: 0 0.15em;
  margin-left: -0.05em;
  border: var(--border);
  border-radius: 0.2em;
  box-shadow: var(--shadow);
  display: inline-block;
  rotate: -1.5deg;
}
.hero-sub { margin-top: 1.5rem; max-width: 36ch; color: var(--ink-soft); font-size: 1.1rem; }

.search { margin-top: clamp(24px, 4vw, 40px); max-width: 560px; }
.search input {
  width: 100%;
  font: 500 1.05rem var(--font);
  color: var(--ink);
  background: var(--surface);
  border: var(--border);
  border-radius: 999px;
  padding: 0.95rem 1.4rem;
  box-shadow: var(--shadow);
}
.search input::placeholder { color: var(--ink-soft); }
.search input:focus-visible { outline-offset: 4px; }

.chips {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 6px 4px 14px 2px;
  margin-inline: -2px;
  scrollbar-width: thin;
}
.chip {
  flex: none;
  font: 600 0.95rem/1 var(--font);
  color: var(--ink);
  background: var(--surface);
  border: var(--border);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  min-height: 44px;
  cursor: pointer;
  transition: transform var(--duration) var(--ease), background-color var(--duration);
}
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.chip .count { opacity: 0.6; font-weight: 500; margin-left: 0.35em; }

.status { color: var(--ink-soft); padding-block: 8px 20px; }
.status:empty { display: none; }
.status button { margin-left: 0.5rem; }

.section-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; margin-block: 8px 16px; }

.grid, .featured-grid {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.featured { margin-bottom: clamp(28px, 5vw, 56px); }
.featured-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

.card {
  --app: var(--accent);
  position: relative;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px;
  text-decoration: none;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.card::before { /* colour tab: the app's own colour along the top edge */
  content: ''; position: absolute; inset: 0 0 auto 0; height: 8px;
  background: var(--app);
  border-bottom: var(--border);
  border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-lift); }
.card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.card .icon { width: 64px; height: 64px; margin-top: 8px; }
.card-body { min-width: 0; padding-top: 8px; }
.card-name { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; overflow-wrap: anywhere; }
.card-tagline {
  color: var(--ink-soft); font-size: 0.95rem; margin-top: 2px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.card-meta li {
  font-size: 0.78rem; font-weight: 600; line-height: 1;
  padding: 0.35rem 0.6rem;
  border: 1.5px solid var(--ink); border-radius: 999px;
}
.card-meta .cat { background: var(--mint); color: var(--accent-ink); }
.card-go { position: absolute; right: 14px; top: 20px; font-weight: 900; font-size: 1.2rem; }

.featured .card { padding: 20px; background: color-mix(in oklab, var(--app) 22%, var(--surface)); }
.featured .card .icon { width: 84px; height: 84px; }
.featured .card-name { font-size: 1.4rem; }
.featured .card:nth-child(odd) { rotate: -0.6deg; }
.featured .card:nth-child(even) { rotate: 0.5deg; }
.featured .card:hover { rotate: 0deg; }

.empty { grid-column: 1 / -1; padding: 48px 16px; text-align: center; color: var(--ink-soft); }
.empty strong { display: block; font-size: 1.3rem; color: var(--ink); margin-bottom: 4px; }

.footer {
  display: flex; justify-content: space-between;
  padding-block: 56px 32px;
  color: var(--ink-soft); font-size: 0.9rem;
}
.footer a { text-underline-offset: 3px; }

@media (max-width: 480px) {
  .card .icon { width: 56px; height: 56px; }
  .card-go { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .featured .card:nth-child(n) { rotate: 0deg; }
}
