/* 積学堂 サイト共通スタイル
   色・形のルール：インク色の太い線と、ずらした影で「積み上げたブロック」を表現しています。 */

:root {
  --ink: #23224f;
  --ink-soft: #55547e;
  --paper: #ffffff;
  --cloud: #eef4ff;
  --sun: #ffd23f;
  --sky: #4aa8ff;
  --mint: #2ed3a0;
  --pink: #ff6fae;
  --grid: rgba(74, 168, 255, 0.18);

  --line: 3px solid var(--ink);
  --radius-l: 28px;
  --radius-m: 18px;
  --radius-s: 10px;

  --font-display: "Dela Gothic One", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-body: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
    "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;

  color-scheme: light;
}

/* アプリごとの色 */
.c-sun { --c: var(--sun); }
.c-sky { --c: var(--sky); }
.c-mint { --c: var(--mint); }
.c-pink { --c: var(--pink); }

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--paper);
}

:lang(en) body, body:lang(en) { line-height: 1.7; }

img, svg { max-width: 100%; }

a { color: inherit; text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

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

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px 16px; flex-wrap: wrap; min-height: 68px; padding-top: 8px; padding-bottom: 8px;
}

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 1.55rem; line-height: 1;
  text-decoration: none; letter-spacing: 0.06em; white-space: nowrap;
}
.logo-mark { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.logo-mark i {
  display: block; height: 7px; border: 2px solid var(--ink); border-radius: 3px;
}
.logo-mark i:nth-child(1) { width: 14px; margin-left: 5px; background: var(--pink); }
.logo-mark i:nth-child(2) { width: 18px; margin-left: 1px; background: var(--sky); }
.logo-mark i:nth-child(3) { width: 24px; background: var(--sun); }
.logo-sub { font-family: var(--font-body); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.04em; color: var(--ink-soft); }

.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a {
  font-weight: 700; font-size: 0.95rem; text-decoration: none;
  padding: 6px 12px; border-radius: 999px;
}
.site-nav a:hover { background: var(--cloud); }
.site-nav a[aria-current="page"] { background: var(--sun); }
.site-nav .lang { border: 2px solid var(--ink); }

/* ---------- ボタン ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.7em 1.4em;
  border: var(--line); border-radius: 999px;
  background: var(--paper);
  font-weight: 700; text-decoration: none; line-height: 1.4;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn-primary { background: var(--sun); }
.btn[aria-disabled="true"] {
  border-style: dashed; box-shadow: none; color: var(--ink-soft); cursor: default; transform: none;
}

/* ---------- トップ：ヒーロー ---------- */

.graph-paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

.hero { border-bottom: var(--line); overflow: hidden; }
.hero .wrap {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center;
  padding-top: 64px; padding-bottom: 72px;
}
.hero-logo { font-size: clamp(3.6rem, 13vw, 7.5rem); line-height: 1; margin: 0; letter-spacing: 0.06em; }
.hero-reading { margin: 10px 0 0; font-weight: 700; color: var(--ink-soft); letter-spacing: 0.08em; }
.hero-lead { font-family: var(--font-display); font-size: clamp(1.45rem, 3.6vw, 2.1rem); line-height: 1.4; margin: 28px 0 12px; }
.hero-sub { margin: 0; max-width: 32em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.stack { display: flex; flex-direction: column; align-items: center; padding-top: 8px; }
.stack .mascot { width: 128px; height: auto; margin-bottom: -10px; position: relative; z-index: 2; }
.brick {
  display: block; text-align: center;
  padding: 14px 10px;
  font-family: var(--font-display); font-size: clamp(1.05rem, 2.4vw, 1.35rem); line-height: 1.2;
  background: var(--c); border: var(--line); border-radius: 14px;
  box-shadow: 5px 5px 0 var(--ink);
  margin-top: -3px; position: relative;
  transform: translateX(var(--x, 0)) rotate(var(--r, 0deg));
}
.brick:nth-of-type(1) { width: 62%; --x: -6px; --r: -2.5deg; z-index: 1; }
.brick:nth-of-type(2) { width: 72%; --x: 10px; --r: 1.5deg; }
.brick:nth-of-type(3) { width: 84%; --x: -8px; --r: -1deg; }
.brick:nth-of-type(4) { width: 96%; --x: 4px; --r: 0.5deg; }

@media (prefers-reduced-motion: no-preference) {
  .stack .brick, .stack .mascot { animation: drop-in 0.55s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
  .stack .brick:nth-of-type(4) { animation-delay: 0.05s; }
  .stack .brick:nth-of-type(3) { animation-delay: 0.2s; }
  .stack .brick:nth-of-type(2) { animation-delay: 0.35s; }
  .stack .brick:nth-of-type(1) { animation-delay: 0.5s; }
  .stack .mascot { animation-delay: 0.68s; }
}
@keyframes drop-in {
  from { opacity: 0; translate: 0 -48px; }
  to { opacity: 1; translate: 0 0; }
}

/* ---------- セクション共通 ---------- */

.section { padding: 76px 0; }
.section h2 { font-size: clamp(1.6rem, 4.2vw, 2.3rem); margin: 0 0 12px; }
.section-lead { margin: 0 0 36px; color: var(--ink-soft); max-width: 40em; }
.tint { background: var(--cloud); border-top: var(--line); border-bottom: var(--line); }
.band-sun { background: var(--sun); border-top: var(--line); border-bottom: var(--line); }

/* ---------- アプリ一覧（積み上げたブロック） ---------- */

.app-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.app-row > a {
  display: grid; grid-template-columns: 88px 1fr auto; gap: 22px; align-items: center;
  padding: 20px 24px;
  background: var(--c); border: var(--line); border-radius: var(--radius-m);
  box-shadow: 6px 6px 0 var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.app-row > a:hover { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.app-row:nth-child(odd) { margin-right: 32px; }
.app-row:nth-child(even) { margin-left: 32px; }
.app-row h3 { font-size: 1.25rem; margin: 0 0 4px; }
.app-row p { margin: 0; }
.app-more { font-weight: 700; white-space: nowrap; border-bottom: 3px solid var(--ink); }

.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pill {
  display: inline-block; padding: 1px 12px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 999px;
  font-size: 0.82rem; font-weight: 700; line-height: 1.7;
}
.pill-strong { background: var(--ink); color: var(--paper); }

/* アプリアイコン（仮） */
.app-icon {
  position: relative; width: 88px; height: 88px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--paper); border: var(--line); border-radius: 24%;
  font-family: var(--font-display); font-size: 2.1rem; line-height: 1;
}
.app-icon.is-cat::before, .app-icon.is-cat::after {
  content: ""; position: absolute; top: -17%; width: 26%; height: 20%;
  background: var(--ink); clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.app-icon.is-cat::before { left: 12%; }
.app-icon.is-cat::after { right: 12%; }
.sample-tag {
  position: absolute; bottom: -11px; left: 50%; transform: translateX(-50%);
  padding: 0 8px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-body); font-size: 0.66rem; font-weight: 700; line-height: 1.8; white-space: nowrap;
}

/* ---------- 学び方（階段状のステップ） ---------- */

.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: end;
}
.steps li {
  background: var(--paper); border: var(--line); border-radius: var(--radius-m);
  box-shadow: 6px 6px 0 var(--ink); padding: 26px 24px 22px;
}
.steps li:nth-child(1) { margin-top: 96px; }
.steps li:nth-child(2) { margin-top: 48px; }
.steps h3 { font-size: 1.2rem; margin: 0 0 8px; }
.steps p { margin: 0; }
.step-num {
  display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px;
  border: var(--line); border-radius: 50%; background: var(--sun);
  font-family: var(--font-display); font-size: 1.35rem; line-height: 1;
}
.steps li:nth-child(2) .step-num { background: var(--sky); }
.steps li:nth-child(3) .step-num { background: var(--mint); }

/* ---------- シリーズ紹介 ---------- */

.series .wrap { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: center; }
.series .mascot { width: 100%; height: auto; }
.series p { margin: 0 0 12px; max-width: 36em; }
.small-note { font-size: 0.85rem; color: var(--ink-soft); }
.band-sun .small-note { color: var(--ink); }

/* ---------- お知らせ ---------- */

.news { margin: 0; border-top: var(--line); }
.news div { display: grid; grid-template-columns: 9em 1fr; gap: 16px; padding: 16px 4px; border-bottom: 2px solid var(--ink); }
.news dt { font-weight: 700; }
.news dd { margin: 0; }

/* ---------- 下層ページの見出し ---------- */

.page-head { border-bottom: var(--line); }
.page-head .wrap { padding-top: 52px; padding-bottom: 44px; }
.page-head h1 { font-size: clamp(2rem, 6vw, 3.1rem); margin: 0; }
.page-head p { margin: 12px 0 0; color: var(--ink-soft); max-width: 40em; }

/* ---------- 本文 ---------- */

.prose > * { max-width: 780px; }
.prose h2 { font-size: 1.35rem; margin: 44px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; margin: 24px 0 6px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 1.5em; }
.prose li { margin-bottom: 4px; }
.prose .date { margin-top: 40px; font-weight: 700; }

/* 情報テーブル */
.info-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--paper); border: var(--line); border-radius: var(--radius-m); overflow: hidden;
}
.info-table th, .info-table td { padding: 14px 20px; text-align: left; vertical-align: top; border-bottom: 2px solid var(--ink); }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: 0; }
.info-table th { width: 30%; background: var(--cloud); font-weight: 700; border-right: 2px solid var(--ink); }
.info-table td p { margin: 0; }
.info-table td p + p { margin-top: 6px; }

