:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --ink: #0e1116;
  --ink-soft: #4a5262;
  --line: #e6e8ec;
  --line-strong: #cbd0d8;

  --rx-navy: #1b2a4e;
  --rx-red:  #c9302c;
  --rx-yellow: #f2c130;
  --rx-blue: #2f6fb6;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(14,17,22,.04), 0 2px 8px rgba(14,17,22,.04);
  --shadow-md: 0 6px 20px rgba(14,17,22,.08);
  --shadow-lift: 0 2px 6px rgba(14,17,22,.05), 0 12px 28px rgba(27,42,78,.12);

  /* Motion: one easing for entrances, one snappier curve for controls */
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-snap: cubic-bezier(.2, .8, .2, 1);

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Special Gothic Condensed One", "Impact", "Arial Narrow Bold", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--rx-navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- NAV --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
/* Full-figure mascot, so it is sized by height and keeps its own aspect ratio.
   56px fits the 64px nav with a little breathing room. */
.brand-mark {
  height: 56px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.tab {
  border: 0;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
  transition: color .18s var(--ease-snap), background .18s var(--ease-snap), transform .12s var(--ease-snap);
}
.tab:hover { color: var(--ink); }
.tab:active { transform: scale(.97); }
.tab.is-active {
  background: var(--ink);
  color: #fff;
}
.tab.is-active:hover { color: #fff; }
.tab:focus-visible {
  outline: 2px solid var(--rx-navy);
  outline-offset: 2px;
}

/* --- HERO --- */
.hero {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 400px at 90% -10%, rgba(47,111,182,.10), transparent 60%),
    radial-gradient(600px 300px at 10% 110%, rgba(201,48,44,.06), transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--rx-red);
  box-shadow: 0 0 0 3px rgba(201,48,44,.15);
}
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: .01em;
  margin: 18px 0 12px;
  text-transform: uppercase;
}
.hero h1 .accent { color: var(--rx-red); }
.hero p.lead {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 0 24px;
}
.hero-cta {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: transform .1s ease, background .15s, color .15s, border-color .15s;
}
.btn:hover { text-decoration: none; background: var(--bg-soft); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--rx-navy); border-color: var(--rx-navy); color: #fff; }

/* --- SECTION --- */
.section { padding: 40px 0 64px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: 32px;
  margin: 0;
}
.section-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 16px; }
.panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.panel ul { margin: 0; padding-left: 20px; }
.panel ul li + li { margin-top: 6px; }

/* --- RESOURCE LIST --- */
.res-list { list-style: none; padding-left: 0; }
.res-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.res-list li + li {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.res-list a { font-weight: 600; color: var(--rx-blue); }
.res-note {
  flex-basis: 100%;
  color: var(--ink-soft);
  font-size: 14px;
}
.res-tag {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--bg-soft);
}

/* --- CONTROLS --- */
.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0 12px;
}
.search {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
}
.search input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus {
  border-color: var(--rx-navy);
  box-shadow: 0 0 0 3px rgba(27,42,78,.12);
}
.search::before {
  content: "";
  position: absolute;
  left: 14px; top: 50%;
  width: 14px; height: 14px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5262' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.3-4.3'/></svg>") center/contain no-repeat;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 500;
  transition: background .18s var(--ease-snap), color .18s var(--ease-snap), border-color .18s var(--ease-snap), transform .12s var(--ease-snap);
}
.chip:hover { background: var(--bg-soft); color: var(--ink); }
.chip:active { transform: scale(.96); }
.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chip:focus-visible,
.link-btn:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--rx-navy);
  outline-offset: 2px;
}

.results-count {
  color: var(--ink-soft);
  font-size: 13px;
  font-family: var(--font-mono);
  margin: 12px 0 20px;
}

