:root {
  --bg: #f8f6f1;
  --surface: #ffffff;
  --surface-alt: #f1ede4;
  --ink: #191816;
  --ink-soft: #545049;
  --ink-muted: #767067;
  --border: #e4dfd5;
  --border-strong: #cfc8ba;
  --accent: #c83e2b;
  --accent-hover: #a63020;
  --accent-soft: #fbece9;
  --ok: #1f6a4a;
  --ok-soft: #e8f4ee;
  --warn: #9c6212;
  --warn-soft: #faf1e1;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(25, 24, 22, 0.05);
  --shadow-md: 0 14px 36px rgba(25, 24, 22, 0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none !important;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-alt);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(248, 246, 241, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  text-decoration: none !important;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
}

.nav-links a {
  color: var(--ink-soft);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

/* ---------- Landing Hero ---------- */
.hero {
  padding: 68px 0 60px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 44px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.eyebrow-rule {
  width: 18px;
  height: 2px;
  background: var(--accent);
}

.hero h1 {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: clamp(34px, 4.2vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.hero-lead {
  margin: 0 0 28px;
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.hero-stat strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.hero-stat span {
  font-size: 12px;
  color: var(--ink-muted);
}

/* Hero visual proof card */
.proof-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-md);
}

.proof-card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.pill-pass {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
}

.hero-compare-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1440 / 780;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #e9e6de;
}

.hero-compare-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-compare-after {
  clip-path: inset(0 0 0 50%);
}

.hero-compare-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.hero-compare-tag {
  position: absolute;
  bottom: 10px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(25, 24, 22, 0.78);
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.hero-compare-tag.left {
  left: 10px;
}

.hero-compare-tag.right {
  right: 10px;
  background: rgba(200, 62, 43, 0.9);
}

.proof-card-foot {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ---------- Landing Sections ---------- */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  max-width: 62ch;
  margin-bottom: 30px;
}

.section-header h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.section-header p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
}

.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 16.5px;
}

.card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.cta-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cta-strip h3 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 22px;
}

.cta-strip p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  font-size: 13px;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- Inspector Workspace ---------- */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.app-bar-inner {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.back-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 10px;
  border-radius: 6px;
}

.back-link:hover {
  background: var(--surface-alt);
  color: var(--ink);
  text-decoration: none;
}

.app-tabs {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  overflow-x: auto;
}

.app-tab {
  padding: 6px 13px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none !important;
  white-space: nowrap;
}

.app-tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.workspace {
  padding: 24px 0 56px;
}

/* Tab 1: Visual Diff Grid */
.diff-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.seg-btn {
  padding: 6px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.seg-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.compare-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1440 / 780;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #e9e5dc;
  user-select: none;
  cursor: ew-resize;
}

.compare-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}

#img-render {
  clip-path: inset(0 0 0 50%);
}

#img-diff {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--accent);
  pointer-events: none;
  z-index: 4;
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.stage-badge {
  position: absolute;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  z-index: 3;
  pointer-events: none;
}

.stage-badge.left {
  left: 12px;
  background: rgba(25, 24, 22, 0.78);
  color: #ffffff;
}

.stage-badge.right {
  right: 12px;
  background: rgba(200, 62, 43, 0.9);
  color: #ffffff;
}

.slider-bar {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.slider-bar input[type="range"] {
  flex: 1;
  min-width: 140px;
  accent-color: var(--accent);
}

/* QA Scorecard sidebar */
.qa-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.qa-sub {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.qa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.qa-kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}

.qa-kpi span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qa-kpi strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--ink);
}

.qa-kpi strong.pass {
  color: var(--ok);
}

.qa-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.qa-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.badge-ok {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-warn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Tab 2: Live HTML & Mobile */
.responsive-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 390px;
  gap: 22px;
  align-items: start;
}

.iframe-shell {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.iframe-shell iframe {
  display: block;
  width: 100%;
  height: 540px;
  border: 0;
}

.mobile-frame {
  width: 345px;
  max-width: 100%;
  margin: 0 auto;
  border: 8px solid #1d1c1a;
  border-radius: 26px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.mobile-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* Tab 3: Source Code */
.code-card {
  background: #1b1a18;
  color: #ece9e2;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #302d28;
}

.code-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: #131210;
  border-bottom: 1px solid #302d28;
}

.code-tabs {
  display: inline-flex;
  gap: 6px;
}

.code-tab {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #a8a296;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
}

.code-tab.active {
  background: #2b2924;
  border-color: #464139;
  color: #ffffff;
}

.code-card pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  max-height: 560px;
}

/* Tab 4: Local Mockup Tester */
.upload-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  background: var(--bg);
  margin: 14px 0;
}

.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.guide-preview {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-alt);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.guide-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.guide-line {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1.5px dashed rgba(200, 62, 43, 0.85);
}

.guide-line span {
  position: absolute;
  top: 8px;
  left: 6px;
  background: rgba(200, 62, 43, 0.9);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .hero-grid,
  .diff-layout,
  .responsive-grid,
  .upload-grid,
  .cards-3 {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
  .app-bar-inner {
    height: auto;
    padding: 12px 0;
    flex-wrap: wrap;
  }
}