/* ---------- サポート ---------- */

.contact-card {
  background: var(--sun); border: var(--line); border-radius: var(--radius-l);
  box-shadow: 6px 6px 0 var(--ink); padding: 32px;
  margin-bottom: 56px;
}
.contact-card h2 { margin-top: 0; }
.contact-mail {
  display: inline-block; margin: 6px 0 14px;
  font-family: var(--font-display); font-size: clamp(1.25rem, 4.5vw, 1.9rem); line-height: 1.3;
  word-break: break-all;
}
.contact-card ul { margin: 0; padding-left: 1.4em; }

.faq details {
  background: var(--paper); border: var(--line); border-radius: var(--radius-m);
  box-shadow: 4px 4px 0 var(--ink); margin-bottom: 16px;
}
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 20px; font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "Q"; flex: 0 0 auto; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--sky); border: 2px solid var(--ink);
  font-family: var(--font-display); font-weight: 400; line-height: 1;
}
.faq details[open] summary { border-bottom: 2px solid var(--ink); }
.faq .answer { padding: 16px 20px 18px 64px; }
.faq .answer p { margin: 0 0 10px; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- アプリ紹介ページ ---------- */

.app-hero { background: var(--c); border-bottom: var(--line); }
.app-hero .wrap {
  display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center;
  padding-top: 60px; padding-bottom: 60px;
}
.app-hero .app-icon { width: 148px; height: 148px; font-size: 3.4rem; box-shadow: 6px 6px 0 var(--ink); }
.app-hero h1 { font-size: clamp(1.75rem, 4.8vw, 2.8rem); margin: 0 0 10px; }
.app-hero .catch { font-weight: 700; font-size: 1.1rem; margin: 0; }
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.store-buttons .btn[aria-disabled="true"] { background: var(--paper); }

.intro p { max-width: 40em; margin: 0 0 14px; }

.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px; }
.features li { border-left: 8px solid var(--c); padding: 2px 0 2px 20px; }
.features h3 { font-size: 1.1rem; margin: 0 0 6px; }
.features p { margin: 0; }

