/* HabloTech — one brand, two places.
   Tokens mirror shared/config.yaml and remotion/src/brand.ts in the parent
   project. Change all three together or the on-site video embeds stop matching
   the videos themselves. */

:root {
  --primary: #6366f1;   /* indigo */
  --accent:  #22d3ee;   /* cyan   */
  --ink:     #17172a;
  --muted:   #5b5b74;
  --paper:   #ffffff;
  --sunken:  #f5f5fa;
  --line:    #e3e3ee;
  --radius:  10px;
  --wrap:    68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:    #ececf5;
    --muted:  #a0a0bb;
    --paper:  #0f0f17;
    --sunken: #191926;
    --line:   #2b2b3d;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--primary); }
a:hover { color: var(--accent); }

.skip {
  position: absolute; left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem; z-index: 10;
  background: var(--paper); padding: .5rem .75rem; border-radius: var(--radius);
}

/* --- header / footer --- */

.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .9rem; flex-wrap: wrap;
}
.logo {
  font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em;
  text-decoration: none; color: var(--ink);
}
.logo span { color: var(--primary); }
.site-header nav { display: flex; gap: 1.25rem; }
.site-header nav a { text-decoration: none; font-weight: 600; }

.site-footer {
  margin-top: 4rem; padding-block: 2rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem;
}
.site-footer p { margin: .25rem 0; }

/* --- typography --- */

h1 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; letter-spacing: -.01em; margin-top: 2.5rem; }
h3 { font-size: 1.05rem; margin-top: 1.75rem; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 46rem; }

code, kbd, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .93em;
}
code { background: var(--sunken); padding: .12em .35em; border-radius: 4px; }
pre {
  background: var(--sunken); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem 1rem; overflow-x: auto;
}
pre code { background: none; padding: 0; }

/* --- search --- */

.search { display: flex; gap: .5rem; margin: 1.5rem 0 2rem; max-width: 34rem; }
.search input {
  flex: 1; padding: .65rem .85rem; font: inherit;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.search input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.search button {
  padding: .65rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--primary);
  border: 0; border-radius: var(--radius);
}

/* --- function listings --- */

.fn-grid {
  display: grid; gap: .75rem; padding: 0; margin: 1rem 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.fn-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .85rem 1rem; background: var(--paper);
}
.fn-card a { text-decoration: none; font-weight: 700; }
.fn-card p { margin: .3rem 0 0; color: var(--muted); font-size: .9rem; }

.cat-block { margin-top: 2.5rem; }
.cat-block > h2 { margin-bottom: .25rem; }
.cat-block > p  { margin-top: 0; color: var(--muted); }

/* --- function detail --- */

.syntax {
  display: block; background: var(--sunken); border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .8rem 1rem; margin: 1rem 0; overflow-x: auto; white-space: pre;
}

table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.table-scroll { overflow-x: auto; }

.capture { margin: 1.5rem 0; }
.capture img {
  max-width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.capture figcaption { color: var(--muted); font-size: .88rem; margin-top: .5rem; }

.gotchas { padding-left: 1.1rem; }
.gotchas li { margin: .4rem 0; }

.related { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
.related a {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: .9rem;
  border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem;
}

.muted { color: var(--muted); }
.notice {
  background: var(--sunken); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.15rem;
}
