/* PresentAI LP — 一枚図解。値は tokens.css（tokens.json から生成）だけを使う */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + var(--space-3)); }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-base);
  line-height: var(--line-height);
  letter-spacing: var(--tracking-base);
  caret-color: var(--color-primary);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt" 0;
}
::selection { background: var(--color-accent); color: var(--color-on-accent); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
h1, h2, h3, p, summary, .build__item { word-break: auto-phrase; }
ol, ul { padding: 0; list-style: none; }
a { color: var(--color-link); text-underline-offset: 0.2em; text-decoration-thickness: 2px; }
a:hover { color: var(--color-primary-hover); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-3); top: -100px; z-index: var(--z-modal); background: var(--color-bg-inverse); color: var(--color-text-inverse); padding: var(--space-2) var(--space-3); }
.skip-link:focus { top: var(--space-3); }
.skip-link:hover { color: var(--color-text-inverse); }

/* 蛍光マーカー：文字の下半分にだけ引く */
.marker {
  background: linear-gradient(transparent 58%, var(--color-accent) 58%, var(--color-accent) 92%, transparent 92%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 0.08em;
}

/* 丸数字 */
.num {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2em;
  height: 2em;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-bold);
  font-size: 0.9em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.num--inverse { background: var(--color-bg); border-color: var(--color-bg); color: var(--color-primary); }

/* ボタン */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 52px;
  padding: var(--space-2) var(--space-4);
  border: var(--border-width-thick) solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font: inherit;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-lg);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.button:hover { background: var(--color-primary-hover); }
.button:active { transform: translateY(2px); }
.button__icon { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: square; transition: transform var(--duration-base) var(--ease-out); }
.button:hover .button__icon { transform: translateX(3px); }

/* ヘッダー */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--color-bg);
  border-bottom: var(--border-width-thick) solid var(--color-border);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  max-width: var(--content-max);
  min-height: var(--header-height);
  margin: 0 auto;
  padding: 0 var(--content-gutter);
}
.header__logo, .footer__logo {
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-black);
  font-size: var(--font-xl);
  letter-spacing: 0;
}
.header__logo-ai { background: var(--color-bg-inverse); color: var(--color-text-inverse); padding: 0 0.15em; margin-left: 0.05em; }
.header__nav { display: flex; gap: var(--space-4); margin-left: auto; font-weight: var(--font-weight-bold); }
.header__nav a { color: var(--color-text); text-decoration: none; padding: var(--space-1) 0; }
.header__nav a:hover { text-decoration: underline; color: var(--color-text); }
.header__login {
  padding: var(--space-1) var(--space-3);
  border: var(--border-width) solid var(--color-border);
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
  text-decoration: none;
}
.header__login:hover { background: var(--color-bg-inverse); color: var(--color-text-inverse); }

/* 最初の画面 */
.hero { padding: var(--space-5) 0 var(--space-7); border-bottom: var(--border-width-thick) solid var(--color-border); }
.hero__inner { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--content-gutter); }
.hero__title {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-black);
  font-size: var(--font-display);
  line-height: var(--line-height-heading);
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}
.hero__br { display: none; }
.hero__lead { max-width: 40em; text-wrap: pretty; margin-top: var(--space-3); font-size: var(--font-lg); }

/* 流れの図解 */
.flow {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 56px minmax(0, 0.95fr) 56px minmax(0, 1fr);
  align-items: stretch;
  margin-top: var(--space-5);
}
.flow__step {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: var(--border-width-thick) solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}
.flow__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-black);
  font-size: var(--font-lg);
  line-height: var(--line-height-heading);
}
.flow__step--ai { background: var(--color-primary); color: var(--color-on-primary); }
.flow__arrow { display: grid; place-items: center; }
.flow__arrow svg { width: 100%; height: 40px; fill: none; stroke: var(--color-border); stroke-width: 6; stroke-linecap: square; }
.flow__note { font-weight: var(--font-weight-bold); }

/* 入力欄 */
.ask { display: flex; flex-direction: column; gap: var(--space-3); }
.ask__input {
  width: 100%;
  min-height: 7.5em;
  padding: var(--space-3);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-subtle);
  color: var(--color-text);
  font: inherit;
  font-size: var(--font-lg);
  line-height: 1.6;
  resize: vertical;
}
.ask__input::placeholder { color: var(--color-text-muted); }
.ask__input:focus { background: var(--color-bg); }
.ask__input[aria-invalid="true"] { border-color: var(--color-error); border-width: var(--border-width-thick); }
.ask__error { color: var(--color-error); font-weight: var(--font-weight-bold); }
.ask__note { font-size: var(--font-sm); color: var(--color-text-muted); }
.ask .button { align-self: flex-start; }

/* AI が組み立てる箱の中 */
.build { display: flex; flex: 1; flex-direction: column; justify-content: space-between; gap: var(--space-2); }
.build__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: var(--border-width) solid var(--color-on-primary);
  font-weight: var(--font-weight-bold);
}
.build__item::before {
  content: "";
  flex: none;
  width: 0.7em;
  height: 0.7em;
  background: var(--color-on-primary);
}

