:root {
  --ink: #12131a;
  --paper: #f3efe6;
  --paper-2: #ebe5d9;
  --white: #fffdf8;
  --muted: #69675f;
  --line: rgba(18, 19, 26, .15);
  --lime: #d9ff57;
  --blue: #3757ff;
  --coral: #ff6f61;
  --violet: #8f70ff;
  --shadow: 0 24px 70px rgba(24, 22, 18, .12);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", Arial, sans-serif;
  min-width: 320px;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 76px;
  padding: 12px clamp(18px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(243, 239, 230, .86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--lime);
  font: 800 12px/1 "Bahnschrift", sans-serif;
  letter-spacing: .08em;
  transform: rotate(-8deg);
}
.brand strong, .brand small { display: block; }
.brand strong { font: 700 15px/1.1 "Bahnschrift", sans-serif; text-transform: uppercase; letter-spacing: .06em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.top-actions { display: flex; gap: 9px; }
.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 750;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0) scale(.98); }
.button.dark { color: var(--white); background: var(--ink); box-shadow: 0 8px 20px rgba(18, 19, 26, .18); }
.button.dark span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 7px; padding: 0 6px; color: var(--ink); background: var(--lime); border-radius: 12px; font-size: 11px; }
.button.ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.button.light { color: var(--ink); background: var(--lime); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

 .eyebrow { margin: 0 0 9px; font: 800 11px/1 "Bahnschrift", sans-serif; letter-spacing: .16em; }

.explorer { padding: 26px clamp(18px, 5vw, 74px) 120px; }
.explorer-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px 24px; max-width: 1500px; margin: 0 auto 16px; }
.explorer-heading h1 { margin: 0; font: 500 clamp(31px, 4vw, 53px)/.99 Georgia, serif; letter-spacing: -.04em; }
.catalog-note { max-width: 390px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: right; }
.filter-panel { max-width: 1500px; margin: 0 auto 14px; padding: 13px; background: rgba(255, 253, 248, .72); border: 1px solid var(--line); border-radius: 18px; }
.search-box { height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.search-box span { font: 400 30px/1 Georgia, serif; transform: rotate(-18deg); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.search-box kbd { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--paper); font-size: 10px; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 11px; }
.filter-label { display: block; margin-bottom: 10px; color: var(--muted); font: 800 10px/1 "Bahnschrift", sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px; color: #4e4c47; background: transparent; font-size: 12px; transition: all .18s ease; }
.chip:hover { color: var(--ink); background: var(--paper-2); }
.chip.active { color: var(--white); background: var(--ink); border-color: var(--ink); }
.filter-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.filter-footer p { margin: 0; color: var(--muted); font-size: 12px; }
.filter-footer strong { color: var(--ink); }
.view-controls { display: flex; align-items: center; gap: 18px; }
.view-controls label { color: var(--muted); font-size: 11px; }
.view-controls select { margin-left: 6px; border: 0; color: var(--ink); background: transparent; font-weight: 700; }
.text-button { padding: 4px 0; border: 0; border-bottom: 1px solid currentColor; color: var(--ink); background: transparent; font-size: 11px; font-weight: 700; }
.active-state { max-width: 1500px; margin: -10px auto 24px; color: var(--muted); font-size: 13px; }
.format-grid { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 34px); align-items: start; }
.format-grid:has(> .format-card:only-child) { max-width: 500px; grid-template-columns: minmax(0, 1fr); }
.format-grid:has(> .format-card:nth-child(2):last-child) { max-width: 1000px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.format-card { min-width: 0; padding: 10px; border: 1px solid transparent; border-radius: 22px; transition: border-color .25s ease, background .25s ease, transform .25s ease; }
.format-card:hover { transform: translateY(-5px); border-color: var(--line); background: rgba(255,255,255,.35); }
.reference-shell { position: relative; overflow: hidden; padding-top: 50px; border-radius: 20px; background: var(--ink); box-shadow: 0 16px 40px rgba(18,19,26,.13); }
.reference-badge { position: absolute; z-index: 2; left: 16px; right: 108px; top: 0; height: 50px; display: flex; align-items: center; gap: 10px; color: white; font: 800 9px/1 "Bahnschrift", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.reference-badge span:first-child { display: grid; place-items: center; min-width: 32px; height: 24px; padding: 0 7px; color: var(--ink); background: var(--lime); border-radius: 999px; letter-spacing: .06em; }
.reference-preview, .capture-media { position: relative; overflow: hidden; background: #fff; }
.reference-preview { height: auto; aspect-ratio: 4 / 5.65; min-height: 405px; }
.instagram-embed { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.embed-skeleton { height: 100%; padding: 20px; display: grid; align-content: start; gap: 14px; color: var(--muted); }
.skeleton-line, .skeleton-media { display: block; border-radius: 8px; background: #f0eee8; }
.skeleton-line { width: 86%; height: 13px; }
.skeleton-line.short { width: 46%; }
.skeleton-media { width: 100%; aspect-ratio: 4 / 5; }
.capture-media { aspect-ratio: 4 / 5.65; display: grid; place-items: center; touch-action: pan-y; background: #191a20; }
.capture-media img { width: 100%; height: 100%; min-height: 0; object-fit: contain; user-select: none; }
.capture-arrow { position: absolute; z-index: 1; top: 50%; display: grid; place-items: center; width: 43px; height: 43px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink); background: var(--white); transform: translateY(-50%); box-shadow: 0 4px 14px #0003; font: 700 26px/1 system-ui; }
.capture-prev { left: 8px; }
.capture-next { right: 8px; }
.capture-arrow:disabled { visibility: hidden; }
.capture-carousel:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.capture-footer { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 7px 12px; min-height: 42px; padding: 10px 13px; background: var(--white); color: var(--muted); font-size: 11px; }
.source-link { color: #2939ae; font-weight: 750; text-underline-offset: 3px; }
.source-unavailable { background: var(--white); padding: 22px 16px; font-size: 13px; line-height: 1.5; }
.source-unavailable p { margin: 4px 0 10px; color: var(--muted); }
.card-actions { position: absolute; top: 8px; right: 10px; z-index: 3; display: flex; gap: 7px; }
.round-action { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; color: var(--ink); background: rgba(255,255,255,.82); backdrop-filter: blur(8px); transition: transform .18s ease, background .18s ease; }
.round-action:hover { transform: scale(1.08); }
.round-action.active { color: white; background: var(--ink); }
.card-body { padding: 15px 5px 4px; }
.card-code { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--muted); font: 800 10px/1 "Bahnschrift", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.card-body h3 { margin: 0; font: 700 19px/1.08 Georgia, serif; letter-spacing: -.02em; }
.card-objectives { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.mini-chip { padding: 5px 7px; border-radius: 6px; color: #4f4b42; background: var(--paper-2); font-size: 9px; font-weight: 700; }
.open-card { width: 100%; margin-top: 13px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: transparent; font-size: 11px; font-weight: 750; transition: background .18s ease, color .18s ease; }
.open-card:hover { color: white; background: var(--ink); }
.empty-state { max-width: 1500px; margin: 40px auto; padding: 70px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state strong { font: 600 32px/1 Georgia, serif; }
.empty-state p { color: var(--muted); }

.compare-bar { position: fixed; left: 50%; bottom: 22px; z-index: 17; width: min(880px, calc(100% - 28px)); padding: 13px 14px 13px 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; color: white; background: rgba(18,19,26,.96); border: 1px solid rgba(255,255,255,.18); border-radius: 18px; box-shadow: 0 22px 65px rgba(0,0,0,.28); backdrop-filter: blur(16px); }
.compare-bar[hidden] { display: none; }
.compare-bar > div:first-child { min-width: 150px; }
.compare-kicker { display: block; margin-bottom: 4px; color: var(--lime); font: 800 9px/1 "Bahnschrift", sans-serif; letter-spacing: .16em; }
.compare-bar strong { font-size: 12px; }
.compare-picks { flex: 1; display: flex; gap: 7px; }
.compare-pick { min-width: 0; max-width: 170px; padding: 8px 10px; border-radius: 10px; color: var(--ink); background: white; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-close, .icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; color: inherit; background: rgba(255,255,255,.12); font-size: 20px; }

dialog { padding: 0; border: 0; color: var(--ink); background: var(--paper); box-shadow: 0 40px 100px rgba(0,0,0,.32); }
dialog::backdrop { background: rgba(15,16,22,.62); backdrop-filter: blur(7px); }
.detail-dialog { width: min(1120px, calc(100% - 28px)); max-height: calc(100vh - 28px); border-radius: 28px; overflow: auto; }
.dialog-close { position: sticky; z-index: 5; top: 16px; float: right; margin: 16px 16px -56px 0; width: 42px; height: 42px; border: 0; border-radius: 50%; color: white; background: rgba(18,19,26,.82); font-size: 24px; backdrop-filter: blur(8px); }
.dialog-close.static { position: static; float: none; margin: 0; flex: 0 0 auto; }
.detail-hero { padding: 36px 52px; color: white; background: var(--ink); }
.detail-hero h2 { max-width: 700px; margin: 8px 0 18px; font: 500 clamp(38px, 6vw, 78px)/.92 Georgia, serif; letter-spacing: -.05em; }
.detail-kicker { color: var(--lime); font: 800 11px/1 "Bahnschrift", sans-serif; letter-spacing: .15em; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-meta span { padding: 7px 9px; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; font-size: 10px; }
.detail-main { padding: 38px 52px 54px; }
.detail-tabs { display: flex; gap: 8px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.detail-tab { padding: 12px 6px; margin-right: 16px; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: transparent; font-weight: 750; }
.detail-tab.active { color: var(--ink); border-color: var(--blue); }
.detail-panel[hidden] { display: none; }
.detail-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 40px; }
.detail-section { margin-bottom: 28px; }
.detail-section h3 { margin: 0 0 10px; font: 600 23px/1 Georgia, serif; }
.detail-section p { margin: 0; color: #4f4d47; line-height: 1.65; }
.warning-card { padding: 18px; border-left: 5px solid var(--coral); background: #ffe8df; border-radius: 10px; }
.warning-card strong { display: block; margin-bottom: 6px; }
.reference-card { padding: 18px; background: var(--paper-2); border-radius: 14px; }
.reference-card a { display: inline-block; margin-top: 10px; color: var(--blue); font-weight: 750; }
.visual-spec, .prompt-box { position: relative; padding: 22px; border-radius: 14px; color: #e9e9f0; background: #171820; font: 12px/1.65 Consolas, monospace; white-space: pre-wrap; max-height: 490px; overflow: auto; }
.copy-button { margin-top: 14px; }
.detail-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.compare-dialog { width: min(1100px, calc(100% - 28px)); max-height: calc(100vh - 36px); border-radius: 24px; overflow: auto; }
.compare-dialog-head { display: flex; justify-content: space-between; align-items: start; padding: 32px; color: white; background: var(--ink); }
.compare-dialog-head h2 { margin: 0; font: 500 44px/1 Georgia, serif; }
.comparison-table { display: grid; padding: 25px; }
.comparison-row { display: grid; grid-template-columns: 130px repeat(var(--columns), 1fr); border-bottom: 1px solid var(--line); }
.comparison-row > * { min-width: 0; padding: 16px; }
.comparison-row > strong { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.comparison-title { font: 600 20px/1.1 Georgia, serif; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 25; padding: 12px 18px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; color: white; background: var(--ink); border-radius: 999px; font-size: 12px; transition: opacity .22s ease, transform .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1120px) {
  .format-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .topbar { height: 68px; }
  .brand small, .top-actions .ghost { display: none; }
  .filter-row { grid-template-columns: 1fr; }
  .format-grid { grid-template-columns: 1fr; max-width: 620px; }
  .explorer-heading { display: block; }
  .catalog-note { margin-top: 18px; text-align: left; }
  .detail-grid { grid-template-columns: 1fr; }
  .compare-bar > div:first-child { display: none; }
  .compare-picks { overflow: hidden; }
}
@media (max-width: 560px) {
  .brand strong { font-size: 12px; }
  .brand-mark { width: 40px; height: 40px; }
  .button { padding: 10px 13px; font-size: 12px; }
  .explorer { padding-inline: 10px; }
  .filter-panel { padding: 11px; }
  .filter-footer { align-items: start; }
  .view-controls { align-items: end; flex-direction: column; gap: 8px; }
  .format-grid { gap: 18px; }
  .format-card { padding: 5px; border-radius: 15px; }
  .card-body h3 { font-size: 15px; }
  .card-objectives { display: none; }
  .round-action { width: 30px; height: 30px; }
  .card-actions { top: 10px; right: 10px; }
  .reference-shell { padding-top: 50px; }
  .detail-hero, .detail-main { padding: 28px 20px; }
  .detail-tabs { overflow-x: auto; }
  .detail-tab { white-space: nowrap; }
  .compare-picks .compare-pick:nth-child(n+3) { display: none; }
  .comparison-row { grid-template-columns: 90px repeat(var(--columns), minmax(180px, 1fr)); }
  .comparison-table { overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
