:root {
  color-scheme: light;
  --ink: #24332f;
  --muted: #61706b;
  --green: #486c5d;
  --green-dark: #2f5144;
  --sage: #dfe9e2;
  --sage-light: #edf3ef;
  --cream: #f7f3ea;
  --paper: #fffdf8;
  --gold: #b9914d;
  --gold-light: #f4e9d2;
  --line: #d9ddd7;
  --danger: #8b4b3c;
  --shadow: 0 18px 55px rgba(40, 57, 51, 0.1);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  color: #fff;
  background: var(--green-dark);
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(72, 108, 93, 0.12);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(12px);
}

.header-inner,
.section-inner,
.hero-inner,
.legal-footer {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  line-height: 1.25;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--green-dark);
  border-radius: 50% 50% 45% 55%;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 21px;
}

.brand strong { display: block; font-size: 15px; letter-spacing: 0.04em; }
.brand small { color: var(--muted); font-size: 11px; }

.header-cta {
  padding: 9px 16px;
  color: #fff;
  background: var(--green-dark);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 18%, rgba(185, 145, 77, 0.17), transparent 25%),
    radial-gradient(circle at 8% 84%, rgba(72, 108, 93, 0.12), transparent 30%),
    var(--cream);
}

.hero-inner {
  position: relative;
  padding: 82px 0 58px;
}

.hero-inner::after {
  content: "遺言";
  position: absolute;
  z-index: 0;
  top: 12px;
  right: -15px;
  color: rgba(72, 108, 93, 0.055);
  font: 700 clamp(90px, 16vw, 190px)/1 "Yu Mincho", "Hiragino Mincho ProN", serif;
  letter-spacing: -0.12em;
  writing-mode: vertical-rl;
  pointer-events: none;
}

