/* ---------- fonts (self-hosted, SIL OFL) ---------- */
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Sans Thai';
  src: url('fonts/noto-sans-thai-thai-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Anuphan';
  src: url('fonts/anuphan-thai-wght-normal.woff2') format('woff2');
  font-weight: 100 700;
  font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

/* ---------- tokens ---------- */
:root {
  --ink: #0b0f14;
  --ink2: #0e141b;
  --aqua: #2dd4bf;
  --magenta: #e879f9;
  --s200: #e2e8f0;
  --s300: #cbd5e1;
  --s400: #94a3b8;
  --s500: #64748b;
  --line: rgba(255, 255, 255, 0.08);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.85);
  --glow: 0 40px 90px -30px rgba(45, 212, 191, 0.35), 0 0 0 1px rgba(45, 212, 191, 0.25);
  /* Latin glyphs come from Inter / Space Grotesk, Thai glyphs fall through to the Thai faces. */
  --font-sans: 'Inter', 'Noto Sans Thai', system-ui, 'Segoe UI', 'Leelawadee UI', sans-serif;
  --font-display: 'Space Grotesk', 'Anuphan', 'Inter', 'Leelawadee UI', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--s200);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(45, 212, 191, 0.3);
}

:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 3px;
}

button {
  font: inherit;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* ---------- nav ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(11, 15, 20, 0.7);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}

.brand-chip {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--aqua), var(--magenta));
  color: var(--ink);
  box-shadow: 0 10px 20px -6px rgba(45, 212, 191, 0.35);
}

.brand-chip-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.view-toggle {
  flex: none;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--s300);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.view-btn:hover {
  color: #fff;
}

.view-btn[aria-pressed='true'] {
  background: #fff;
  color: var(--ink);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.aurora {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* fade out at the bottom so the glow never ends in a hard edge */
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}

.aurora::before,
.aurora::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.aurora::before {
  width: 620px;
  height: 620px;
  top: -240px;
  left: -200px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.75), transparent 65%);
}

.aurora::after {
  width: 680px;
  height: 680px;
  right: -240px;
  bottom: -280px;
  background: radial-gradient(circle, rgba(232, 121, 249, 0.65), transparent 65%);
}

.aurora-mid {
  position: absolute;
  top: 46%;
  left: 50%;
  z-index: -1;
  width: 520px;
  height: 320px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(45, 212, 191, 0.4), rgba(232, 121, 249, 0.28) 50%, transparent 72%);
  filter: blur(110px);
  pointer-events: none;
}

.grid-tex {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 62% at 50% 38%, #000 18%, transparent 72%);
  mask-image: radial-gradient(ellipse 90% 62% at 50% 38%, #000 18%, transparent 72%);
}

.hero-intro {
  padding-top: 44px;
  padding-bottom: 12px;
  text-align: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--s300);
  font-size: 0.8125rem;
  font-weight: 500;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 8px var(--aqua);
}

h1 {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.gradient-text {
  background: linear-gradient(100deg, #2dd4bf 0%, #7defe0 35%, #e879f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 36rem;
  margin: 14px auto 0;
  color: var(--s400);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 32rem;
  height: 52px;
  margin: 26px auto 0;
  padding: 0 14px 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  cursor: text;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus-within {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12), var(--shadow);
}

.search-icon {
  flex: none;
  color: var(--s400);
}

#search {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1rem;
}

#search::placeholder {
  color: var(--s500);
}

kbd {
  flex: none;
  padding: 1px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--s400);
  font-family: var(--font-sans);
  font-size: 0.75rem;
}

/* ---------- view 1: 3D coverflow ---------- */
.flow-view {
  position: relative;
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 16px 72px;
}

.flow-glow {
  position: absolute;
  top: 460px;
  left: 0;
  right: 0;
  max-width: 48rem;
  height: 110px;
  margin: 0 auto;
  border-radius: 100%;
  background: rgba(45, 212, 191, 0.14);
  filter: blur(64px);
  pointer-events: none;
}

.coverflow {
  position: relative;
  height: 620px;
  perspective: 1600px;
}

.cf-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 450px;
  height: 600px;
  margin: -300px 0 0 -225px;
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--ink2);
  box-shadow: var(--shadow);
  color: #fff;
  text-align: left;
  cursor: pointer;
  filter: brightness(0.76) saturate(0.9);
  transition: transform 0.55s var(--ease), opacity 0.55s ease, filter 0.55s ease, box-shadow 0.55s ease;
}

.cf-card:hover {
  filter: brightness(0.95);
}

/* uploaded cover photo, sits under the sheen/label; the label's own gradient keeps text readable */
.cf-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* darkens the top and bottom of a photo so white text stays legible */
.cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(7, 10, 14, 0.45), transparent 32%),
    linear-gradient(to top, rgba(7, 10, 14, 0.9), rgba(7, 10, 14, 0.28) 48%, transparent 72%);
  pointer-events: none;
}

.dialog-hero:not(.has-cover) .dialog-cover,
.dialog-hero:not(.has-cover) .cover-shade {
  display: none;
}

