/* Landing page. Colors and radii mirror the extension (src/styles/tokens.css). */
:root {
  --bg: 212 60% 98%;
  --fg: 215 28% 12%;
  --muted: 215 14% 38%;
  --card: 0 0% 100%;
  --line: 214 25% 86%;
  --primary: 212 92% 42%;
  --on-primary: 0 0% 100%;
  --gh: 222 12% 24%;
  --gl: 22 80% 44%;
  --bb: 212 84% 42%;
  --beam: 212 100% 22%;
  --rail: 176px;
  --s: 1.08;
  --font:
    "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: 215 28% 7%;
    --fg: 0 0% 96%;
    --muted: 215 12% 66%;
    --card: 215 21% 11%;
    --line: 213 14% 20%;
    --primary: 212 92% 62%;
    --on-primary: 215 28% 7%;
    --gh: 210 14% 68%;
    --gl: 22 85% 58%;
    --bb: 212 90% 64%;
    --beam: 200 100% 86%;
  }
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font);
  background: hsl(var(--bg));
  color: hsl(var(--fg));
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
::selection {
  background: hsl(var(--primary) / 0.22);
}
:focus-visible {
  outline: 3px solid hsl(var(--primary));
  outline-offset: 3px;
  border-radius: 6px;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: hsl(var(--bg) / 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid hsl(var(--line));
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand img {
  border-radius: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    transform 0.15s ease-out,
    background-color 0.15s;
}
.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--on-primary));
}
.btn-primary:hover {
  background: hsl(var(--primary) / 0.88);
}
.btn:active {
  transform: translateY(1px);
}
.btn-lg {
  height: 52px;
  padding: 0 28px;
  font-size: 17px;
  border-radius: 10px;
}
.btn.pending {
  background: transparent;
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.5);
  cursor: default;
}
.btn.pending:hover {
  background: transparent;
}
.link {
  color: hsl(var(--primary));
  font-weight: 600;
  text-underline-offset: 4px;
}

