/* Haloniq Developer API — landing page.
   Visual language ported from the HALONIQ demo deck design system:
   white 250px sticky brand rail + centred stage, white cards, soft shadows,
   aqua #00B6BE as the precise accent, Helvetica Neue, light theme. */

:root {
  color-scheme: light;
  /* ---- HALONIQ brand-exact (Brand ID v3.0) ---- */
  --haloniq-aqua:      #00B6BE;   /* signature / primary */
  --haloniq-aqua-dark: #009AA1;   /* hover / active */
  --haloniq-aqua-soft: #E6F7F8;   /* 8% aqua wash */
  --haloniq-blue:      #004263;   /* deep navy secondary */
  --haloniq-black:     #231F20;   /* near-black ink */

  --ink:   #231F20;
  --ink-2: #3f464f;
  --muted: #677282;
  --line:  #dce1e7;
  --line-hover: #c7d2e4;
  --bg:    #f6f7f9;
  --card:  #ffffff;
  --sidebar-bg: #ffffff;

  --shadow-sm: 0 1px 2px rgba(35,31,32,0.05);
  --shadow-md: 0 4px 16px rgba(35,31,32,0.08);
  --shadow-lg: 0 16px 48px rgba(35,31,32,0.12);

  --stage-max: 1360px;
  --sidebar-w: 250px;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Dark code terminal (deck uses a dark caption surface; reused for code blocks) */
  --code-bg:      #0f1720;
  --code-bg-head: #141d28;
  --code-line:    rgba(255,255,255,0.08);
  --code-text:    #e6edf3;
  --code-muted:   #8aa0b2;
}

/* Light-only page (matches the Haloniq deck) — dark adaptation intentionally removed. */

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--haloniq-aqua-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico { width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }

/* Inline prose code (kbd-style) */
:is(p, li, caption) code {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--haloniq-blue);
  background: var(--bg); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 5px;
}

/* ---------- app shell ---------- */
.app { display: flex; align-items: stretch; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--sidebar-bg); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); z-index: 20;
}

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.stage {
  padding: 32px; max-width: var(--stage-max); margin: 0 auto; width: 100%;
  transition: max-width .2s ease, padding .2s ease;
}

/* ---------- sidebar brand ---------- */
.sidebar-brand { padding: 22px 20px 16px; display: flex; flex-direction: column; gap: 6px; }
.sidebar-brand .brand-logo {
  height: 30px; width: auto; max-width: 100%; display: block;
  align-self: flex-start; flex-shrink: 0; object-fit: contain;
}
.sidebar-brand .brand-sub {
  font-size: 12px; color: var(--muted); font-weight: 500;
  letter-spacing: 0.2px; padding-left: 1px;
}


/* ---------- sidebar nav ---------- */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.nav-group-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); padding: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px; cursor: pointer; user-select: none;
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  border-left: 3px solid transparent; margin-left: -3px; text-decoration: none;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.nav-item:hover { background: var(--bg); text-decoration: none; }
.nav-item.active {
  background: var(--haloniq-aqua-soft); color: var(--haloniq-aqua-dark);
  border-left-color: var(--haloniq-aqua); font-weight: 600;
}
.nav-item .ico { width: 18px; height: 18px; color: inherit; }
.nav-item .label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- sidebar foot ---------- */
.sidebar-foot {
  padding: 14px 20px 16px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
}
.sidebar-foot .endorse { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.sidebar-foot .endorse b { color: var(--ink-2); font-weight: 600; }
.sidebar-tools { display: flex; gap: 8px; }
.sidebar-tools .btn { flex: 1; justify-content: center; }
.mark {
  font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.2px;
  color: var(--haloniq-aqua-dark);
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.crumb {
  font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.1px;
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.crumb .crumb-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--haloniq-aqua-dark);
}
.crumb .crumb-sep { color: var(--line-hover); }
.top-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- buttons ---------- */
.btn {
  background: var(--card); border: 1px solid var(--line); color: var(--ink-2);
  padding: 9px 16px; border-radius: 999px; font-size: 13.5px; cursor: pointer;
  font-family: inherit; font-weight: 500; transition: all .15s ease;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--bg); border-color: var(--line-hover); text-decoration: none; }
