/* Fuchi（縁）LP。配色と部品は Yohaku Design v0.1（紙と墨、差し色は朱ひとつ）に合わせる */

:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-subtle: #EFEDE7;
  --canvas: #E4E1DA;
  --text: #1F1F1F;
  --text-muted: #6B6A66;
  --border-subtle: #E2DFD8;
  --border-control: #8F8C85;
  --ink: #1F1F1F;
  --on-ink: #F7F6F2;
  --shu: #C8442E;
  --shu-ink: #A8361F;
  --shu-subtle: #F6E4DF;

  --font-mincho: 'Shippori Mincho', 'Yu Mincho', serif;
  --font-gothic: 'Noto Sans JP', system-ui, sans-serif;
  --font-maru: 'Zen Maru Gothic', 'Noto Sans JP', sans-serif;
  --font-hand: 'Klee One', 'Noto Sans JP', sans-serif;

  --gutter: 16px;
  --measure: 1120px;
  --radius-small: 4px;
  --radius-control: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212;
    --surface: #1C1C1C;
    --surface-subtle: #242424;
    --canvas: #0A0A0A;
    --text: #EDEBE6;
    --text-muted: #A3A09A;
    --border-subtle: #2E2E2E;
    --border-control: #77746E;
    --ink: #EDEBE6;
    --on-ink: #121212;
    --shu: #E5674F;
    --shu-ink: #F08A75;
    --shu-subtle: #3A201B;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121212;
  --surface: #1C1C1C;
  --surface-subtle: #242424;
  --canvas: #0A0A0A;
  --text: #EDEBE6;
  --text-muted: #A3A09A;
  --border-subtle: #2E2E2E;
  --border-control: #77746E;
  --ink: #EDEBE6;
  --on-ink: #121212;
  --shu: #E5674F;
  --shu-ink: #F08A75;
  --shu-subtle: #3A201B;
  color-scheme: dark;
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
}

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

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-gothic);
  font-size: 16px;
  line-height: 1.9;
  font-feature-settings: 'palt' 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-mincho);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

p { margin: 0; }

/* 縁の読み（ふち）を示すルビ */
rt {
  font-family: var(--font-mincho);
  font-size: 0.42em;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--shu);
  outline-offset: 3px;
  border-radius: var(--radius-small);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--radius-control);
  z-index: 10;
}

.skip:focus { top: 8px; }

/* ---------- ヘッダー ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}

.header.is-scrolled { border-bottom-color: var(--border-subtle); }

.header__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand__icon {
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
}

.brand__name {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}

.nav a {
  padding: 10px 10px;
  text-decoration: none;
  color: var(--text-muted);
}

.nav a:hover { color: var(--text); }

.theme {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-control);
}

.theme svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.theme__half { fill: currentColor; stroke: none; }

@media (max-width: 640px) {
  .nav a { display: none; }
}

/* ---------- 共通 ---------- */

.section__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section__head {
  display: grid;
  gap: 16px;
  margin-bottom: 48px;
  max-width: 34em;
}

.section__head h2 { font-size: clamp(26px, 4vw, 36px); }

.section__head p { color: var(--text-muted); }

/* PC では説明を1行に収める */
@media (min-width: 900px) {
  .section__head { max-width: none; }

  .section__head p { white-space: nowrap; }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-control);
  cursor: pointer;
}

.button--sub {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-control);
}

.button--sub:active { opacity: 0.7; }

.store__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px 0 18px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
}

.store__badge svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

/* ---------- 書き出す画像（テンプレート）の描画。UI の色を持ち込まない ---------- */

.frame {
  position: relative;
  overflow: hidden;
  background: #FFFFFF;
  flex: none;
}

.frame__photo {
  position: absolute;
  overflow: hidden;
}

.frame__photo svg {
  display: block;
  width: 100%;
  height: 100%;
}

.frame__slot {
  position: absolute;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: normal;
  line-break: strict;
}

.frame__slot--vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.frame__exif-item { display: inline-block; white-space: nowrap; }

/* ---------- ヒーロー ---------- */

.hero__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 56px var(--gutter) 120px;
  display: grid;
  grid-template-columns: 1fr minmax(0, 440px) 1fr;
  grid-template-areas:
    ". stage heading"
    ". text .";
  gap: 48px 56px;
}

