/* ============================================================
   気分で変える、わたしの部屋 — Editorial Quiet-Luxury Japandi
   Mincho display + warm-gothic body, oatmeal paper, terracotta accent.
   Mobile-first. No generic AI aesthetics: no purple gradients,
   no centered-everything, no cookie-cutter cards.
   ============================================================ */

:root {
  /* Paper & ink */
  --paper:      #ECE4D5;   /* warm oatmeal base */
  --paper-2:    #E3D9C6;   /* deeper paper for bands */
  --card:       #F7F2E8;   /* slightly lifted card surface */
  --ink:        #262019;   /* warm near-black */
  --ink-soft:   #574E40;
  --ink-mute:   #8B8170;
  --line:       #D5C9B4;   /* hairline */
  --line-soft:  #E0D6C4;

  /* Accent */
  --clay:       #B0512F;   /* terracotta — the single confident accent */
  --clay-deep:  #8C3D20;
  --sage:       #767C5E;   /* secondary, used sparingly */

  /* Effects */
  --shadow:     0 2px 10px rgba(38, 32, 25, 0.06);
  --shadow-lg:  0 24px 60px -28px rgba(38, 32, 25, 0.40);
  --radius:     4px;       /* restrained, editorial */
  --radius-img: 2px;

  /* Type */
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans:  "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --latin: "Fraunces", "Shippori Mincho", serif;

  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  /* subtle paper grain via layered radial noise */
  background-image:
    radial-gradient(circle at 20% 12%, rgba(176, 81, 47, 0.04), transparent 42%),
    radial-gradient(circle at 88% 70%, rgba(118, 124, 94, 0.05), transparent 46%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.85;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }
a { color: var(--clay-deep); text-underline-offset: 3px; }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
  position: relative;
  z-index: 2;
}

.hidden { display: none !important; }

/* Editorial eyebrow / kicker */
.eyebrow {
  font-family: var(--latin);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--clay);
  margin: 0;
}
.kicker {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);   /* ISSUE-003: darker for AA contrast on paper */
}

/* ---------- Disclosure bar (compliance) ---------- */
.ad-disclosure-bar {
  background: var(--ink);
  color: #E9E1D2;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 7px 0;
  position: relative;
  z-index: 3;
}
.ad-disclosure-bar .container { padding: 0 22px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
}
.brand-icon { font-size: 17px; transform: translateY(1px); }
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.06em;
}
.brand-tagline {
  font-family: var(--latin);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);          /* ISSUE-003: lift contrast */
  white-space: nowrap;             /* ISSUE-004: no wrap */
}
@media (max-width: 520px) {
  .brand-tagline { display: none; } /* ISSUE-004: hide on small screens */
}

/* ---------- Hero (asymmetric editorial) ---------- */
.intro { padding: 0 0 24px; }

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 40px 0 8px;
}
.hero-copy { position: relative; }
.hero-index {
  font-family: var(--latin);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  border-top: 1px solid var(--ink);
  padding-top: 10px;
  margin-bottom: 30px;
  display: inline-block;
}
.hero-title {
  font-size: clamp(33px, 6.4vw, 58px);
  line-height: 1.24;
  letter-spacing: 0.005em;
  font-weight: 600;
  margin: 14px 0 0;
  word-break: keep-all;        /* keep CJK runs intact; break only at <br> */
  overflow-wrap: break-word;
}
.hero-title .accent { color: var(--clay); }
.hero-lead {
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 2;
  max-width: 46ch;
  margin: 26px 0 0;
}
.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 34px;
}
.hero-meta {
  font-family: var(--latin);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
}
.hero-figure {
  position: relative;
  margin-top: 40px;
}
.hero-figure img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  object-position: 62% center;   /* ISSUE-005: favor the subject (right side) when cropped */
  border-radius: var(--radius-img);
  filter: saturate(0.92) contrast(1.02);
}
.hero-figure figcaption {
  font-family: var(--latin);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 8px;
  text-align: right;
}

@media (min-width: 880px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    align-items: center;
    padding: 76px 0 36px;
  }
  .hero-figure { margin-top: 0; }
  .hero-figure img { height: 500px; }
  .hero-figure::after {
    content: "";
    position: absolute;
    left: -22px; top: 26px; bottom: 26px;
    width: 1px;
    background: var(--line);
  }
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.06em;
  border: none;
  cursor: pointer;
  padding: 16px 34px;
  border-radius: 999px;
  transition: transform 0.25s cubic-bezier(.2,.7,.3,1), background 0.25s, color 0.25s, box-shadow 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--clay); transform: translateY(-2px); }
.btn-primary .arrow { transition: transform 0.25s; }
.btn-primary:hover .arrow { transform: translateX(4px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 14px 28px;
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- Process (editorial numbered list, not cards) ---------- */
.process {
  border-top: 1px solid var(--line);
  padding: 48px 0 8px;
}
.process-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 30px;
}
.process-head .kicker { white-space: nowrap; }
.process-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  padding: 26px 0;
  border-top: 1px solid var(--line-soft);
}
.step:first-child { border-top: none; }
.step-no {
  font-family: var(--latin);
  font-size: 30px;
  font-style: italic;
  color: var(--clay);
  line-height: 1;
}
.step h3 { font-size: 19px; margin-bottom: 6px; font-weight: 600; }
.step p { color: var(--ink-soft); font-size: 14px; line-height: 1.9; }