/* 重なった配布資料（影を使わず、ずらして重ねる） */
.stack { position: relative; aspect-ratio: 16 / 10.4; margin-top: var(--space-1); }
.stack__sheet {
  position: absolute;
  width: 84%;
  border: var(--border-width) solid var(--color-border);
  background: var(--color-bg);
}
.stack__sheet--3 { right: 0; top: 0; }
.stack__sheet--2 { right: 8%; top: 12%; }
.stack__sheet--1 { right: 16%; top: 24%; }

/* セクションの共通 */
.section { padding: var(--section-space-lg) 0; border-bottom: var(--border-width-thick) solid var(--color-border); }
.section__inner { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--content-gutter); }
.section__title {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-black);
  font-size: var(--font-3xl);
  line-height: var(--line-height-heading);
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}
.section__lead { max-width: 42em; margin-top: var(--space-3); font-size: var(--font-lg); }

/* 実物に書き込む */
.callout { position: relative; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; margin-top: var(--space-6); padding-bottom: var(--space-5); }
.callout__figure { position: relative; margin: 124px 0 48px; border: var(--border-width-thick) solid var(--color-border); }
/* ピンは資料の外（上か下の余白）に段をずらして置き、証拠の点から縦の短い線で結ぶ */
.callout__pin {
  position: absolute;
  left: var(--x);
  top: calc(var(--tier) * -38px - 4px);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: var(--border-width-thick) solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-base);
  line-height: 1;
  transform: translate(-50%, -100%);
  z-index: 2;
}
.callout__pin[data-tier="1"] { --tier: 2; }
.callout__pin[data-tier="2"] { --tier: 1; }
.callout__pin[data-tier="3"] { --tier: 0; }
.callout__pin[data-tier="-1"] { top: calc(100% + 4px + var(--border-width-thick)); transform: translate(-50%, 0); }
.callout__select { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); border: var(--border-width) solid var(--color-border); }
.callout__select i { position: absolute; width: 9px; height: 9px; border: var(--border-width) solid var(--color-border); background: var(--color-bg); }
.callout__select i:nth-child(1) { left: -5px; top: -5px; }
.callout__select i:nth-child(2) { right: -5px; top: -5px; }
.callout__select i:nth-child(3) { left: -5px; bottom: -5px; }
.callout__select i:nth-child(4) { right: -5px; bottom: -5px; }
.callout__lines { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.callout__lines .halo { fill: none; stroke: var(--color-bg); stroke-width: 6; }
.callout__lines .line { fill: none; stroke: var(--color-border); stroke-width: 2; }
.callout__lines .dot { fill: var(--color-border); }
.callout__list { display: flex; flex-direction: column; gap: var(--space-4); counter-reset: none; }
.callout__item { display: flex; gap: var(--space-3); align-items: flex-start; }
.callout__item .num { font-size: var(--font-lg); }
.callout__item h3 { font-size: var(--font-xl); line-height: var(--line-height-heading); }
.callout__item p { margin-top: var(--space-1); }

/* 作例ビューア：一度に1本だけ */
.viewer { margin-top: var(--space-6); }
.viewer__tabs { display: flex; flex-wrap: wrap; border-bottom: var(--border-width-thick) solid var(--color-border); }
.viewer__tab {
  margin-bottom: calc(var(--border-width-thick) * -1);
  padding: var(--space-3) var(--space-4);
  border: var(--border-width-thick) solid transparent;
  border-bottom: 0;
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-lg);
  cursor: pointer;
}
.viewer__tab:hover { color: var(--color-text); }
.viewer__tab[aria-selected="true"] {
  border-color: var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: inset 0 -6px 0 var(--color-accent);
}
.viewer__panel { padding-top: var(--space-4); }
.viewer__ask { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: baseline; font-size: var(--font-lg); font-weight: var(--font-weight-bold); }
.viewer__ask-label { padding: 0 var(--space-2); background: var(--color-bg-inverse); color: var(--color-text-inverse); font-size: var(--font-sm); }
.viewer__stage { margin-top: var(--space-4); border: var(--border-width-thick) solid var(--color-border); background: var(--color-bg-subtle); aspect-ratio: 1280 / 722; }
.viewer__slide { width: 100%; transition: opacity var(--duration-base) var(--ease-out); }
.viewer__slide.is-swapping { opacity: 0.2; }
.viewer__bar { display: flex; align-items: center; justify-content: center; gap: var(--space-4); margin-top: var(--space-3); }
.viewer__step {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: var(--border-width-thick) solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
}
.viewer__step:hover { background: var(--color-bg-inverse); color: var(--color-text-inverse); }
.viewer__step svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: square; }
.viewer__count { min-width: 5ch; text-align: center; font-family: var(--font-family-heading); font-weight: var(--font-weight-black); font-size: var(--font-xl); font-variant-numeric: tabular-nums; }
.viewer__thumbs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-4); }
.viewer__thumb { display: block; width: 100%; padding: 0; border: var(--border-width) solid var(--color-border-quiet); background: none; cursor: pointer; opacity: 0.45; transition: opacity var(--duration-fast) var(--ease-out); }
.viewer__thumb:hover { opacity: 0.8; }
.viewer__thumb[aria-current="true"] { opacity: 1; border: var(--border-width-thick) solid var(--color-border); }

