:root {
  --bg: #07111f;
  --bg-2: #0b1630;
  --bg-3: #111936;
  --text: #f7f0df;
  --muted: #d8d2c3;
  --gold: #d8c077;
  --gold-deep: #bfa46a;
  --purple: #9d7adf;
  --purple-deep: #7b61c9;
  --danger: #e06060;
  --success: #78c89a;
  --line: rgba(247, 240, 223, 0.18);
  --glass: rgba(12, 24, 52, 0.62);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 72% 12%, rgba(157, 122, 223, 0.18), transparent 32rem),
    radial-gradient(circle at 15% 44%, rgba(216, 192, 119, 0.11), transparent 28rem),
    linear-gradient(180deg, var(--bg), var(--bg-2) 46%, var(--bg-3));
  color: var(--text);
  font-family: system-ui, "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  line-height: 1.75;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 48px);
  background: linear-gradient(180deg, rgba(7, 17, 31, 0.88), rgba(7, 17, 31, 0.34));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(247, 240, 223, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
}

.brand__icon {
  color: var(--gold);
  filter: drop-shadow(0 0 10px rgba(216, 192, 119, 0.65));
  font-size: 1.35rem;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 3vw, 34px);
  font-size: 0.94rem;
  color: rgba(247, 240, 223, 0.9);
}

.site-nav a,
.site-footer a {
  transition: color 180ms ease;
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--gold);
}

.header-actions {
  display: flex;
  gap: 10px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.menu-button span:not(.visually-hidden) {
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.hero {
  position: relative;
  min-height: 760px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 120px clamp(22px, 8vw, 126px) 110px;
  border-bottom-left-radius: 56px;
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
}

.hero__image {
  background-image: url("public/images/hero-night-bedroom.png");
  background-position: center right;
  background-size: cover;
  transform: scale(1.01);
}

.hero__shade {
  background:
    linear-gradient(90deg, rgba(7, 17, 31, 0.98) 0%, rgba(7, 17, 31, 0.82) 34%, rgba(7, 17, 31, 0.24) 72%),
    linear-gradient(180deg, rgba(7, 17, 31, 0.24), rgba(7, 17, 31, 0.88));
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 580px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
}

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

h1,
h2 {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "YuMincho", serif;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 28px;
  font-size: clamp(4.2rem, 9vw, 8.7rem);
  line-height: 1.08;
  text-shadow: 0 0 32px rgba(216, 192, 119, 0.18);
}

.hero__copy {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.22rem);
}

.primary-cta,
.ghost-button,
.save-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.primary-cta {
  min-width: min(100%, 360px);
  padding: 14px 28px;
  color: #fffaf5;
  background: linear-gradient(135deg, #bda3ff, var(--purple-deep));
  box-shadow: 0 14px 40px rgba(123, 97, 201, 0.34);
  font-weight: 700;
}

.primary-cta:hover,
.save-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 48px rgba(157, 122, 223, 0.32);
}

.hero__note {
  margin: 18px 0 0;
  color: rgba(247, 240, 223, 0.84);
  font-size: 0.92rem;
}

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

.section-heading h2 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.35;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
}

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

.section-heading--row a {
  color: var(--gold);
}

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

.glass-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.category-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  padding: 24px;
}

.category-card h3,
.article-card h3,
.feature-item p {
  margin-bottom: 8px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

.category-card p,
.article-card p,
.preview-card p,
.result-card p {
  color: var(--muted);
}

.category-card a {
  color: var(--gold);
  font-size: 0.9rem;
}

.category-icon {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #668de4, #425aa7);
  font-size: 2.1rem;
}

.category-icon--purple {
  background: linear-gradient(135deg, #d19de4, #8461b9);
}

.category-icon--gold {
  background: linear-gradient(135deg, #e7bb60, #b98d3c);
}

.diagnosis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.9fr);
  gap: clamp(22px, 3vw, 34px);
  align-items: start;
}

.section--diagnosis {
  scroll-margin-top: 92px;
}

.form-card,
.result-card,
.preview-card {
  padding: clamp(22px, 3vw, 34px);
}

.form-card .section-heading {
  margin-bottom: 26px;
}

.form-card .section-heading h2 {
  max-width: 14em;
  font-size: clamp(1.7rem, 3.1vw, 2.45rem);
}

.form-card .section-heading p:not(.eyebrow) {
  max-width: 48em;
}

.diagnosis-form {
  display: grid;
  gap: 26px;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--text);
}

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