/* --- CARDS --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out), border-color .22s var(--ease-out);
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: auto 340px;
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
  transform: translateY(-3px);
}
.card-media {
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .4s var(--ease-out);
  transform: translateZ(0);
  backface-visibility: hidden;
}
.card:hover .card-media img { transform: scale(1.04) translateZ(0); }
.card-media.no-image {
  color: var(--ink-soft);
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: default;
}
.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.card-name {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
}
.card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-soft);
}
.tag.series-UC { border-color: rgba(47,111,182,.35); color: var(--rx-blue); background: rgba(47,111,182,.08); }
.tag.series-FC { border-color: rgba(242,193,48,.5); color: #96731a; background: rgba(242,193,48,.12); }
.tag.series-Seed { border-color: rgba(201,48,44,.35); color: var(--rx-red); background: rgba(201,48,44,.08); }
.tag.series-00 { border-color: rgba(27,42,78,.35); color: var(--rx-navy); background: rgba(27,42,78,.08); }
.tag.series-Evangelion { border-color: rgba(112,50,140,.35); color: #6a2a86; background: rgba(112,50,140,.08); }
.tag.series-IBO { border-color: rgba(176,92,32,.35); color: #a2521c; background: rgba(176,92,32,.08); }
.tag.series-Full-Metal-Panic { border-color: rgba(74,102,88,.35); color: #3f5d4c; background: rgba(74,102,88,.08); }
.tag.series-Code-Geass { border-color: rgba(140,36,72,.35); color: #8c2448; background: rgba(140,36,72,.08); }
.tag.series-Dunbine { border-color: rgba(40,112,110,.35); color: #1f6a68; background: rgba(40,112,110,.08); }
.tag.series-Wataru { border-color: rgba(196,120,26,.4); color: #9c5f14; background: rgba(196,120,26,.1); }
.tag.series-Getter-Robo { border-color: rgba(158,52,44,.35); color: #9e342c; background: rgba(158,52,44,.08); }
.tag.series-Kamen-Rider { border-color: rgba(60,84,148,.35); color: #3c5494; background: rgba(60,84,148,.08); }
.tag.type-Option-Set { background: #fff; border-color: var(--line-strong); }
.tag.tag-date { text-transform: none; letter-spacing: 0; color: var(--ink-soft); }

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.card-source {
  font-size: 12px;
  text-align: center;
  color: var(--ink-soft);
}
.card-source:hover { color: var(--rx-blue); }
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-btn > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-btn .vendor-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.link-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); text-decoration: none; }
.link-btn.primary {
  background: var(--rx-navy);
  color: #fff;
  border-color: var(--rx-navy);
}
.link-btn.primary:hover { background: var(--ink); border-color: var(--ink); }
.link-btn .icon { width: 14px; height: 14px; }

.no-results {
  padding: 40px;
  text-align: center;
  color: var(--ink-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

/* --- ALT LINKS SUBLIST --- */
.alt-inline {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-soft);
}
.alt-inline strong {
  display: block;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-weight: 600;
}
.alt-inline a { display: inline-block; margin-right: 8px; color: var(--rx-blue); }