.hero-inner > * { position: relative; z-index: 1; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1, h2, h3 { margin-top: 0; line-height: 1.35; }

h1 {
  margin-bottom: 20px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1 em { color: var(--green); font-style: normal; }

.lead {
  max-width: 620px;
  margin: 0 0 34px;
  color: #475752;
  font-size: clamp(16px, 2vw, 19px);
}

.law-alert {
  max-width: 820px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid #dfcda8;
  background: rgba(255, 253, 248, 0.88);
  border-radius: 16px;
}

.alert-icon {
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  height: 40px;
  color: #fff;
  background: var(--gold);
  border-radius: 50%;
  font-weight: 800;
}

.law-alert h2 { margin-bottom: 5px; font-size: 17px; }
.law-alert p { margin: 0; color: #56635f; font-size: 14px; }
.as-of { display: inline-block; margin-top: 7px; color: var(--danger); font-size: 12px; font-weight: 700; }
.scope-note { max-width: 820px; margin: 14px 0 0; color: var(--muted); font-size: 12px; }

.compare-section { padding: 84px 0 96px; background: #fff; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.section-heading h2, .guidance-copy h2 { margin-bottom: 0; font: 600 clamp(28px, 4vw, 42px)/1.4 "Yu Mincho", "Hiragino Mincho ProN", serif; }
.text-button { padding: 8px 0; border: 0; color: var(--green); background: none; font-size: 13px; font-weight: 700; text-decoration: underline; cursor: pointer; }

.condition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.condition {
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.condition:hover { border-color: #9eb3a9; transform: translateY(-1px); }
.condition:focus-visible, .primary-button:focus-visible, .detail-link:focus-visible, .detail-close:focus-visible { outline: 3px solid rgba(185, 145, 77, 0.45); outline-offset: 3px; }
.condition[aria-pressed="true"] { border-color: var(--green); background: var(--sage-light); }

.condition-check {
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  height: 25px;
  border: 2px solid #9cadA5;
  border-radius: 50%;
}

.condition[aria-pressed="true"] .condition-check { border-color: var(--green); background: var(--green); }
.condition[aria-pressed="true"] .condition-check::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 800; }
.condition strong, .condition small { display: block; }
.condition strong { font-size: 14px; line-height: 1.45; }
.condition small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.selection-summary {
  margin: 20px 0 22px;
  padding: 14px 18px;
  color: var(--green-dark);
  background: var(--sage-light);
  border-left: 4px solid var(--green);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
}

.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }

.method-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.method-card.best-match { border-color: var(--green); box-shadow: var(--shadow); transform: translateY(-4px); }
.method-card.best-match::before {
  content: "選んだ条件に最も近い";
  position: absolute;
  top: -13px;
  left: 22px;
  padding: 4px 11px;
  color: #fff;
  background: var(--green-dark);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}
.method-card.future { background: linear-gradient(180deg, #fffaf0, var(--paper)); }
.card-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.number { color: var(--gold); font: 700 18px/1 "Yu Mincho", serif; }
.availability { padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.availability.available { color: var(--green-dark); background: var(--sage); }
.availability.pending { color: #76572b; background: var(--gold-light); }
.method-card h3 { margin-bottom: 4px; font: 600 24px/1.4 "Yu Mincho", "Hiragino Mincho ProN", serif; }
.method-catch { min-height: 2em; margin: 0 0 20px; color: var(--muted); font-size: 13px; }

.match { margin: 0 0 20px; padding: 13px 14px; background: var(--sage-light); border-radius: 12px; }
.match > span { font-size: 11px; }
.match-label { float: right; color: var(--green-dark); font-size: 13px; }
.meter { clear: both; height: 6px; margin-top: 9px; overflow: hidden; background: #d8e1db; border-radius: 999px; }
.meter i { display: block; width: 0; height: 100%; background: var(--green); border-radius: inherit; transition: width 0.25s ease; }

.quick-facts { margin: 0 0 22px; }
.quick-facts > div { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid #e4e6e1; }
.quick-facts dt { color: var(--muted); font-size: 11px; font-weight: 800; }
.quick-facts dd { margin: 0; font-size: 13px; font-weight: 700; }
.quick-facts small { color: var(--muted); font-size: 10px; font-weight: 500; }

.detail-link {
  width: 100%;
  min-height: 46px;
  margin-top: auto;
  border: 1px solid var(--green);
  color: var(--green-dark);
  background: transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.detail-link:hover { color: #fff; background: var(--green-dark); }

.detail-panel { position: relative; margin-top: 22px; padding: 30px; border: 1px solid #c9d7cf; background: var(--sage-light); border-radius: var(--radius); }
.detail-close { position: absolute; top: 14px; right: 16px; width: 38px; height: 38px; border: 0; color: var(--green-dark); background: #fff; border-radius: 50%; font-size: 22px; cursor: pointer; }
.detail-panel h3 { margin-bottom: 8px; padding-right: 40px; font: 600 26px/1.4 "Yu Mincho", serif; }
.detail-panel .detail-lead { margin: 0 0 20px; color: var(--muted); }
.detail-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.detail-columns > div { padding: 18px; background: rgba(255,255,255,0.8); border-radius: 14px; }
.detail-columns h4 { margin: 0 0 8px; color: var(--green-dark); font-size: 13px; }
.detail-columns p, .detail-columns ul { margin: 0; color: #4b5c56; font-size: 13px; }
.detail-columns ul { padding-left: 1.2em; }
.detail-note { margin: 16px 0 0; padding-top: 15px; border-top: 1px solid #cbd8d0; color: var(--danger); font-size: 12px; font-weight: 700; }

.guidance-section { padding: 88px 0 0; background: var(--cream); }
.guidance-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 70px; align-items: center; }
.guidance-copy > p:not(.eyebrow) { max-width: 580px; color: var(--muted); }
.support-list { display: flex; flex-wrap: wrap; gap: 9px; margin: 24px 0 0; padding: 0; list-style: none; }
.support-list li { padding: 7px 11px; border: 1px solid #ccd5ce; background: rgba(255,255,255,.55); border-radius: 999px; font-size: 12px; }

.memo-card { padding: 32px; background: var(--green-dark); border-radius: var(--radius); color: #fff; box-shadow: var(--shadow); }
.memo-label { color: #d7e6df; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }
.memo-card h3 { margin: 8px 0 10px; font: 600 23px/1.5 "Yu Mincho", serif; }
.memo-card > p { color: #dce7e2; font-size: 13px; }
.primary-button { width: 100%; min-height: 52px; margin-top: 12px; border: 0; color: var(--green-dark); background: #fff; border-radius: 13px; font-weight: 800; cursor: pointer; }
.primary-button:hover { background: var(--gold-light); }
.copy-status { min-height: 1.5em; margin: 8px 0 0; color: #fff !important; font-weight: 700; }
.prototype-note { margin: 18px 0 0 !important; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.18); color: #c8d6d0 !important; font-size: 10px !important; }

.legal-footer { display: grid; grid-template-columns: 1.2fr .8fr; gap: 30px; margin-top: 72px; padding: 28px 0 48px; border-top: 1px solid #d8d6cf; }
.legal-footer strong, .legal-footer summary { font-size: 12px; font-weight: 800; }
.legal-footer p, .legal-footer li { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.legal-footer ul { margin: 8px 0 0; padding-left: 1.2em; }
.legal-footer a { color: var(--green-dark); text-underline-offset: 2px; }
.legal-footer summary { cursor: pointer; }

.site-footer { display: flex; justify-content: space-between; gap: 18px; padding: 24px max(20px, calc((100% - 1120px)/2)); color: #dce7e2; background: #233d33; font-size: 11px; }
.site-footer p { margin: 0; }

@media (max-width: 860px) {
  .condition-grid { grid-template-columns: repeat(2, 1fr); }
  .method-grid { grid-template-columns: 1fr; gap: 28px; }
  .method-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 26px; }
  .card-topline, .method-card h3, .method-catch, .match { grid-column: 1 / -1; }
  .quick-facts, .detail-link { grid-column: 1 / -1; }
  .detail-columns { grid-template-columns: 1fr; }
  .guidance-grid { grid-template-columns: 1fr; gap: 34px; }
}

@media (max-width: 600px) {
  .header-inner, .section-inner, .hero-inner, .legal-footer { width: min(100% - 28px, 1120px); }
  .header-inner { min-height: 66px; }
  .brand-mark { width: 36px; height: 36px; font-size: 18px; }
  .brand strong { font-size: 13px; }
  .brand small { font-size: 9px; }
  .header-cta { padding: 8px 11px; font-size: 10px; }
  .hero-inner { padding: 56px 0 44px; }
  .hero-inner::after { right: -32px; font-size: 100px; }
  h1 { font-size: 38px; }
  .lead { font-size: 15px; }
  .law-alert { padding: 18px; gap: 12px; }
  .alert-icon { flex-basis: 34px; height: 34px; font-size: 13px; }
  .law-alert h2 { font-size: 15px; }
  .law-alert p { font-size: 12px; }
  .compare-section { padding: 62px 0 70px; }
  .section-heading { align-items: start; }
  .section-heading h2, .guidance-copy h2 { font-size: 29px; }
  .condition-grid { grid-template-columns: 1fr; gap: 9px; }
  .condition { min-height: 74px; }
  .selection-summary { font-size: 12px; }
  .method-card { display: flex; padding: 23px; }
  .detail-panel { padding: 24px 18px; }
  .detail-panel h3 { font-size: 22px; }
  .guidance-section { padding-top: 64px; }
  .memo-card { padding: 25px 22px; }
  .legal-footer { grid-template-columns: 1fr; gap: 18px; margin-top: 52px; }
  .site-footer { display: block; padding: 22px 14px; text-align: center; }
  .site-footer p + p { margin-top: 4px; }
}

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