/* haath docs - haath.treefour.studio (Tree Four Studio Brand Theme) */
:root {
  --bg: #0b0713;
  --bg-2: #140c24;
  --panel: #170F26;
  --panel-alt: #270D4D;
  --fg: #f4f1f8;
  --muted: #a59bb8;
  --line: #2d1e46;
  --accent: #C4F542;
  --accent-fg: #09050f;
  --accent-soft: rgba(196, 245, 66, 0.14);
  --code-bg: #110a1d;
  --code-fg: #ebe6f5;
  --comment: #85789c;
  --canvas: #110a1d;
  --left: #C4F542;
  --right: #b57cff;
  --radius: 10px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f8f7fb;
  --bg-2: #eeeaf6;
  --panel: #ffffff;
  --panel-alt: #270D4D;
  --fg: #140c24;
  --muted: #584d6e;
  --line: #dcd5ea;
  --accent: #270D4D;
  --accent-fg: #C4F542;
  --accent-soft: rgba(39, 13, 77, 0.08);
  --code-bg: #f1eef8;
  --code-fg: #170F26;
  --comment: #6e6285;
  --canvas: #f1eef8;
  --left: #270D4D;
  --right: #7e22ce;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 var(--sans); }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: .88em; background: var(--code-bg); border: 1px solid var(--line); padding: .1em .38em; border-radius: 5px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-fg); padding: 8px 12px; border-radius: 8px; z-index: 50; font-weight: 600; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 62px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -.01em; font-family: var(--mono); }
.brand-sub { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--panel-alt); color: #C4F542; border: 1px solid rgba(196, 245, 66, 0.3); letter-spacing: .04em; text-transform: uppercase; }
.topnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topnav a { color: var(--muted); text-decoration: none; padding: 6px 11px; border-radius: 8px; font-size: 14.5px; font-weight: 500; transition: color .15s, background .15s; }
.topnav a:hover { color: var(--fg); background: var(--bg-2); }
.topnav .t4-nav-logo { display: inline-flex; align-items: center; padding: 3px 6px; margin-left: 6px; border-radius: 7px; border: 1px solid transparent; }
.topnav .t4-nav-logo:hover { background: transparent; border-color: var(--accent); }
.topnav .t4-nav-logo img { height: 24px; width: auto; display: block; }
.menu { display: none; font: inherit; font-size: 14px; background: transparent; color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; }

/* Docs shell */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr) 220px; gap: 40px; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.sidebar { position: sticky; top: 62px; align-self: start; max-height: calc(100vh - 62px); overflow: auto; padding: 28px 0; }
.nav-group { margin-bottom: 22px; }
.nav-group p { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-family: var(--mono); }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 7px; color: var(--fg); text-decoration: none; font-size: 14.5px; }
.nav-group a:hover { background: var(--bg-2); }
.nav-group a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; border-left: 2px solid var(--accent); border-radius: 0 7px 7px 0; }
.content { min-width: 0; padding: 32px 0 64px; }
article { max-width: 760px; }
article h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 16px; }
article h2 { font-size: 24px; letter-spacing: -.01em; margin: 44px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); }
article h3 { font-size: 18px; margin: 28px 0 8px; }
article p, article li { color: var(--fg); }
article > p:first-of-type { font-size: 18px; color: var(--muted); }
article ul, article ol { padding-left: 22px; }
article li { margin: 4px 0; }
.anchor { opacity: 0; margin-left: 6px; color: var(--muted); text-decoration: none; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
.note { margin: 18px 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; color: var(--fg); }
.toc { position: sticky; top: 62px; align-self: start; padding: 32px 0; font-size: 13.5px; }
.toc p { margin: 0 0 8px; font-weight: 700; color: var(--muted); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; font-family: var(--mono); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 12px; color: var(--muted); text-decoration: none; }
.toc li.l3 a { padding-left: 24px; }
.toc li a:hover { color: var(--accent); }
.pager { display: flex; justify-content: space-between; gap: 12px; max-width: 760px; margin-top: 48px; }
.pager a { flex: 1; display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--fg); background: var(--panel); transition: border-color .15s; }
.pager a:hover { border-color: var(--accent); }
.pager span { display: block; font-size: 12px; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.pager .next { text-align: right; }
.edit { max-width: 760px; color: var(--muted); font-size: 13px; margin-top: 18px; }

/* Code blocks */
.code { position: relative; margin: 16px 0; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius); font: 13.5px/1.6 var(--mono); color: var(--code-fg); }
.code pre code { background: none; border: none; padding: 0; font-size: inherit; }
.code .c { color: var(--comment); font-style: italic; }
.copy { position: absolute; top: 8px; right: 8px; font: 12px var(--mono); color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; cursor: pointer; opacity: 0; transition: opacity .15s, border-color .15s; }
.copy:hover { border-color: var(--accent); color: var(--fg); }
.code:hover .copy, .copy:focus-visible, .code.inline .copy { opacity: 1; }
.copy.done { color: var(--accent); border-color: var(--accent); }