/* --- ALTERNATIVES CARDS --- */
.alt-card { padding: 18px; }
.alt-card .card-name { font-size: 16px; }
.alt-card .card-price {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--rx-navy);
  font-weight: 600;
}
.alt-card .card-notes {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.alt-card .fits {
  display: flex; flex-wrap: wrap; gap: 4px;
  font-size: 11px;
}
.alt-card .fits span {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  color: var(--ink-soft);
}

/* --- IMAGE ZOOM MODAL --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(14,17,22,.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  cursor: zoom-out;
}
.modal.is-open { display: flex; animation: modal-fade .2s var(--ease-out) both; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
  from { opacity: 0; transform: scale(.96) translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: scale(1) translate3d(0, 0, 0); }
}
.modal img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal.is-open img { animation: modal-pop .26s var(--ease-out) both; }
.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.modal-close:hover { background: rgba(255,255,255,.25); }
.modal-close:focus-visible {
  outline: 2px solid var(--rx-yellow);
  outline-offset: 2px;
}

/* --- DETAIL MODAL (Alternatives) --- */
.detail {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 110;
}
.detail.is-open { display: block; }
.detail.is-open .detail-scrim { animation: modal-fade .2s var(--ease-out) both; }
/* Keeps the -50%/-50% centering while adding the lift + scale entrance. */
@keyframes detail-pop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.detail.is-open .detail-panel { animation: detail-pop .28s var(--ease-out) both; }
.detail-scrim {
  position: absolute;
  inset: 0;
  background: rgba(14,17,22,.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.detail-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.detail-header h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.1;
}
.detail-close {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
  flex-shrink: 0;
}
.detail-close:hover { background: var(--bg-soft); }
.detail-close:focus-visible {
  outline: 2px solid var(--rx-navy);
  outline-offset: 2px;
}
.detail-body {
  overflow-y: auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) {
  .detail-body { grid-template-columns: 1fr; }
  .detail-header h2 { font-size: 18px; }
}
.detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-gallery-main {
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.detail-gallery-main.no-image {
  color: var(--ink-soft);
  font-family: var(--font-head);
  font-size: 26px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.detail-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  border: 2px solid var(--line);
  background: var(--bg-soft);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .15s;
}
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-thumb:hover { border-color: var(--line-strong); }
.detail-thumb.is-active { border-color: var(--rx-navy); }
.detail-thumb:focus-visible {
  outline: 2px solid var(--rx-yellow);
  outline-offset: 2px;
}
.detail-info { display: flex; flex-direction: column; gap: 14px; }
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.detail-price {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--rx-navy);
}
.detail-description {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
.detail-section h3 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-weight: 600;
}
.detail-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-chips .tag { cursor: default; }
.detail-chips .tag.link { cursor: pointer; background: rgba(47,111,182,.08); border-color: rgba(47,111,182,.35); color: var(--rx-blue); }
.detail-chips .tag.link:hover { background: rgba(47,111,182,.15); }
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.detail-actions .link-btn { width: auto; min-width: 200px; }

.badge {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.badge-owned {
  background: rgba(242,193,48,.18);
  color: #86651a;
  border: 1px solid rgba(242,193,48,.5);
}
.badge-tested {
  background: rgba(47,111,182,.12);
  color: var(--rx-blue);
  border: 1px solid rgba(47,111,182,.4);
}

.detail-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0;
  font-size: 13px;
}
.detail-facts dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 2px;
}
.detail-facts dd {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

.alt-card { cursor: pointer; }
.manual-card { cursor: default; }
.card:focus-visible {
  outline: 2px solid var(--rx-navy);
  outline-offset: 3px;
}
.card-media:focus-visible {
  outline: 2px solid var(--rx-yellow);
  outline-offset: -2px;
}
.card-actions a,
.card-actions button,
.alt-inline a,
.card-source {
  position: relative;
  z-index: 2;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  z-index: 200;
}
.skip-link:focus {
  left: 0;
  outline: 2px solid var(--rx-yellow);
  text-decoration: none;
}

/* --- FOOTER --- */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 40px;
}
footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
footer .brand { font-size: 18px; }
footer .brand-mark { height: 48px; }

/* --- TAB PANELS --- */
/* Entrances use animation (not transition) so they fire across display:none -> block.
   Transform/opacity only, so they composite on the GPU and never shift layout. */
@keyframes panel-enter {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes subpanel-enter {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.tab-panel { display: none; }
.tab-panel.is-active {
  display: block;
  animation: panel-enter .28s var(--ease-out) both;
}

/* --- SUB-TABS (Metal Build) --- */
.subtabs {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}
.subtab {
  border: 0;
  background: transparent;
  padding: 8px 20px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: color .18s var(--ease-snap), background .18s var(--ease-snap), transform .12s var(--ease-snap), box-shadow .18s var(--ease-snap);
}
.subtab:hover { color: var(--ink); }
.subtab:active { transform: scale(.97); }
.subtab.is-active {
  background: var(--rx-navy);
  color: #fff;
  box-shadow: 0 1px 2px rgba(27,42,78,.25), 0 4px 12px rgba(27,42,78,.22);
}
.subtab.is-active:hover { color: #fff; }
.subtab:focus-visible {
  outline: 2px solid var(--rx-navy);
  outline-offset: 2px;
}

.subpanel { display: none; }
.subpanel.is-active {
  display: block;
  animation: subpanel-enter .24s var(--ease-out) both;
}
.subpanel-intro {
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 62ch;
  margin: 16px 0 8px;
  padding-left: 14px;
  border-left: 3px solid var(--rx-yellow);
}

/* --- ABOUT --- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

@media (max-width: 640px) {
  .nav-inner { height: 56px; gap: 10px; }
  .brand-mark { height: 46px; }
  .container { padding: 0 16px; }
  .tabs { padding: 3px; gap: 2px; }
  .tab { padding: 6px 9px; font-size: 13px; }
  .brand { font-size: 18px; gap: 8px; }
  /* Space is tight; the distinctive mark carries identity, so drop the nav wordmark. Footer keeps it. */
  .nav .brand > span:not(.brand-mark) { display: none; }
  .hero { padding: 40px 0 28px; }
  .section { padding: 28px 0 48px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .card-body { padding: 12px; }
  .card-name { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .card:hover { transform: none; }
  .card:hover .card-media img { transform: none; }
  .tab:active, .subtab:active, .chip:active { transform: none; }
  /* Killing the animation leaves the panel visible; restore its centering transform. */
  .detail.is-open .detail-panel { transform: translate(-50%, -50%); }
}
