:root {
  color-scheme: light;
  --ink: #332c48;
  --muted: #756d87;
  --soft: #f8f5ff;
  --lavender: #eae2ff;
  --lilac: #c8b5ff;
  --violet: #7559d9;
  --pink: #f39ab7;
  --line: rgba(83, 67, 130, .14);
  --shadow: 0 24px 70px rgba(91, 68, 151, .14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 6%, rgba(255, 235, 181, .58), transparent 21rem),
    radial-gradient(circle at 92% 10%, rgba(208, 193, 255, .62), transparent 25rem),
    linear-gradient(145deg, #fffdfb 0%, #f8f5ff 53%, #fff8fa 100%);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button { font: inherit; }

.page-shell {
  width: min(100% - 32px, 960px);
  margin: 0 auto;
  padding: 48px 0 30px;
}

.hero { max-width: 720px; }

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--violet);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .15em;
}

.plumbob {
  display: inline-grid;
  width: 22px;
  height: 27px;
  place-items: center;
  color: #6fce98;
  font-size: 19px;
  line-height: 1;
  filter: drop-shadow(0 3px 3px rgba(84, 139, 103, .23));
  transform: rotate(45deg) scaleX(.72);
}

.eyebrow-note {
  margin-left: 4px;
  color: #a29ab3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

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

h1 {
  max-width: 680px;
  margin: 24px 0 16px;
  color: #302846;
  font-size: clamp(44px, 9vw, 84px);
  font-weight: 900;
  letter-spacing: -.075em;
  line-height: .98;
}

.hero-copy {
  max-width: 610px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.rule-pills { display: flex; flex-wrap: wrap; gap: 10px; }

.rule-pills span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
  color: #615a75;
  font-size: 12px;
  font-weight: 750;
}

.pill-dot, .swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-number { background: #eb6d91; }
.dot-color { background: #7559d9; }

main { margin-top: 72px; }

.results-section, .palette-section {
  padding: 28px;
  border: 1px solid rgba(117, 89, 217, .12);
  border-radius: 28px;
  background: rgba(255, 255, 255, .64);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

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

.section-label {
  margin-bottom: 6px;
  color: #9a8bc9;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
}

h2 {
  margin-bottom: 0;
  color: #39304e;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 850;
  letter-spacing: -.045em;
}

.reroll-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 11px;
  padding: 0 16px 0 19px;
  border: 0;
  border-radius: 14px;
  background: var(--violet);
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(117, 89, 217, .28);
  font-size: 14px;
  font-weight: 850;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.reroll-button:hover { background: #6347ca; transform: translateY(-2px); box-shadow: 0 13px 26px rgba(117, 89, 217, .34); }
.reroll-button:active { transform: translateY(0); }
.reroll-button:focus-visible { outline: 3px solid rgba(117, 89, 217, .3); outline-offset: 3px; }
.reroll-icon { font-size: 23px; font-weight: 500; line-height: 1; }

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  max-width: 780px;
  margin: 0 auto;
}

.result-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(240px, 1.1fr);
  grid-template-rows: auto 1fr;
  column-gap: 30px;
  overflow: hidden;
  min-height: 285px;
  padding: 22px;
  border: 1px solid rgba(117, 89, 217, .13);
  border-radius: 22px;
  background: rgba(253, 251, 255, .9);
  box-shadow: 0 14px 30px rgba(70, 48, 121, .08);
  animation: card-in .42s cubic-bezier(.2, .8, .2, 1) both;
}

.result-card::after {
  position: absolute;
  top: -60px;
  right: -52px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--card-accent);
  content: "";
  opacity: .12;
}

.card-top, .color-pair, .color-row, .dimension-heading {
  position: relative;
  z-index: 1;
}

.card-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.area-block {
  position: relative;
  z-index: 1;
  grid-column: 1;
  align-self: center;
}

.card-number {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: #eee8ff;
  color: var(--violet);
  font-size: 12px;
  font-weight: 900;
}

.card-tag { color: #a39aaf; font-size: 11px; font-weight: 750; }
.dimension-heading { margin: 27px 0 2px; color: #8d859c; font-size: 12px; font-weight: 750; }
.dimension-values { display: flex; align-items: baseline; gap: 9px; color: #332b49; font-size: clamp(48px, 8vw, 66px); font-weight: 900; letter-spacing: -.08em; line-height: 1; }
.dimension-values .times { color: #b6abc7; font-size: 28px; font-weight: 500; letter-spacing: 0; }
.dimension-unit { margin-top: 8px; color: #a49ba9; font-size: 12px; font-weight: 700; }

.color-pair {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  padding-left: 26px;
  border-left: 1px dashed rgba(117, 89, 217, .2);
}

.color-pair-label {
  margin: 0 0 8px;
  color: #9a8bc9;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
}

.color-row + .color-row { border-top: 1px dashed rgba(117, 89, 217, .17); }

.color-swatch {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 4px solid white;
  border-radius: 12px;
  background: var(--row-accent);
  box-shadow: 0 4px 10px rgba(66, 49, 95, .15);
}

.color-copy { min-width: 0; }
.color-label { margin: 0 0 2px; color: #aaa0b3; font-size: 10px; font-weight: 750; }
.color-name { margin: 0; color: #453957; font-size: 17px; font-weight: 900; }
.color-en { margin-left: auto; color: #b1a8bd; font-size: 10px; font-weight: 900; letter-spacing: .12em; }

.palette-section { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 18px; box-shadow: none; }
.palette { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 520px; }
.palette-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(117, 89, 217, .12); border-radius: 999px; background: rgba(255,255,255,.74); color: #6d657a; font-size: 12px; font-weight: 750; }
.palette-chip .swatch { width: 10px; height: 10px; box-shadow: 0 0 0 2px rgba(80, 62, 110, .06); }

.red { background: #ef5a72; }
.orange { background: #f39a43; }
.yellow { background: #f6cf52; }
.green { background: #65bd83; }
.blue { background: #5b91e9; }
.purple { background: #9a70d8; }
.black { background: #312c3a; }
.white { background: #fff; border: 1px solid #d9d1df; }

footer { display: flex; justify-content: center; gap: 11px; margin-top: 25px; color: #aaa0b4; font-size: 11px; font-weight: 700; }
.footer-mark { color: #e9a3bc; }

@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 650px) {
  .page-shell { width: min(100% - 24px, 560px); padding-top: 30px; }
  .eyebrow-note { display: none; }
  h1 { margin-top: 20px; font-size: clamp(42px, 14vw, 66px); }
  .hero-copy { font-size: 15px; }
  main { margin-top: 48px; }
  .results-section, .palette-section { padding: 19px; border-radius: 22px; }
  .section-heading { align-items: start; flex-direction: column; margin-bottom: 19px; }
  .reroll-button { width: 100%; justify-content: center; }
  .results-grid { grid-template-columns: 1fr; }
  .result-card { grid-template-columns: 1fr; grid-template-rows: auto auto auto; min-height: 258px; }
  .area-block { grid-column: 1; }
  .color-pair { grid-column: 1; grid-row: auto; padding-top: 16px; padding-left: 0; border-top: 1px dashed rgba(117, 89, 217, .2); border-left: 0; }
  .dimension-values { font-size: 60px; }
  .palette-section { align-items: start; flex-direction: column; }
  .palette { justify-content: flex-start; max-width: none; }
  footer { padding-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