.dialog-hero.has-cover {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.dialog-hero.has-cover .dialog-icon {
  margin-bottom: auto;
}

.cf-sheen {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 30% 20%, rgba(255, 255, 255, 0.18), transparent 60%);
  pointer-events: none;
}

.cf-cover ~ .cf-sheen {
  background: radial-gradient(120% 80% at 30% 15%, rgba(255, 255, 255, 0.05), transparent 50%);
}

.cf-icon,
.hero-icon,
.dialog-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.55);
  font-size: 30px;
  line-height: 1;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.cf-icon {
  position: absolute;
  top: 18px;
  left: 18px;
}

.cf-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 44px 22px 20px;
  background: linear-gradient(to top, rgba(7, 10, 14, 0.94) 15%, rgba(7, 10, 14, 0.52) 62%, transparent);
}

.cf-cat {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  font-weight: 600;
}

.cf-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.cf-tag {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.cf-pos-0 {
  transform: none;
  opacity: 1;
  z-index: 50;
  filter: none;
  box-shadow: var(--glow);
}
.cf-pos-0:hover {
  filter: none;
}
.cf-pos-1 {
  transform: translate3d(185px, 0, -120px) rotateY(-38deg) scale(0.84);
  opacity: 0.92;
  z-index: 40;
}
.cf-pos-n1 {
  transform: translate3d(-185px, 0, -120px) rotateY(38deg) scale(0.84);
  opacity: 0.92;
  z-index: 40;
}
.cf-pos-2 {
  transform: translate3d(300px, 0, -250px) rotateY(-42deg) scale(0.7);
  opacity: 0.55;
  z-index: 30;
}
.cf-pos-n2 {
  transform: translate3d(-300px, 0, -250px) rotateY(42deg) scale(0.7);
  opacity: 0.55;
  z-index: 30;
}
.cf-pos-3 {
  transform: translate3d(385px, 0, -380px) rotateY(-45deg) scale(0.58);
  opacity: 0.22;
  z-index: 20;
}
.cf-pos-n3 {
  transform: translate3d(-385px, 0, -380px) rotateY(45deg) scale(0.58);
  opacity: 0.22;
  z-index: 20;
}
.cf-hidden {
  transform: translate3d(0, 0, -520px) scale(0.75);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}

.flow-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 28px;
}

.nav-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  color: var(--s200);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
  transform: scale(1.08);
  border-color: rgba(45, 212, 191, 0.55);
}

.nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  position: relative;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: all 0.35s ease;
}

/* bigger tap target than the 8px dot */
.dot::after {
  content: '';
  position: absolute;
  inset: -10px -4px;
}

.dot:hover {
  background: rgba(255, 255, 255, 0.45);
}

.dot.active {
  width: 26px;
  background: linear-gradient(90deg, var(--aqua), var(--magenta));
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.6);
}

.flow-cta {
  margin-top: 32px;
  text-align: center;
}

.cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  border: 0;
  background: linear-gradient(90deg, var(--aqua), var(--magenta));
  color: var(--ink);
  box-shadow: 0 20px 28px -10px rgba(45, 212, 191, 0.3);
  transition: box-shadow 0.25s ease;
}

.btn-primary svg {
  flex: none;
  transition: transform 0.25s var(--ease);
}

.btn-primary:hover {
  box-shadow: 0 20px 36px -8px rgba(45, 212, 191, 0.5);
}

.btn-primary:hover svg {
  transform: translate(2px, -2px);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 0.2s ease;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.flow-meta {
  margin: 18px 0 0;
  color: var(--s400);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.empty-state {
  margin: 0;
  padding: 40px 24px 96px;
  color: var(--s400);
  font-size: 1.0625rem;
  text-align: center;
}

/* ---------- view 2: list ---------- */
.list-view {
  padding-top: 16px;
  padding-bottom: 96px;
}

.spotlight {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-bottom: 72px;
}

.hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 320px;
  padding: 22px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: #fff;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.35s var(--ease), box-shadow 0.35s ease;
}

.hero-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.hero-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero-cat {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  font-weight: 600;
}

.hero-icon {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  font-size: 27px;
}

.hero-bottom {
  position: relative;
  margin-top: 28px;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.hero-tagline {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.app-section {
  margin-bottom: 64px;
}

.eyebrow {
  margin: 0;
  color: var(--aqua);
  font-size: 0.8125rem;
  font-weight: 700;
}

.eyebrow-magenta {
  color: var(--magenta);
}

.section-title {
  margin: 6px 0 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  font-weight: 700;
  line-height: 1.25;
}

.section-subtitle {
  margin: 6px 0 0;
  color: var(--s400);
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 24px;
}

.app-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s ease;
}

.app-row:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 212, 191, 0.3);
}

.row-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 15px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 10px 22px -10px rgba(0, 0, 0, 0.6);
  font-size: 28px;
  line-height: 1;
}

.row-info {
  flex: 1;
  min-width: 0;
}

.row-title {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.row-tagline {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  color: var(--s400);
  font-size: 0.875rem;
  line-height: 1.5;
}

.open-btn {
  flex: none;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.3);
  background: rgba(45, 212, 191, 0.1);
  color: var(--aqua);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.open-btn:hover {
  background: rgba(45, 212, 191, 0.2);
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(14, 20, 27, 0.6);
}

.footer-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 28px;
  padding-bottom: 28px;
  text-align: center;
}

