/* ==========================================================================
   ConnTest Probe — Website
   Palette and type follow the app (mockup/styles.css) and manual.html.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #fff3e8;
  --surface: #fffaf5;
  --panel: #fffefd;
  --panel-alt: #f8eadc;
  --line: #dfc8b2;
  --line-strong: #b99470;
  --text: #2c261f;
  --muted: #6d5d4d;
  --primary: #f59e0b;
  --primary-strong: #d98200;
  --accent: #9a6500;
  --accent-bg: #fff4df;
  --danger: #ca1f27;
  --success: #16a75f;

  --font-sans: "Segoe UI", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 10px;
  --shadow-shot: 0 1px 2px rgba(99, 67, 36, .08), 0 18px 40px -12px rgba(99, 67, 36, .22);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line-strong) var(--bg);
}

body {
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--text);
  line-height: 1.8;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt" 0;
}

::selection { background: #fde2b0; color: var(--text); }

img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }

:focus-visible {
  outline: 3px solid rgba(245, 158, 11, .45);
  outline-offset: 2px;
  border-radius: 4px;
}

code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

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

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--text); color: #fff; padding: 8px 14px; border-radius: 6px;
}
.skip-link:focus { top: 12px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px;
  border: 1px solid transparent; border-radius: 6px;
  font-size: .94rem; font-weight: 700; line-height: 1.4;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-sm { padding: 6px 14px; font-size: .86rem; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }

.btn-outline { background: var(--panel); border-color: var(--line-strong); color: var(--text); }
.btn-outline:hover { background: var(--accent-bg); color: var(--text); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 250, 245, .94);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { width: 30px; height: auto; }
.brand-name, .footer-brand-name {
  font-weight: 800; letter-spacing: -0.02em; color: var(--text); line-height: 1; white-space: pre;
}
.brand-name { font-size: 1.3rem; }
.brand-accent { color: var(--primary); }

.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) {
  color: var(--muted); font-size: .88rem; font-weight: 600; text-decoration: none;
}
.nav a:not(.btn):hover { color: var(--text); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 72px 0 0;
  overflow: hidden;
}

.hero-copy { max-width: 760px; }

.hero-tag {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px;
  color: var(--muted); font-size: .9rem; font-weight: 600;
}
.beta {
  font-size: .78rem; font-weight: 700; color: var(--accent);
  background: var(--accent-bg); border: 1px solid var(--line-strong);
  border-radius: 4px; padding: 0 8px;
}

.hero-title {
  margin-top: 18px;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero-title, .download-title { word-break: keep-all; overflow-wrap: anywhere; }

.hero-lead {
  margin-top: 22px;
  max-width: 42em;
  color: var(--muted);
  font-size: 1.06rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero-facts {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 10px 32px;
  margin-top: 36px;
  color: var(--muted); font-size: .9rem;
}
.hero-facts li { display: flex; align-items: baseline; gap: 6px; }
.hero-facts strong {
  color: var(--text); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Screenshots */
.shot { margin: 0; }
.shot > img, .crop {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-shot);
}
.shot > img { object-fit: cover; object-position: top left; }
.shot figcaption { margin-top: 12px; color: var(--muted); font-size: .82rem; line-height: 1.7; }

/* Crop each capture to its content (hides overlays and the app's status bar) */
.shot-hero { margin-top: 56px; padding-bottom: 40px; }
.shot-hero > img { aspect-ratio: 1600 / 640; }

.crop { position: relative; overflow: hidden; }
.crop img { position: absolute; max-width: none; height: auto; }
/* 04-detail: modal at x160–1440, y32–868 */
.shot-detail .crop { aspect-ratio: 1280 / 836; }
.shot-detail .crop img { width: 125%; left: -12.5%; top: -3.83%; }
/* 05-trace-diff: modal content at x260–1340, y25–445 */
.shot-trace .crop { aspect-ratio: 1080 / 420; }
.shot-trace .crop img { width: 148.15%; left: -24.07%; top: -5.95%; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding: 104px 0; }
.section-alt { background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 720px; margin-bottom: 52px; }
.section-title {
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
  line-height: 1.4; font-weight: 800; letter-spacing: -0.025em;
  text-wrap: balance;
}
.section-lead { margin-top: 14px; color: var(--muted); font-size: 1.02rem; }

/* --------------------------------------------------------------------------
   Flow (ordered phases of a cutover)
   -------------------------------------------------------------------------- */
.flow {
  list-style: none;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 2px solid var(--text);
}
.flow-step {
  position: relative;
  padding: 28px 24px 0 0;
}
.flow-step + .flow-step { padding-left: 24px; border-left: 1px solid var(--line); }
.flow-step::before {
  content: "";
  position: absolute; top: -7px; left: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--text);
}
.flow-step + .flow-step::before { left: 24px; }
.flow-step:nth-child(2)::before { background: var(--primary); border-color: var(--primary); }