.btn.primary { background: var(--haloniq-aqua); color: #ffffff; border-color: var(--haloniq-aqua); }
.btn.primary:hover { background: var(--haloniq-aqua-dark); border-color: var(--haloniq-aqua-dark); color: #fff; }
.btn .ico { width: 16px; height: 16px; }

/* ---------- eyebrow / lede / section-note ---------- */
.eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--haloniq-aqua-dark); text-transform: uppercase; margin-bottom: 14px;
}
.section-note {
  margin-top: 18px; font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 1.5;
}
.section-note .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--haloniq-aqua); flex-shrink: 0; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; align-items: stretch;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  margin-bottom: 20px; box-shadow: var(--shadow-md);
}
.hero-copy { padding: 48px; min-width: 0; }
.hero h1 {
  font-size: 40px; margin: 0 0 12px; color: var(--ink); font-weight: 700;
  letter-spacing: -0.8px; line-height: 1.1;
}
.hero h1 .em { color: var(--haloniq-aqua-dark); }
.hero p.lede { font-size: 17px; color: var(--muted); margin: 0 0 24px; line-height: 1.55; max-width: 560px; }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-visual {
  position: relative; overflow: hidden; min-height: 360px;
  background: linear-gradient(150deg, #04555c 0%, var(--haloniq-aqua-dark) 55%, var(--haloniq-aqua) 125%);
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  padding: 44px; color: #fff;
}
.hero-visual::after {
  content: ""; position: absolute; right: -46px; bottom: -46px; width: 300px; height: 300px;
  background: url('/brand/haloniq-logo-wa.png') no-repeat center / contain;
  opacity: 0.10; pointer-events: none; z-index: 0;
}
.hero-visual > * { position: relative; z-index: 1; }
.hv-badge {
  align-self: flex-start; font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: #fff;
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.32);
  padding: 4px 11px; border-radius: 999px;
}
.hv-endpoint { font-family: var(--font-mono); font-size: 20px; font-weight: 600; letter-spacing: -0.2px; word-break: break-word; }
.hv-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.hv-pill {
  font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.26);
  padding: 5px 11px; border-radius: 999px;
}

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--haloniq-aqua-soft);
  display: flex; align-items: center; justify-content: center; color: var(--haloniq-aqua-dark); flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-num { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- card / panel ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.card h2 { margin: 0 0 6px; font-size: 24px; color: var(--ink); font-weight: 700; letter-spacing: -0.3px; }
.card .sublede { color: var(--muted); font-size: 15px; margin: 0 0 22px; line-height: 1.55; max-width: 760px; }

/* ---------- steps (numbered) ---------- */
.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 8px; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px;
  box-shadow: var(--shadow-sm); transition: border-color .15s ease, transform .15s ease;
}
.step:hover { border-color: var(--haloniq-aqua); transform: translateY(-1px); }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.step .n {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--haloniq-aqua-soft); color: var(--haloniq-aqua-dark);
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.step .t { font-weight: 600; font-size: 15px; color: var(--ink); }
.step .d { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }
.step .code { margin-top: 14px; }

