/* Polygork — light low-poly design system (original code, layout-matched to reference) */
:root {
  --bg: #f7f8fa;
  --bg-2: #ffffff;
  --bg-3: #f0f2f5;
  --line: #e3e7ec;
  --text: #0f172a;
  --muted: #5b6572;
  --accent: #2563eb;
  --accent-2: #10b981;
  --accent-3: #3b82f6;
  --danger: #ef4444;
  --radius: 12px;
  --maxw: 1160px;
  --font: "Inter", "SF Pro Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, .06), 0 18px 44px rgba(16, 24, 40, .10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg, canvas { display: block; max-width: 100%; }
code { background: var(--bg-3); border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; font-size: .9em; color: var(--accent); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--text); letter-spacing: -0.01em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #7c3aed); display: grid; place-items: center; font-size: 14px; color: #fff; font-weight: 800; }
.nav-links { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--text); font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 999px; }
.nav-links a:hover { background: var(--bg-3); text-decoration: none; }
.nav-pill { border: 1px solid var(--line); background: var(--bg-2); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--text) !important; }
.nav-pill:hover { border-color: #c9d2dd; text-decoration: none; }
.nav-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-3); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: 13px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff !important;
  font-weight: 700; font-size: 14px; padding: 10px 18px;
  border-radius: 999px; border: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(37, 99, 235, .25); text-decoration: none; }