/* ---- the branch graph ---- */
.flow {
  position: relative;
  overflow-x: clip;
  padding-left: var(--rail);
  padding-right: clamp(16px, 4vw, 48px);
  max-width: 1280px;
  margin: 0 auto;
}
.graph {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--rail);
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.graph .base {
  fill: none;
  stroke: hsl(var(--line));
  stroke-width: 3;
  stroke-linecap: round;
}
.graph .live {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
}
.graph .live.gh {
  stroke: hsl(var(--gh));
}
.graph .live.gl {
  stroke: hsl(var(--gl));
}
.graph .live.bb {
  stroke: hsl(var(--bb));
}
.graph .live.trunk {
  stroke: hsl(var(--primary));
}
.graph .beam {
  fill: none;
  stroke: url(#beam);
  stroke-width: 3;
  stroke-linecap: round;
}
.beam-stop {
  stop-color: hsl(var(--beam));
}
.graph .node {
  fill: hsl(var(--bg));
  stroke: hsl(var(--line));
  stroke-width: 3;
  transition:
    fill 0.25s,
    stroke 0.25s;
}
.graph .node.on {
  fill: hsl(var(--primary));
  stroke: hsl(var(--primary));
}
.graph .label {
  fill: hsl(var(--muted));
  font: 700 11px/1 var(--font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: fill 0.25s;
}
.graph .label.on {
  fill: hsl(var(--fg));
}
.graph .ring {
  fill: none;
  stroke: hsl(var(--bg));
  stroke-width: 6;
}

section[data-section] {
  position: relative;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  padding: 72px 0 120px;
  min-height: min(calc(100svh - 66px), 820px);
}
.heads {
  position: absolute;
  left: calc(var(--rail) * -1);
  top: 24px;
  width: var(--rail);
  height: 28px;
}
.chip {
  position: absolute;
  top: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  transform: translateX(-50%);
}
.chip svg {
  width: 15px;
  height: 15px;
}
.chip-gh {
  left: 18%;
  background: hsl(222 12% 24%);
}
.chip-gl {
  left: 50%;
  background: hsl(22 80% 40%);
}
.chip-bb {
  left: 82%;
  background: hsl(212 84% 40%);
}
.hero-copy {
  max-width: 600px;
}
h1 {
  margin: 0 0 24px;
  font-size: clamp(44px, 6.4vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  text-wrap: balance;
}
.lede {
  margin: 0 0 32px;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  color: hsl(var(--muted));
  max-width: 34ch;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}
.fine {
  margin: 20px 0 0;
  font-size: 14px;
  color: hsl(var(--muted));
}

/* The real popup UI in a window frame, scaled by --s */
.device {
  margin: 0;
  justify-self: center;
}
.popup {
  position: relative;
  width: calc(440px * var(--s));
  height: calc(var(--h) * var(--s));
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 0 0 1px hsl(var(--line)),
    0 28px 64px -16px hsl(215 40% 20% / 0.35);
}
.popup iframe {
  width: 440px;
  height: var(--h);
  border: 0;
  display: block;
  transform: scale(var(--s));
  transform-origin: top left;
}
.device figcaption,
.caption {
  margin-top: 14px;
  font-size: 13px;
  color: hsl(var(--muted));
  text-align: center;
}

.step {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 56px clamp(32px, 5vw, 80px);
  align-items: center;
  padding: 96px 0;
}
/* Text takes the spare width; the visual keeps its own width and wraps below when the row is too narrow. */
.step > .device {
  flex: 0 0 auto;
}
.step h2,
.finale h2 {
  margin: 0 0 20px;
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.copy {
  flex: 1 1 380px;
  min-width: 0;
  max-width: 540px;
}
.copy > p {
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.6;
  color: hsl(var(--muted));
  text-wrap: pretty;
}
.facts {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}
.facts li {
  font-size: 16px;
  line-height: 1.55;
  color: hsl(var(--fg));
  padding-top: 14px;
  border-top: 1px solid hsl(var(--line));
  text-wrap: pretty;
}
.copy > p.note {
  margin: 24px 0 0;
  font-size: 15px;
}
kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0 0.45em;
  border: 1px solid hsl(var(--line));
  border-bottom-width: 2px;
  border-radius: 6px;
  background: hsl(var(--card));
  color: hsl(var(--fg));
  font:
    600 0.82em/1.6 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  text-align: center;
}

.toasts {
  flex: 0 1 440px;
  min-width: 0;
}
.toast {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: hsl(var(--card));
  box-shadow:
    0 0 0 1px hsl(var(--line)),
    0 18px 40px -12px hsl(215 40% 20% / 0.3);
}
.toast + .toast {
  margin-top: 14px;
}
.toast img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
}
.toast p {
  margin: 0;
}
.toast .t {
  font-weight: 700;
}
.toast .m {
  color: hsl(var(--fg) / 0.85);
  line-height: 1.35;
}
.toast .a {
  margin-top: 4px;
  font-size: 12px;
  color: hsl(var(--muted));
}

.perms {
  flex: 0 1 520px;
  min-width: 0;
}
.perms table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: hsl(var(--card));
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px hsl(var(--line));
  font-size: 15px;
}
.perms caption {
  text-align: left;
  padding: 0 0 12px;
  font-weight: 700;
}
.perms th,
.perms td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid hsl(var(--line));
}
.perms thead th {
  border-top: 0;
  font-size: 13px;
  color: hsl(var(--muted));
  background: hsl(var(--fg) / 0.04);
}
.perms tbody th {
  font-weight: 600;
  width: 40%;
}
.perms td {
  color: hsl(var(--muted));
}
/* Permission names and API hosts are literal values, so they set in mono. */
.perm,
.host {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.perm {
  font-size: 14px;
  font-weight: 600;
}
.hosts {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.host {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  border: 1px solid hsl(var(--line));
  border-radius: 6px;
  background: hsl(var(--bg));
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.host svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.finale {
  padding: 120px 0 140px;
  max-width: 640px;
}
.finale p {
  margin: 0 0 32px;
  font-size: 20px;
  color: hsl(var(--muted));
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding: 28px clamp(16px, 4vw, 48px);
  border-top: 1px solid hsl(var(--line));
  font-size: 14px;
  color: hsl(var(--muted));
}
.foot span:last-child {
  margin-left: auto;
}

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-top: 56px;
  }
  .device {
    justify-self: start;
  }
  .step {
    padding: 72px 0;
  }
}
@media (max-width: 560px) {
  .graph .label {
    display: none;
  }
  :root {
    --rail: 56px;
    --s: 0.85;
  }
  .brand span {
    font-size: 14px;
  }
  .bar .btn {
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
  }
  .chip {
    width: 22px;
    height: 22px;
  }
  .chip svg {
    width: 12px;
    height: 12px;
  }
  .foot span:last-child {
    margin-left: 0;
  }
  /* Too narrow for two columns: each permission sits above its reason. */
  .perms thead {
    display: none;
  }
  .perms tbody th,
  .perms td {
    display: block;
    width: auto;
  }
  .perms td {
    border-top: 0;
    padding-top: 0;
  }
}
@media (max-width: 420px) {
  :root {
    --s: 0.66;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn,
  .graph .node {
    transition: none;
  }
}

.flex {
  display: "flex";
}