@media (min-width: 760px) {
  .process-grid { grid-template-columns: repeat(3, 1fr); gap: 0; }
  .step {
    grid-template-columns: 1fr;
    border-top: none;
    border-left: 1px solid var(--line-soft);
    padding: 0 28px;
  }
  .step:first-child { padding-left: 0; border-left: none; }
  .step-no { margin-bottom: 14px; }
}

/* ---------- Quiz ---------- */
.quiz-section { padding: 40px 0; }

.quiz-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 22px 26px;
  max-width: 660px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) { .quiz-card { padding: 48px 52px 40px; } }

.progress {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}
.progress-track {
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--line);
}
.progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  height: 2px;
  background: var(--clay);
  transition: width 0.5s cubic-bezier(.4,0,.1,1);
}
.progress-count {
  font-family: var(--latin);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-mute);
  white-space: nowrap;
}

.q-index {
  font-family: var(--latin);
  font-style: italic;
  font-size: 13px;
  color: var(--clay);
  margin-bottom: 10px;
}
.q-title {
  font-size: clamp(22px, 4.6vw, 29px);
  line-height: 1.45;
  margin-bottom: 8px;
  word-break: keep-all;
}
.q-subtitle { color: var(--ink-mute); font-size: 13.5px; margin-bottom: 26px; }

.options { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line-soft);
  padding: 18px 6px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: padding-left 0.25s, color 0.25s;
}
.options li:last-child .option { border-bottom: 1px solid var(--line-soft); }
.option:hover { padding-left: 16px; color: var(--clay-deep); }
.option-marker {
  font-family: var(--latin);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-mute);
  min-width: 22px;
  transition: color 0.25s;
}
.option:hover .option-marker { color: var(--clay); }
.option-label { flex: 1; }
.option-arrow { color: var(--clay); opacity: 0; transform: translateX(-6px); transition: all 0.25s; }
.option:hover .option-arrow { opacity: 1; transform: translateX(0); }
/* ISSUE-006: previously chosen answer is highlighted when navigating back */
.option.selected { padding-left: 16px; color: var(--clay-deep); }
.option.selected .option-marker { color: var(--clay); }
.option.selected .option-arrow { opacity: 1; transform: translateX(0); }

.quiz-nav { margin-top: 26px; min-height: 22px; }
.link-btn {
  background: none; border: none;
  font-family: var(--sans);
  color: var(--ink-mute);
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 6px 0;
}
.link-btn:hover { color: var(--clay-deep); }

/* ---------- Result ---------- */
.result { max-width: 860px; margin: 0 auto; }

.result-head {
  text-align: center;
  padding: 8px 0 34px;
}
.result-kicker {
  font-family: var(--latin);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--clay);
  margin-bottom: 16px;
}
.result-title {
  font-size: clamp(28px, 6.4vw, 50px);
  line-height: 1.28;
  margin-bottom: 14px;
  word-break: keep-all;
}
.result-sub {
  font-family: var(--latin);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  margin-bottom: 22px;
}
.match-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid var(--clay);
  color: var(--clay-deep);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 13px;
  letter-spacing: 0.06em;
  margin-bottom: 26px;
}
.match-badge b { font-family: var(--latin); font-size: 18px; font-weight: 600; }
.result-intro {
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 2.05;
  max-width: 60ch;
  margin: 0 auto;
  text-align: left;
}

/* Hero pick */
.pick-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 46px 0 18px;
}
.pick-label .kicker { white-space: nowrap; }
.pick-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.hero-pick {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-pick .pick-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-2);
}
.hero-pick .pick-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.hero-pick:hover .pick-img img { transform: scale(1.04); }
.hero-pick .pick-body { padding: 26px 24px 28px; display: flex; flex-direction: column; }
@media (min-width: 720px) {
  .hero-pick { grid-template-columns: 1fr 1fr; }
  .hero-pick .pick-img { aspect-ratio: auto; height: 100%; }
  .hero-pick .pick-body { padding: 40px 38px; justify-content: center; }
}

.pick-cat {
  font-family: var(--latin);
  font-style: italic;
  font-size: 13px;
  color: var(--clay);
  margin-bottom: 12px;
}
.pick-name { font-size: 23px; line-height: 1.5; margin-bottom: 12px; }
.pick-desc { color: var(--ink-soft); font-size: 14.5px; line-height: 1.95; margin-bottom: 22px; }

/* Alternates: 2 items */
.alt-label { display: flex; align-items: center; gap: 14px; margin: 44px 0 18px; }
.alt-label .kicker { white-space: nowrap; }
.alt-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.alt-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 620px) { .alt-grid { grid-template-columns: 1fr 1fr; } }