.flow-when { display: block; color: var(--accent); font-size: .86rem; font-weight: 700; }
.flow-step h3 { margin-top: 6px; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.flow-step p { margin-top: 10px; color: var(--muted); font-size: .93rem; line-height: 1.85; }

/* --------------------------------------------------------------------------
   Features
   -------------------------------------------------------------------------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: center;
}
.feature + .feature { margin-top: 96px; }
.feature-reverse { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature-reverse .feature-text { order: 2; }

.feature-title { font-size: 1.4rem; line-height: 1.45; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.feature-text > p { margin-top: 16px; color: var(--muted); }

.spec-list {
  display: grid; grid-template-columns: 1fr 1fr;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}
.spec-list > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.spec-list dt { font-size: .78rem; color: var(--muted); font-weight: 600; }
.spec-list dd { font-family: var(--font-mono); font-size: .9rem; font-variant-numeric: tabular-nums; }

/* Code blocks */
.code {
  margin-top: 24px;
  padding: 18px 20px;
  background: #2c261f;
  color: #f8eadc;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: .84rem;
  line-height: 1.75;
  overflow-x: auto;
  tab-size: 2;
}
.code code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; white-space: pre; }
.code .c-mute { color: #b99470; }
.code .c-strong { color: #fbbf4d; font-weight: 700; }
.code::selection, .code *::selection { background: #6d5d4d; color: #fff; }

.code-tree { margin-top: 0; font-size: .9rem; padding: 26px 28px; }

/* Extras */
.extras { margin-top: 112px; padding-top: 48px; border-top: 1px solid var(--line-strong); }
.extras-title { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; }
.extras-list {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px 48px;
  margin-top: 28px;
}
.extras-list dt { font-weight: 800; font-size: 1rem; }
.extras-list dd { margin-top: 6px; color: var(--muted); font-size: .92rem; line-height: 1.85; }

/* --------------------------------------------------------------------------
   Setup
   -------------------------------------------------------------------------- */
.setup .section-head { margin-bottom: 32px; }
.setup-steps {
  list-style: none; counter-reset: s;
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  margin-top: 24px; font-weight: 600; font-size: .95rem;
}
.setup-steps li { counter-increment: s; display: flex; align-items: center; gap: 10px; }
.setup-steps li::before {
  content: counter(s);
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: .8rem; font-weight: 800;
}
.code-csv { font-size: .8rem; }
.setup-note { margin-top: 14px; color: var(--muted); font-size: .9rem; }
.setup-note code { white-space: nowrap; }

/* --------------------------------------------------------------------------
   Comparison table
   -------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.compare { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .93rem; }
.compare th, .compare td { padding: 15px 20px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare thead th { font-size: .86rem; color: var(--muted); font-weight: 700; background: var(--panel-alt); }
.compare tbody th { font-weight: 700; white-space: nowrap; width: 15%; }
.compare td { color: var(--muted); }
.compare .is-us { background: var(--accent-bg); color: var(--text); font-weight: 700; }
.compare thead .is-us { color: var(--accent); background: #fdebc8; }

/* --------------------------------------------------------------------------
   Requirements
   -------------------------------------------------------------------------- */
.req { border-top: 2px solid var(--text); max-width: 880px; }
.req > div {
  display: grid; grid-template-columns: 9em 1fr; gap: 24px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.req dt { font-weight: 800; }
.req dd { color: var(--muted); }
.req dd code { white-space: normal; word-break: break-all; }

/* --------------------------------------------------------------------------
   Download
   -------------------------------------------------------------------------- */
.download { background: var(--text); color: #f8eadc; }
.download-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px; align-items: center;
}
.download-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; line-height: 1.4; letter-spacing: -0.025em; color: #fff; text-wrap: balance; }
.download-copy p { margin-top: 14px; color: #dfc8b2; max-width: 36em; }
.download code { background: #463c31; border-color: #6d5d4d; color: #fff; }

.download-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.download-meta { font-size: .84rem; color: #dfc8b2; font-variant-numeric: tabular-nums; }
.download-links { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 6px; font-size: .88rem; }
.download-links a { color: #fbbf4d; }
.download-links a:hover { color: #fff; }
.download :focus-visible { outline-color: #fbbf4d; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer { background: var(--surface); border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: .84rem; }
.footer-inner {
  display: grid; grid-template-columns: auto 1fr; gap: 16px 32px; align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-brand-name { font-size: 1.05rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 22px; }
.footer-links a { color: var(--muted); font-weight: 600; text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-note { grid-column: 1 / -1; color: var(--muted); max-width: 60em; line-height: 1.7; }
.copyright { grid-column: 1 / -1; color: var(--muted); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .nav a:not(.btn):not([href="manual.html"]) { display: none; }
  .flow { grid-template-columns: 1fr 1fr; border-top: 0; gap: 0; }
  .flow-step, .flow-step + .flow-step { padding: 24px 24px 28px; border-left: 0; border-top: 2px solid var(--text); }
  .flow-step::before, .flow-step + .flow-step::before { left: 24px; }
  .feature, .feature-reverse { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .feature-reverse .feature-text { order: 0; }
  .extras-list { grid-template-columns: 1fr 1fr; }
  .download-inner { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .header-inner { height: 56px; }
  .brand-name { font-size: 1.12rem; }
  .brand-logo { width: 26px; }
  .nav { gap: 14px; }
  .br-wide { display: none; }
  .hero { padding-top: 44px; }
  .hero-actions .btn { width: 100%; }
  .hero-facts { gap: 8px 22px; }
  .shot-hero { margin-top: 40px; padding-bottom: 28px; }
  .shot-hero > img { aspect-ratio: 1000 / 640; }
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 36px; }
  .flow { grid-template-columns: 1fr; }
  .feature + .feature { margin-top: 64px; }
  .extras { margin-top: 72px; }
  .extras-list { grid-template-columns: 1fr; gap: 22px; }
  .req > div { grid-template-columns: 1fr; gap: 4px; }
  .code { font-size: .78rem; padding: 16px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
