﻿@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  --paper: #f3f4ef;
  --ink: #221d1b;
  --muted: #746b64;
  --line: rgba(34, 29, 27, 0.12);
  --panel: rgba(255, 255, 252, 0.9);
  --plum: #5f3c57;
  --moss: #58684f;
  --amber: #5f3c57;
  --rose: #b96872;
  --shadow: 0 14px 44px rgba(48, 37, 30, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,252,.72), rgba(255,255,252,0)),
    repeating-linear-gradient(90deg, rgba(34, 29, 27, .018) 0, rgba(34, 29, 27, .018) 1px, transparent 1px, transparent 86px),
    #f3f4ef;
  line-height: 1.6;
}

button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 44px 20px calc(72px + env(safe-area-inset-bottom));
}

.hero { padding: 34px 0 28px; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--plum);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}
.hero h1 {
  margin: 0;
  font-size: clamp(54px, 13vw, 96px);
  line-height: .92;
  letter-spacing: 0;
  word-break: keep-all;
}
.hero-copy {
  margin: 24px 0 10px;
  font-size: clamp(21px, 5vw, 34px);
  line-height: 1.28;
  font-weight: 700;
  word-break: keep-all;
}
.micro-copy {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.scent-strip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 26px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 252, .62);
}
.scent-strip span {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  border-right: 1px solid var(--line);
}
.scent-strip span:last-child { border-right: 0; }

.panel, .summary-panel, .note-box, .share-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin: 14px 0;
  backdrop-filter: blur(12px);
}
.panel[hidden], .summary-panel[hidden] { display: none; }
.panel-head {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 18px;
}
.panel-head span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
}
.panel-head h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0;
  word-break: keep-all;
}
.hint, .affiliate-note, .note-box p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.note-box { box-shadow: none; background: rgba(255, 255, 255, .46); }
.note-box p { margin: 0; }

.mbti-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.mbti-btn, .at-btn, .scenario-btn, .share-actions button, .primary-btn, .ghost-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.mbti-btn {
  min-height: 48px;
  font-weight: 800;
  letter-spacing: .04em;
}
.mbti-btn:hover, .at-btn:hover, .scenario-btn:hover, .share-actions button:hover, .ghost-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(95, 60, 87, .35);
  box-shadow: 0 10px 24px rgba(48, 37, 30, .08);
}
.mbti-btn.selected, .at-btn.selected, .scenario-btn.selected {
  background: #221d1b;
  border-color: #221d1b;
  color: #fffffb;
}
.choice-grid { display: grid; gap: 10px; }
.choice-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.at-btn {
  padding: 18px;
  text-align: left;
}
.at-btn strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  margin-bottom: 10px;
}
.at-btn span { color: inherit; opacity: .74; font-size: 14px; }
.scenario-btn { min-height: 44px; font-weight: 700; }

.slider-group { display: grid; gap: 18px; }
.slider-item {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) 1.4fr;
  gap: 18px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.slider-copy strong { display: block; font-size: 15px; }
.slider-copy span { color: var(--muted); font-size: 13px; }
.slider-control {
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 10px;
  align-items: center;
}
.slider-control output {
  display: none;
  color: var(--plum);
  font-weight: 800;
  text-align: right;
}
.slider-line {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}
.step-btn, .preset-row button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .68);
  color: var(--ink);
  font-weight: 900;
}
.step-btn {
  min-height: 42px;
  font-size: 20px;
}
.percent-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .68);
  color: var(--plum);
  font-weight: 900;
}
.percent-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-weight: inherit;
  text-align: right;
}
.preset-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.preset-row button {
  min-height: 36px;
  color: var(--muted);
  font-size: 12px;
}
.step-btn:hover, .preset-row button:hover {
  border-color: rgba(95, 60, 87, .35);
  box-shadow: 0 8px 18px rgba(48, 37, 30, .07);
}
input[type='range'] {
  width: 100%;
  accent-color: var(--plum);
}