/* Home */
.home main section { max-width: 1120px; margin: 0 auto; padding: 56px 24px; }
.hero { padding-top: 68px !important; background: radial-gradient(ellipse 80% 55% at 50% 0%, rgba(39, 13, 77, 0.72), transparent 75%); border-bottom: 1px solid var(--line); }
.hero-text { max-width: 820px; }
.eyebrow { display: inline-block; margin: 0 0 16px; padding: 4px 12px; border-radius: 999px; background: var(--panel-alt); border: 1px solid rgba(196, 245, 66, 0.35); color: #C4F542; font-family: var(--mono); font-weight: 600; font-size: 13px; letter-spacing: .04em; }
.hero h1 { font-size: clamp(34px, 5.6vw, 58px); line-height: 1.06; letter-spacing: -.03em; margin: 0 0 20px; }
.hero h1 code { font-size: .82em; background: none; border: none; padding: 0; color: var(--accent); }
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--muted); margin: 0 0 28px; max-width: 680px; }
.install { max-width: 420px; }
.install pre { padding-right: 70px; border-color: rgba(196, 245, 66, 0.3); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn { display: inline-block; padding: 11px 20px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); text-decoration: none; font-weight: 600; font-size: 15px; font-family: var(--mono); transition: all .15s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: #d4ff58; border-color: #d4ff58; color: #000000; }
.section-head { margin-bottom: 24px; max-width: 720px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.02em; margin: 0 0 8px; line-height: 1.15; }
.section-head p { margin: 0; color: var(--muted); }
.demo-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
#demo-canvas { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--line); background: var(--canvas); }
.demo-controls { display: grid; gap: 14px; }
.label { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-family: var(--mono); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: 13px var(--mono); padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; transition: all .15s; }
.chips button:hover { border-color: var(--accent); }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.readout { margin: 0; padding: 12px 14px; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius); font: 12.5px/1.55 var(--mono); white-space: pre-wrap; min-height: 200px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cards article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; max-width: none; transition: border-color .15s; }
.cards article:hover { border-color: rgba(196, 245, 66, 0.45); }
.cards h3 { margin: 0 0 6px; font-size: 17px; color: var(--fg); }
.cards p { margin: 0; color: var(--muted); font-size: 15px; }
.sample .code pre { font-size: 14px; }
.pills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-weight: 500; font-family: var(--mono); font-size: 13.5px; }
.more { margin-top: 18px; }
.faq-teaser details { border-bottom: 1px solid var(--line); padding: 14px 0; max-width: 760px; }
.faq-teaser summary { cursor: pointer; font-weight: 600; font-size: 17px; }
.faq-teaser summary:hover { color: var(--accent); }
.faq-teaser details p { color: var(--muted); margin: 8px 0 0; }
.origin p { max-width: 720px; color: var(--muted); font-size: 17px; border-top: 1px solid var(--line); padding-top: 28px; margin: 0; }

/* Footer */
.foot { border-top: 1px solid var(--line); background: var(--panel); padding: 36px 24px 44px; text-align: center; color: var(--muted); font-size: 14px; }
.foot-brand { display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; text-decoration: none; border-radius: 8px; }
.foot-brand img { height: 28px; width: auto; display: block; }
.foot p { margin: 6px auto; max-width: 720px; }

/* Responsive */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 820px) {
  .top { padding: 0 16px; gap: 8px; }
  .topnav a:nth-child(n+4):not(.t4-nav-logo) { display: none; }
  .menu { display: inline-block; }
  .shell { grid-template-columns: minmax(0, 1fr); padding: 0 16px; gap: 0; }
  .sidebar { display: none; position: fixed; inset: 62px 0 0 0; background: var(--bg); padding: 20px 24px; z-index: 30; max-height: none; }
  body.nav-open .sidebar { display: block; }
  .demo-grid { grid-template-columns: 1fr; }
}
