:root {
  --ink: #15283b;
  --ink-soft: #526579;
  --paper: #f7f9fc;
  --white: #ffffff;
  --line: #dde5ee;
  --navy: #142b44;
  --navy-2: #1b3a58;
  --blue: #3f7cff;
  --cyan: #54d1c2;
  --yellow: #ffc85a;
  --red: #e97671;
  --green: #39b68a;
  --shadow: 0 20px 60px rgba(26, 52, 79, .10);
  --radius: 18px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.75;
}

a { color: var(--blue); }
button, input { font: inherit; }

.page-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  color: #fff;
  background: rgba(20, 43, 68, .95);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .02em;
  text-decoration: none;
}
.brand em { color: var(--cyan); font-style: normal; font-weight: 500; }

.brand-mark {
  width: 28px;
  height: 28px;
  position: relative;
  display: inline-block;
  transform: rotate(-30deg);
}
.brand-mark span {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
}
.brand-mark span:nth-child(1) { left: 0; top: 9px; }
.brand-mark span:nth-child(2) { right: 0; top: 0; border-color: var(--yellow); }
.brand-mark span:nth-child(3) { right: 0; bottom: 0; border-color: #81a8ff; }
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  left: 7px;
  width: 14px;
  border-top: 2px solid rgba(255,255,255,.55);
  transform: rotate(-25deg);
}
.brand-mark::before { top: 8px; }
.brand-mark::after { top: 19px; transform: rotate(25deg); }

.topbar-actions { display: flex; gap: 14px; align-items: center; }
.search-box {
  width: 220px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
}
.search-box input {
  width: 100%;
  color: #fff;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
}
.search-box input::placeholder { color: rgba(255,255,255,.55); }
.menu-toggle { display: none; color: #fff; background: transparent; border: 0; cursor: pointer; font-size: 22px; }

.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  padding: 34px 20px;
  overflow-y: auto;
  background: #edf2f7;
  border-right: 1px solid var(--line);
}
.sidebar-label, .eyebrow, .card-kicker {
  color: #7890a7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}
.sidebar-label { padding: 0 14px 14px; }
.toc { display: grid; gap: 3px; }
.toc a {
  position: relative;
  display: block;
  padding: 8px 14px;
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: none;
  border-radius: 8px;
  transition: .2s ease;
}
.toc a:hover, .toc a.active { color: var(--navy); background: #fff; box-shadow: 0 5px 16px rgba(35, 63, 91, .07); }
.toc a.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; background: var(--blue); border-radius: 3px; }
.sidebar-tip {
  display: flex;
  gap: 10px;
  margin: 30px 4px;
  padding: 14px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.65;
}
.tip-icon, .callout-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
  font-weight: 800;
}

