:root {
  color-scheme: light;
  --page: #fafafa;
  --card: #ffffff;
  --ink: #2b2b2b;
  --muted: #66666d;
  --subtle: #8b8b92;
  --border: #e7e7e7;
  --divider: #efefef;
  --accent: #6757d6;
  --accent-soft: #f0edff;
  --success: #147a34;
  --success-soft: #eaf7ee;
  --warning: #a95d00;
  --warning-soft: #fff4df;
  --danger: #c43636;
  --danger-soft: #fff0f0;
  --radius-card: 14px;
  --radius-chip: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
}

.filter-input {
  position: fixed;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 48px;
}

.hero {
  padding: 0 2px 42px;
  border-bottom: 1px solid var(--border);
}

.eyebrow,
.section-kicker,
.filter-label,
footer p:first-child {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 40px;
  align-items: start;
  margin-top: 18px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 15px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.intro {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.72;
}

.hero-mark {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 48px 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--border);
}

.summary div {
  padding: 19px 20px 18px;
  background: var(--card);
}

.summary dt {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.summary dd {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 12px;
}

.filters {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 2px;
  border-bottom: 1px solid var(--border);
  background: rgba(250, 250, 250, 0.94);
  backdrop-filter: blur(16px);
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-label {
  margin-right: 8px;
  color: var(--subtle);
}

.filters label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.filters label:hover {
  border-color: #cfcfcf;
  color: var(--ink);
}

.filters small {
  color: var(--subtle);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

#filter-all:checked ~ .shell label[for="filter-all"],
#filter-core:checked ~ .shell label[for="filter-core"],
#filter-tasks:checked ~ .shell label[for="filter-tasks"],
#filter-clips:checked ~ .shell label[for="filter-clips"],
#filter-files:checked ~ .shell label[for="filter-files"],
#filter-state:checked ~ .shell label[for="filter-state"],
#filter-settings:checked ~ .shell label[for="filter-settings"],
#filter-brand:checked ~ .shell label[for="filter-brand"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

#filter-core:checked ~ .shell .group:not(.core),
#filter-tasks:checked ~ .shell .group:not(.tasks),
#filter-clips:checked ~ .shell .group:not(.clips),
#filter-files:checked ~ .shell .group:not(.files),
#filter-state:checked ~ .shell .group:not(.state),
#filter-settings:checked ~ .shell .group:not(.settings),
#filter-brand:checked ~ .shell .group:not(.brand) {
  display: none;
}

#filter-core:checked ~ .shell .review-notes,
#filter-tasks:checked ~ .shell .review-notes,
#filter-clips:checked ~ .shell .review-notes,
#filter-files:checked ~ .shell .review-notes,
#filter-state:checked ~ .shell .review-notes,
#filter-settings:checked ~ .shell .review-notes,
#filter-brand:checked ~ .shell .review-notes {
  display: none;
}

.group,
.review-notes {
  padding: 64px 2px 10px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 40px;
  align-items: end;
  margin-bottom: 22px;
}

.section-heading.compact {
  grid-template-columns: 1fr;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.section-heading > p {
  max-width: 420px;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.summary.reduction-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 18px;
}

.reduction-summary .cut dt {
  color: var(--danger);
}

.reduction-summary .active {
  background: var(--accent-soft);
}

.reduction-summary .active dt {
  color: var(--accent);
}

.icon-card.reduction-card {
  display: block;
  min-height: 0;
  padding: 18px;
}

.reduction-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.reduction-symbol {
  min-width: 0;
  text-align: center;
}

.reduction-symbol > span {
  display: block;
  margin-bottom: 8px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reduction-symbol .icon-stage {
  margin: 0 auto 10px;
}

.reduction-symbol code {
  display: block;
  min-height: 2.7em;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.retired-symbol {
  opacity: 0.58;
}

.merge-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.reduction-copy {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--divider);
}

.reduction-copy strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.reduction-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.reduction-keep {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(103, 87, 214, 0.3);
  border-radius: var(--radius-card);
  background: var(--accent-soft);
}

.reduction-keep h3 {
  margin: 6px 0 8px;
  font-size: 18px;
}

.reduction-keep p:last-child {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.keep-symbols {
  display: flex;
  gap: 10px;
}

.keep-symbol {
  min-width: 86px;
  text-align: center;
}

.keep-symbol .icon-stage {
  margin: 0 auto 8px;
}

.keep-symbol > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.icon-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  min-height: 146px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card);
}

.icon-stage {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  background: #f3f3f3;
}

.icon-stage img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  opacity: 0.72;
}

.icon-stage.accent {
  background: var(--accent-soft);
}

.icon-stage.accent img {
  filter: invert(40%) sepia(43%) saturate(1645%) hue-rotate(215deg) brightness(84%) contrast(91%);
  opacity: 1;
}

.icon-stage.success {
  background: var(--success-soft);
}

.icon-stage.success img {
  filter: invert(38%) sepia(42%) saturate(1200%) hue-rotate(86deg) brightness(82%) contrast(94%);
  opacity: 1;
}

.icon-stage.warning {
  background: var(--warning-soft);
}

.icon-stage.warning img {
  filter: invert(39%) sepia(92%) saturate(1055%) hue-rotate(10deg) brightness(81%) contrast(101%);
  opacity: 1;
}

.icon-stage.danger {
  background: var(--danger-soft);
}

.icon-stage.danger img {
  filter: invert(28%) sepia(76%) saturate(1778%) hue-rotate(340deg) brightness(90%) contrast(85%);
  opacity: 1;
}

.icon-copy {
  min-width: 0;
}

.icon-copy h3,
.brand-card h3,
.note-grid h3 {
  margin: 1px 0 8px;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.icon-copy h3 {
  overflow-wrap: anywhere;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
}

.icon-copy p,
.brand-card p,
.note-grid p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tags span,
.note-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 7px;
  border-radius: 5px;
  color: var(--muted);
  background: #f2f2f2;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.brand-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card);
}

.brand-stage {
  display: grid;
  place-items: center;
  aspect-ratio: 1.48;
  margin-bottom: 18px;
  border-radius: 12px;
  background: #f3f3f3;
}

.brand-stage img {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.app-icon .brand-stage img {
  width: 112px;
  height: 112px;
  border-radius: 25px;
}

.brand-variants {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.brand-variant {
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  align-self: stretch;
  min-width: 0;
  padding: 20px 12px 14px;
}

.brand-variant + .brand-variant {
  border-left: 1px solid var(--border);
}

.brand-variant img {
  width: 92px;
  height: 92px;
}

.brand-variant span {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-align: center;
}

.brand-variant.menu-mark {
  background: #29292d;
}

.brand-variant.menu-mark img {
  width: 54px;
  height: 54px;
  image-rendering: auto;
}

.brand-variant.menu-mark span {
  color: #b8b8bf;
}

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.88em;
}

.brand-card > div:last-child > code {
  color: var(--subtle);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.review-notes {
  margin-top: 54px;
  padding: 44px 32px 34px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #f4f2ff;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.note-grid article {
  padding-top: 20px;
  border-top: 1px solid rgba(103, 87, 214, 0.24);
}

.note-grid span {
  margin-bottom: 14px;
  color: var(--accent);
  background: var(--card);
}

.note-grid span.applied {
  color: var(--success);
  background: var(--success-soft);
}

.note-grid h3 {
  font-size: 17px;
}

.note-grid p {
  margin: 0;
  font-size: 13px;
  line-height: 1.72;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 72px;
  padding: 24px 2px 0;
  border-top: 1px solid var(--border);
}

footer p {
  margin: 0;
  color: var(--subtle);
  font-size: 11px;
}

footer p:first-child {
  color: var(--subtle);
}

@media (max-width: 900px) {
  .icon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-grid,
  .note-grid {
    grid-template-columns: 1fr;
  }

  .brand-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
  }

  .brand-stage {
    margin: 0;
  }

  .brand-variant {
    padding: 12px 8px 9px;
  }

  .brand-variant img {
    width: 64px;
    height: 64px;
  }

  .brand-variant.menu-mark img {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1180px);
    padding-top: 40px;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 16px;
  }

  .hero-mark {
    width: 64px;
    height: 64px;
  }

  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .icon-grid {
    grid-template-columns: 1fr;
  }

  .icon-card {
    min-height: 0;
  }

  .brand-card {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
  }

  .brand-card.line-family {
    grid-template-columns: 1fr;
  }

  .line-family .brand-stage {
    aspect-ratio: 2.2;
  }

  .review-notes {
    padding: 34px 20px 24px;
  }

  .reduction-summary div {
    padding-inline: 14px;
  }

  .reduction-pair {
    gap: 7px;
  }

  .reduction-symbol .icon-stage {
    width: 68px;
    height: 68px;
  }

  .reduction-symbol .icon-stage img {
    width: 48px;
    height: 48px;
  }

  .merge-label {
    padding-inline: 6px;
    font-size: 8px;
  }

  .reduction-keep {
    grid-template-columns: 1fr;
  }

  .keep-symbols {
    justify-content: flex-start;
  }

  footer {
    display: block;
  }

  footer p + p {
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .filters label {
    transition: none;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #141416;
    --card: #1d1d20;
    --ink: #f2f2f3;
    --muted: #b1b1b7;
    --subtle: #8e8e96;
    --border: #303035;
    --divider: #29292d;
    --accent: #c9c2ff;
    --accent-soft: #302d46;
    --success: #66d98a;
    --success-soft: #20372a;
    --warning: #ffc168;
    --warning-soft: #3b3020;
    --danger: #ff8b8b;
    --danger-soft: #3b2527;
  }

  .filters {
    background: rgba(20, 20, 22, 0.94);
  }

  .icon-stage,
  .brand-stage,
  .tags span {
    background: #29292d;
  }

  .icon-stage img {
    filter: invert(1);
  }

  .icon-stage.accent img,
  .icon-stage.success img,
  .icon-stage.warning img,
  .icon-stage.danger img {
    filter: invert(1);
  }

  .review-notes {
    background: #242131;
  }

  .note-grid span {
    background: #302d46;
  }

}
