/* ============================================================================
 * DrNick · Home / Index — ONFA Noir
 * Header-light editorial landing in the WebML/HF demo manner: centered column,
 * mono eyebrow, two-clause display headline, bold lede, stat strip, CTA + link,
 * an INLINE working chat, and a "how it works" architecture explorer.
 * Reuses dn-* chat components via .dn-scope. Dark default; light via themes.css.
 * ==========================================================================*/

html { scroll-behavior: smooth; }
html, body { background: var(--bg); }
body { margin: 0; color: var(--fg-1); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.hm-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 82% 2%, rgba(255,191,0,0.08), transparent 34%),
    radial-gradient(circle at 6% 60%, rgba(255,191,0,0.045), transparent 30%),
    linear-gradient(180deg, #050505 0%, var(--bg) 60%); }

/* ── slim sticky bar ──────────────────────────────────────────────────────*/
.hm-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 13px clamp(18px, 5vw, 40px);
  background: var(--dn-chrome, rgba(2,2,2,0.72));
  -webkit-backdrop-filter: blur(20px) saturate(120%); backdrop-filter: blur(20px) saturate(120%);
  border-bottom: 1px solid var(--line);
}
.hm-bar-brand { display: flex; align-items: center; gap: 11px; }
.hm-bar-brand img { height: 23px; width: auto; display: block; }
.hm-bar-brand .wm { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.01em; color: var(--fg-1); }
.hm-bar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.hm-bar-peg { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--fg-3); }
.hm-bar-peg .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold-glow); animation: onfa-pulse 1.6s ease-in-out infinite; }

/* ── content column ───────────────────────────────────────────────────────*/
.hm-wrap { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 0 clamp(18px, 5vw, 40px); }

/* ── HERO ─────────────────────────────────────────────────────────────────*/
.hm-hero { position: relative; padding: clamp(60px, 11vw, 120px) 0 clamp(48px, 7vw, 80px); text-align: center; }
.hm-hero > *:not(.hm-orb) { position: relative; z-index: 1; }

/* animated dotted-sphere backdrop (canvas) — echoes the reference hero */
.hm-orb {
  position: absolute; z-index: 0; pointer-events: none;
  top: clamp(-40px, -1vw, 8px); left: 50%; transform: translateX(-50%);
  width: min(860px, 122%); height: auto; aspect-ratio: 1 / 1; max-height: 860px;
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 30%, rgba(0,0,0,0.45) 54%, transparent 72%);
          mask-image: radial-gradient(circle at 50% 46%, #000 30%, rgba(0,0,0,0.45) 54%, transparent 72%);
}
.hm-orb::before {
  content: ""; position: absolute; inset: 18%; border-radius: 50%;
  background: radial-gradient(circle at 50% 46%, rgba(255,191,0,0.10), transparent 64%);
}
.hm-orb canvas { position: relative; width: 100%; height: 100%; display: block; }
.hm-eyebrow {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3);
}
.hm-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold-glow); animation: onfa-pulse 1.6s ease-in-out infinite; }
.hm-eyebrow .sep { color: var(--fg-5); }
.hm-h1 {
  margin: 24px auto 0; max-width: 16ch;
  font-family: var(--font-display); font-size: clamp(38px, 7vw, 72px); font-weight: 800;
  line-height: 1.0; letter-spacing: -0.025em; color: var(--fg-1); text-wrap: balance;
}
.hm-h1 .alt { color: var(--fg-3); }
.hm-lede { margin: 24px auto 0; max-width: 60ch; font-size: clamp(16px, 2.2vw, 19px); line-height: 1.6; color: var(--fg-2); }
.hm-lede b { color: var(--fg-1); font-weight: 700; }

/* stat strip */
.hm-stats {
  margin: 44px auto 0; max-width: 720px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden;
  background: var(--panel);
}
.hm-stat { padding: 22px 14px; text-align: center; border-left: 1px solid var(--line); }
.hm-stat:first-child { border-left: none; }
.hm-stat .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: clamp(20px, 3vw, 26px); font-weight: 700; letter-spacing: -0.01em; color: var(--fg-1); line-height: 1; }
.hm-stat .v.gold { color: var(--gold); }
.hm-stat .k { margin-top: 9px; font-size: 12px; line-height: 1.4; color: var(--fg-3); }