.content { min-width: 0; overflow: hidden; }
.hero {
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 470px;
  align-items: center;
  gap: 35px;
  padding: 80px clamp(32px, 7vw, 110px);
  color: #fff;
  background:
    radial-gradient(circle at 78% 34%, rgba(84, 209, 194, .18), transparent 26%),
    radial-gradient(circle at 96% 84%, rgba(63, 124, 255, .20), transparent 30%),
    var(--navy);
}
.hero h1 {
  max-width: 670px;
  margin: 17px 0 20px;
  font-size: clamp(42px, 5.2vw, 72px);
  line-height: 1.08;
  letter-spacing: -.045em;
}
.hero h1 span { color: var(--cyan); }
.hero .eyebrow { color: var(--yellow); }
.hero-lead { max-width: 540px; color: rgba(255,255,255,.72); font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.button-primary { color: var(--navy); background: var(--cyan); }
.button-primary:hover { background: #7be0d4; }
.button-quiet { color: #fff; border: 1px solid rgba(255,255,255,.20); }
.button-quiet:hover { background: rgba(255,255,255,.08); }

.hero-visual { position: relative; height: 380px; }
.orbit { position: absolute; border: 1px solid rgba(132, 185, 255, .22); border-radius: 50%; transform: rotate(-25deg); }
.orbit-one { inset: 22px -20px 50px 10px; }
.orbit-two { inset: 70px 16px 0 54px; border-color: rgba(84, 209, 194, .22); transform: rotate(40deg); }
.git-card {
  position: absolute;
  left: 50%;
  top: 102px;
  width: 260px;
  height: 177px;
  padding: 20px;
  background: linear-gradient(145deg, #294a6b, #1a304b);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.28);
  transform: translateX(-50%) rotate(-5deg);
}
.card-dots { display: flex; gap: 5px; }
.card-dots i { width: 6px; height: 6px; display: block; border-radius: 50%; background: #ff7771; }
.card-dots i:nth-child(2) { background: var(--yellow); }
.card-dots i:nth-child(3) { background: var(--cyan); }
.branch-line { position: absolute; border-left: 2px solid #81a8ff; }
.line-main { left: 62px; top: 66px; height: 69px; }
.line-feature { left: 62px; top: 92px; width: 82px; height: 36px; border-top: 2px solid var(--cyan); border-left: 0; border-radius: 0 20px 0 0; transform: skewY(-18deg); }
.node { position: absolute; width: 13px; height: 13px; border: 3px solid #81a8ff; background: var(--navy-2); border-radius: 50%; }
.node-main { left: 56px; top: 58px; }
.node-feature { left: 137px; top: 116px; border-color: var(--cyan); }
.node-merge { left: 56px; top: 128px; border-color: var(--yellow); }
.git-card small { position: absolute; bottom: 16px; right: 18px; color: rgba(255,255,255,.45); font-family: var(--mono); font-size: 10px; }
.floating-chip { position: absolute; padding: 8px 12px; color: var(--navy); background: #fff; border-radius: 9px; box-shadow: 0 12px 30px rgba(0,0,0,.18); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.chip-git { top: 58px; left: 14px; transform: rotate(-8deg); }
.chip-github { right: 12px; bottom: 50px; color: var(--navy); background: var(--yellow); transform: rotate(6deg); }

.reading-progress { height: 3px; background: #dfe8f1; }
.reading-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--blue)); }

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 90px clamp(24px, 5vw, 70px);
  border-bottom: 1px solid var(--line);
}
.section-heading { display: flex; align-items: flex-start; gap: 17px; margin-bottom: 28px; }
.section-number { color: var(--blue); font-family: var(--mono); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.section-heading .eyebrow { margin: 0 0 7px; }
h2 { margin: 0; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.2; letter-spacing: -.04em; }
h3 { margin: 0 0 9px; line-height: 1.35; }
p { margin: 0 0 14px; }
.section-lead { max-width: 680px; color: var(--ink-soft); font-size: 17px; }
.muted { color: #7b8b9c; font-size: 13px; }
code, pre { font-family: var(--mono); }
code { padding: 2px 5px; color: #315278; background: #eaf0f6; border-radius: 4px; font-size: .9em; }
pre {
  position: relative;
  margin: 14px 0 0;
  padding: 17px 52px 17px 17px;
  overflow-x: auto;
  color: #d9f6ef;
  background: #12283d;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.75;
}
pre code { padding: 0; color: inherit; background: transparent; font-size: inherit; }
.comment { color: #6f8ca7; }
.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 7px;
  color: #b5c8da;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
}
.copy:hover { color: #fff; background: rgba(255,255,255,.18); }

.compare-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 34px 0 22px; }
.info-card { display: flex; gap: 17px; padding: 26px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tile-icon { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; border-radius: 13px; font-size: 24px; font-weight: 900; }
.git-icon { background: var(--navy); }
.github-icon { background: var(--blue); }
.card-kicker { display: block; margin-bottom: 5px; }
.info-card h3 { font-size: 24px; }
.info-card p { color: var(--ink-soft); font-size: 14px; }
.analogy { display: inline-block; padding: 6px 9px; color: #526b83; background: #eef4f8; border-radius: 6px; font-size: 11px; }
.flow-strip { display: grid; grid-template-columns: 1fr 26px 1fr 26px 1fr 26px 1fr; align-items: center; padding: 17px 20px; color: var(--navy); background: #e7f6f3; border: 1px solid #c5eae3; border-radius: 12px; font-size: 12px; font-weight: 700; }
.flow-strip div { display: flex; align-items: center; gap: 8px; }
.flow-strip span { color: #168e83; font-family: var(--mono); font-size: 10px; }
.flow-strip b { color: #43b6aa; text-align: center; }
.term-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.term-grid h3 { font-size: 15px; }
.term-grid p { color: var(--ink-soft); font-size: 13px; }

.step-list { display: grid; gap: 14px; }
.step-card { display: grid; grid-template-columns: 45px 1fr; gap: 15px; padding: 22px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.step-index { width: 35px; height: 35px; display: grid; place-items: center; color: var(--blue); background: #eaf0ff; border-radius: 9px; font-family: var(--mono); font-size: 11px; font-weight: 800; }
.step-card h3 { font-size: 17px; }
.step-card p { color: var(--ink-soft); font-size: 14px; }
.step-card pre { margin-top: 10px; }
.callout { display: flex; gap: 12px; align-items: flex-start; margin-top: 24px; padding: 17px 18px; border: 1px solid; border-radius: 12px; font-size: 13px; }
.callout p { margin: 0; }
.callout-blue { color: #315b84; background: #edf5ff; border-color: #c9ddf8; }
.callout-yellow { color: #725827; background: #fff8e7; border-color: #f6dfa2; }
.callout-red { color: #7e4a4a; background: #fff1f0; border-color: #f2c4c0; }
.callout-yellow .callout-icon { color: #634b1b; background: var(--yellow); }
.callout-red .callout-icon { background: var(--red); }

.os-table-wrap { margin-top: 30px; padding: 23px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.os-table-wrap h3 { font-size: 18px; }
.os-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.os-table th, .os-table td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.os-table th { color: #7890a7; font-size: 10px; letter-spacing: .1em; }
.os-table tr:last-child td { border-bottom: 0; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.mini-grid > div { padding: 19px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.mini-command { display: inline-block; margin-bottom: 12px; color: var(--blue); font-family: var(--mono); font-size: 12px; font-weight: 800; }
.mini-grid h3 { font-size: 15px; }
.mini-grid p { color: var(--ink-soft); font-size: 12px; }
.danger-text { color: var(--red); }

.staging-diagram { display: flex; align-items: center; gap: 8px; margin: 35px 0 24px; padding: 20px; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.stage-box { min-width: 148px; padding: 17px 14px; border: 1px solid; border-radius: 12px; }
.stage-box strong, .stage-box small, .stage-box p { display: block; }
.stage-box strong { font-size: 12px; }
.stage-box small { margin: 4px 0 7px; font-family: var(--mono); font-size: 9px; opacity: .7; }
.stage-box p { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.stage-label { display: block; margin-bottom: 5px; font-family: var(--mono); font-size: 10px; font-weight: 800; }
.stage-work { background: #f4f7fb; border-color: #cfdae6; }
.stage-work .stage-label { color: #7890a7; }
.stage-ready { background: #fff8e7; border-color: #f2dda7; }
.stage-ready .stage-label { color: #c28a1c; }
.stage-saved { background: #edf5ff; border-color: #c8dcfa; }
.stage-saved .stage-label { color: var(--blue); }
.stage-cloud { background: #e7f6f3; border-color: #bfe7df; }
.stage-cloud .stage-label { color: #159486; }
.stage-arrow { min-width: 60px; text-align: center; color: #7890a7; }
.stage-arrow b { display: block; font-family: var(--mono); font-size: 9px; }
.stage-arrow span { font-size: 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 25px; }
.two-col h3 { font-size: 16px; }

.command-hero { display: grid; grid-template-columns: .8fr 1.2fr; gap: 25px; align-items: center; padding: 29px; color: #fff; background: var(--navy); border-radius: var(--radius); }
.command-hero .card-kicker { color: var(--cyan); }
.command-hero h3 { font-size: 24px; }
.command-hero p { color: rgba(255,255,255,.7); font-size: 13px; }
.command-hero pre { margin: 0; background: #0b1d2d; }
.branch-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.branch-pills span { padding: 7px 11px; color: #3b6188; background: #eaf2fa; border-radius: 6px; font-family: var(--mono); font-size: 11px; }
.inline-note { margin-top: 18px; padding: 15px 18px; color: var(--ink-soft); background: #fff; border-left: 3px solid var(--cyan); border-radius: 0 10px 10px 0; font-size: 13px; }
.sync-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.sync-card { position: relative; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.sync-icon { position: absolute; top: 20px; right: 20px; color: var(--blue); font-size: 24px; font-weight: 300; }
.sync-card h3 { font-size: 17px; }
.sync-card p { min-height: 46px; color: var(--ink-soft); font-size: 12px; }
.sync-card pre { margin-top: 12px; font-size: 10px; }
.init-box { margin-top: 20px; padding: 22px; background: #eaf6f5; border: 1px solid #c7e7e2; border-radius: 14px; }
.init-box h3 { font-size: 16px; }
.init-box pre { background: #173849; }

.pr-section { background: linear-gradient(180deg, #f7fbff 0%, #f7f9fc 100%); }
.pr-timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 32px 0; }
.pr-step { position: relative; display: flex; gap: 12px; padding: 15px 16px; border-top: 2px solid #cbd9e9; }
.pr-step:not(:last-child)::after { content: "→"; position: absolute; top: 11px; right: -7px; z-index: 1; color: var(--blue); background: var(--paper); }
.pr-step > span { color: var(--blue); font-family: var(--mono); font-size: 11px; font-weight: 800; }
.pr-step strong { font-size: 13px; }
.pr-step p { margin: 3px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.pr-instructions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 18px; }
.pr-instructions > div { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.pr-instructions .card-kicker { color: var(--blue); }
.pr-instructions ol { margin: 15px 0 0; padding-left: 22px; color: var(--ink-soft); font-size: 13px; }
.pr-example pre { margin: 0; }
.merge-note { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 15px 18px; color: #1e665c; background: #e7f6f3; border-radius: 10px; font-size: 13px; }
.merge-note span { padding: 5px 8px; color: #fff; background: #25a18f; border-radius: 5px; font-family: var(--mono); font-size: 10px; font-weight: 800; }

.conflict-box { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; margin-top: 28px; padding: 25px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.conflict-box pre { margin: 0; }
.conflict-box ol { margin: 12px 0; padding-left: 22px; color: var(--ink-soft); font-size: 13px; }
.conflict-mark { color: #ff9a72; }

.secret-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.secret-copy, .env-card { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.secret-copy h3 { font-size: 18px; }
.secret-copy p { color: var(--ink-soft); font-size: 13px; }
.env-stack { display: grid; gap: 14px; }
.env-card { padding: 19px; }
.env-card h3 { margin-bottom: 3px; font-family: var(--mono); font-size: 17px; }
.env-card p { color: var(--ink-soft); font-size: 12px; }
.env-card pre { margin-top: 9px; padding: 11px; font-size: 10px; }
.env-private { border-left: 4px solid var(--red); }
.env-public { border-left: 4px solid var(--green); }
.env-tag { display: inline-block; margin-bottom: 7px; color: var(--red); font-family: var(--mono); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.env-public .env-tag { color: var(--green); }

.danger-section { background: #fffafa; }
.danger-banner { display: flex; gap: 15px; margin: 27px 0 18px; padding: 19px 22px; color: #7e4a4a; background: #fff0ef; border: 1px solid #f2c5c0; border-radius: 13px; }
.danger-banner > span { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--red); border-radius: 50%; font-weight: 900; }
.danger-banner strong { color: #a34d49; }
.danger-banner p { margin: 4px 0 0; font-size: 13px; }
.danger-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.danger-table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 12px; }
.danger-table th, .danger-table td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.danger-table th { color: #9d7774; background: #fff7f6; font-size: 10px; letter-spacing: .1em; }
.danger-table tr:last-child td { border-bottom: 0; }
.danger-table td:first-child { white-space: nowrap; }
.check-command { margin-top: 22px; padding: 22px; background: var(--navy); border-radius: 13px; }
.check-command .card-kicker { color: var(--cyan); }
.check-command h3 { color: #fff; font-size: 17px; }
.check-command p { margin: 11px 0 0; color: rgba(255,255,255,.7); font-size: 12px; }

.screenshot-section { background: #f1f7fb; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 30px; }
.shot { margin: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 9px 25px rgba(25,52,80,.06); }
.shot-wide { grid-column: span 2; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: #dfe8f1; }
.shot-wide img { aspect-ratio: 2 / 1; }
.shot figcaption { display: flex; flex-direction: column; gap: 1px; padding: 12px 15px 14px; }
.shot figcaption strong { font-size: 13px; }
.shot figcaption span { color: var(--ink-soft); font-size: 11px; }

.cheat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; }
.cheat-grid > div { display: flex; flex-direction: column; gap: 4px; padding: 14px 15px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.cheat-grid code { padding: 0; color: var(--navy); background: transparent; font-size: 11px; }
.cheat-grid span { color: var(--ink-soft); font-size: 11px; }
.final-note { display: flex; gap: 14px; align-items: center; margin-top: 26px; padding: 20px; background: #e7f6f3; border-radius: 13px; }
.final-mark { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--green); border-radius: 50%; font-weight: 900; }
.final-note h3 { font-size: 16px; }
.final-note p { margin: 0; color: var(--ink-soft); font-size: 13px; }

.footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; max-width: 1120px; margin: 0 auto; padding: 38px clamp(24px, 5vw, 70px); color: var(--ink-soft); font-size: 12px; }
.footer > div { display: flex; align-items: center; gap: 9px; color: var(--navy); }
.footer .brand-mark { transform: scale(.75) rotate(-30deg); transform-origin: left center; margin-right: -4px; }
.footer p { margin: 0; }
.footer a { text-decoration: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 30;
  padding: 10px 16px;
  color: #fff;
  background: var(--navy);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.no-results { display: none; padding: 40px; text-align: center; color: var(--ink-soft); }
.section.hidden { display: none; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 210px minmax(0, 1fr); }
  .hero { grid-template-columns: 1fr 330px; padding-left: 55px; padding-right: 55px; }
  .hero-visual { transform: scale(.8); transform-origin: center; }
  .staging-diagram { padding: 14px; }
}

@media (max-width: 820px) {
  .topbar { padding: 0 20px; }
  .search-box { width: 180px; }
  .layout { display: block; }
  .sidebar { position: fixed; left: 0; top: 72px; z-index: 15; width: 280px; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 12px 0 30px rgba(17,42,67,.12); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 68px 28px 50px; }
  .hero-visual { height: 300px; transform: scale(.7); margin: -10px auto -30px; width: 430px; max-width: 100%; }
  .section { padding: 64px 28px; }
  .term-grid, .sync-grid { grid-template-columns: 1fr; }
  .compare-grid, .secret-grid, .two-col, .conflict-box, .pr-instructions { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: 1fr; }
  .flow-strip { grid-template-columns: 1fr; gap: 8px; }
  .flow-strip b { display: none; }
  .pr-timeline { grid-template-columns: 1fr 1fr; gap: 12px; }
  .pr-step { border: 0; background: #fff; border-radius: 9px; }
  .pr-step:not(:last-child)::after { display: none; }
  .gallery { grid-template-columns: 1fr; }
  .shot-wide { grid-column: auto; }
  .shot-wide img, .shot img { aspect-ratio: 16 / 10; }
  .cheat-grid { grid-template-columns: 1fr 1fr; }
  .footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 500px) {
  .brand em { display: none; }
  .search-box { width: 145px; }
  .hero h1 { font-size: 43px; }
  .hero-lead { font-size: 15px; }
  .hero-visual { transform: scale(.58); margin-left: -40px; margin-right: -40px; }
  .section { padding-left: 20px; padding-right: 20px; }
  .section-heading { gap: 10px; }
  h2 { font-size: 28px; }
  .section-lead { font-size: 15px; }
  .staging-diagram { margin-left: -20px; margin-right: -20px; border-radius: 0; }
  .cheat-grid { grid-template-columns: 1fr; }
  .os-table-wrap { padding: 15px; margin-left: -5px; margin-right: -5px; }
  .os-table { min-width: 600px; }
}