.alt-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease;
}
.alt-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.alt-card .alt-img { aspect-ratio: 3 / 2; overflow: hidden; background: var(--paper-2); }
.alt-card .alt-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.alt-card:hover .alt-img img { transform: scale(1.05); }
.alt-card .alt-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; gap: 10px; }
.alt-cat { font-family: var(--latin); font-style: italic; font-size: 12px; color: var(--clay); }
.alt-name { font-size: 16px; line-height: 1.55; font-family: var(--serif); font-weight: 600; }
.alt-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.8; flex: 1; }

/* Amazon CTA — terracotta, editorial (not bright orange AI-look) */
.amazon-btn {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.05em;
  background: var(--clay);
  color: #fff;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .25s, transform .2s;
  align-self: flex-start;
}
.amazon-btn:hover { background: var(--clay-deep); transform: translateY(-2px); }
.amazon-btn.full { align-self: stretch; justify-content: center; }
.amazon-btn .arrow { transition: transform .25s; }
.amazon-btn:hover .arrow { transform: translateX(3px); }
.alt-card .amazon-btn { background: transparent; color: var(--clay-deep); border: 1px solid var(--clay); padding: 10px 16px; }
.alt-card .amazon-btn:hover { background: var(--clay); color: #fff; }

/* Retake / disclosure */
.retake {
  text-align: center;
  margin-top: 56px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.disclaimer { margin-top: 22px; font-size: 11.5px; color: var(--ink-mute); line-height: 1.9; }

/* Sticky mobile CTA */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: rgba(38, 32, 25, 0.96);
  backdrop-filter: blur(8px);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  transform: translateY(120%);
  transition: transform .35s cubic-bezier(.2,.7,.3,1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sticky-cta.show { transform: translateY(0); }
/* ISSUE-002: reserve space so the fixed CTA never covers the footer (mobile only) */
@media (max-width: 860px) {
  body.has-sticky { padding-bottom: 76px; }
}
.sticky-cta .sc-name {
  flex: 1;
  color: #EDE5D6;
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sticky-cta .amazon-btn { white-space: nowrap; }
@media (min-width: 860px) { .sticky-cta { display: none; } }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); margin-top: 64px; padding: 48px 0 8px; }
.faq-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16.5px;
  color: var(--ink);
  padding: 20px 36px 20px 0;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 4px; top: 18px;
  font-family: var(--latin);
  font-size: 22px; color: var(--clay);
  transition: transform .3s;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-soft); font-size: 14px; line-height: 1.95; padding: 0 0 22px; max-width: 64ch; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 72px;
  background: var(--ink);
  color: #CFC6B4;
  padding: 40px 0 34px;
}
.site-footer .container { text-align: center; }
.footer-links { margin-bottom: 16px; font-size: 13px; letter-spacing: 0.04em; }
.footer-links a { color: #E9E1D2; text-decoration: none; margin: 0 4px; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-disclaimer { font-size: 12px; color: #A79D8A; line-height: 1.9; margin-bottom: 14px; max-width: 60ch; margin-left: auto; margin-right: auto; }
.footer-copy { font-family: var(--latin); font-style: italic; font-size: 12px; color: #B5AC99; } /* ISSUE-003: AA contrast on dark footer */

/* ---------- Static pages (about / privacy / contact) ---------- */
.static-content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 24px;
  margin: 48px auto;
  max-width: 820px;
  box-shadow: var(--shadow);
}
@media (min-width: 640px) { .static-content { padding: 56px 56px; } }
.static-content h1 {
  font-size: clamp(26px, 5vw, 36px);
  margin-bottom: 8px;
}
.static-content .page-kicker {
  font-family: var(--latin); font-style: italic; color: var(--clay);
  font-size: 14px; margin-bottom: 28px; display: block;
  border-bottom: 1px solid var(--line); padding-bottom: 20px;
}
.static-content h2 { font-size: 19px; margin: 32px 0 12px; }
.static-content p { margin-bottom: 16px; color: var(--ink-soft); font-size: 15px; line-height: 1.95; }
.static-content ul { color: var(--ink-soft); font-size: 15px; line-height: 1.95; padding-left: 1.2em; }
.static-content li { margin-bottom: 8px; }
.info-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.info-table th, .info-table td { border: 1px solid var(--line); padding: 13px 16px; font-size: 14.5px; vertical-align: top; }
.info-table th { background: var(--paper); color: var(--ink); text-align: left; width: 32%; font-weight: 600; font-family: var(--serif); }
.info-table td { color: var(--ink-soft); }

/* Contact form */
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 8px; color: var(--ink); letter-spacing: 0.03em; }
.field input, .field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--clay); }
.field textarea { min-height: 140px; resize: vertical; }

/* ---------- Motion: staggered reveal on load ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; animation: fadeUp 0.9s cubic-bezier(.2,.7,.3,1) forwards; }
.reveal.d1 { animation-delay: .08s; }
.reveal.d2 { animation-delay: .18s; }
.reveal.d3 { animation-delay: .30s; }
.reveal.d4 { animation-delay: .44s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; }
  * { scroll-behavior: auto; }
}

/* ---------- Focus ---------- */
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
