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

:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: #EEF2FF;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text: #1E293B;
  --muted: #64748B;
  --essential: #059669;
  --essential-bg: #D1FAE5;
  --recommended: #2563EB;
  --recommended-bg: #DBEAFE;
  --optional: #D97706;
  --optional-bg: #FEF3C7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.hero {
  background: linear-gradient(135deg, #312E81 0%, #4F46E5 55%, #7C3AED 100%);
  color: white;
  padding: 5.5rem 0 5rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.95);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255,255,255,0.25);
}

.hero h1 {
  font-size: clamp(1.85rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.13;
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.82);
  max-width: 580px;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  background: white;
  color: var(--primary);
  padding: 0.875rem 2rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.975rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.btn-hero:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.tool-section { padding: 3rem 0 5rem; }

.step-indicator { display: flex; align-items: center; justify-content: center; margin-bottom: 3rem; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; }

.step-number {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
}
.step-item.active .step-number { background: var(--primary); color: white; box-shadow: 0 0 0 4px var(--primary-light); }
.step-item.completed .step-number { background: #10B981; color: white; }

.step-label { font-size: 0.72rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.step-item.active .step-label { color: var(--primary); }
.step-item.completed .step-label { color: #10B981; }

.step-connector { height: 2px; width: 5rem; background: var(--border); margin-bottom: 1.5rem; transition: background 0.25s; }
.step-connector.done { background: #10B981; }

.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeUp 0.3s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-panel h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.5rem; letter-spacing: -0.025em; }
.step-desc { color: var(--muted); margin-bottom: 2rem; font-size: 0.925rem; }
.step-actions { margin-top: 2rem; }
.step-actions.split { display: flex; justify-content: space-between; align-items: center; }

.business-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 0.875rem; margin-bottom: 0.5rem; }

.business-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.375rem 1.125rem 1.25rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  font-family: inherit;
  color: var(--text);
}
.business-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.business-card.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 1px var(--primary); }

.bc-emoji { font-size: 2.1rem; margin-bottom: 0.5rem; line-height: 1; }
.bc-name { font-weight: 700; font-size: 0.875rem; margin-bottom: 0.25rem; }
.bc-desc { font-size: 0.72rem; color: var(--muted); line-height: 1.45; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 0.75rem; margin-bottom: 0.5rem; }

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.feature-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.feature-item.selected { border-color: var(--primary); background: var(--primary-light); }

.feature-cb {
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-size: 0.7rem;
  color: transparent;
}
.feature-item.selected .feature-cb { background: var(--primary); border-color: var(--primary); color: white; }

.fi-name { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.15rem; }
.fi-desc { font-size: 0.72rem; color: var(--muted); line-height: 1.4; }

.results-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap; }
.legend { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; font-size: 0.8rem; }
.legend-text { color: var(--muted); margin-right: 0.75rem; }

.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.67rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.badge.essential { background: var(--essential-bg); color: var(--essential); }
.badge.recommended { background: var(--recommended-bg); color: var(--recommended); }
.badge.optional { background: var(--optional-bg); color: var(--optional); }

.table-wrapper { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.schema-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.875rem; }

