:root {
  --bg: #f4ede4;
  --paper: #fbf6ee;
  --ink: #3a2f2a;
  --muted: #75665f;
  --line: rgba(58, 47, 42, 0.18);
  --accent: #8b6f7a;
  --accent-dark: #6e5362;
  --gold: #b18b56;
  --shadow: 0 18px 50px rgba(58, 47, 42, 0.08);
  --display: "Cormorant Garamond", "Shippori Mincho", serif;
  --serif: "Shippori Mincho", "Noto Serif JP", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% 120px, rgba(255, 248, 235, 0.72), transparent 240px),
    linear-gradient(180deg, var(--bg), #f7efe7 48%, var(--bg));
  letter-spacing: 0;
}

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

p { line-height: 1.95; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 237, 228, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 28px;
  font-style: italic;
  font-weight: 500;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8eb, #e2caa6 45%, #8b6f7a 100%);
  box-shadow: 0 0 0 1px rgba(58, 47, 42, 0.18);
}

.site-header nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.section {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 64px 0;
}

.hero {
  min-height: calc(100svh - 80px);
  display: grid;
  align-items: center;
  padding: 42px 0 28px;
}

.hero-inner {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(28px, 6vw, 74px);
  align-items: center;
}

.eyebrow {
  color: var(--accent);
  font-family: var(--display);
  font-size: 19px;
  font-style: italic;
  margin: 0 0 12px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.45;
  margin: 0;
}

h1 {
  font-size: clamp(38px, 8vw, 76px);
  letter-spacing: 0;
}

h2 { font-size: clamp(27px, 4vw, 42px); }
h3 { font-size: 20px; }

.lead {
  color: var(--muted);
  margin: 22px 0 0;
  max-width: 650px;
}

.moon-card {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.moon-card::before,
.moon-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(139, 111, 122, 0.38);
}

.moon-card::before { inset: 8%; }
.moon-card::after { inset: 18%; border-style: dashed; }

.moon {
  width: 54%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #fff8eb 0 18%, #e9d6b8 43%, #b89f8c 74%, #6f5c52 100%);
  box-shadow: 0 28px 80px rgba(58, 47, 42, 0.18);
}

.sanmei-card span,
.sanmei-orbit span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46px;
  aspect-ratio: 1;
  border: 1px solid rgba(58, 47, 42, 0.18);
  border-radius: 50%;
  background: rgba(251, 246, 238, 0.84);
  color: var(--accent-dark);
  font-family: var(--serif);
  font-size: 20px;
}

.sanmei-card span:nth-child(2) { top: 18%; right: 22%; }
.sanmei-card span:nth-child(3) { bottom: 20%; left: 18%; }
.sanmei-card span:nth-child(4) { right: 12%; bottom: 28%; }

.sanmei-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 28px;
  align-items: center;
}

.sanmei-orbit {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid rgba(58, 47, 42, 0.18);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(139, 111, 122, 0.12), rgba(177, 139, 86, 0.13)),
    rgba(251, 246, 238, 0.58);
}

.sanmei-orbit::before,
.sanmei-orbit::after {
  content: "";
  position: absolute;
  inset: 20%;
  border: 1px dashed rgba(58, 47, 42, 0.2);
  border-radius: 50%;
}

.sanmei-orbit::after {
  inset: 39%;
  border-style: solid;
  background: rgba(139, 111, 122, 0.16);
}

.sanmei-orbit span:nth-child(1) { top: 14px; left: calc(50% - 23px); }
.sanmei-orbit span:nth-child(2) { left: 18px; bottom: 36px; }
.sanmei-orbit span:nth-child(3) { right: 18px; bottom: 36px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button,
button,
.affiliate-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 600 14px/1 var(--sans);
  cursor: pointer;
}

.button.secondary,
button.secondary {
  background: transparent;
  color: var(--ink);
}

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

.lp-section {
  padding-top: 18px;
}