/* actions */
.hm-actions { margin: 36px 0 0; display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.hm-link { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--fg-2); }
.hm-link svg { width: 15px; height: 15px; }
.hm-link:hover { color: var(--gold); }

/* trust callout */
.hm-callout {
  margin: 28px auto 0; max-width: 640px;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 18px; border: 1px solid var(--gold-line); border-radius: var(--r-full);
  font-size: 13.5px; color: var(--fg-3);
}
.hm-callout svg { width: 16px; height: 16px; color: var(--gold); flex: none; }
.hm-callout b { color: var(--fg-1); font-weight: 600; }
.hm-callout .steps { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--gold); white-space: nowrap; }

/* ── section divider label ────────────────────────────────────────────────*/
.hm-divider { display: flex; align-items: center; gap: 16px; margin: clamp(56px, 8vw, 88px) 0 26px; }
.hm-divider::before, .hm-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.hm-divider span { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-4); }

/* ── INLINE CHAT CARD ─────────────────────────────────────────────────────*/
.hm-chat {
  border: 1px solid var(--line-strong); border-radius: var(--r-2xl);
  background: var(--bg); overflow: hidden; isolation: isolate; position: relative;
  display: flex; flex-direction: column;
  height: 600px;
  box-shadow: var(--shadow-2);
}
.hm-chat::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 86% 4%, var(--dn-bloom-1), transparent 42%), radial-gradient(circle at 10% 98%, var(--dn-bloom-2), transparent 36%); }
.hm-chat > * { position: relative; z-index: 1; }

.hm-chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  background: var(--dn-chrome); -webkit-backdrop-filter: blur(20px) saturate(120%); backdrop-filter: blur(20px) saturate(120%);
}
.hm-chat-head .av { width: 36px; height: 36px; flex: 0 0 36px; border-radius: var(--r-full); object-fit: cover; object-position: 50% 16%; border: 1px solid var(--gold-line); background: var(--dn-fab-img-b); }
.hm-chat-head .meta { flex: 1; min-width: 0; }
.hm-chat-head .nm { font-size: 14.5px; font-weight: 600; color: var(--fg-1); letter-spacing: -0.01em; line-height: 1.2; }
.hm-chat-head .st { display: inline-flex; align-items: center; gap: 7px; margin-top: 3px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); }
.hm-chat-head .st .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 10px rgba(45,195,133,0.6); animation: onfa-pulse 1.6s ease-in-out infinite; }
.hm-chat-head .acts { display: flex; align-items: center; gap: 4px; }
.hm-chat-head .iconbtn { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--fg-3); background: none; border: 0; cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.hm-chat-head .iconbtn:hover { background: var(--secondary); color: var(--fg-1); }
.hm-chat-head .iconbtn svg { width: 16px; height: 16px; }
.hm-seg { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-full); padding: 2px; background: var(--secondary); }
.hm-seg button { appearance: none; border: 0; background: none; cursor: pointer; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--fg-4); padding: 4px 9px; border-radius: var(--r-full); line-height: 1; transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.hm-seg button.on { background: var(--dn-gold-text, var(--gold)); color: var(--ink); }

.hm-chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--dn-scroll) transparent; }
.hm-chat-scroll::-webkit-scrollbar { width: 8px; }
.hm-chat-scroll::-webkit-scrollbar-thumb { background: var(--dn-scroll); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }

/* welcome inside card */
.hm-cw { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 24px; }
.hm-cw-av { width: 72px; height: 72px; border-radius: var(--r-full); object-fit: cover; object-position: 50% 14%; border: 1px solid var(--gold-line); background: var(--dn-fab-img-b); box-shadow: 0 0 36px var(--gold-glow); }
.hm-cw h3 { margin: 18px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg-1); text-wrap: balance; }
.hm-cw p { margin: 10px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--fg-3); max-width: 40ch; }
.hm-cw-chips { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 480px; }
.hm-cw-chip { text-align: left; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); color: var(--fg-2); font-family: var(--font-sans); font-size: 13px; font-weight: 500; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.hm-cw-chip svg { width: 14px; height: 14px; flex: 0 0 14px; color: var(--fg-4); transition: color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.hm-cw-chip:hover { border-color: var(--gold-line); background: var(--panel-2); color: var(--fg-1); }
.hm-cw-chip:hover svg { color: var(--gold); transform: translateX(2px); }
.hm-cw-chip:active { transform: scale(0.99); }

.hm-chat-scope .dn-thread { padding: 20px 18px 10px; gap: 18px; }
.hm-chat-scope .dn-bubble { max-width: min(560px, 100%); }

/* composer inside card */
.hm-composer { border-top: 1px solid var(--line); background: var(--dn-chrome); -webkit-backdrop-filter: blur(20px) saturate(120%); backdrop-filter: blur(20px) saturate(120%); padding: 12px 14px 13px; }

/* ── HOW IT WORKS · architecture explorer ─────────────────────────────────*/
.hm-how { padding-bottom: clamp(64px, 10vw, 110px); }
.hm-how-head { max-width: 640px; }
.hm-how-eyebrow { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.hm-how-h { margin: 14px 0 0; font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; color: var(--fg-1); text-wrap: balance; }
.hm-how-p { margin: 16px 0 0; font-size: 16px; line-height: 1.65; color: var(--fg-2); max-width: 64ch; }
.hm-how-p b { color: var(--fg-1); font-weight: 700; }

.hm-explorer { margin-top: 34px; border: 1px solid var(--line); border-radius: var(--r-2xl); overflow: hidden; background: var(--panel); }
.hm-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); background: var(--bg-2); overflow-x: auto; scrollbar-width: none; }
.hm-tabs::-webkit-scrollbar { display: none; }
.hm-tab { flex: 1 0 auto; min-width: 128px; appearance: none; cursor: pointer; background: none; border: 0; border-right: 1px solid var(--line); padding: 16px 18px; text-align: left; transition: background var(--dur-fast) var(--ease); }
.hm-tab:last-child { border-right: 0; }
.hm-tab .tag { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--fg-4); letter-spacing: 0.02em; transition: color var(--dur-fast) var(--ease); }
.hm-tab .nm { margin-top: 5px; font-size: 13px; font-weight: 600; color: var(--fg-3); transition: color var(--dur-fast) var(--ease); }
.hm-tab:hover { background: var(--secondary); }
.hm-tab.on { background: var(--panel); }
.hm-tab.on .tag { color: var(--gold); }
.hm-tab.on .nm { color: var(--fg-1); }

.hm-panel { display: grid; grid-template-columns: 1fr 1.1fr; gap: 0; }
.hm-panel-info { padding: 26px 28px; border-right: 1px solid var(--line); }
.hm-panel-info h4 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--fg-1); }
.hm-panel-info .role { margin-top: 4px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.hm-panel-info p { margin: 16px 0 0; font-size: 14px; line-height: 1.65; color: var(--fg-3); }
.hm-panel-info p b { color: var(--fg-2); font-weight: 600; }
.hm-panel-code { background: #060606; padding: 22px 24px; overflow-x: auto; }
[data-theme="light"] .hm-panel-code { background: var(--panel-3); }
.hm-panel-code pre { margin: 0; }
.hm-panel-code code { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75; color: var(--fg-2); white-space: pre; tab-size: 2; }
.hm-panel-code .c-key { color: var(--gold-200); }
.hm-panel-code .c-com { color: var(--fg-4); }
.hm-panel-code .c-str { color: var(--pos); }

/* ── footer ───────────────────────────────────────────────────────────────*/
.hm-foot { position: relative; z-index: 1; border-top: 1px solid var(--line); }
.hm-foot-in { max-width: 880px; margin: 0 auto; padding: 28px clamp(18px, 5vw, 40px); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hm-foot-in img { height: 18px; width: auto; opacity: 0.8; }
.hm-foot-in span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-4); }

/* ── responsive ───────────────────────────────────────────────────────────*/
@media (max-width: 720px) {
  .hm-stats { grid-template-columns: 1fr 1fr; }
  .hm-stat:nth-child(3) { border-left: none; }
  .hm-stat:nth-child(odd) { border-left: none; }
  .hm-stat:nth-child(3), .hm-stat:nth-child(4) { border-top: 1px solid var(--line); }
  .hm-panel { grid-template-columns: 1fr; }
  .hm-panel-info { border-right: none; border-bottom: 1px solid var(--line); }
  .hm-cw-chips { grid-template-columns: 1fr; }
  .hm-chat { height: 560px; }
}
@media (max-width: 480px) {
  .hm-bar-peg { display: none; }
}
