:root {
  color: #1f2933;
  background: #f7f4ef;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f4ef;
}

a {
  color: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid #ded7cb;
  background: #fffaf2;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand-mark {
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}

.main-nav a {
  margin-left: 18px;
  color: #52606d;
  font-weight: 700;
  text-decoration: none;
}

.page-shell {
  padding: 36px 0 64px;
}

.hero,
.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}

@media (min-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    align-items: end;
  }
}

.eyebrow,
.brand-name {
  margin: 0 0 8px;
  color: #7b5e36;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 850px;
  margin-bottom: 16px;
  color: #111827;
  font-size: clamp(2.25rem, 6vw, 4.9rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  color: #111827;
}

.hero-copy {
  max-width: 700px;
  color: #52606d;
  font-size: 1.1rem;
  line-height: 1.65;
}

.search-panel,
.goal-form,
.panel,
.fragrance-card,
.recommendation-card {
  border: 1px solid #ded7cb;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 10px 30px rgba(49, 38, 23, 0.06);
}

.search-panel,
.goal-form {
  padding: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #323f4b;
  font-weight: 800;
}

.search-row,
.goal-form {
  display: flex;
  gap: 10px;
}

input,
select,
button,
.button-primary,
.button-secondary {
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid #c6bcae;
  background: #ffffff;
  padding: 0 12px;
}

button,
.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #111827;
  padding: 0 16px;
  background: #111827;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.button-secondary {
  border-color: #c6bcae;
  background: #fffdf8;
  color: #111827;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading p,
.meta-line {
  color: #66788a;
}

.fragrance-grid,
.profile-grid,
.recommendation-list {
  display: grid;
  gap: 16px;
}

.fragrance-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.algorithm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.fragrance-card,
.panel,
.recommendation-card {
  padding: 20px;
}

.algorithm-panel {
  position: relative;
}

.algorithm-panel p {
  color: #52606d;
  line-height: 1.65;
}

.step-number {
  display: inline-flex;
  margin-bottom: 14px;
  border-radius: 999px;
  background: #111827;
  padding: 6px 10px;
  color: #fffdf8;
  font-size: 0.8rem;
  font-weight: 800;
}

.formula-box {
  margin: 14px 0;
  border: 1px solid #d7c8b8;
  border-radius: 6px;
  background: #fbf7ef;
  padding: 12px;
  color: #25313d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.formula-summary {
  margin: 18px 0;
}

.large-formula {
  font-size: 1rem;
}

.compact-list {
  margin: 0;
  padding-left: 18px;
  color: #52606d;
  line-height: 1.7;
}

.fragrance-card h3,
.recommendation-card h2 {
  margin-bottom: 8px;
}

.text-link {
  color: #8a5a18;
  font-weight: 800;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.accord-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  color: #323f4b;
  font-weight: 700;
}

.accord-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece5da;
}

.accord-meter div {
  height: 100%;
  background: #7f5f32;
}

.note-pyramid {
  display: grid;
  gap: 14px;
}

.note-pyramid div {
  border-left: 4px solid #7f5f32;
  padding-left: 14px;
}

.note-pyramid h3 {
  margin-bottom: 4px;
}

.source-line {
  margin-top: 20px;
  color: #66788a;
  overflow-wrap: anywhere;
}

.recommendation-list {
  grid-template-columns: minmax(0, 1fr);
}

.recommendation-top,
.layer-order {
  display: grid;
  gap: 12px;
}

@media (min-width: 720px) {
  .recommendation-top {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

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

.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #111827;
  color: #fffdf8;
}

.layer-order {
  margin: 16px 0;
}

.layer-order div {
  border: 1px solid #ded7cb;
  border-radius: 8px;
  padding: 14px;
  background: #fbf7ef;
}

.layer-order span {
  display: block;
  margin-bottom: 4px;
  color: #7b5e36;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag-row span {
  border-radius: 999px;
  background: #ece5da;
  padding: 6px 10px;
  color: #323f4b;
  font-size: 0.9rem;
  font-weight: 800;
}

.alert {
  padding: 12px 14px;
  margin-bottom: 20px;
  border-radius: 6px;
}

.alert-info {
  background: #e5f4ff;
}

.alert-danger {
  background: #fde8e8;
}

.alert:empty {
  display: none;
}

@media (max-width: 620px) {
  .search-row,
  .goal-form,
  .section-heading {
    display: grid;
  }
}