/* ---------- code terminal ---------- */
.code {
  background: var(--code-bg); border: 1px solid var(--code-line);
  border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden;
}
.code-head {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  background: var(--code-bg-head); border-bottom: 1px solid var(--code-line);
}
.code-head .lamp { width: 10px; height: 10px; border-radius: 50%; background: #33465a; }
.code-head .lamp.a { background: var(--haloniq-aqua); }
.code-head .title {
  margin-left: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--code-muted); font-family: var(--font-sans);
}
.code pre { margin: 0; overflow-x: auto; padding: 16px 16px 18px; }
.code code { font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: var(--code-text); white-space: pre; }
.c-cmt { color: var(--code-muted); }
.c-mth { color: #4fd6dc; font-weight: 700; }
.c-url { color: #e6edf3; }
.c-flg { color: #9fd0dd; }
.c-str { color: #bfe6c9; }

/* ---------- scopes table (deck row-list idiom) ---------- */
.table-wrap {
  margin-top: 8px; border: 1px solid var(--line); border-radius: 12px;
  overflow-x: auto; background: var(--card); box-shadow: var(--shadow-sm);
}
table { border-collapse: collapse; width: 100%; min-width: 560px; }
caption { text-align: left; padding: 14px 18px 2px; color: var(--muted); font-size: 12.5px; }
thead th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 12px 18px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
tbody td { padding: 12px 18px; border-top: 1px solid var(--line); vertical-align: top; font-size: 13px; color: var(--ink-2); }
.grp td {
  background: var(--bg); font-weight: 700; color: var(--muted);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 9px 18px;
}
td.scope code {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
  color: var(--haloniq-blue); background: var(--haloniq-aqua-soft);
  padding: 3px 9px; border-radius: 6px; white-space: nowrap; display: inline-block;
}
td .desc { color: var(--muted); font-size: 13px; }

/* ---------- sub-headings inside cards (webhooks / SDK sections) ---------- */
.card h3 {
  margin: 26px 0 10px; font-size: 15.5px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.1px;
}
.card h3:first-of-type { margin-top: 6px; }
.card p.muted-p { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 14px; max-width: 860px; }

/* ---------- callout (honesty notes / guidance) ---------- */
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--haloniq-aqua-soft); border: 1px solid var(--line);
  border-left: 3px solid var(--haloniq-aqua);
  border-radius: 10px; padding: 14px 16px; margin: 18px 0 6px;
}
.callout .ico { width: 18px; height: 18px; color: var(--haloniq-aqua-dark); margin-top: 1px; }
.callout p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.55; }

/* ---------- feature cards (capabilities, 3-up) ---------- */
.api-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 4px; }
.feature-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; background: var(--card);
  box-shadow: var(--shadow-sm); transition: border-color .15s ease, transform .15s ease;
}
.feature-card:hover { border-color: var(--haloniq-aqua); transform: translateY(-2px); }
.feature-card .fh { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.feature-card .fh .ico { width: 20px; height: 20px; color: var(--haloniq-aqua-dark); }
.feature-card .fh .ft { font-weight: 600; font-size: 14px; color: var(--ink); }
.feature-card .fd { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; }

/* ---------- footer ---------- */
.site-foot { margin-top: 4px; padding: 4px 4px 24px; }
.foot-top {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.foot-brand { display: flex; align-items: center; gap: 14px; }
.foot-brand .brand-logo { height: 24px; width: auto; }
.foot-brand .endorse {
  font-size: 12.5px; color: var(--muted); padding-left: 12px;
  border-left: 1px solid var(--line); white-space: nowrap;
}
.foot-brand .endorse b { color: var(--ink-2); font-weight: 600; }
.foot-links { display: flex; flex-wrap: wrap; gap: 22px; font-size: 13.5px; }
.foot-legal { margin: 18px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; max-width: 78ch; }

/* ---------- focus ring ---------- */
.nav-item:focus-visible, .btn:focus-visible, a:focus-visible, .feature-card:focus-visible {
  outline: 2px solid var(--haloniq-aqua); outline-offset: 2px; border-radius: 6px;
}

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-hover); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #a9b6cc; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; flex-direction: column;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .sidebar-brand { padding: 16px 18px 10px; }
  .sidebar-nav { display: flex; flex-wrap: nowrap; overflow-x: auto; padding: 6px 12px 10px; gap: 4px; }
  .nav-group-label { display: none; }
  .nav-item { border-left: 0; margin-left: 0; padding: 8px 12px; white-space: nowrap; }
  .nav-item.active { border-left: 0; box-shadow: inset 0 -2px 0 var(--haloniq-aqua); }
  .sidebar-foot { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { min-height: 220px; order: -1; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .api-features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .top-actions .btn { display: none; }
  .steps { grid-template-columns: 1fr; }
  .api-features { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .stage { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .hero-copy { padding: 28px; }
  .hero h1 { font-size: 28px; }
  .card { padding: 22px; }
}

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