.btn.dark { background: var(--text); }
.btn.dark:hover { box-shadow: 0 8px 20px rgba(15, 23, 42, .25); }
.btn.ghost { background: transparent; color: var(--text) !important; border: 1px solid var(--line); }
.btn.ghost:hover { border-color: #c9d2dd; box-shadow: none; }
.btn.small { padding: 7px 14px; font-size: 13px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 30px; }
.hero-bg { position: absolute; inset: 0; z-index: 0; background: radial-gradient(120% 140% at 85% 10%, #e6f0ff 0%, #f7f8fa 55%, #f2f6fc 100%); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 4.6vw, 56px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.08; color: var(--text); }
.hero h1 .accent { color: #4b5563; }
.hero p.sub { color: var(--muted); font-size: 17px; max-width: 540px; margin: 18px 0 26px; }
.hero p.sub b { color: var(--text); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.compat { margin-top: 22px; color: var(--muted); font-size: 13.5px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.compat b { color: var(--text); font-weight: 700; }
.compat .sep { color: #c9d2dd; }

.hero-stage {
  position: relative; z-index: 1; aspect-ratio: 1/1; max-width: 520px; width: 100%;
  margin-left: auto; border-radius: 20px; overflow: hidden;
  background: radial-gradient(120% 120% at 50% 30%, #ffffff 0%, #eef3fb 60%, #e4ecf7 100%);
  box-shadow: var(--shadow-lg);
}
.hero-stage canvas { width: 100%; height: 100%; }

/* floating tool UI (mirrors reference interaction) */
.floating-tools { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); z-index: 3; display: flex; flex-direction: column; gap: 10px; }
.tool-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--muted); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 24, 40, .08); transition: all .12s ease;
}
.tool-btn:hover { color: var(--text); }
.tool-btn.active { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.tool-btn svg { width: 19px; height: 19px; }

.floating-swatches {
  position: absolute; right: 16px; bottom: 18px; z-index: 3;
  display: flex; gap: 10px; padding: 12px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 4px 12px rgba(16, 24, 40, .08);
}
.swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all .12s ease; }
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: #0f172a; box-shadow: 0 0 0 2px #fff inset; }
.swatch.split { background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); }

.tool-panel {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 3;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 4px 12px rgba(16, 24, 40, .08); padding: 14px 18px; width: 240px;
}
.tool-panel h4 { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.tool-panel .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.tool-panel input[type=range] { width: 100%; accent-color: var(--accent); }
.tool-panel .switch { position: relative; width: 38px; height: 22px; flex: none; }
.tool-panel .switch input { opacity: 0; width: 0; height: 0; }
.tool-panel .slider { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .15s; cursor: pointer; }
.tool-panel .slider::before { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.tool-panel .switch input:checked + .slider { background: var(--accent); }
.tool-panel .switch input:checked + .slider::before { transform: translateX(16px); }

/* hero divider */
.hero-divider { text-align: center; padding: 26px 0 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.hero-divider .arrow { display: block; font-size: 18px; margin-top: 2px; color: #c9d2dd; }

/* ---------- sections ---------- */
section { padding: 60px 0; }
.sec-label { color: var(--accent); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
h2.sec-title { font-size: clamp(26px, 3.2vw, 36px); font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.sec-sub { color: var(--muted); margin-top: 10px; max-width: 640px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 34px; }
.step { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.step-num { font-size: 13px; color: var(--accent); font-weight: 800; }
.step h3 { margin: 8px 0 6px; font-size: 17px; color: var(--text); }
.step p { color: var(--muted); font-size: 14px; }

/* asset grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 30px; }
.card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  box-shadow: var(--shadow); color: var(--text);
}
.card:hover { transform: translateY(-3px); border-color: #c9d2dd; box-shadow: var(--shadow-lg); text-decoration: none; }
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #f4f6f9; }
.card-body { padding: 14px; }
.card-title { font-weight: 700; font-size: 15px; color: var(--text); }
.card-meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-block; background: var(--bg-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; color: var(--muted); }
.tag.free { color: var(--accent-2); border-color: rgba(16, 185, 129, .35); background: rgba(16, 185, 129, .08); }
.tag.pro { color: var(--accent); border-color: rgba(37, 99, 235, .35); background: rgba(37, 99, 235, .08); }

/* kits */
.kits-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 30px; }
.kit-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.kit-swatch { display: flex; gap: 6px; margin: 12px 0; }
.kit-swatch i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(15, 23, 42, .12); }
.kit-card h3 { font-size: 17px; color: var(--text); }
.kit-status { font-size: 12px; color: var(--accent-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.kit-status.filling { color: #f59e0b; }

/* agent strip */
.agent-strip { background: linear-gradient(120deg, rgba(37, 99, 235, .06), rgba(16, 185, 129, .06)); border: 1px solid var(--line); border-radius: 16px; padding: 28px; margin-top: 34px; display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.agent-strip h3 { font-size: 20px; margin-bottom: 6px; color: var(--text); }
.agent-strip p { color: var(--muted); font-size: 14.5px; max-width: 560px; }
.agent-strip .btn { margin-left: auto; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 34px; }
.plan { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 14px 40px rgba(37, 99, 235, .12); }
.plan h3 { font-size: 18px; color: var(--text); }
.plan .price { font-size: 38px; font-weight: 800; margin: 10px 0 2px; color: var(--text); }
.plan .price small { font-size: 15px; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; margin: 18px 0 24px; display: grid; gap: 10px; }
.plan li { font-size: 14px; color: var(--muted); display: flex; gap: 8px; }
.plan li::before { content: "✓"; color: var(--accent-2); font-weight: 700; }
.plan .btn { margin-top: auto; justify-content: center; }

/* FAQ */
.faq { max-width: 760px; margin: 30px auto 0; display: grid; gap: 10px; }
.faq details { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; align-items: center; color: var(--text); }
.faq summary::after { content: "+"; font-size: 18px; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq .faq-a { color: var(--muted); font-size: 14.5px; margin-top: 10px; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 40px 0 30px; margin-top: 40px; background: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; }
.footer-grid h4 { font-size: 13px; color: var(--text); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em; }
.footer-grid a { display: block; color: var(--muted); font-size: 13.5px; margin-bottom: 6px; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { color: var(--muted); font-size: 12.5px; margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* page header */
.page-head { padding: 56px 0 12px; }
.page-head h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.page-head p { color: var(--muted); margin-top: 10px; max-width: 660px; }
.breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

/* filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0; align-items: center; }
.filters input[type="text"] { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 9px 16px; font-size: 14px; min-width: 220px; }
.filters select { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 9px 14px; font-size: 14px; }
.chip { background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }

/* prose (legal/docs pages) */
.prose { max-width: 760px; margin-top: 28px; display: grid; gap: 18px; }
.prose h2 { font-size: 22px; color: var(--text); margin-top: 8px; }
.prose h3 { font-size: 17px; color: var(--text); margin-top: 6px; }
.prose p, .prose li { color: var(--muted); font-size: 15px; }
.prose ul { padding-left: 22px; display: grid; gap: 8px; }
.prose pre { background: #0f172a; border-radius: 10px; padding: 16px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.prose pre code { background: none; border: none; padding: 0; color: #e2e8f0; }

/* misc */
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.stat-row { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 22px; }
.stat { text-align: center; }
.stat b { display: block; font-size: 30px; font-weight: 800; color: var(--text); }
.stat span { color: var(--muted); font-size: 13px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

.notice { background: rgba(37, 99, 235, .06); border: 1px solid rgba(37, 99, 235, .2); border-radius: 10px; padding: 14px 16px; font-size: 14px; color: var(--muted); margin-top: 20px; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-stage { margin: 0 auto; }
  .nav-links a { display: none; }
  .nav-links .nav-pill, .nav-links .nav-avatar { display: inline-flex; }
}
