:root {
  --washi: #f4f4f1;      /* page */
  --sheet: #fbfbf9;      /* raised surfaces */
  --sumi: #22201d;       /* ink */
  --sumi-soft: #5d5953;  /* secondary text */
  --hinoki: #9a7a55;     /* wood */
  --hinoki-dark: #6f5539;
  --ai: #26345a;         /* indigo actions */
  --ai-hover: #1c284a;
  --rule: #dcd9d1;
  --tile: url("/assets/tile-plain.webp");
  --paper-opacity: 0.42;

  --serif: "Shippori Mincho", "Hiragino Mincho ProN", Georgia, serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", -apple-system, system-ui, sans-serif;
  --wrap: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--washi);
  color: var(--sumi);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--ai); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible, .stile:focus-visible, .switch input:focus-visible + .switch-track {
  outline: 2px solid var(--ai);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; }

/* ---------- Paper view: the whole page under paper ---------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  background-image: var(--tile);
  background-size: 256px 256px;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.veil.on { opacity: var(--paper-opacity); }
@media (prefers-reduced-motion: reduce) { .veil { transition: none; } }

/* ---------- Header ---------- */
.top {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--sumi); text-decoration: none;
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem;
}
.nav { display: flex; gap: 22px; margin-right: auto; }
.nav a { color: var(--sumi-soft); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--sumi); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  width: 42px; height: 24px; border-radius: 12px;
  background: #cfccc4; position: relative; transition: background 0.2s;
}
.switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(34, 32, 29, 0.25); transition: transform 0.2s;
}
.switch input:checked + .switch-track { background: var(--ai); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch-label { font-size: 0.95rem; font-weight: 500; }

/* ---------- Sections ---------- */
main > section { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
main > section + section { margin-top: 128px; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--sumi-soft); margin-top: 12px; }

.hero { padding-top: 56px !important; }
.hero h1 { max-width: 16ch; }
.lede { font-size: 1.2rem; color: var(--sumi-soft); max-width: 36em; margin-top: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.fine { font-size: 0.88rem; color: var(--sumi-soft); margin-top: 14px; }
.fine.note { margin-top: 24px; max-width: 760px; }

.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px;
  font-weight: 500; text-decoration: none; font-size: 1rem; line-height: 1.3;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--ai); color: #fff; }
.btn-primary:hover { background: var(--ai-hover); }
.btn-quiet { color: var(--sumi); border: 1px solid #c9c5bb; background: var(--sheet); }
.btn-quiet:hover { border-color: var(--sumi-soft); }

/* ---------- Sliding shoji door demo ---------- */
.demo { margin: 64px 0 0; }
.stage {
  --x: 100%;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(34, 32, 29, 0.08), 0 24px 60px -24px rgba(34, 32, 29, 0.35);
  overflow: hidden;
  touch-action: pan-y;
  cursor: ew-resize;
}
.screen { position: absolute; inset: 0; }
.doc {
  max-width: 620px; margin: 0 auto; padding: 7% 32px 0;
  font-size: clamp(0.78rem, 1.55vw, 1.05rem); line-height: 1.75; color: #2b2a28;
}
.doc h2 { font-size: 1.9em; margin-bottom: 0.8em; }
.doc p + p { margin-top: 0.9em; }
.door-paper {
  position: absolute; inset: 0;
  background-image: var(--tile);
  background-size: 256px 256px;
  opacity: var(--paper-opacity);
  clip-path: inset(0 calc(100% - var(--x)) 0 0);
  pointer-events: none;
}
.stile {
  position: absolute; top: 0; bottom: 0; left: var(--x);
  width: 14px; transform: translateX(-50%);
  background: linear-gradient(90deg, var(--hinoki-dark), var(--hinoki) 35%, #b39572 60%, var(--hinoki-dark));
  box-shadow: 2px 0 10px rgba(34, 32, 29, 0.25);
  cursor: ew-resize;
}
.stile::before { /* wider invisible grab area for touch */
  content: ""; position: absolute; inset: 0 -16px;
}
.hikite { /* the recessed oval door pull */
  position: absolute; left: 50%; top: 50%; width: 8px; height: 30px;
  transform: translate(-50%, -50%); border-radius: 4px;
  background: #4f3c28; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.demo figcaption {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 18px;
}
.hint { color: var(--sumi-soft); font-size: 0.92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 0.9rem; padding: 6px 14px; border-radius: 999px;
  border: 1px solid #c9c5bb; background: var(--sheet); color: var(--sumi); cursor: pointer;
}
.chip[aria-checked="true"] { background: var(--sumi); border-color: var(--sumi); color: #fff; }

/* ---------- Textures ---------- */
.swatches {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 36px 28px;
}
.swatch img {
  border-radius: 10px; width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(34, 32, 29, 0.08);
}
.swatch h3 { margin-top: 14px; display: flex; align-items: center; gap: 8px; }
.swatch p { color: var(--sumi-soft); font-size: 0.95rem; margin-top: 2px; }
.tag {
  font-family: var(--sans); font-size: 0.75rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; background: #e3ebe0; color: #2f5130;
}

/* ---------- Details ---------- */
.facts {
  margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px;
}
.facts div { padding: 20px 0; border-top: 1px solid var(--rule); }
.facts dt { font-weight: 700; }
.facts dd { margin: 4px 0 0; color: var(--sumi-soft); }
kbd {
  font-family: var(--sans); font-size: 0.85em; padding: 1px 6px; border-radius: 5px;
  background: var(--sheet); border: 1px solid #d3cfc6;
}

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 760px; }
.plan {
  background: var(--sheet); border-radius: 14px; padding: 30px;
  border: 1px solid var(--rule); display: flex; flex-direction: column;
}
.plan-pro { border: 2px solid var(--ai); }
.price { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; margin-top: 8px; }
.price span { font-family: var(--sans); font-size: 1rem; font-weight: 400; color: var(--sumi-soft); }
.plan ul { margin: 18px 0 26px; padding-left: 1.1em; color: var(--sumi-soft); flex: 1; }
.plan li + li { margin-top: 4px; }
.plan .btn { text-align: center; }

/* ---------- FAQ ---------- */
.faq > * { max-width: 760px; }
.faq details { border-top: 1px solid var(--rule); padding: 18px 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--sumi-soft); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--sumi-soft); margin-top: 10px; max-width: 62ch; }

/* ---------- Footer ---------- */
.foot {
  max-width: var(--wrap); margin: 140px auto 0; padding: 28px 24px 48px;
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  color: var(--sumi-soft); font-size: 0.92rem;
}
.foot::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; border-top: 1px solid var(--rule); }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; }
.foot a { color: var(--sumi-soft); }

/* ---------- Legal pages ---------- */
.legal { max-width: 720px !important; padding-top: 40px !important; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.legal .updated { color: var(--sumi-soft); margin-top: 10px; }
.legal h2 { font-size: 1.35rem; margin: 40px 0 10px; }
.legal p, .legal li { color: #3a3732; }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 1.2em; }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  br.wide { display: none; }
  .top { flex-wrap: wrap; gap: 14px 20px; padding: 16px; }
  .nav { order: 3; width: 100%; margin-right: 0; }
  .switch { margin-left: auto; }
  main > section { padding: 0 16px; }
  main > section + section { margin-top: 88px; }
  .hero { padding-top: 28px !important; }
  .stage { aspect-ratio: 4 / 5; }
  .doc { padding: 10% 22px 0; font-size: 0.9rem; }
  .facts, .plans { grid-template-columns: 1fr; }
  .foot { padding: 24px 16px 40px; margin-top: 96px; }
  .foot::before { left: 16px; right: 16px; }
}
