/* =========================================================================
   家事負担タイプ診断 — 暮らしの処方箋
   claude.ai/design ハンドオフ (styles.css + screens.jsx inline) の vanilla 移植。
   視覚はプロトのまま保つ。本番に必要な追加（トップ flex / トースト /
   html-to-image のカード保存 / アクセシビリティ AA）のみ足す。
   ========================================================================= */

:root{
  /* paper & ink */
  --paper:       #F2E8D5;   /* desk / outer */
  --sheet:       #F8F1E2;   /* card sheet */
  --sheet-deep:  #EFE4CD;   /* recessed panel */
  --ink:         #322A20;   /* main text */
  --ink-soft:    #6A5E4C;   /* secondary  (5.6:1 on sheet — AA) */
  /* tertiary / captions — darkened from #9C8E78 (2.85:1, FAIL) to meet
     WCAG AA 4.5:1 on the cream sheet. PR / コスト注記 / 注意書きの可読性のため。 */
  --ink-faint:   #786A52;   /* 4.69:1 on sheet — AA */
  --rule:        rgba(50,42,32,0.16);
  --rule-soft:   rgba(50,42,32,0.09);
  /* accent — 朱 vermilion */
  --accent:      #E04A36;
  --accent-ink:  #B23322;   /* darker accent for small text (5.5:1 on sheet) */
  --accent-wash: rgba(224,74,54,0.08);
  /* texture */
  --grain:       0.5;       /* multiplier 0..1 */
  /* fonts */
  --f-hand:  "Yomogi", "Klee One", cursive;
  --f-mincho:"Shippori Mincho", serif;
  --f-gothic:"Zen Kaku Gothic New", system-ui, sans-serif;
}

*{ box-sizing:border-box; }