.phones { display: flex; gap: 28px; overflow-x: auto; padding: 6px 6px 22px; margin: 0 -6px; }
.phone {
  flex: 0 0 228px; display: flex; flex-direction: column; gap: 10px;
  min-height: 440px; padding: 14px 14px 16px;
  background: var(--paper); border: var(--line); border-radius: 32px;
  box-shadow: 6px 6px 0 var(--ink);
  font-size: 0.8rem; line-height: 1.6;
}
.phone::before {
  content: ""; display: block; width: 64px; height: 7px; margin: 0 auto 4px;
  border-radius: 4px; background: var(--ink);
}
.ph-head { font-weight: 700; background: var(--c); border: 2px solid var(--ink); border-radius: 10px; padding: 4px 10px; }
.ph-q { font-weight: 700; font-size: 0.86rem; margin: 4px 0; }
.ph-choice { border: 2px solid var(--ink); border-radius: 10px; padding: 7px 10px; }
.ph-choice.is-correct { background: var(--mint); }
.ph-verdict { font-family: var(--font-display); font-size: 1.8rem; text-align: center; margin: 10px 0 0; }
.ph-explain { background: var(--cloud); border-radius: 10px; padding: 10px; }
.ph-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ph-list li { border: 2px solid var(--ink); border-radius: 10px; padding: 7px 10px; }
.ph-foot { font-weight: 700; text-align: center; }
.ph-sample { margin-top: auto; text-align: center; font-size: 0.7rem; color: var(--ink-soft); }
.phones-caption { font-size: 0.85rem; color: var(--ink-soft); margin: 4px 0 0; }

