:root {
  color-scheme: light;
  --paper: #f6faf5;
  --sheet: #fafcf9;
  --ink: #242923;
  --black: #171917;
  --green: #2f6547;
  --muted: #4f5b50;
  --hairline: color-mix(in srgb, var(--ink) 22%, transparent);
  --typeface: "Noto Serif JP", serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.8 var(--typeface); font-synthesis: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:where(a,button,summary,input,select,textarea,h3):focus { outline: none; }
:where(a,button,summary):focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
:is(input,select,textarea):focus { border-bottom-color: var(--black); box-shadow: 0 2px var(--black); caret-color: var(--black); }
:where(input,textarea)::selection { background: #dedfdb; color: var(--ink); }
button, a, summary { -webkit-tap-highlight-color: transparent; }
footer { width: min(100% - 3rem, 77rem); margin-inline: auto; }
h1, h2, h3 { margin: 0; font-family: var(--typeface); font-weight: 400; line-height: 1.45; }
strong { font-weight: 400; }
h3 { font-size: clamp(1.45rem,4vw,2rem); letter-spacing: .035em; overflow-wrap: anywhere; }
.hero { width: min(100% - 3rem, 77rem); margin: clamp(1.25rem,4vw,3.5rem) auto 0; }
.hero-content { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); align-items: center; justify-items: center; }
.logo-field {
  display: grid; place-items: center; width: min(100%, 29rem); aspect-ratio: 1;
  padding: 0; background: url("washi-square-dark.webp") center / 100% 100% no-repeat;
}
.hero h1 { width: min(100%, 29rem); }
.hero h1 .logo-field { width: 100%; }
.hero h1 img { display: block; width: 78%; height: auto; }
.hero-aside {
  position: relative; display: grid; align-content: center; justify-items: start;
  padding: clamp(1.25rem,4vw,4rem); min-width: 0;
  width: 100%;
}
.phrase { display: inline-block; }
.tagline { margin: 0; font: 400 clamp(1.38rem,3.1vw,2.55rem)/1.5 var(--typeface); letter-spacing: .05em; }
.intro { margin: 1rem 0 0; font-size: .9375rem; line-height: 1.85; color: var(--muted); }
.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 44px;
  padding: .58rem 1.25rem; border: 0; border-radius: 999px;
  background: transparent; cursor: pointer; font-size: .9rem;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.button:hover, button:hover { background: color-mix(in srgb,var(--ink) 5%,transparent); }
.button:active, button:active { transform: scale(.98); }
.primary, .primary:hover { background: var(--black); color: var(--paper); }
:is(.primary,.primary:hover,.modes button:first-child,.modes button:first-child:hover) {
  background-color: var(--black);
  background-image: url("washi.png?v=12");
  background-size: 360px 360px;
}
.subtle, .text-action {
  border: 0; border-radius: 0; min-height: 44px; padding-inline: 0; background: transparent;
}
.subtle:hover { background: transparent; text-decoration: underline; text-underline-offset: .32em; }
.text-action { display: inline-flex; align-items: center; gap: .7rem; font-size: .9rem; }
.text-action span { display: inline-block; transition: transform .22s ease; }
:is(a,button).text-action:is(:hover,:focus-visible) { background: transparent; text-decoration: none; }
.text-action:is(:hover,:focus-visible) span { transform: translateX(.24rem); }
.result-footer .text-action:is(:hover,:focus-visible) span { transform: translateX(-.24rem); }
button.text-action:active { transform: none; }
#studio { width: min(100% - 3rem, 49rem); margin-inline: auto; padding: clamp(2.2rem,6vw,4.8rem) 0; scroll-margin-top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#steps { display: grid; grid-template-columns: repeat(3,1fr); padding: 0; margin: 0 0 1.1rem; list-style: none; }
#steps li { padding: .5rem; border-bottom: 1px solid var(--hairline); text-align: center; font-size: .875rem; }
#steps li[aria-current] { border-bottom: 2px solid var(--green); color: var(--green); font-weight: 400; }
.panel { padding: clamp(1.15rem,5vw,3.1rem); }
.panel:has(.mode-title, .story-sheet) { padding-inline: 0; }
.mode-title { text-align: center; font-size: clamp(1.3rem,3vw,1.65rem); }
.modes { display: grid; grid-template-columns: repeat(2,minmax(0,17rem)); justify-content: center; gap: .75rem; margin-top: 1.25rem; }
.modes button { display: grid; place-content: center; gap: .18rem; min-height: 4.25rem; border: 1px solid var(--black); border-radius: 999px; padding: .55rem 1rem; text-align: center; }
.modes button:first-child { color: var(--paper); }
.modes button:hover, .modes button:focus-visible { transform: translateY(-2px); }
.modes strong { font: 400 1rem/1.5 var(--typeface); }
.modes span { font-size: .75rem; line-height: 1.45; }
.field { display: grid; gap: .4rem; margin: 0 0 1.25rem; }
.panel h3 + form { margin-top: 1.25rem; }
.names { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; margin: 1rem 0 1.25rem; }
.names label { display: grid; gap: .35rem; }
.actions { display: flex; gap: .8rem 1.25rem; flex-wrap: wrap; align-items: center; }
.theme-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 1rem; }
#random:hover { text-decoration: none; }
#theme { border-bottom: 1px solid #000; caret-color: #000; }
#theme:focus { border-bottom-color: #000; box-shadow: 0 1px #000; }
#random:focus-visible { outline-color: #000; }
label, .caption { font-size: .9rem; }
.theme-help { font-size: .78rem; line-height: 1.65; }
.caption, #notice { margin: .35rem 0; overflow-wrap: anywhere; }
input, select, textarea { font-size: max(18px, 1.125rem); width: 100%; min-height: 44px; padding: .55rem .7rem; border: 0; border-bottom: 1px solid var(--black); border-radius: 0; background: transparent; accent-color: var(--black); }
select { appearance: none; padding-right: 2.45rem; }
.select-wrap { position: relative; display: block; width: min(100%, 13rem); }
.select-wrap::after {
  content: ""; position: absolute; right: 1.05rem; top: 50%; width: .42rem; height: .42rem;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateY(-65%) rotate(45deg); color: var(--black); pointer-events: none;
}
textarea { resize: vertical; min-height: 10rem; }
.panel p, .panel summary, .panel h3, #notice { white-space: pre-line; }
.panel blockquote, .panel .story p { white-space: pre-wrap; }
blockquote { margin: .65rem 0 1.5rem; padding: .55rem 1rem; border-left: 1px solid var(--ink); font-family: var(--typeface); overflow-wrap: anywhere; }
.guidance { margin: 1.6rem 0; border-block: 1px solid var(--hairline); }
.guidance summary { display: flex; justify-content: space-between; align-items: center; gap: .6rem; min-height: 48px; list-style: none; cursor: pointer; font-weight: 400; }
.guidance summary::-webkit-details-marker { display: none; }
.guidance summary::after { content: "+"; font: 400 1.3rem/1 var(--typeface); }
.guidance[open] summary::after { content: "−"; }
.writing-role { display: grid; grid-template-columns: 2.25rem minmax(0,1fr); align-items: start; gap: .85rem; padding: .95rem 0 1.05rem; }
.writing-role + .writing-role { border-top: 1px solid var(--hairline); }
.role-letter, .writing-role strong { font: 400 1rem/1.5 var(--typeface); }
.role-letter { display: grid; align-self: start; place-items: center; aspect-ratio: 1; line-height: 1; border: 1px solid currentColor; border-radius: 50%; }
.role-letter > span { transform: translateY(-.08em); }
.writing-role strong { display: flex; align-items: center; min-height: 2.25rem; }
.writing-role p { margin: .3rem 0 0; font-size: .875rem; }
.panel:has(.story-sheet) { padding-block: .5rem; }
.story-sheet { padding: clamp(1rem,4vw,2rem); border: 1px solid var(--hairline); }
.story { padding: 0; margin: 1.35rem 0 0; list-style: none; }
.story li { overflow-wrap: anywhere; }
.story li + li { margin-top: 1.15rem; }
.story h4 { margin: 0; font-size: .875rem; letter-spacing: .04em; color: var(--muted); }
.story p { margin: .45rem 0 0; font-family: var(--typeface); line-height: 1.95; }
.count { text-align: right; }
.eyebrow { margin: 0 0 .5rem; font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.actions { margin-top: 1rem; }
.result-tools { justify-content: flex-end; }
.consult-card {
  display: grid; justify-items: center; text-align: center; gap: .35rem; margin: 2rem auto 0;
}
.consult-card p { margin: 0; font: 400 clamp(1.15rem,3.5vw,1.45rem)/1.7 var(--typeface); }
.result-footer { text-align: right; margin-top: .8rem; }
.result-footer .text-action { text-decoration: none; }
dialog { position: fixed; width: min(100% - 2rem, 37rem); max-height: calc(100% - 2rem); padding: clamp(1.2rem,6vw,2.55rem); border: 0; background: var(--sheet); color: var(--ink); }
dialog::backdrop { background: #171917a8; }
.dialog-close { float: right; min-width: 44px; padding: 0; margin: -.35rem -.3rem .4rem .6rem; border: 0; font-size: 1.5rem; }
.dialog-close:is(:hover, :focus-visible) { background: transparent; }
.dialog-close:focus-visible { outline: none; }
dialog .caption { margin-top: .85rem; }
.share-link { margin-top: 1rem; }
.shared-view .hero { display: none; }
.shared-view #studio { padding-top: 2.25rem; }
footer { display: flex; align-items: center; justify-content: center; gap: 1rem; font-size: .875rem; }
footer a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-brand { color: var(--ink); font-size: .8125rem; letter-spacing: .08em; }
@keyframes reveal-paper {
  0%, 18% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
@keyframes enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  body::before {
    content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none;
    background: var(--paper); animation: reveal-paper .8s ease both;
  }
  main { animation: enter .72s cubic-bezier(.2,.75,.25,1) .12s both; }
  dialog[open] { animation: enter .32s ease-out both; }
}
@media (max-width: 700px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero h1 { width: min(76vw, 22rem); }
  .hero-aside {
    padding: 1.55rem 1rem 0; justify-items: center; text-align: center;
  }
  .hero-aside .intro { margin: .85rem 0 0; }
  .tagline, .intro { width: min(100%, 22rem); line-break: strict; }
  input, select, textarea { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  .tagline { font-size: clamp(1.23rem,5.8vw,1.85rem); }
  .panel { padding-inline: .35rem; line-break: strict; overflow-wrap: anywhere; }
}
@media (max-width: 460px) {
  footer, .hero, #studio { width: calc(100% - 1.75rem); }
  .modes { grid-template-columns: minmax(0,17rem); }
  .names { grid-template-columns: 1fr; }
  .select-wrap { width: 100%; }
  .writing-role { grid-template-columns: 1.9rem minmax(0,1fr); gap: .65rem; }
  .writing-role strong { min-height: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