.summary-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  background: #221d1b;
  color: #fffffb;
}
.summary-panel p { margin: 0; color: rgba(255, 250, 242, .72); }
.summary-panel strong { color: #fffffb; }
.primary-btn {
  min-width: 150px;
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  background: #fffffb;
  color: #221d1b;
  font-weight: 900;
}
.primary-btn:disabled { opacity: .45; cursor: not-allowed; }

.loading-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(243, 244, 239, .94);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.loading-layer div {
  padding: 28px;
  min-width: 240px;
  text-align: center;
  background: #fffffb;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.loading-layer b, .loading-layer span { display: block; }
.loading-layer span { color: var(--muted); margin-top: 6px; }
body.is-loading .loading-layer { opacity: 1; pointer-events: auto; }

.footer {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 0 20px calc(36px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.result-shell { padding-top: 28px; }
.result-hero {
  position: relative;
  padding: 34px 0 22px;
}
.home-link {
  display: inline-block;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.result-type {
  color: var(--plum);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .12em;
}
.scenario-chip {
  display: inline-flex;
  margin: 14px 0 10px;
  padding: 5px 10px;
  border: 1px solid rgba(95, 60, 87, .18);
  border-radius: 999px;
  color: var(--plum);
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, .5);
}
.result-hero h1 {
  margin: 0;
  max-width: 680px;
  font-size: clamp(42px, 10vw, 82px);
  line-height: .96;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.one-liner {
  max-width: 620px;
  margin: 18px 0 0;
  font-size: clamp(19px, 4vw, 28px);
  font-weight: 700;
  line-height: 1.35;
  word-break: keep-all;
}
.note-tags, .perfume-tags, .chemistry p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.note-tags { margin-top: 24px; }
.note-tags span, .perfume-tags span, .chemistry span {
  display: inline-flex;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.note-tags span::after {
  content: '/';
  margin-left: 8px;
  color: rgba(34, 29, 27, .28);
}
.note-tags span:last-child::after { content: ''; margin: 0; }
.perfume-tags span, .chemistry span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .44);
  text-transform: none;
  letter-spacing: 0;
}

.split-copy, .chemistry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.split-copy article, .chemistry > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, .5);
}
.split-copy b, .chemistry b { display: block; margin-bottom: 8px; color: var(--plum); }
.split-copy p, .chemistry p { margin: 0; color: var(--muted); }
.analysis { margin: 0 0 18px; }
.bars { display: grid; gap: 12px; }
.bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 48px;
  gap: 12px;
  align-items: center;
}
.bar-label { color: var(--muted); font-size: 13px; }
.bar-label b { margin-left: 5px; color: var(--ink); }
.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(34, 29, 27, .08);
}
.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--plum), var(--amber));
}
.bar-value { color: var(--plum); font-weight: 900; font-size: 13px; text-align: right; }

.recommendations { display: grid; gap: 12px; }
.perfume-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .56);
}
.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}
.perfume-meta { margin-top: 18px; color: var(--muted); font-size: 13px; }
.perfume-card h3 { margin: 2px 0 8px; font-size: 24px; line-height: 1.15; }
.perfume-card p { margin: 0 0 12px; color: var(--muted); }
.perfume-match { color: var(--ink) !important; font-weight: 800; }
.product-link {
  display: inline-flex;
  margin-top: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fffffb;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}
.affiliate-note { margin: 16px 0 0; font-size: 12px; }
.moments { margin: 0; padding-left: 20px; color: var(--muted); }
.moments li + li { margin-top: 8px; }

.share-panel h2 { margin: 0 0 8px; font-size: 22px; }
.share-kicker {
  margin: 0 0 8px !important;
  color: var(--plum) !important;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
}
.share-panel p { margin: 0 0 18px; color: var(--muted); }
.share-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}
.share-actions button, .ghost-btn {
  min-height: 44px;
  padding: 0 12px;
  font-weight: 800;
}
.share-actions button:first-child {
  background: var(--ink);
  border-color: var(--ink);
  color: #fffffb;
}
.ghost-btn {
  width: 100%;
  margin-top: 10px;
  background: transparent;
}

#share-card {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 405px;
  height: 720px;
  background: linear-gradient(150deg, #f8f8f3 0%, #e7ebe1 56%, #f1edf3 100%);
  padding: 30px;
}
#share-card.capture { left: 0; }
.share-card-inner {
  height: 100%;
  border: 1px solid rgba(34, 29, 27, .16);
  border-radius: 8px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  color: var(--ink);
}
.share-logo { margin: 0 0 auto; color: var(--plum); font-weight: 900; letter-spacing: .08em; }
.share-type { margin: auto 0 10px; color: var(--amber); font-weight: 900; letter-spacing: .12em; }
.share-card-inner h2 { margin: 0; font-size: 46px; line-height: .98; }
.share-card-inner p:not(.share-logo):not(.share-type) { font-size: 20px; font-weight: 800; line-height: 1.35; }
.share-card-inner span { color: var(--muted); font-weight: 700; }
.share-card-inner small { margin-top: auto; color: var(--muted); }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 50;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fffffb;
  font-size: 13px;
  transition: opacity .2s ease, transform .2s ease;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .42s ease, transform .42s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 620px) {
  .shell { padding-top: 28px; }
  .panel, .summary-panel, .note-box, .share-panel { padding: 20px; }
  .mbti-grid { grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .choice-grid.two, .split-copy, .chemistry, .summary-panel { grid-template-columns: 1fr; }
  .choice-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slider-item { grid-template-columns: 1fr; gap: 10px; }
  .slider-control { grid-template-columns: 1fr; }
  .percent-field { width: 92px; justify-self: end; }
  .bar-row { grid-template-columns: 72px 1fr 44px; }
  .footer { flex-direction: column; }
}

@media (max-width: 380px) {
  .mbti-btn { min-height: 44px; font-size: 13px; }
  .choice-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

