:root {
  --ink: #162024;
  --muted: #5d6b70;
  --paper: #f8faf6;
  --surface: #ffffff;
  --line: #dfe8e2;
  --teal: #0f766e;
  --teal-dark: #0b4f4a;
  --coral: #d95d39;
  --gold: #d5a723;
  --plum: #563761;
  --blue: #3a6ea5;
  --shadow: 0 20px 60px rgba(22, 32, 36, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body,
button,
input,
select {
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hero {
  position: relative;
  min-height: 560px;
  display: grid;
  align-items: stretch;
  overflow: hidden;
  color: #fff;
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__image {
  object-fit: cover;
  object-position: center;
}

.hero__shade {
  background:
    linear-gradient(90deg, rgba(12, 18, 21, 0.78), rgba(12, 18, 21, 0.44) 45%, rgba(12, 18, 21, 0.18)),
    linear-gradient(180deg, rgba(12, 18, 21, 0.5), rgba(12, 18, 21, 0.18) 32%, rgba(12, 18, 21, 0.72));
}

.topbar,
.hero__content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
}

.brand,
.topbar__links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  font-weight: 800;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.topbar__links {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(11, 16, 18, 0.28);
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

.topbar__links a {
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
}

.topbar__links a:hover,
.topbar__links a:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.hero__content {
  align-self: end;
  padding: 48px 0 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow--dark {
  color: var(--teal);
}

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

h1 {
  max-width: 790px;
  margin-bottom: 18px;
  font-size: 56px;
  line-height: 1.02;
}

h2 {
  margin-bottom: 10px;
  font-size: 36px;
  line-height: 1.12;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.2;
}

.hero__copy {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 19px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button,
.icon-button,
.shop-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button {
  padding: 0 18px;
}

.button:hover,
.icon-button:hover,
.shop-link:hover {
  transform: translateY(-1px);
}

.button--primary {
  color: #fff;
  background: var(--coral);
  box-shadow: 0 14px 30px rgba(217, 93, 57, 0.28);
}

.button--ghost {
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.hero__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  max-width: 560px;
  margin: 24px 0 0;
}

.hero__metrics div {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.hero__metrics dt {
  font-size: 26px;
  font-weight: 900;
}

.hero__metrics dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.match-studio,
.roaster-band,
.method-band {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.match-studio {
  padding: 62px 0;
}

.studio-heading,
.section-heading,
.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
}

.studio-heading p,
.section-heading p,
.results-toolbar p {
  max-width: 660px;
  color: var(--muted);
}

.icon-button {
  min-width: 88px;
  padding: 0 16px;
  border: 1px solid var(--line);
  color: var(--teal-dark);
  background: var(--surface);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(300px, 1fr);
  gap: 24px;
  margin-top: 28px;
  align-items: start;
}

.wheel-panel,
.filter-panel,
.results-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filter-panel {
  position: sticky;
  top: 18px;
}

.wheel-panel {
  padding: 22px;
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.95), rgba(248, 238, 224, 0.98));
  border-color: rgba(100, 66, 42, 0.18);
}

.wheel-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
}

.wheel-panel__header h3 {
  margin-bottom: 8px;
  color: #26180f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
}

.wheel-panel__header p:not(.eyebrow) {
  max-width: 520px;
  margin-bottom: 0;
  color: #5e4636;
}

.wheel-panel__clear {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: #fff8ef;
  background: #2a1b12;
  font-weight: 800;
}

.wheel-panel__clear:hover,
.wheel-panel__clear:focus-visible {
  background: #462c1f;
  outline: none;
}

.wheel-panel__chart {
  width: 100%;
  max-width: 760px;
  min-height: 340px;
  margin: 8px auto 0;
  overflow: hidden;
}

.wheel-panel__chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.wheel-panel__chart path:focus-visible {
  outline: none;
  stroke: #101719;
  stroke-width: 3;
}

.wheel-panel__selection {
  padding-top: 18px;
  border-top: 1px solid rgba(100, 66, 42, 0.16);
}

.wheel-panel__selection .block-header {
  margin-bottom: 10px;
}

.selected-flavors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-flavors p {
  margin: 0;
  color: #6b4e3d;
  font-size: 14px;
}

.selected-flavor {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(100, 66, 42, 0.24);
  border-radius: 999px;
  color: #38261b;
  background: #fffaf2;
  font-weight: 800;
}

.selected-flavor:hover,
.selected-flavor:focus-visible {
  border-color: #8d5a34;
  outline: none;
}

.wheel-panel__hint {
  margin: 12px 0 0;
  color: #6b4e3d;
  font-size: 13px;
  text-align: center;
}

.control-block {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.control-block--last {
  border-bottom: 0;
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.block-header span,
label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tag-row,
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
}

.segmented button:hover,
.segmented button:focus-visible {
  border-color: rgba(15, 118, 110, 0.45);
  outline: none;
}

.segmented button.is-active {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.segmented--wrap {
  grid-template-columns: repeat(2, 1fr);
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  padding: 0 12px;
}

.toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

.toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--teal);
}

.results-panel {
  margin-top: 24px;
  padding: 28px;
}

.results-toolbar {
  align-items: start;
  margin-bottom: 20px;
}

.results-toolbar h2 {
  margin-bottom: 0;
}

.result-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
}

.result-card--primary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 28px;
  margin-bottom: 18px;
  border-color: rgba(15, 118, 110, 0.28);
  background: linear-gradient(135deg, #fff, #f4fbf7);
}

.result-card--small {
  padding: 20px;
}

.result-meta,
.roaster-location,
.card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.result-meta {
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: #e8f5f1;
  font-size: 13px;
  font-weight: 800;
}

.pill--coral {
  color: #7b2b17;
  background: #f9dfd5;
}

.pill--blue {
  color: #1f4e7d;
  background: #e4eff8;
}

.pill--available {
  color: #386032;
  background: #eaf4e5;
}

.coffee-title {
  margin-bottom: 6px;
  font-size: 30px;
  line-height: 1.15;
}

.roaster-name {
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 800;
}

.result-reason {
  margin-bottom: 18px;
  color: #344146;
}

.card-tags {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.card-tags li {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.score-dial {
  display: grid;
  place-items: center;
  align-self: start;
  width: 128px;
  height: 128px;
  border: 10px solid #dceee9;
  border-top-color: var(--coral);
  border-right-color: var(--teal);
  border-radius: 50%;
  color: var(--ink);
}

.score-dial strong {
  display: block;
  max-width: 100px;
  font-size: 22px;
  line-height: 1;
  text-align: center;
}

.score-dial span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.shop-link {
  min-width: 152px;
  padding: 0 14px;
  color: #fff;
  background: var(--ink);
}

.card-foot {
  justify-content: space-between;
  margin-top: 18px;
}

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

.result-card--small h3 {
  margin-bottom: 4px;
}

.result-card--small .result-reason {
  font-size: 14px;
}

.roaster-band,
.method-band {
  padding: 28px 0 72px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.roaster-index {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.roaster-tile,
.method-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.roaster-tile {
  min-height: 128px;
  padding: 16px;
}

.roaster-tile h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.roaster-tile p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.roaster-tile a {
  color: var(--teal-dark);
  font-weight: 800;
}

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

.method-grid article {
  padding: 24px;
}

.method-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--plum);
  font-weight: 900;
}

.method-grid article:nth-child(2) span {
  background: var(--blue);
}

.method-grid article:nth-child(3) span {
  background: var(--coral);
}

.method-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero {
    min-height: 540px;
  }

  h1 {
    font-size: 46px;
  }

  h2 {
    font-size: 30px;
  }

  .studio-grid,
  .result-card--primary {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    position: static;
  }

  .wheel-panel__chart {
    max-width: 680px;
  }

  .score-dial {
    width: 108px;
    height: 108px;
  }

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

@media (max-width: 720px) {
  .topbar,
  .hero__content,
  .match-studio,
  .roaster-band,
  .method-band {
    width: min(100% - 28px, 1180px);
  }

  .topbar {
    align-items: flex-start;
    padding-top: 16px;
  }

  .topbar__links {
    display: none;
  }

  .hero {
    min-height: 600px;
  }

  .hero__content {
    padding-top: 34px;
    padding-bottom: 30px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 26px;
  }

  .hero__copy {
    font-size: 17px;
  }

  .studio-heading,
  .section-heading,
  .results-toolbar,
  .card-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .control-grid,
  .secondary-grid,
  .method-grid,
  .roaster-index {
    grid-template-columns: 1fr;
  }

  .segmented,
  .segmented--wrap {
    grid-template-columns: 1fr 1fr;
  }

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

  .hero__metrics div {
    padding: 10px;
  }

  .hero__metrics dt {
    font-size: 22px;
  }

  .hero__metrics dd {
    font-size: 11px;
  }

  .results-panel {
    padding: 18px;
  }

  .wheel-panel {
    padding: 14px;
  }

  .wheel-panel__header {
    flex-direction: column;
  }

  .wheel-panel__chart {
    min-height: 320px;
  }

  .result-card--primary {
    padding: 20px;
  }

  .coffee-title {
    font-size: 24px;
  }
}