.schema-table th {
  background: #F1F5F9;
  padding: 0.8rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.schema-table td { padding: 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.schema-table tr:last-child td { border-bottom: none; }
.schema-table tbody tr:hover td { background: #F8FAFC; }

.schema-name { font-weight: 700; font-size: 0.925rem; display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.4rem; }
.s-emoji { font-size: 1rem; flex-shrink: 0; }
.page-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.page-tag { display: inline-block; background: #F1F5F9; color: var(--muted); font-size: 0.68rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 4px; white-space: nowrap; }
.page-type-label { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.badge.goal-rich-snippet    { background: #DCFCE7; color: #15803D; }
.badge.goal-knowledge-graph { background: #F3E8FF; color: #7E22CE; }
.badge.goal-nice-to-have    { background: #F1F5F9; color: #475569; }

.filter-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-right: 0.25rem; }
.filter-btn { padding: 0.3rem 0.85rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; transition: all 0.15s; font-family: inherit; }
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active                      { background: var(--primary);  border-color: var(--primary);  color: #fff; }
.filter-btn.active[data-goal="rich-snippet"]    { background: #15803D; border-color: #15803D; }
.filter-btn.active[data-goal="knowledge-graph"] { background: #7E22CE; border-color: #7E22CE; }
.filter-btn.active[data-goal="nice-to-have"]    { background: #475569; border-color: #475569; }

.schema-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; }
.schema-chip-wrap { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.schema-chip { display: inline-flex; align-items: center; background: var(--primary-light); color: var(--primary); border: 1px solid #C7D2FE; font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 6px; cursor: pointer; white-space: nowrap; transition: background 0.15s; }
.schema-chip:hover { background: #E0E7FF; }
.col-desc { min-width: 220px; }
.col-actions { min-width: 130px; }
.action-btns { display: flex; flex-direction: column; gap: 0.45rem; }
.action-group { display: flex; flex-direction: column; gap: 0.45rem; }

.btn-sm { display: block; padding: 0.4rem 0.75rem; font-size: 0.775rem; border-radius: 6px; font-weight: 600; cursor: pointer; transition: all 0.15s; text-align: center; text-decoration: none; font-family: inherit; white-space: nowrap; }
.btn-docs { background: #F1F5F9; color: var(--text); border: 1px solid var(--border); }
.btn-docs:hover { background: var(--border); }
.btn-example { background: var(--primary); color: white; border: none; }
.btn-example:hover { background: var(--primary-dark); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 740px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.22s;
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }

.modal-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.3rem; letter-spacing: -0.02em; }
.modal-docs-link { font-size: 0.8rem; color: var(--primary); text-decoration: none; font-weight: 500; }
.modal-docs-link:hover { text-decoration: underline; }
.modal-close { background: none; border: none; font-size: 1.35rem; cursor: pointer; color: var(--muted); padding: 0.15rem 0.4rem; line-height: 1; border-radius: 4px; transition: all 0.15s; flex-shrink: 0; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { overflow-y: auto; padding: 1.5rem; }
.code-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.code-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.btn-copy { padding: 0.4rem 0.9rem; border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: all 0.15s; font-family: inherit; }
.btn-copy:hover { background: var(--primary); color: white; border-color: var(--primary); }
.btn-copy.copied { background: #10B981; color: white; border-color: #10B981; }

.code-block {
  background: #0F172A;
  color: #CBD5E1;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  font-family: "Cascadia Code", "Fira Code", "SF Mono", Consolas, Monaco, monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

.copy-hint { margin-top: 0.875rem; font-size: 0.78rem; color: var(--muted); line-height: 1.6; }
.copy-hint code { background: #F1F5F9; padding: 0.1rem 0.35rem; border-radius: 3px; font-size: 0.75rem; color: var(--text); border: 1px solid var(--border); font-family: inherit; }

.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 2rem 0; text-align: center; font-size: 0.82rem; color: var(--muted); }
.site-footer a { color: var(--primary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Static Pages (About, Privacy Policy) ──────────────────── */
.static-section { padding: 3rem 0 5.5rem; }

.static-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 2rem;
}
.static-back:hover { text-decoration: underline; }

.static-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.static-card h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.static-meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 2rem; }
.static-intro { display: flex; align-items: flex-start; gap: 1.5rem; margin-bottom: 2.25rem; flex-wrap: wrap; }
.static-intro img { width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }

.static-card section { margin-bottom: 2rem; }
.static-card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.7rem; color: var(--text); }
.static-card p { color: #374151; font-size: 0.9375rem; line-height: 1.75; margin-bottom: 0.8rem; }
.static-card p:last-child { margin-bottom: 0; }
.static-card ul { color: #374151; font-size: 0.9375rem; line-height: 1.75; padding-left: 1.4rem; margin-bottom: 0.8rem; }
.static-card ul li { margin-bottom: 0.2rem; }
.static-card a { color: var(--primary); text-decoration: none; font-weight: 500; }
.static-card a:hover { text-decoration: underline; }
.static-card strong { color: var(--text); }
.social-links { display: flex; flex-wrap: wrap; gap: 1rem; }

.footer-links { margin-top: 0.5rem; }
.footer-links a { color: var(--primary); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* ── Detail Page ────────────────────────────────────────────── */
.detail-section { padding: 2.5rem 0 6rem; min-height: 70vh; animation: fadeUp 0.25s ease; }

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2.25rem;
  font-family: inherit;
}
.detail-back:hover { border-color: var(--primary); color: var(--primary); }

.detail-header { margin-bottom: 2rem; }
.detail-for {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.detail-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
  line-height: 1.15;
}
.detail-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.85rem; }
.detail-badges .badge { font-size: 0.75rem; padding: 0.3rem 0.75rem; }

.detail-docs-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.detail-docs-link {
  font-size: 0.82rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.detail-docs-link:hover { text-decoration: underline; }

.detail-code-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

/* ── Hierarchy Tree ─────────────────────────────────────────── */
.detail-hierarchy { margin-bottom: 2rem; }
.detail-hierarchy-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.schema-tree { display: inline-flex; flex-direction: column; align-items: flex-start; min-width: 260px; max-width: 380px; }

.tree-node {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  width: 100%;
}
.tree-emoji { font-size: 1.2rem; flex-shrink: 0; line-height: 1; }
.tree-node-body { display: flex; flex-direction: column; gap: 0.2rem; }
.tree-node-name { font-weight: 700; font-size: 0.875rem; color: var(--text); }

.tree-arrow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 1.75rem;
}
.tree-vline { width: 2px; height: 7px; background: var(--border); }
.tree-rel-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid #C7D2FE;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin: 2px 0;
}

@media (max-width: 640px) {
  .detail-title { font-size: 1.6rem; }
  .detail-code-wrap { padding: 1rem; }
  .schema-tree { max-width: 100%; min-width: 0; width: 100%; }
}

@media (max-width: 640px) {
  .hero { padding: 3.5rem 0 3rem; }
  .business-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
  .results-header { flex-direction: column; gap: 0.75rem; }
  .step-connector { width: 2.5rem; }
  .step-label { display: none; }
  .col-desc, .schema-table th.col-desc { display: none; }
  .step-actions.split { flex-direction: column-reverse; gap: 0.75rem; align-items: stretch; }
}

/* Layer badges */
.schema-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; align-items: center; }

.layer-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.layer-site       { background: #F3E8FF; color: #6D28D9; }
.layer-page       { background: #FEF9C3; color: #854D0E; }
.layer-entity     { background: #DBEAFE; color: #1D4ED8; }
.layer-author     { background: #D1FAE5; color: #065F46; }
.layer-supporting { background: #F1F5F9; color: #475569; }

.legend-section { margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.legend-section-label { font-size: 0.7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 0.25rem; min-width: 60px; }

.legend code { background: #F1F5F9; padding: 0.05rem 0.3rem; border-radius: 3px; font-size: 0.7rem; color: var(--text); border: 1px solid var(--border); font-family: inherit; }