.hero__heading {
  grid-area: heading;
  align-self: start;
  justify-self: start;
  writing-mode: vertical-rl;
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.7;
}

.hero__stage { grid-area: stage; }

.frame--hero {
  margin-inline: auto;
  outline: 1px solid var(--border-subtle);
}

.hero__text {
  grid-area: text;
  display: grid;
  justify-items: center;
  gap: 28px;
  text-align: center;
}

@media (max-width: 860px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "stage heading"
      "text text";
    gap: 40px 20px;
    padding-top: 32px;
    padding-bottom: 96px;
  }

  .hero__heading { font-size: clamp(26px, 7.4vw, 40px); }

  .hero__text { justify-items: start; text-align: start; }

  .frame--hero { margin-inline: 0; }
}

/* ---------- 実演 ---------- */

.try { padding: 120px 0; border-top: 1px solid var(--border-subtle); }

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}

.editor__canvas {
  background: var(--canvas);
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  gap: 20px;
  padding: 40px 24px 24px;
}

.editor__box {
  width: 100%;
  height: 560px;
  display: grid;
  place-items: center;
}

.editor__panel {
  padding: 28px 24px;
  display: grid;
  align-content: start;
  gap: 28px;
  border-left: 1px solid var(--border-subtle);
}

.field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  display: grid;
  gap: 10px;
}

.field > legend,
.field > label {
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.field > legend { margin-bottom: 10px; }

.field--row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.field__count {
  font-weight: 400;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.templates {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.template {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 2px 6px;
  font: inherit;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: -0.03em;
  white-space: nowrap;
  font-feature-settings: 'palt' 1;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  cursor: pointer;
}

.template__mini {
  position: relative;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border-control);
}

.template__mini span {
  position: absolute;
  background: #B6B0A4;
}

.template[aria-pressed="true"] {
  border: 2px solid var(--shu);
  padding: 7px 1px 5px;
  color: var(--shu-ink);
  font-weight: 600;
}

.slider {
  display: grid;
  grid-template-columns: 1fr 3.5em;
  align-items: center;
  gap: 12px;
}

.slider output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--text-muted);
}

input[type="range"] {
  --fill: 50%;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--shu) var(--fill), var(--border-subtle) var(--fill));
}

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: var(--border-subtle);
}

input[type="range"]::-moz-range-progress {
  height: 3px;
  border-radius: 2px;
  background: var(--shu);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -9.5px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-control);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-control);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.swatches__sep {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

.swatches__note {
  font-size: 12px;
  color: var(--text-muted);
}

.swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  position: relative;
}

.swatch[aria-pressed="true"]::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 2px solid var(--shu);
  border-radius: 50%;
}

.fonts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.font {
  min-height: 44px;
  padding: 0 8px;
  font-size: 15px;
  color: var(--text);
  background: var(--surface-subtle);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
}

.font[aria-pressed="true"] {
  background: var(--surface);
  border-color: var(--border-control);
  box-shadow: inset 0 -2px 0 var(--shu);
}

textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  resize: none;
}

.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 28px;
  margin: 0;
  border-radius: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-control);
  position: relative;
  cursor: pointer;
  transition: background 150ms;
}

.switch::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border-control);
  transition: transform 150ms, background 150ms;
}

.switch:checked {
  background: var(--ink);
  border-color: var(--ink);
}

.switch:checked::before {
  transform: translateX(20px);
  background: var(--on-ink);
}

@media (max-width: 900px) {
  /* 操作しながら見本が見えるよう、見本をヘッダーの下に留める（overflow: hidden だと留まらない） */
  .editor { grid-template-columns: 1fr; overflow: clip; }

  .editor__canvas {
    position: sticky;
    top: var(--header-h, 68px);
    z-index: 2;
    height: min(46svh, 460px);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .editor__box { height: 100%; min-height: 0; }

  .editor__canvas .button { min-height: 40px; font-size: 13px; }

  .editor__panel { border-left: 0; padding: 24px 16px 28px; gap: 24px; }

  /* テンプレートはアプリと同じく横に並べ、指で送る */
  .templates {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 76px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    margin-inline: -16px;
    padding: 2px 16px 6px;
    scrollbar-width: none;
  }

  .templates::-webkit-scrollbar { display: none; }

  .template { scroll-snap-align: start; padding-block: 10px 8px; }

  .template[aria-pressed="true"] { padding-block: 9px 7px; }
}

/* ---------- 使い方 ---------- */

.steps { padding: 120px 0; border-top: 1px solid var(--border-subtle); }

.steps__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 56px;
}

