/* HOACraft website. Tokens match lib/core/theme.dart (Brand). */
:root {
  --night: #0b0d12;
  --night-soft: #171a22;
  --signal: #c6f24e;
  --signal-deep: #4d7c0f;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --line: #e4e4e0;
  --ink: #0b0d12;
  --muted: #5b616e;
  --warn: #ea580c;
  --ok: #16a34a;
  --code-bg: #0b0d12;
  --code-ink: #e6e8ee;
  --radius: 14px;
  --max: 1160px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --surface: #12151c;
    --line: #262a35;
    --ink: #eceef2;
    --muted: #9aa1ae;
    --signal-deep: #c6f24e;
    --code-bg: #07080c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:hover { color: var(--signal-deep); }
code, pre { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 5px;
  overflow-wrap: anywhere;
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--night) 92%, transparent);
  backdrop-filter: blur(10px);
  color: #fff;
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 22px; letter-spacing: -0.03em; color: #fff; }
.logo:hover { color: #fff; }
.logo img { width: 30px; height: 30px; }
.logo .tag { font-weight: 600; font-size: 13px; letter-spacing: 0; color: var(--signal); margin-left: 2px; }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; font-size: 15px; }
.nav a { text-decoration: none; color: #c9cdd6; }
.nav a:hover, .nav a.active { color: #fff; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px;
  font-weight: 650; font-size: 15px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--signal); color: var(--night); }
.btn-primary:hover { color: var(--night); filter: brightness(1.06); }
.btn-ghost { border-color: color-mix(in srgb, currentColor 35%, transparent); color: inherit; background: transparent; }
.nav .btn { padding: 8px 14px; color: var(--night); }
@media (max-width: 760px) {
  .nav a:not(.btn):not(.keep) { display: none; }
  .logo .tag { display: none; }
}