.scope { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.scope > div { background: var(--paper); border: var(--line); border-radius: var(--radius-m); padding: 20px 22px; }
.scope h3 { font-size: 1.05rem; margin: 0 0 12px; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { background: var(--cloud); border-radius: 999px; padding: 2px 12px; font-size: 0.88rem; }

.notice {
  margin-top: 28px; padding: 14px 18px;
  border: 2px dashed var(--ink); border-radius: var(--radius-s);
  font-size: 0.92rem; background: var(--paper);
}

.back-link { display: inline-block; margin-top: 8px; font-weight: 700; }

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

.site-footer { background: var(--ink); color: var(--paper); padding: 48px 0 40px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 24px 40px; }
.site-footer .logo { color: var(--paper); }
.site-footer .logo-mark i { border-color: var(--paper); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; max-width: 640px; }
.footer-nav a { text-decoration: none; font-weight: 700; font-size: 0.92rem; }
.footer-nav a:hover { text-decoration: underline; }
.footer-meta { flex: 1 0 100%; margin: 0; font-size: 0.85rem; opacity: 0.85; }

/* ---------- レスポンシブ ---------- */

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 44px; }
  .stack { max-width: 420px; margin: 0 auto; width: 100%; }
  .steps { grid-template-columns: 1fr; }
  .steps li:nth-child(1), .steps li:nth-child(2) { margin-top: 0; }
  .series .wrap { grid-template-columns: 1fr; gap: 24px; }
  .series .mascot { max-width: 180px; }
  .features { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .app-row:nth-child(odd), .app-row:nth-child(even) { margin: 0; }
  .app-row > a { grid-template-columns: 64px 1fr; gap: 16px; padding: 18px; }
  .app-row .app-icon { width: 64px; height: 64px; font-size: 1.5rem; }
  .app-more { display: none; }
  .app-hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .app-hero .app-icon { width: 112px; height: 112px; font-size: 2.6rem; }
  .news div { grid-template-columns: 1fr; gap: 2px; }
  .info-table th, .info-table td { display: block; width: auto; border-right: 0; }
  .info-table th { border-bottom: 0; padding-bottom: 6px; }
  .info-table td { padding-top: 6px; }
  .faq .answer { padding-left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .app-row > a { transition: none; }
}