.option-grid label {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(247, 240, 223, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(247, 240, 223, 0.92);
  cursor: pointer;
  line-height: 1.45;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.option-grid label:has(input:checked) {
  border-color: rgba(216, 192, 119, 0.75);
  background: rgba(216, 192, 119, 0.12);
  box-shadow: inset 0 0 0 1px rgba(216, 192, 119, 0.22);
  transform: translateY(-1px);
}

.option-grid input {
  flex: 0 0 auto;
  accent-color: var(--gold);
}

.option-grid label:focus-within {
  outline: 2px solid rgba(216, 192, 119, 0.5);
  outline-offset: 3px;
}

.form-submit {
  width: 100%;
}

.result-card {
  position: sticky;
  top: 96px;
  scroll-margin-top: 92px;
}

.result-card h2 {
  margin-bottom: 12px;
  color: var(--gold);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.35;
}

.result-card > p:not(.eyebrow) {
  margin-bottom: 0;
}

.result-card.is-updated {
  animation: result-reveal 520ms ease both;
  border-color: rgba(216, 192, 119, 0.44);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42), 0 0 34px rgba(216, 192, 119, 0.12);
}

.risk-meter {
  margin: 24px 0;
}

.risk-meter span,
.risk-meter strong {
  display: inline-block;
  margin-bottom: 8px;
}

.risk-meter strong {
  float: right;
  color: var(--gold);
}

.meter-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.meter-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), var(--gold), var(--danger));
  transition: width 260ms ease;
}