html,body{ margin:0; padding:0; }
body{
  background:
    radial-gradient(120% 80% at 50% -10%, #F6EEDD 0%, var(--paper) 55%, #ECE0C8 100%);
  min-height:100vh;
  font-family:var(--f-gothic);
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

/* ---- app shell: phone-width sheet of paper ---- */
.stage{
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  padding:0;
}
.sheet{
  position:relative;
  width:100%;
  max-width:430px;
  min-height:100vh;
  background:var(--sheet);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 18px 50px -20px rgba(60,46,24,0.45),
    0 4px 14px -8px rgba(60,46,24,0.30);
  overflow:hidden;
}
@media(min-width:460px){
  .sheet{ min-height:calc(100vh - 48px); margin:24px 0; border-radius:6px; }
  .stage{ align-items:center; padding:0 12px; }
}

/* paper grain overlay (per-sheet so it scrolls with content) */
.grain{
  position:absolute; inset:0; pointer-events:none; z-index:60;
  mix-blend-mode:multiply;
  opacity:calc(0.38 * var(--grain));
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.55'/></svg>");
  background-size:160px 160px;
}
/* faint long fibres */
.grain::after{
  content:""; position:absolute; inset:0;
  opacity:calc(0.25 * var(--grain));
  background-image:
    repeating-linear-gradient(92deg, transparent 0 6px, rgba(120,96,60,0.05) 6px 7px);
}

.screen{
  position:relative; z-index:1;
  display:flex; flex-direction:column;
  min-height:100vh; padding:30px 26px 36px;
}
@media(min-width:460px){ .screen{ min-height:calc(100vh - 48px); } }
.hidden{ display:none !important; }

/* ---- type ---- */
.kicker{
  font-family:var(--f-gothic);
  font-size:12px; letter-spacing:0.28em; font-weight:600;
  color:var(--ink-faint); text-transform:none;
}
.hand{ font-family:var(--f-hand); font-weight:400; line-height:1.4; }
.mincho{ font-family:var(--f-mincho); }

h1,h2,h3{ margin:0; font-weight:500; }
p{ margin:0; }

/* ---- PR / 広告 bar ---- */
.pr-bar{
  display:flex; align-items:center; gap:8px;
  font-family:var(--f-gothic); font-size:11.5px; letter-spacing:0.06em;
  color:var(--ink-faint);
}
.pr-tag{
  font-weight:700; font-size:10px; letter-spacing:0.14em;
  color:var(--accent-ink);
  border:1px solid rgba(178,51,34,0.45);
  border-radius:3px; padding:1px 5px; background:var(--accent-wash);
}

/* ---- buttons ---- */
.btn{
  font-family:var(--f-gothic); font-weight:600; font-size:16px;
  border:none; cursor:pointer; width:100%;
  padding:16px 20px; border-radius:11px;
  display:flex; align-items:center; justify-content:center; gap:10px;
  transition:transform .12s ease, box-shadow .12s ease, background .15s ease;
  letter-spacing:0.04em;
}
.btn-primary{
  background:var(--accent); color:#FFF6EE;
  box-shadow:0 8px 18px -8px rgba(224,74,54,0.7), 0 2px 0 rgba(150,40,28,0.5);
}
.btn-primary:hover{ transform:translateY(-1px); box-shadow:0 12px 22px -8px rgba(224,74,54,0.75); }
.btn-primary:active{ transform:translateY(1px); box-shadow:0 4px 12px -8px rgba(224,74,54,0.7); }
.btn-primary:disabled{ cursor:default; }
.btn-ghost{
  background:transparent; color:var(--ink-soft);
  box-shadow:inset 0 0 0 1.5px var(--rule);
}
.btn-ghost:hover{ background:rgba(50,42,32,0.04); }

.link-quiet{
  background:none; border:none; cursor:pointer;
  font-family:var(--f-gothic); font-size:13px; color:var(--ink-faint);
  text-decoration:underline; text-underline-offset:3px; text-decoration-color:var(--rule);
}
.link-quiet:hover{ color:var(--ink-soft); }

/* ---- stamp (rubber permission stamp) ---- */
.stamp{
  display:inline-flex; align-items:center; justify-content:center;
  font-family:var(--f-hand); color:var(--accent);
  letter-spacing:0.08em; line-height:1;
  border:2px solid var(--accent); border-radius:14px;
  padding:9px 15px 8px; position:relative;
  mix-blend-mode:multiply;
  transform:rotate(-7deg);
  -webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='3'/><feColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.4 1.15'/></filter><rect width='90' height='90' filter='url(%23n)'/></svg>");
  mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='3'/><feColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.4 1.15'/></filter><rect width='90' height='90' filter='url(%23n)'/></svg>");
  -webkit-mask-size:120px 120px; mask-size:120px 120px;
}
.stamp::before{
  content:""; position:absolute; inset:2.5px; border:1px solid var(--accent);
  border-radius:10px; opacity:0.7;
}
.stamp.round{ border-radius:50%; padding:14px; aspect-ratio:1; }
.stamp.round::before{ border-radius:50%; }

/* circular seal stamp for hero */
.seal{
  width:96px; height:96px; border-radius:50%;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  color:var(--accent); border:2.5px solid var(--accent);
  font-family:var(--f-hand); text-align:center; line-height:1.25;
  mix-blend-mode:multiply; transform:rotate(-6deg); position:relative;
  -webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='3'/><feColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.5 1.2'/></filter><rect width='100' height='100' filter='url(%23n)'/></svg>");
  mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='3'/><feColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.5 1.2'/></filter><rect width='100' height='100' filter='url(%23n)'/></svg>");
}
.seal::before{
  content:""; position:absolute; inset:5px; border:1px solid var(--accent);
  border-radius:50%; opacity:0.65;
}
.seal span{ display:block; }

/* ---- progress dots ---- */
.dots{ display:flex; gap:7px; align-items:center; }
.dot{ width:8px; height:8px; border-radius:50%; background:var(--rule); transition:all .25s ease; }
.dot.done{ background:var(--accent-ink); }
.dot.cur{ background:var(--accent); transform:scale(1.45); }

/* ---- option cards ---- */
.opt{
  width:100%; text-align:left; cursor:pointer;
  font-family:var(--f-mincho); font-size:17px; color:var(--ink);
  background:var(--sheet); border:1.5px solid var(--rule);
  border-radius:13px; padding:18px 18px 18px 54px;
  position:relative; transition:all .14s ease; line-height:1.5;
}
.opt:hover{ border-color:rgba(178,51,34,0.4); background:#FBF5E9; transform:translateY(-1px); }
.opt .tick{
  position:absolute; left:17px; top:50%; transform:translateY(-50%);
  width:22px; height:22px; border-radius:50%;
  border:1.5px solid var(--rule); transition:all .14s ease;
}
.opt.sel{ border-color:var(--accent); background:#FCF4E7; box-shadow:0 6px 16px -10px rgba(224,74,54,0.6); }
.opt.sel .tick{ border-color:var(--accent); background:var(--accent); box-shadow:inset 0 0 0 3px var(--sheet); }
.opt small{ display:block; font-family:var(--f-gothic); font-size:12.5px; color:var(--ink-faint); margin-top:4px; letter-spacing:0.02em; }

/* dim siblings during the brief auto-advance lock */
.opt.dim{ opacity:0.45; }

/* ---- result card sections ---- */
.rcard{
  background:var(--sheet);
  border:1px solid var(--rule-soft);
  border-radius:16px; overflow:hidden;
  box-shadow:0 14px 36px -22px rgba(60,46,24,0.5);
}
.rsec{ padding:26px 24px; position:relative; }
.rsec + .rsec{ border-top:1px dashed var(--rule); }
.rsec-num{
  font-family:var(--f-hand); color:var(--accent); font-size:13px;
  display:inline-flex; align-items:center; gap:7px; margin-bottom:12px;
}
.rsec-num b{ font-size:11px; font-family:var(--f-gothic); letter-spacing:0.2em; color:var(--ink-faint); font-weight:600; }

.divider-deco{ display:flex; align-items:center; gap:10px; color:var(--rule); margin:2px 0; }
.divider-deco::before,.divider-deco::after{ content:""; height:1px; background:var(--rule); flex:1; }

/* prescription quote */
.rx{
  font-family:var(--f-hand); color:var(--ink); font-size:20px; line-height:1.7;
  background:var(--accent-wash); border-left:3px solid var(--accent);
  padding:16px 18px; border-radius:0 10px 10px 0; margin-top:4px;
}

/* honest cost table */
.cost{
  font-family:var(--f-gothic); border:1px solid var(--rule);
  border-radius:10px; overflow:visible; margin-top:14px; background:var(--sheet-deep);
}
.cost-row{ display:flex; flex-direction:column; align-items:flex-start; gap:3px; padding:11px 14px; }
.cost-row + .cost-row{ border-top:1px solid var(--rule-soft); }
.cost-row .k{ font-size:11.5px; letter-spacing:0.04em; color:var(--ink-faint); }
.cost-row .v{ font-size:15px; color:var(--ink); font-weight:600; font-variant-numeric:tabular-nums; line-height:1.55; }
.cost-note{ font-size:11.5px; color:var(--ink-faint); margin-top:8px; line-height:1.6; }

/* service-kind panel */
.svc-panel{
  background:var(--sheet-deep); border:1px solid var(--rule);
  border-radius:13px; padding:18px 18px 20px;
}
.svc-kind-label{
  font-family:var(--f-gothic); font-size:11.5px; letter-spacing:0.12em; color:var(--ink-faint);
}
.svc-kind{ font-family:var(--f-hand); font-size:24px; color:var(--accent-ink); margin-top:4px; }
.svc-hands{
  font-family:var(--f-gothic); font-size:13px; color:var(--ink-soft);
  margin-top:8px; line-height:1.7;
}

/* email capture */
.field{
  width:100%; font-family:var(--f-gothic); font-size:16px; color:var(--ink);
  background:var(--sheet); border:1.5px solid var(--rule); border-radius:10px;
  padding:14px 15px; outline:none; transition:border-color .14s ease;
}
.field:focus{ border-color:var(--accent); }
.field::placeholder{ color:var(--ink-faint); }

/* ---- top screen helpers ---- */
.top-seal-wrap{ display:flex; justify-content:center; margin-bottom:26px; }
.note-quiet{
  font-family:var(--f-gothic); font-size:11px; color:var(--ink-faint);
  line-height:1.7;
}

/* ---- result-card grain (baked into the savable card so html-to-image
   captures the paper texture; the .sheet/.grain overlay sits outside the
   captured node and would be lost in the PNG otherwise) ---- */
.result-card{ position:relative; }
.result-card .rcard{ position:relative; z-index:1; }
.card-grain{
  position:absolute; inset:0; z-index:0; pointer-events:none;
  opacity:calc(0.34 * var(--grain));
  border-radius:16px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='cg'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23cg)' opacity='0.09'/%3E%3C/svg%3E");
  background-size:160px 160px;
}

/* save chrome (excluded from PNG via data-noexport) */
.save-row{ display:flex; gap:10px; margin-top:16px; }
.save-btn{
  flex:1; font-family:var(--f-gothic); font-weight:600; font-size:13.5px;
  letter-spacing:0.06em; color:var(--accent-ink);
  background:var(--sheet); border:1.5px solid rgba(178,51,34,0.4);
  border-radius:11px; padding:13px 14px; cursor:pointer;
  transition:background .15s ease, border-color .15s ease;
}
.save-btn:hover{ background:#FBF1E6; border-color:var(--accent); }

/* ---- entrances (visible by default; fade is additive only when anim-ready) ---- */
.fade-in{ opacity:1; transform:none; }
@keyframes fadeUp{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }
.anim-ready .fade-in{ animation:fadeUp .5s ease both; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.001ms !important; animation-iteration-count:1 !important; }
}

/* ---- footer ---- */
.site-foot{
  position:relative; z-index:1;
  padding:22px 26px 30px; border-top:1px solid var(--rule);
  background:var(--sheet-deep);
}
.site-foot p{
  font-family:var(--f-gothic); font-size:10.5px; line-height:1.85;
  color:var(--ink-faint); text-align:center; margin:0;
}
.site-foot p + p{ margin-top:6px; }
.site-foot .foot-links a{ color:var(--ink-soft); text-decoration:underline; text-underline-offset:2px; text-decoration-color:var(--rule); }
.site-foot .foot-links a:hover{ color:var(--accent-ink); }

/* ---- toast ---- */
.toast{
  position:fixed; left:50%; bottom:28px;
  transform:translateX(-50%) translateY(8px);
  background:var(--ink); color:var(--sheet);
  font-family:var(--f-gothic); font-size:12px; letter-spacing:0.06em;
  padding:11px 18px; border-radius:999px; z-index:200;
  box-shadow:0 10px 30px -12px rgba(60,46,24,0.6);
  opacity:0; pointer-events:none;
  transition:opacity .3s ease, transform .3s ease;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