.lp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.lp-grid > div {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

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

.card,
.article-card,
.affiliate-cta,
.diagnosis-panel {
  background: rgba(251, 246, 238, 0.76);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card,
.article-card {
  padding: 24px;
}

.article-card p,
.card p { color: var(--muted); margin-bottom: 0; }

.meta {
  color: var(--accent);
  font-size: 12px;
  margin: 0 0 10px;
}

.article-body {
  width: min(760px, calc(100% - 36px));
  margin: 0 auto;
  padding: 54px 0;
}

.article-body h1 { font-size: clamp(32px, 6vw, 54px); }
.article-body .content {
  margin-top: 34px;
  overflow-x: auto;
  scrollbar-color: rgba(139, 111, 122, 0.42) rgba(251, 246, 238, 0.52);
}
.article-body .content :where(p, li) { color: var(--muted); line-height: 2; }
.article-body .content :where(h2, h3) {
  margin: 34px 0 12px;
}
.article-body .content :where(figure) {
  margin: 28px 0;
}
.article-body .content :where(img) {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.article-body .content :where(a) {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.article-body .content :where(table) {
  width: 100%;
  min-width: 560px;
  margin: 30px 0;
  border: 1px solid var(--line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  background: rgba(251, 246, 238, 0.72);
  box-shadow: 0 14px 36px rgba(58, 47, 42, 0.06);
  overflow: hidden;
}
.article-body .content :where(th, td) {
  padding: 14px 16px;
  border-right: 1px solid rgba(58, 47, 42, 0.12);
  border-bottom: 1px solid rgba(58, 47, 42, 0.12);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
  text-align: left;
  vertical-align: top;
}
.article-body .content :where(th) {
  background: rgba(139, 111, 122, 0.12);
  color: var(--ink);
  font-weight: 600;
}
.article-body .content :where(tr:last-child > th, tr:last-child > td) {
  border-bottom: 0;
}
.article-body .content :where(th:last-child, td:last-child) {
  border-right: 0;
}
.article-body .content :where(tbody tr:nth-child(even) td) {
  background: rgba(255, 255, 255, 0.22);
}

.affiliate-cta {
  padding: 28px;
  margin: 34px 0;
}

.affiliate-cta.compact { margin: 22px 0 0; }
.result-aside-column > .affiliate-cta.compact { margin: 0; }
.affiliate-cta h2 { font-size: 25px; }
.affiliate-cta p { color: var(--muted); }
.pr-label { color: var(--gold); font-size: 12px; margin: 0 0 8px; }

.affiliate-banner {
  display: grid;
  justify-items: start;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.affiliate-banner .pr-label {
  margin: 0 0 6px;
}

.affiliate-banner a {
  display: block;
  width: min(100%, 468px);
  max-width: 100%;
}

.affiliate-banner a img {
  display: block;
  width: 100%;
  height: auto;
}

.affiliate-banner > img {
  display: block;
  width: 1px;
  height: 1px;
}

.diagnosis-panel {
  width: min(760px, calc(100% - 36px));
  margin: 42px auto 72px;
  padding: clamp(22px, 5vw, 42px);
  scroll-margin-top: 96px;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(58, 47, 42, 0.12);
  overflow: hidden;
  margin-bottom: 26px;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value);
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.choices {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.choice {
  width: 100%;
  justify-content: flex-start;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.3);
  color: var(--ink);
  border-radius: 8px;
  line-height: 1.5;
}

.choice.selected {
  border-color: var(--accent);
  background: rgba(139, 111, 122, 0.12);
}

.related-article {
  display: block;
}

.related-article small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.diagnosis-actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.sanmei-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.sanmei-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.birth-selects,
.time-selects {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.birth-selects {
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
}

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

.birth-selects legend,
.time-selects legend {
  grid-column: 1 / -1;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
}

.time-selects legend small {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
}

.time-selects p {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.sanmei-form input,
.sanmei-form select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  font: 500 15px/1.3 var(--sans);
  padding: 10px 12px;
}

.sanmei-form .actions {
  grid-column: 1 / -1;
  margin-top: 6px;
}

.form-error {
  margin: 18px 0 0;
  color: #8d3333;
}

.sanmei-form[data-loading="true"] {
  pointer-events: none;
  opacity: 0.58;
}

.sanmei-loading {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 26px 18px;
  border: 1px solid rgba(139, 111, 122, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.26);
  text-align: center;
}

.sanmei-loading[hidden] {
  display: none;
}

.sanmei-loading h3 {
  font-size: 20px;
}

.sanmei-loading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.sanmei-loader {
  position: relative;
  width: 112px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.sanmei-loader::before,
.sanmei-loader::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.sanmei-loader::before {
  inset: 0;
  border: 1px solid rgba(58, 47, 42, 0.16);
  background: conic-gradient(from 0deg, rgba(139, 111, 122, 0.12), rgba(177, 139, 86, 0.72), rgba(139, 111, 122, 0.12));
  mask: radial-gradient(circle, transparent 58%, #000 59%);
  animation: sanmei-spin 1.6s linear infinite;
}

.sanmei-loader::after {
  inset: 25%;
  border: 1px dashed rgba(58, 47, 42, 0.28);
  animation: sanmei-spin 2.4s linear infinite reverse;
}

.sanmei-loader span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(251, 246, 238, 0.94);
  color: var(--accent-dark);
  font-family: var(--serif);
  font-size: 16px;
}

.sanmei-loader span:nth-child(1) { top: 4px; left: calc(50% - 16px); }
.sanmei-loader span:nth-child(2) { bottom: 10px; left: 14px; }
.sanmei-loader span:nth-child(3) { right: 14px; bottom: 10px; }

@keyframes sanmei-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sanmei-loader::before,
  .sanmei-loader::after {
    animation: none;
  }
}

.result-shell {
  width: min(980px, calc(100% - 36px));
  margin: 0 auto;
  padding: 56px 0;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 0.86fr;
  gap: 22px;
  align-items: start;
}

.result-aside-column {
  display: grid;
  gap: 22px;
  align-items: start;
  min-width: 0;
}

.result-main,
.result-side {
  min-width: 0;
  background: rgba(251, 246, 238, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 4vw, 38px);
}

.result-block {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 22px;
}

.result-block h4 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
  margin: 0 0 8px;
}

.sanmei-result h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.position-sections {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.position-sections article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.24);
  padding: 16px;
}

.position-sections p {
  margin: 10px 0 0;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.pillar-grid div,
.body-star-map > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.26);
  padding: 14px;
}

.pillar-grid span,
.body-star-map span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.pillar-grid strong,
.body-star-map strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 500;
  line-height: 1.25;
}

.pillar-grid small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.body-star-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.body-star-map .north { grid-column: 2; }
.body-star-map .east { grid-column: 1; }
.body-star-map .center {
  grid-column: 2;
  background: rgba(139, 111, 122, 0.13);
  border-color: rgba(139, 111, 122, 0.38);
}
.body-star-map .west { grid-column: 3; }
.body-star-map .south { grid-column: 2; }

.result-emphasis {
  color: var(--accent-dark);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.55;
  margin: 12px 0;
}

.small-note {
  font-size: 13px;
  color: var(--muted);
}

.static-page {
  width: min(800px, calc(100% - 36px));
  margin: 0 auto;
  padding: 64px 0;
}

.site-footer {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 92px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  font-family: var(--display);
  font-size: 28px;
  font-style: italic;
  margin: 0 0 12px;
}

.site-footer small { display: block; margin-top: 16px; line-height: 1.8; }

@media (max-width: 760px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .hero-inner,
  .sanmei-hero,
  .result-grid,
  .lp-grid,
  .grid,
  .sanmei-form,
  .birth-selects,
  .time-selects,
  .pillar-grid {
    grid-template-columns: 1fr;
  }
  .sanmei-orbit { display: none; }
  .hero { min-height: auto; }
  .moon-card { order: -1; max-width: 320px; margin: 0 auto; }
  .section { padding: 42px 0; }
}