.result-actions {
  padding: 18px;
  border: 1px solid rgba(247, 240, 223, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.result-actions h3 {
  margin-bottom: 10px;
}

.result-actions ol {
  margin: 0;
  padding-left: 1.3rem;
  color: var(--muted);
}

.ghost-button {
  width: 100%;
  margin-top: 20px;
  padding: 12px 20px;
  border: 1px solid rgba(247, 240, 223, 0.22);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.preview-and-articles {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 22px;
  align-items: start;
}

.preview-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
}

.preview-card__header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-family: system-ui, "Noto Sans JP", sans-serif;
}

.preview-card__body {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 20px;
  margin-top: 18px;
}

.preview-orb {
  position: relative;
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(216, 192, 119, 0.4);
  overflow: hidden;
  background:
    radial-gradient(circle at 40% 35%, #ffe3aa 0 20%, transparent 21%),
    radial-gradient(circle at 48% 42%, rgba(255, 227, 170, 0.36) 0 32%, transparent 33%),
    linear-gradient(145deg, #26347d, #111936 58%, #080f22);
  box-shadow: inset 0 0 32px rgba(216, 192, 119, 0.12), 0 0 32px rgba(157, 122, 223, 0.18);
}

.preview-orb::before,
.preview-orb::after {
  position: absolute;
  content: "";
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  background: linear-gradient(135deg, rgba(157, 122, 223, 0.34), rgba(7, 17, 31, 0.8));
  clip-path: polygon(0 76%, 16% 48%, 32% 62%, 48% 28%, 66% 56%, 82% 38%, 100% 64%, 100% 100%, 0 100%);
}

.preview-orb::after {
  height: 24%;
  opacity: 0.8;
  transform: translateY(10px);
}

.preview-orb span {
  position: absolute;
  right: 14px;
  bottom: 18px;
  width: 34px;
  height: 54px;
  border-radius: 999px 999px 16px 16px;
  background: linear-gradient(180deg, rgba(247, 240, 223, 0.26), rgba(157, 122, 223, 0.28));
}

.stars {
  display: grid;
  gap: 4px;
  margin: 16px 0;
}

.stars div {
  display: grid;
  grid-template-columns: 6.5em 1fr;
  gap: 8px;
}

.stars dt {
  color: var(--muted);
}

.stars dd {
  margin: 0;
  color: var(--gold);
}

.save-button {
  min-height: 44px;
  padding: 10px 22px;
  color: #2b1f0a;
  background: linear-gradient(135deg, #ffe0a0, var(--gold));
  font-weight: 700;
}

.save-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--success);
  font-size: 0.9rem;
}

.articles-block {
  min-width: 0;
}

.article-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
}

.article-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid rgba(247, 240, 223, 0.1);
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

.article-card__content span {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(157, 122, 223, 0.75);
  font-size: 0.78rem;
}

.article-card h3 {
  margin-bottom: 10px;
  line-height: 1.55;
}

.article-card p {
  margin-bottom: 18px;
  flex: 1;
  font-size: 0.95rem;
}

.article-card time {
  margin-top: auto;
  color: rgba(247, 240, 223, 0.72);
  font-size: 0.88rem;
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 76px;
  padding: 30px clamp(18px, 6vw, 72px);
  border-top: 1px solid rgba(247, 240, 223, 0.1);
  border-bottom: 1px solid rgba(247, 240, 223, 0.1);
  background: linear-gradient(90deg, rgba(216, 192, 119, 0.09), rgba(157, 122, 223, 0.12));
}

.feature-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.feature-item span {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(216, 192, 119, 0.52);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.8rem;
}

.feature-item p {
  margin: 0;
  color: var(--text);
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 22px;
  align-items: center;
  padding: 34px clamp(18px, 4vw, 48px);
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: auto auto;
  }

  .menu-button {
    display: flex;
    justify-self: end;
  }

  .site-nav,
  .header-actions {
    display: none;
  }

  .site-nav.is-open {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 8px;
  }

  .site-nav.is-open a {
    padding: 10px 12px;
    border: 1px solid rgba(247, 240, 223, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
  }

  .diagnosis-layout,
  .preview-and-articles,
  .feature-band {
    grid-template-columns: 1fr;
  }

  .result-card {
    position: static;
  }

  .article-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header {
    gap: 12px;
    padding: 12px 16px;
  }

  .brand {
    font-size: 0.95rem;
  }

  .hero {
    min-height: auto;
    padding: 96px 18px 48px;
    border-bottom-left-radius: 34px;
  }

  .hero__image {
    background-position: 58% center;
  }

  .hero__shade {
    background:
      linear-gradient(180deg, rgba(7, 17, 31, 0.94), rgba(7, 17, 31, 0.72) 58%, rgba(7, 17, 31, 0.92)),
      linear-gradient(90deg, rgba(7, 17, 31, 0.88), rgba(7, 17, 31, 0.28));
  }

  h1 {
    margin-bottom: 20px;
    font-size: clamp(3.25rem, 15vw, 4.9rem);
  }

  .hero__copy {
    margin-bottom: 22px;
    font-size: 1rem;
  }

  .primary-cta {
    width: 100%;
    min-height: 56px;
    padding-inline: 20px;
  }

  .section {
    width: min(100% - 28px, 1180px);
    padding-top: 54px;
  }

  .form-card,
  .result-card,
  .preview-card {
    padding: 20px 16px;
  }

  .diagnosis-form {
    gap: 22px;
  }

  .option-grid {
    gap: 9px;
  }

  .option-grid label {
    min-height: 54px;
    padding: 12px 13px;
  }

  .category-grid,
  .article-grid,
  .option-grid {
    grid-template-columns: 1fr;
  }

  .article-grid {
    overflow: visible;
  }

  .category-card {
    grid-template-columns: 1fr;
  }

  .preview-card__body {
    grid-template-columns: 1fr;
  }

  .preview-orb {
    width: 118px;
  }

  .article-card__content {
    padding: 16px;
  }

  .feature-band {
    margin-top: 54px;
    padding-block: 22px;
  }

  .feature-item {
    align-items: start;
  }

  .section-heading--row {
    align-items: start;
    flex-direction: column;
  }

  .site-nav.is-open {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@keyframes result-reveal {
  from {
    opacity: 0.78;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