/* 挿絵：切手大で敷き詰める */
.library__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); align-items: end; }
.library__head .section__lead { margin-top: 0; }
.stamps {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  margin-top: var(--space-2);
  border-top: var(--border-width) solid var(--color-border);
  border-left: var(--border-width) solid var(--color-border);
}
.stamps__cell { position: relative; border-right: var(--border-width) solid var(--color-border); border-bottom: var(--border-width) solid var(--color-border); background: var(--color-bg); }
.stamps__cell img { width: 100%; aspect-ratio: 1; object-fit: contain; padding: var(--space-1); }
.stamps__code {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0 var(--space-1);
  background: var(--color-bg);
  border-right: var(--border-width) solid var(--color-border);
  border-bottom: var(--border-width) solid var(--color-border);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.stamps__legend { margin-top: var(--space-5); font-size: var(--font-sm); }
.stamps__legend b { display: inline-block; min-width: 1.6em; margin-right: var(--space-1); border: var(--border-width) solid var(--color-border); text-align: center; }

/* 直す */
.flow--small { grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr) 56px minmax(0, 1fr); }
.flow--small .flow__label { font-size: var(--font-lg); }
.fix__note { margin-top: var(--space-4); font-weight: var(--font-weight-bold); }

/* 料金 */
.price__box { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3) var(--space-6); padding: var(--space-5); border: var(--border-width-thick) solid var(--color-border); }
.price__text { font-size: var(--font-2xl); font-weight: var(--font-weight-bold); }

/* よくある質問 */
.faq__list { margin-top: var(--space-5); border-top: var(--border-width-thick) solid var(--color-border); max-width: 52em; }
.faq__item { border-bottom: var(--border-width) solid var(--color-border); }
.faq__item summary {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-lg);
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__icon { flex: none; width: 22px; height: 22px; margin-top: 0.2em; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: square; }
.faq__v { transition: opacity var(--duration-fast) var(--ease-out); }
.faq__item[open] .faq__v { opacity: 0; }
.faq__item p { max-width: 42em; padding-bottom: var(--space-4); }

/* 締め */
.closing { background: var(--color-bg); }
.closing__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); align-items: center; }
.closing__title { font-family: var(--font-family-heading); font-weight: var(--font-weight-black); font-size: var(--font-3xl); line-height: var(--line-height-heading); text-wrap: balance; }
.ask--closing { padding: var(--space-4); border: var(--border-width-thick) solid var(--color-border); background: var(--color-bg); }
.ask--closing .ask__input { background: var(--color-bg-subtle); }

/* フッター */
.footer { padding: var(--space-6) 0; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); max-width: var(--content-max); margin: 0 auto; padding: 0 var(--content-gutter); }
.footer__copy { margin-left: auto; color: var(--color-text-muted); }

/* 最初の画面の動き：矢印が引かれ、AI の箱の中身が順に並ぶ（1回だけ） */
@media (prefers-reduced-motion: no-preference) {
  .js .flow--hero .flow__arrow path { stroke-dasharray: 120; stroke-dashoffset: 120; animation: draw var(--duration-slow) var(--ease-out) forwards; }
  .js .flow--hero .flow__arrow:nth-of-type(4) path { animation-delay: 900ms; }
  .js .flow--hero .build__item { animation: place var(--duration-base) var(--ease-out) both; }
  .js .flow--hero .build__item:nth-child(1) { animation-delay: 450ms; }
  .js .flow--hero .build__item:nth-child(2) { animation-delay: 570ms; }
  .js .flow--hero .build__item:nth-child(3) { animation-delay: 690ms; }
  .js .flow--hero .build__item:nth-child(4) { animation-delay: 810ms; }
  .js .flow--hero .stack__sheet--1 { animation: place var(--duration-slow) var(--ease-out) 1100ms both; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes place { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 1024px 以下 */
@media (max-width: 1024px) {
  .header__nav { display: none; }
  .header__login { margin-left: auto; }
  .flow, .flow--small { grid-template-columns: minmax(0, 1fr); }
  .flow__arrow { height: 48px; }
  .flow__arrow svg { width: 40px; height: 80px; transform: rotate(90deg); }
  .flow__step--pptx .stack { max-width: 560px; }
  .callout { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .library__head, .closing__inner { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .viewer__thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stamps { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

/* 480px 以下 */
@media (max-width: 480px) {
  .hero { padding-top: var(--space-5); }
  .hero__br { display: inline; }
  .section { padding: var(--section-space) 0; }
  .section__title, .closing__title { font-size: var(--font-2xl); }
  .flow__step { padding: var(--space-3); }
  .ask .button { align-self: stretch; }
  .viewer__tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .viewer__tab { padding: var(--space-2) var(--space-1); font-size: var(--font-sm); }
  .stamps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stamps__cell:nth-child(n + 49) { display: none; }
  .footer__copy { margin-left: 0; width: 100%; }
}