.footer-note {
  color: var(--s400);
  font-size: 0.75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
}

.footer-link {
  color: var(--s400);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--aqua);
}

/* ---------- detail dialog ---------- */
dialog {
  width: min(620px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

dialog::backdrop {
  background: rgba(5, 8, 12, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.dialog-content {
  position: relative;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--ink2);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(45, 212, 191, 0.12);
}

dialog[open] .dialog-content {
  animation: sheet-in 0.4s var(--ease);
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
}

.dialog-hero {
  position: relative;
  padding: 28px 24px 24px;
  color: #fff;
}

.dialog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 20% 10%, rgba(255, 255, 255, 0.18), transparent 60%);
}

.dialog-hero > :not(.cf-cover, .cover-shade) {
  position: relative;
}

.dialog-category {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8125rem;
  font-weight: 600;
}

.dialog-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(11, 15, 20, 0.4);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 0.2s ease;
}

.dialog-close:hover {
  background: rgba(11, 15, 20, 0.7);
}

.dialog-body {
  padding: 22px 24px 24px;
}

.dialog-desc {
  margin: 0;
  color: var(--s300);
  line-height: 1.8;
}

.dialog-meta {
  margin: 20px 0 22px;
  border-top: 1px solid var(--line);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}

.meta-row dt {
  flex: none;
  color: var(--s400);
}

.meta-row dd {
  min-width: 0;
  margin: 0;
  color: var(--s200);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ---------- responsive ---------- */
@media (min-width: 640px) {
  .hero-intro {
    padding-top: 56px;
  }
  .cta-row {
    flex-direction: row;
  }
  .footer-row {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 768px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .hero:has(#flow-view:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
    align-items: center;
    gap: 32px;
    padding: 24px max(32px, calc((100% - 88rem) / 2)) 48px;
  }
  .hero:has(#flow-view:not([hidden])) .hero-intro {
    position: relative;
    z-index: 60;
    max-width: none;
    margin: 0;
    padding: 0;
    text-align: left;
  }
  .hero:has(#flow-view:not([hidden])) h1 {
    font-size: clamp(2rem, 3.1vw, 2.95rem);
  }
  .hero:has(#flow-view:not([hidden])) .lead {
    margin-left: 0;
    margin-right: 0;
  }
  .hero:has(#flow-view:not([hidden])) .search-box {
    margin-left: 0;
    margin-right: 0;
    max-width: 26rem;
  }
  .hero:has(#flow-view:not([hidden])) .flow-view {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .hero:has(#flow-view:not([hidden])) .flow-controls {
    margin-top: 20px;
  }
  .hero:has(#flow-view:not([hidden])) .flow-cta {
    margin-top: 20px;
  }
}

@media (max-width: 860px) {
  .coverflow {
    height: 460px;
  }
  .flow-glow {
    top: 360px;
  }
  .cf-card {
    width: 320px;
    height: 426px;
    margin: -213px 0 0 -160px;
  }
  .cf-pos-1 {
    transform: translate3d(185px, 0, -100px) rotateY(-38deg) scale(0.84);
  }
  .cf-pos-n1 {
    transform: translate3d(-185px, 0, -100px) rotateY(38deg) scale(0.84);
  }
  .cf-pos-2 {
    transform: translate3d(320px, 0, -240px) rotateY(-42deg) scale(0.66);
  }
  .cf-pos-n2 {
    transform: translate3d(-320px, 0, -240px) rotateY(42deg) scale(0.66);
  }
  .cf-pos-3,
  .cf-pos-n3 {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 640px) {
  .spotlight {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 82%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }
  .flow-controls {
    gap: 14px;
  }
  .dots {
    gap: 8px;
  }
  dialog {
    width: 100%;
    max-height: 100%;
    margin: auto 0 0;
  }
  .dialog-content {
    max-height: 90dvh;
    border-radius: 24px 24px 0 0;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding-left: 18px;
    padding-right: 18px;
  }
  /* icon-only toggle; label stays for screen readers */
  .view-btn {
    padding: 7px 11px;
  }
  .view-btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .coverflow {
    height: 390px;
  }
  .flow-glow {
    top: 300px;
  }
  .cf-card {
    width: 260px;
    height: 346px;
    margin: -173px 0 0 -130px;
  }
  .cf-pos-1 {
    transform: translate3d(135px, 0, -90px) rotateY(-38deg) scale(0.78);
    opacity: 0.7;
  }
  .cf-pos-n1 {
    transform: translate3d(-135px, 0, -90px) rotateY(38deg) scale(0.78);
    opacity: 0.7;
  }
  .cf-pos-2,
  .cf-pos-n2 {
    opacity: 0;
    pointer-events: none;
  }
  .cf-icon {
    top: 14px;
    left: 14px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 24px;
  }
  .cf-label {
    padding: 36px 16px 16px;
  }
  .cf-title {
    font-size: 1.0625rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation: none !important;
  }
}
