/* Hubbub site: parchment look matching the extension. No external fonts or assets. */

:root {
  --bg: #f5f0e8;
  --bg-card: #fbf8f2;
  --text: #3b2f25;
  --muted: #6b5a4c;      /* 5.8:1 on --bg */
  --rule: #ddd2c1;
  --link: #8a4a2e;       /* darker rust: 6:1 on --bg (the palette rust is 4.5:1) */
  --link-hover: #6e3a24;

  /* Topic palette (decorative use only; not used for body text). */
  --rust: #a65a3a;
  --plum: #7e4a7a;
  --ochre: #c0913f;
  --sage: #6f8f55;
  --indigo: #5a5aa6;
  --teal: #4f7f8a;

  --serif: Georgia, "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Skip link */
.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--bg-card);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  z-index: 10;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: bold;
  color: var(--text);
  text-decoration: none;
}
.brand img {
  width: 32px;
  height: 32px;
}
.site-nav a {
  margin-left: 1rem;
}

/* Type */
h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.25;
  color: var(--text);
}
h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  margin: 2.5rem 0 1rem;
}
h2 {
  font-size: 1.45rem;
  margin: 2.25rem 0 0.6rem;
}
h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.4rem;
}
p,
ul,
ol {
  margin: 0 0 1rem;
}
li {
  margin-bottom: 0.35rem;
}
a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--link-hover);
}
a:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0 0.25em;
}
.lede {
  font-size: 1.2rem;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}

/* Call to action */
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 1.5rem 0 2rem;
}
.button {
  display: inline-block;
  background: var(--link);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.15rem;
  border-radius: 6px;
}
.button:hover {
  background: var(--link-hover);
  color: #fff;
}

/* Product figure: the static screenshot, swapped for the live demo once demo.js loads. It sits
   outside the text column and runs edge to edge, set into the page between two hairlines rather
   than floating as a card. Content inside is capped at --shot-max and centred. */
.shot {
  --shot-max: 76rem;
  --shot-pad: clamp(1rem, 3vw, 2.5rem);
  margin: 0.5rem 0 1.5rem;
  padding: 1.75rem var(--shot-pad) 1.25rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
/* The screenshot is cropped to the overlay panel (no HN backdrop, close button or rounded window
   corners), so its parchment runs straight into the page; the bottom fades out. */
.shot picture {
  position: relative;
  display: block;
  max-width: var(--shot-max);
  margin: 0 auto;
  overflow: hidden;
  aspect-ratio: 1150 / 752;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, #000 78%, transparent);
}
/* Paint over the overlay's close button (top right of the crop); the panel is exactly --bg. */
.shot picture::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 7%;
  height: 8%;
  background: var(--bg);
}
.shot img {
  display: block;
  width: calc(100% * 1280 / 1150);
  max-width: none;
  height: auto;
  margin: calc(-100% * 48 / 1150) 0 0 calc(-100% * 66 / 1150);
}
.shot figcaption {
  max-width: 44rem;
  margin: 0.75rem auto 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

/* Live demo (demo.js swaps it in for the screenshot): the tree lives in its own shadow root
   (see extension/src/web-demo/mount.ts DEMO_CSS) and grows to its natural height. */
.shot-live {
  padding-top: 0.75rem;
}
.shot-live .hubbub-demo {
  display: block;
  max-width: var(--shot-max);
  min-width: 0;
  margin: 0 auto;
}

/* Soil bar illustration (CSS only; no longer used on the landing page) */
.demo {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1rem 1.1rem 1.1rem;
  margin: 0 0 2rem;
}
.demo figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.75rem;
}
.soil {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 0.9rem;
}
.soil span {
  display: block;
  height: 100%;
}
.soil .s1 { flex: 7; background: var(--rust); }
.soil .s2 { flex: 5; background: var(--plum); }
.soil .s3 { flex: 4; background: var(--ochre); }
.soil .s4 { flex: 3; background: var(--sage); }
.soil .s5 { flex: 2; background: var(--indigo); }
.soil .s6 { flex: 1.5; background: var(--teal); }

.topics {
  list-style: none;
  padding: 0;
  margin: 0;
}
.topics li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0;
  border-top: 1px dashed var(--rule);
  margin: 0;
}
.topics li:first-child {
  border-top: 0;
}
.dot {
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
}
.d1 { background: var(--rust); }
.d2 { background: var(--plum); }
.d3 { background: var(--ochre); }
.d4 { background: var(--sage); }
.d5 { background: var(--indigo); }
.d6 { background: var(--teal); }
.topic-name {
  font-family: var(--serif);
}
.toggle {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Feature list */
.features {
  padding-left: 1.2rem;
}
.features li::marker {
  color: var(--rust);
}

/* Privacy policy */
.policy h2 {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
}
.policy .meta {
  color: var(--muted);
  font-size: 0.95rem;
}
.policy table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}
.policy th,
.policy td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.policy th {
  font-family: var(--serif);
}
.table-scroll {
  overflow-x: auto;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding: 1.25rem 0 2rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.site-footer p {
  margin: 0 0 0.4rem;
}

@media (max-width: 30rem) {
  body {
    font-size: 1rem;
  }
  .site-nav a {
    margin-left: 0.75rem;
  }
}