/* Marketing sections */
.hero { background: var(--night); color: #fff; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 64px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--signal); margin-bottom: 14px; }
.hero h1 { font-size: clamp(36px, 5.4vw, 60px); line-height: 1.04; letter-spacing: -0.035em; margin: 0 0 20px; }
.hero h1 em { font-style: normal; color: var(--signal); }
.hero p.lead { font-size: 19px; color: #c9cdd6; max-width: 34em; margin: 0 0 28px; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .shot { justify-self: center; }
.hero .phone { width: 250px; }
.phone {
  width: 300px; max-width: 100%;
  border-radius: 40px; border: 10px solid #1d212b; border-bottom: 0;
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  aspect-ratio: 1179 / 2000; background: #fff;
}
.phone img { width: 100%; }
.phone.full { border-bottom: 10px solid #1d212b; border-radius: 40px; aspect-ratio: auto; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 48px; }
  .hero .phone { width: 240px; }
}

section.block { padding: 88px 0; }
section.block.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
section.dark { background: var(--night); color: #fff; }
section.dark p, section.dark li { color: #c9cdd6; }
h2.section { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 14px; }
p.section-lead { font-size: 18px; color: var(--muted); max-width: 40em; margin: 0 0 44px; }
section.dark p.section-lead { color: #a9afbb; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.alt .card { background: var(--bg); }
.steps .card::before {
  counter-increment: step; content: counter(step);
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--night); color: var(--signal); font-weight: 800; font-size: 14px; margin-bottom: 14px;
}
.card h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split.reverse > :first-child { order: 2; }
.shots { display: flex; gap: 18px; justify-content: center; }
.shots .phone { width: 230px; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 36px; }
  .split.reverse > :first-child { order: 0; }
  .shots .phone { width: 46%; border-width: 6px; border-radius: 26px; }
}
ul.ticks { list-style: none; padding: 0; margin: 0 0 28px; }
ul.ticks li { padding-left: 30px; position: relative; margin-bottom: 12px; }
ul.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.45em; width: 16px; height: 9px;
  border-left: 3px solid var(--signal-deep); border-bottom: 3px solid var(--signal-deep); transform: rotate(-45deg);
}
section.dark ul.ticks li::before { border-color: var(--signal); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.compare .card h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.compare ul { margin: 0; padding-left: 18px; color: var(--muted); }
.compare li { margin-bottom: 6px; }
.compare .ours { border-color: var(--signal-deep); }
@media (max-width: 760px) { .compare { grid-template-columns: 1fr; } }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .grid3 { grid-template-columns: 1fr; } }

.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 650; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 10px 0 0; max-width: 46em; }

.cta-band { text-align: center; }
.cta-band .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.site-footer { background: var(--night); color: #9aa1ae; font-size: 14px; padding: 40px 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: #c9cdd6; text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* Code */
pre {
  background: var(--code-bg); color: var(--code-ink);
  border-radius: 12px; padding: 18px 20px; overflow-x: auto;
  line-height: 1.55; margin: 0 0 20px;
  border: 1px solid #1d212b;
}
pre code { font-size: 13.5px; background: none; padding: 0; }
.j-key { color: #9cdcfe; }
.j-str { color: #c6f24e; }
.j-num { color: #f5b46b; }
.j-lit { color: #c792ea; }
.j-com { color: #6b7385; }
.codecard { position: relative; }
.codecard .label {
  position: absolute; top: 0; right: 0; font: 600 11px var(--font); letter-spacing: 0.06em; text-transform: uppercase;
  color: #9aa1ae; padding: 8px 12px;
}
.copy-btn {
  position: absolute; top: 8px; right: 8px; font: 600 12px var(--font);
  background: #1d212b; color: #c9cdd6; border: 1px solid #2c313d; border-radius: 7px; padding: 4px 9px; cursor: pointer;
}
.copy-btn:hover { color: #fff; }

/* Developer area */
.dev-banner { background: var(--night-soft); color: #c9cdd6; font-size: 14px; }
.dev-banner .wrap { padding-top: 10px; padding-bottom: 10px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-block; font: 700 11px var(--font); letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--signal); color: var(--night); }
.pill.muted { background: #2c313d; color: #c9cdd6; }
.dev { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; padding-top: 36px; padding-bottom: 80px; }
.sidebar { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; font-size: 14px; padding-right: 8px; }
.sidebar h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 22px 0 8px; }
.sidebar h4:first-child { margin-top: 0; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li a { display: block; padding: 4px 10px; border-radius: 7px; text-decoration: none; color: var(--ink); }
.sidebar li a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.sidebar li a.active { background: var(--night); color: var(--signal); font-weight: 600; }
.sidebar li.sub a { padding-left: 22px; color: var(--muted); font-size: 13.5px; }
.sidebar .m { font: 700 10px var(--mono); display: inline-block; width: 44px; }
@media (max-width: 900px) {
  .dev { grid-template-columns: 1fr; gap: 20px; }
  .sidebar { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
  .sidebar .sub { display: none; }
}
.doc { max-width: 820px; }
.doc h1 { font-size: clamp(30px, 4vw, 40px); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 16px; }
.doc h2 { font-size: 26px; letter-spacing: -0.02em; margin: 52px 0 12px; padding-top: 8px; scroll-margin-top: 80px; }
.doc h3 { font-size: 19px; margin: 32px 0 10px; scroll-margin-top: 80px; }
.doc p, .doc li { color: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.doc blockquote { margin: 0 0 24px; padding: 14px 18px; border-left: 4px solid var(--signal-deep); background: var(--surface); border-radius: 0 10px 10px 0; }
.doc blockquote p { margin: 0 0 6px; }
.doc blockquote ul { margin: 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 15px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.lead-doc { font-size: 18px; color: var(--muted); margin: 0 0 32px; }

.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 32px; }
.cards-2 a.card { text-decoration: none; display: block; }
.cards-2 a.card:hover { border-color: var(--signal-deep); }
.cards-2 a.card h3 { margin-top: 0; }
@media (max-width: 640px) { .cards-2 { grid-template-columns: 1fr; } }

.endpoint { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 22px 24px; margin: 0 0 22px; scroll-margin-top: 80px; }
.endpoint h3 { margin: 0 0 6px; font-size: 18px; }
.route { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--mono); font-size: 14px; margin-bottom: 12px; word-break: break-all; }
.method { font: 800 11px var(--mono); padding: 4px 8px; border-radius: 6px; color: #fff; letter-spacing: 0.04em; }
.method.get { background: #2563eb; }
.method.post { background: #16a34a; }
.method.put { background: #b45309; }
.method.patch { background: #7c3aed; }
.method.delete { background: #dc2626; }
.method.event { background: var(--night); color: var(--signal); }
.endpoint h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 20px 0 8px; }
.props { width: 100%; border-collapse: collapse; font-size: 14px; }
.props td { padding: 8px 10px 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
.props td:first-child { width: 36%; font-family: var(--mono); font-size: 13px; word-break: break-word; }
.props .req { color: var(--warn); font: 600 11px var(--font); margin-left: 4px; }
.props .type { color: var(--muted); font-family: var(--mono); font-size: 12px; display: block; }
.props .enum { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.props details summary { cursor: pointer; color: var(--signal-deep); font-size: 13px; }
.props details .props { margin: 6px 0 0 12px; width: calc(100% - 12px); }
.status-code { font-family: var(--mono); font-weight: 700; margin-right: 8px; }

.tool { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 22px 24px; margin: 0 0 22px; }
.tool label { display: block; font-size: 13px; font-weight: 650; margin: 14px 0 6px; }
.tool input, .tool textarea {
  width: 100%; font: 13px var(--mono); padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.tool textarea { min-height: 120px; resize: vertical; }
.tool .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.tool .btn-ghost { color: var(--ink); }
.result { margin-top: 14px; font-weight: 600; font-size: 15px; }
.result.ok { color: var(--ok); }
.result.bad { color: var(--warn); }
.tabs { display: flex; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.tabs button { font: 600 14px var(--font); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--night); color: var(--signal); border-color: var(--night); }
.logo .hoa { color: var(--signal); }

/* Developer topic pages */
ol.flow { counter-reset: flow; list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; }
ol.flow li { counter-increment: flow; position: relative; padding: 12px 16px 12px 52px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
ol.flow li::before {
  content: counter(flow); position: absolute; left: 14px; top: 11px;
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--night); color: var(--signal); font-weight: 800; font-size: 13px;
}
.sample pre { max-height: 440px; overflow: auto; }

/* Mobile menu */
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; font-size: 15px; color: #c9cdd6; padding: 6px 2px; }
.menu summary::-webkit-details-marker { display: none; }
.menu div {
  position: absolute; right: 0; top: 40px; min-width: 200px; padding: 8px;
  background: var(--night-soft); border: 1px solid #262a35; border-radius: 12px;
  display: grid; box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.menu a { padding: 10px 12px; border-radius: 8px; text-decoration: none; color: #e6e8ee; }
.menu a:hover { background: #222632; color: #fff; }
@media (max-width: 980px) {
  .nav a:not(.btn):not(.keep) { display: none; }
  .nav .keep { display: none; }
  .menu { display: block; }
  .site-header .wrap { gap: 14px; }
}

/* Product pillars and feature pages */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillar { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.pillar:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(11,13,18,0.12); color: inherit; }
.pillar .pic { background: var(--night); padding: 26px 26px 0; display: flex; justify-content: center; height: 300px; overflow: hidden; }
.pillar .pic img { flex: none; align-self: flex-start; width: 220px; height: auto; border-radius: 26px 26px 0 0; border: 7px solid #1d212b; border-bottom: 0; }
.pillar .body { padding: 22px 24px 26px; }
.pillar .kicker { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--signal-deep); }
.pillar h3 { font-size: 22px; letter-spacing: -0.02em; margin: 6px 0 8px; }
.pillar p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.pillar .more { font-weight: 700; font-size: 15px; }
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } .pillar .pic { height: 260px; } }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-grid .card h3 { display: flex; gap: 10px; align-items: center; }
.feature-grid .card .ico { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--night); color: var(--signal); font-size: 16px; flex: none; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }

.breadcrumb { font-size: 14px; color: #a9afbb; margin-bottom: 14px; }
.breadcrumb a { color: #a9afbb; text-decoration: none; }
.events-list { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; }
.events-list li { display: flex; gap: 12px; align-items: baseline; }
.events-list code { white-space: nowrap; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 8px; }
.stat-row .card strong { display: block; font-size: 30px; letter-spacing: -0.03em; }
@media (max-width: 700px) { .stat-row { grid-template-columns: 1fr; } }
.pillar .pic.bottom { align-items: flex-end; padding: 0 26px 26px; }
.pillar .pic.bottom img { align-self: flex-end; border-radius: 0 0 26px 26px; border: 7px solid #1d212b; border-top: 0; }

/* Demo request form */
.demo-form { display: flex; flex-direction: column; gap: 14px; padding: 28px; color: var(--ink); text-align: left; }
.demo-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.demo-form .opt { font-weight: 400; color: var(--muted); }
.demo-form input, .demo-form select, .demo-form textarea {
  font: inherit; font-weight: 400; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
}
.demo-form input:focus, .demo-form select:focus, .demo-form textarea:focus { outline: 2px solid var(--signal); outline-offset: 1px; }
.demo-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.demo-form button { margin-top: 6px; width: 100%; justify-content: center; }
.demo-form .hp { position: absolute; left: -10000px; }
@media (max-width: 560px) { .demo-form .row2 { grid-template-columns: 1fr; } }