.video {
  aspect-ratio: 16 / 9;
  background: var(--canvas);
  border-radius: 16px;
  overflow: hidden;
}

.video__placeholder {
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.video__placeholder svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.steps__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border-control);
}

.steps__list > li {
  display: grid;
  grid-template-columns: 2em 1fr;
  column-gap: 8px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.steps__num {
  grid-row: span 2;
  font-family: var(--font-mincho);
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-muted);
}

.steps__list h3 { font-size: 19px; line-height: 1.6; }

.steps__list p {
  font-size: 14px;
  color: var(--text-muted);
}

@media (max-width: 860px) {
  .steps__body { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- 作例 ---------- */

.works { padding: 120px 0 104px; border-top: 1px solid var(--border-subtle); }

.wall {
  display: flex;
  align-items: flex-end;
  gap: 48px;
  overflow-x: auto;
  --wall-pad: max(var(--gutter), calc((100vw - var(--measure)) / 2 + var(--gutter)));
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--wall-pad);
  padding: 8px var(--wall-pad) 24px;
  scrollbar-width: thin;
}

.wall:focus-visible { outline-offset: -2px; }

.wall figure {
  margin: 0;
  display: grid;
  gap: 14px;
  scroll-snap-align: start;
}

.wall .frame { outline: 1px solid var(--border-subtle); }

.wall figcaption {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

.wall figcaption strong {
  font-family: var(--font-mincho);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

/* ---------- プライバシー ---------- */

.privacy {
  padding: 120px 0;
  background: var(--ink);
  color: var(--on-ink);
}

.privacy__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 30em);
  justify-content: space-between;
  align-items: start;
  gap: 48px;
}

.privacy h2 {
  writing-mode: vertical-rl;
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: 0.16em;
  line-height: 1.8;
  order: 2;
}

.privacy__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid color-mix(in srgb, var(--on-ink) 30%, transparent);
}

.privacy__list li {
  padding: 22px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--on-ink) 30%, transparent);
  font-size: 17px;
}

@media (max-width: 640px) {
  .privacy__inner { grid-template-columns: 1fr; }

  .privacy h2 { writing-mode: horizontal-tb; order: 0; letter-spacing: 0.08em; }

  .privacy__br { display: none; }
}

/* ---------- 締め ---------- */

.closing { padding: 144px 0; }

.closing__inner {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 20px;
}

.closing h2 { font-size: clamp(24px, 4vw, 34px); }

.closing p { color: var(--text-muted); margin-bottom: 12px; }

/* ---------- フッター ---------- */

.footer { border-top: 1px solid var(--border-subtle); }

.footer__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 48px var(--gutter) 56px;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 6px;
  font-size: 15px;
}

.footer__links a {
  padding: 8px 6px;
  color: var(--text-muted);
  text-decoration: none;
}

.footer__links a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

.footer__sep {
  font-size: 12px;
  color: var(--border-control);
}

.footer__copy { font-size: 14px; }

.footer__note {
  font-size: 12px;
  color: var(--border-control);
}

/* ---------- 規約のページ ---------- */

.legal { padding: 64px 0 120px; }

.legal__inner {
  max-width: calc(36em + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
  font-size: 15px;
  line-height: 2;
}

.legal h1 { font-size: clamp(26px, 4vw, 34px); }

.legal__date {
  margin: 8px 0 40px;
  font-size: 13px;
  color: var(--text-muted);
}

.legal h2 {
  margin: 40px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: 18px;
}

.legal p + p { margin-top: 12px; }

.legal ul {
  margin: 12px 0;
  padding-left: 1.2em;
}

.legal li + li { margin-top: 8px; }

.legal strong { font-weight: 600; }

.legal a { color: var(--text); text-underline-offset: 4px; }
