/* ゼロから作るFTQCシミュレータ — landing page
   参考: forest1040.github.io/google-verifiable-qcc-guide のデザイン系統を踏襲 */

:root {
  color-scheme: light;
  --ink: #183447;
  --blue: #0c5e87;
  --muted: #526879;
  --line: #cbdfe9;
  --paper: #f4faff;
  --accent: #94d8f4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 30px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  line-height: 1.85;
}
a { color: inherit; text-underline-offset: 5px; }
a:focus-visible { outline: 3px solid #08618c; outline-offset: 6px; }
.wrap { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.skip { position: absolute; top: -100px; left: 20px; background: white; padding: 8px; z-index: 10; }
.skip:focus { top: 8px; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 96px; border-bottom: 1px solid var(--line); gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .12em; font-weight: 700; text-decoration: none; }
.mark {
  display: grid; place-items: center; background: var(--accent); color: var(--ink);
  width: 32px; height: 32px; border-radius: 50%; font: 23px Georgia, serif;
}
nav { display: flex; gap: 28px; font-size: 13px; }
nav a { text-decoration: none; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 60px; align-items: center; padding-block: 88px 96px; }
.eyebrow { font-size: 10px; letter-spacing: .14em; font-weight: 700; color: var(--blue); margin: 0 0 24px; }
h1 { font-size: clamp(34px, 4.2vw, 54px); line-height: 1.4; letter-spacing: -.04em; margin: 0 0 24px; }
h1 span { color: var(--blue); }
h1 .edition { display: block; font-size: .55em; margin-top: .35em; }
.subtitle { font-size: 19px; line-height: 1.8; margin: 0 0 24px; font-weight: 600; }
.intro { font-size: 14px; color: var(--muted); line-height: 2.1; margin: 0 0 30px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 13px 22px; border: 1px solid var(--blue); border-radius: 3px;
  text-decoration: none; font-size: 14px; font-weight: 600; transition: background .15s;
}
.primary { background: var(--accent); color: var(--ink); }
.primary:hover { background: #75c9ed; }
.secondary:hover { background: #d8effb; }
.file-info { font-size: 11px; color: var(--muted); line-height: 1.9; margin: 18px 0 0; }

/* Book mockup */
.book-area { padding: 28px 5px 0 20px; }
.book {
  position: relative; min-height: 460px; padding: 34px 30px 32px 38px;
  color: #183447; background: #b9e8fa; border-radius: 2px 7px 7px 2px;
  box-shadow: 12px 13px 0 -5px #d3e5ef, 20px 28px 45px -16px #193f5938;
  transform: rotate(3deg); border-left: 8px solid #55aed5; overflow: hidden;
}
.book-top { font-size: 9px; letter-spacing: .13em; line-height: 1.8; color: #365a70; }
.book-title { font: clamp(25px, 2.9vw, 36px)/1.2 Georgia, serif; margin-top: 28px; letter-spacing: -.02em; }
.lattice { position: relative; height: 128px; margin: 30px auto 24px; width: 118px; }
.seam { position: absolute; left: -10px; right: -10px; top: 50%; height: 1px; background: var(--blue); opacity: .85; }
.seam:before, .seam:after { content: ""; position: absolute; top: -2.5px; width: 6px; height: 6px; background: var(--blue); border-radius: 50%; }
.seam:before { left: -2px; }
.seam:after { right: -2px; }
.q { position: absolute; width: 16px; height: 16px; }
.lattice .q:nth-of-type(1) { left: 0; top: 0; }
.lattice .q:nth-of-type(2) { left: 51px; top: 0; }
.lattice .q:nth-of-type(3) { right: 0; top: 0; }
.lattice .q:nth-of-type(4) { left: 0; top: 56px; }
.lattice .q:nth-of-type(5) { left: 51px; top: 56px; }
.lattice .q:nth-of-type(6) { right: 0; top: 56px; }
.lattice .q:nth-of-type(7) { left: 0; bottom: 0; }
.lattice .q:nth-of-type(8) { left: 51px; bottom: 0; }
.lattice .q:nth-of-type(9) { right: 0; bottom: 0; }
.q.d { background: var(--blue); border-radius: 2px; }
.q.s { width: 12px; height: 12px; background: transparent; border: 1px solid #3185ac; transform: rotate(45deg); }
.q.s:nth-of-type(2) { left: 53px; top: 2px; }
.q.s:nth-of-type(4) { left: 2px; top: 58px; }
.q.s:nth-of-type(6) { right: 2px; top: 58px; }
.q.s:nth-of-type(8) { left: 53px; bottom: 2px; }
.book-bottom { font-size: 15px; font-weight: 600; }
.book-bottom span { display: block; font-size: 10px; letter-spacing: .12em; color: #365a70; margin-top: 8px; }
.book-caption { text-align: center; font-size: 9px; letter-spacing: .16em; color: var(--muted); margin: 35px 0 0; }

/* Stages */
.stages { padding-block: 64px 70px; background: #e3f3fc; border-block: 1px solid var(--line); }
h2 { font-size: 27px; line-height: 1.6; letter-spacing: -.03em; margin: 0 0 16px; }
.section-heading .eyebrow { margin-bottom: 13px; }
.section-heading > p:last-child { font-size: 14px; color: var(--muted); margin: 0; }
.stage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin-top: 40px; }
.stage-grid article { border-top: 1px solid #accfdf; padding-top: 20px; }
.number { font-size: 10px; letter-spacing: .12em; color: var(--blue); font-weight: 600; }
.stage-grid h3 { font: 32px Georgia, serif; margin: 14px 0 10px; }
.stage-grid p { font-size: 13px; color: var(--muted); line-height: 2; }
.stage-grid .task { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 10px; }

/* Contents */
.contents { display: grid; grid-template-columns: .85fr 1.4fr; gap: 95px; padding-block: 88px; }
.contents-intro { position: sticky; top: 30px; align-self: start; }
.contents-intro > p:not(.eyebrow) { font-size: 14px; color: var(--muted); }
.chapters { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.chapters li { border-bottom: 1px solid var(--line); }
.chapters a { display: flex; align-items: center; gap: 20px; text-decoration: none; padding: 17px 14px; }
.chapters a:hover { background: #e8f5fc; }
.chapters a:focus-visible { outline-offset: -3px; }
.chapters a > div { min-width: 0; }
.chapters a:hover h3 { text-decoration: underline; }
.chapters a > span { font: 15px Georgia, serif; color: var(--muted); min-width: 34px; flex-shrink: 0; }
.chapters h3 { font-size: 14px; margin: 0; font-weight: 600; }
.chapters p { font-size: 11px; margin: 2px 0 0; color: var(--muted); }
.chapters small { margin-left: auto; white-space: nowrap; font-size: 11px; color: var(--muted); }
.chapters .part-row { background: #e8f5fc; }
.chapters .part-row > a { padding: 12px 14px; gap: 14px; }
.chapters .part-row > a > span { font-size: 11px; letter-spacing: .1em; color: var(--blue); font-family: inherit; font-weight: 700; min-width: 0; }
.chapters .part-row h3 { font-size: 12px; letter-spacing: .02em; }

/* Run */
.run { display: grid; grid-template-columns: .85fr 1.4fr; gap: 95px; padding-block: 24px 88px; }
.run > div:first-child > p:not(.eyebrow) { font-size: 14px; color: var(--muted); }
.terminal { min-width: 0; background: #173f59; color: #e7f6ff; border-radius: 6px; padding: 22px 24px 18px; box-shadow: 8px 9px 0 -4px #d3e5ef; }
.terminal b { display: block; font-size: 10px; letter-spacing: .14em; color: var(--accent); margin-bottom: 14px; }
.terminal pre { margin: 0; overflow-x: auto; }
.terminal code { font: 13px/2.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #e7f6ff; }
.terminal > code { font: 13px/2.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.terminal small { display: block; font-size: 11px; color: #b4d4e6; margin-top: 12px; line-height: 1.9; }
.terminal small code { font-size: 11px; line-height: 1.9; color: #94d8f4; }

/* Notes */
.notes { display: grid; grid-template-columns: .85fr 1.4fr; gap: 95px; padding-block: 40px; border-top: 1px solid var(--line); }
.notes .eyebrow { margin-bottom: 12px; }
.notes h2 { font-size: 20px; }
.notes p:not(.eyebrow) { font-size: 12px; color: var(--muted); margin-top: 0; line-height: 2; }

/* Closing & footer */
.closing {
  background: #e3f3fc; padding: 36px 40px; margin-block: 25px 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 25px; border-radius: 4px;
}
.closing .eyebrow { margin-bottom: 8px; }
.closing h2 { font-size: 24px; margin-bottom: 8px; }
.closing p:last-child { font-size: 13px; color: var(--muted); margin: 0; }
footer { display: flex; justify-content: space-between; gap: 20px; padding-block: 25px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }

@media (max-width: 850px) {
  .wrap { width: calc(100% - 48px); }
  .hero { gap: 30px; padding-block: 55px; }
  .book-area { padding-left: 0; }
  .book { min-height: 420px; padding: 25px 20px; }
  .book-title { font-size: 28px; }
  .contents, .notes, .run { grid-template-columns: 1fr; gap: 28px; }
  .contents-intro { position: static; }
  .stage-grid { gap: 24px; }
}

@media (max-width: 620px) {
  .wrap { width: calc(100% - 36px); }
  .site-header { min-height: 76px; flex-wrap: wrap; gap: 8px 20px; padding-block: 14px; }
  .brand { font-size: 9px; gap: 8px; letter-spacing: .06em; }
  .mark { width: 26px; height: 26px; font-size: 19px; }
  nav { gap: 14px; font-size: 11px; }
  nav a { display: inline-flex; align-items: center; min-height: 32px; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding-block: 42px 52px; }
  .eyebrow { font-size: 8px; letter-spacing: .08em; }
  h1 { font-size: 38px; }
  .subtitle { font-size: 17px; }
  .intro { font-size: 13px; }
  .subtitle br, .intro br { display: none; }
  .book-area { max-width: 290px; margin: auto; width: 100%; padding: 0 10px; }
  .book { min-height: 390px; padding: 25px; transform: rotate(1.5deg); }
  .book-title { font-size: 29px; }
  .book-top { font-size: 8px; }
  .lattice { margin-block: 22px 18px; }
  .book-caption { font-size: 8px; }
  .stages { padding-block: 42px; }
  .stage-grid { grid-template-columns: 1fr; gap: 26px; margin-top: 28px; }
  .stage-grid h3 { font-size: 28px; margin-block: 7px; }
  .contents { grid-template-columns: 1fr; gap: 25px; padding-block: 48px; }
  .contents h2 br { display: none; }
  .run { grid-template-columns: 1fr; gap: 25px; padding-block: 10px 48px; }
  .notes { grid-template-columns: 1fr; gap: 10px; padding-block: 30px; }
  .chapters a { gap: 14px; }
  .chapters h3 { font-size: 13px; }
  .chapters p { font-size: 10px; }
  h2 { font-size: 24px; }
  .closing { flex-direction: column; align-items: flex-start; padding: 25px; margin-block: 15px 40px; }
  .closing h2 { font-size: 20px; }
  footer { flex-direction: column; gap: 7px; font-size: 10px; }
}

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