/* Huddle website. One accent (indigo), two typefaces, light and dark. No build step, no dependencies. */

/* The two typefaces are served from this site (SIL Open Font License, see fonts/): no third-party request, and with the
   preload in each page no swap that moves the text. Latin subset; both files are variable fonts. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url(fonts/bricolage-grotesque-latin.woff2) format("woff2");
  font-weight: 600 800;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url(fonts/source-serif-4-latin.woff2) format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --ink: #12142b;
  --muted: #4b4f6b;
  --line: #d5d7e8;
  --accent: #4336d8;
  --on-accent: #ffffff;
  --board: #14163a;
  --board-ink: #ecedff;
  --board-muted: #b4b7dc;
  --board-line: #3b3f78;
  --board-accent: #a29bff;
  --display: "Bricolage Grotesque", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --measure: 66ch;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d1f;
    --surface: #15173a;
    --ink: #ecedfa;
    --muted: #aeb1cf;
    --line: #2a2d57;
    --accent: #a29bff;
    --on-accent: #0c0d1f;
    --board: #15173a;
    --board-line: #3b3f78;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.16em; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--display);
  font-weight: 600;
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip:focus { top: 0.5rem; }

/* Layout */
.wrap { width: min(100% - 2 * var(--gutter), 72rem); margin-inline: auto; }
.prose { max-width: var(--measure); }
section { padding-block: clamp(3rem, 8vw, 6rem); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.9rem;
}
.brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.brand svg { width: 1.7rem; height: 1.7rem; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; font-family: var(--display); font-weight: 600; font-size: 1rem; }
.nav a { color: var(--ink); text-decoration: none; padding-block: 0.4rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--accent); }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* Type */
h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(2.5rem, 7vw, 4.9rem); line-height: 1.02; letter-spacing: -0.03em; }
h2 { font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.1; letter-spacing: -0.02em; }
h3 { font-weight: 700; font-size: 1.3rem; line-height: 1.25; letter-spacing: -0.01em; }
p, ul, ol { margin: 0 0 1.1em; }
.lead { font-size: clamp(1.2rem, 2.4vw, 1.5rem); line-height: 1.5; color: var(--muted); max-width: 40rem; }
.muted { color: var(--muted); }

code, kbd {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.08em 0.35em;
}

pre {
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.6;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  margin: 0 0 1.4em;
  overflow-x: auto;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.btn {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  display: inline-block;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }

/* Hero */
.hero { padding-block: clamp(3rem, 9vw, 7rem) clamp(2.5rem, 6vw, 4rem); }
.hero h1 { max-width: 15ch; }

/* The board: the label-flow diagram is the signature of the site */
.board {
  background: var(--board);
  color: var(--board-ink);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}
.board h2 { color: var(--board-ink); }
.board .lead { color: var(--board-muted); }
.board a { color: var(--board-accent); }
.flow { margin-top: 2.5rem; }
.flow svg { display: block; width: 100%; }
.flow .wide { display: block; }
.flow .tall { display: none; max-width: 22rem; margin-inline: auto; }
@media (max-width: 44rem) {
  .flow .wide { display: none; }
  .flow .tall { display: block; }
}
.f-line { stroke: var(--board-line); stroke-width: 3; fill: none; }
.f-branch { stroke: var(--board-accent); stroke-width: 2.5; fill: none; stroke-dasharray: 6 6; }
.f-arrow { fill: var(--board-accent); }
.f-node { fill: var(--board); stroke: var(--board-ink); stroke-width: 3; }
.f-node-end { fill: var(--board-accent); stroke: var(--board-accent); stroke-width: 3; }
.f-box { fill: none; stroke: var(--board-accent); stroke-width: 2; }
.f-label { fill: var(--board-ink); font-family: var(--display); font-weight: 700; font-size: 20px; }
.f-note { fill: var(--board-muted); font-family: var(--text); font-size: 15px; }
.f-branch-label { fill: var(--board-accent); font-family: var(--display); font-weight: 700; font-size: 17px; }

/* Problem, steps, columns */
.problem-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.problem-list li { border-top: 3px solid var(--accent); padding-top: 0.9rem; }
.problem-list strong { display: block; font-family: var(--display); font-size: 1.25rem; margin-bottom: 0.2rem; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 2rem auto 0; width: min(100% - 2 * var(--gutter), 72rem); display: grid; gap: 2rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--display);
  font-weight: 800;
  margin-bottom: 0.8rem;
}
.steps h3 { margin-bottom: 0.3em; }
.steps p { color: var(--muted); margin: 0; }

.two { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); margin-top: 2rem; }
.two > div { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1.4rem; }
.two h3 { margin-bottom: 0.4em; }
.two p:last-child { margin-bottom: 0; }

.band { background: var(--surface); border-block: 1px solid var(--line); }

/* FAQ */
details { border-bottom: 1px solid var(--line); max-width: 48rem; }
details:first-of-type { border-top: 1px solid var(--line); }
summary {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  padding: 1rem 2rem 1rem 0;
  list-style: none;
  position: relative;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0.2rem;
  top: 0.85rem;
  font-size: 1.5rem;
  color: var(--accent);
  transition: transform 0.15s ease;
}
details[open] summary::after { transform: rotate(45deg); }
details > :not(summary) { max-width: var(--measure); }
details p:last-child { margin-bottom: 1.2rem; }

/* Inner pages */
.page-head { padding-block: clamp(2.5rem, 7vw, 5rem) 1rem; }
.page-head h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); max-width: 18ch; }
article section { padding-block: clamp(1.5rem, 4vw, 2.5rem); }
article h2 { margin-top: 0.4em; }
.toc { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; list-style: none; padding: 0; margin: 1.5rem 0 0; font-family: var(--display); font-weight: 600; }
table { border-collapse: collapse; width: 100%; max-width: 48rem; margin: 0 0 1.5em; font-size: 1rem; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 0.8rem 0.7rem 0; border-bottom: 1px solid var(--line); }
th { font-family: var(--display); font-weight: 700; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.note { border-left: 4px solid var(--accent); padding: 0.2rem 0 0.2rem 1.1rem; max-width: var(--measure); }
.only-you { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1.2rem 1.4rem; max-width: var(--measure); }
.only-you h3 { margin-bottom: 0.4em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; font-size: 1rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; justify-content: space-between; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.site-footer p { margin: 0; }

/* ---------- Landing page (Issue #61) ----------
   The page is complete without the script: every rule below that moves or re-lays-out something is either an
   animation under prefers-reduced-motion: no-preference, or hangs on a class the script adds (.fx-*). */

body { overflow-x: clip; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The ↗ after a link that opens another site in a new tab (the words «opens in a new tab» are in .sr-only) */
.ext { display: inline-block; margin-left: 0.2em; font-family: system-ui, sans-serif; font-size: 0.8em; font-weight: 400; text-decoration: none; }

/* Lenis (smooth scroll) needs these few rules; they come from lenis.css 1.3.27 */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }

/* 1. Hero: three depth layers behind the headline */
.hero { position: relative; overflow: clip; isolation: isolate; }
.hero-copy { position: relative; z-index: 1; }
.hero-layers { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.layer { position: absolute; inset: -12% 0; }
.layer-grid {
  background-image: radial-gradient(circle, var(--line) 1.6px, transparent 1.8px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 72% 40%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 70% 80% at 72% 40%, #000 15%, transparent 72%);
}
.hero-orb { position: absolute; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffffff55, transparent 42%), var(--accent); }
.o1 { width: 4.2rem; height: 4.2rem; top: 18%; left: 52%; opacity: 0.9; }
.o2 { width: 2.2rem; height: 2.2rem; top: 72%; left: 64%; opacity: 0.55; }
.o3 { width: 9rem; height: 9rem; top: 6%; right: -3rem; opacity: 0.16; }
.float-card {
  position: absolute;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  box-shadow: 0 14px 34px -16px rgb(67 54 216 / 0.45);
  white-space: nowrap;
}
.float-card b { color: var(--accent); margin-right: 0.3rem; }
.fc1 { top: 14%; right: 9%; }
.fc2 { top: 38%; right: 26%; }
.fc3 { top: 60%; right: 6%; }
.fc4 { top: 80%; right: 30%; }
@media (max-width: 44rem) {
  .layer-grid { -webkit-mask-image: none; mask-image: none; opacity: 0.6; }
  .fc2, .fc4, .o1, .o2 { display: none; }
  .fc1 { top: 4%; right: 4%; opacity: 0.8; }
  .fc3 { top: auto; bottom: 3%; right: 4%; opacity: 0.8; }
}

/* 2. The problem: five session orbs */
#problem { overflow: clip; }
.orbs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 1rem;
  margin: 2.5rem 0 1rem;
}
.orb { display: grid; justify-items: center; gap: 0.2rem; width: 6.6rem; text-align: center; font-family: var(--display); }
.orb-dot {
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff55, transparent 42%), var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  font-size: 1.2rem;
}
.orb:nth-child(2) .orb-dot { background-color: color-mix(in srgb, var(--accent) 82%, var(--surface)); }
.orb:nth-child(3) .orb-dot { background-color: color-mix(in srgb, var(--accent) 66%, var(--surface)); }
.orb:nth-child(4) .orb-dot { background-color: color-mix(in srgb, var(--accent) 90%, var(--ink)); }
.orb:nth-child(5) .orb-dot { background-color: color-mix(in srgb, var(--accent) 74%, var(--ink)); }
.orb-tag { font-weight: 700; font-size: 0.95rem; }
.orb-branch { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.clash {
  position: absolute;
  visibility: hidden;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--on-accent);
  background: var(--ink);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  white-space: nowrap;
}
.c1 { left: 24%; top: 0; }
.c2 { left: 58%; top: 52%; }

/* 3. The label flow: the signature scene. Pinned only when the script says so (.fx-flow). */
.board-link { color: var(--board-muted); }
.board .flow { margin-top: 2rem; }
.flow svg.wide { max-height: 52svh; }
.f-line-lit { stroke: var(--board-accent); stroke-width: 3; fill: none; transform-box: fill-box; transform-origin: 0 50%; }
.f-ring { stroke: var(--board-accent); stroke-width: 2.5; }
.f-bubble rect { fill: var(--board-accent); }
.f-bubble text { fill: #14163a; font-family: var(--display); font-weight: 700; font-size: 16px; }
.f-a rect, .f-c rect { fill: var(--board-ink); }
.f-card rect { fill: #ffffff; stroke: var(--board-accent); stroke-width: 2.5; }
.f-card text { fill: #14163a; font-family: var(--display); font-weight: 800; font-size: 15px; }
.f-card { filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.35)); }
.fx-flow .board { min-height: 100svh; display: flex; align-items: center; padding-block: 1.5rem; }
.fx-flow .board .wrap { width: min(100% - 2 * var(--gutter), 72rem); }
.fx-flow .board h2 { margin-bottom: 0.3em; }
.fx-flow .board .lead { margin-bottom: 0; }
.fx-flow .board .flow { margin-top: 1rem; }
.fx-flow .board-link { margin: 0.5rem 0 0; }
.fx-flow-phone .board { min-height: 0; display: block; padding-block: 2.5rem; }
.fx-flow-phone .board .flow { min-height: 0; margin-top: 1.5rem; }
.fx-flow-phone .flow svg.tall { height: min(76svh, 38rem); width: auto; max-width: 100%; aspect-ratio: 340 / 580; margin-inline: auto; }
.is-active .f-card, .is-active .f-bubble, .is-active .f-line-lit, .is-active .f-ring { will-change: transform, opacity; }

/* 4. Four steps: sideways inside a pinned scene on wide screens, a plain grid everywhere else */
.progress { display: none; height: 4px; margin-top: 2rem; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.fx-h #steps { padding-block: 0; overflow: clip; }
.fx-h .hpin { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.fx-h .htrack { overflow: clip; margin-top: 1.5rem; }
.fx-h .steps { display: flex; flex-wrap: nowrap; gap: 1.5rem; width: max-content; margin: 0; padding-inline: max(var(--gutter), calc((100vw - 72rem) / 2)); }
.fx-h .steps li {
  width: min(25rem, 72vw);
  min-height: 15rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.6rem;
}
.fx-h .progress { display: block; }
.is-active .steps, .is-active .progress i { will-change: transform; }

/* 5. Two roles */
.split { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); margin-top: 2.5rem; }
.role { border-radius: 8px; padding: 1.8rem; }
.role h3 { margin-bottom: 0.6em; font-size: 1.5rem; }
.role ul { margin: 0; padding-left: 1.2rem; }
.role li + li { margin-top: 0.6rem; }
.role-manager { background: var(--board); color: var(--board-ink); }
.role-manager h3 { color: var(--board-ink); }
.role-dev { background: var(--surface); border: 1px solid var(--line); }
@media (min-width: 48em) {
  .role-dev { margin-top: 3rem; }
}
.is-active .role { will-change: transform; }

/* 6. GitHub and GitLab come together */
.merge { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 1.2rem; margin: 2.5rem 0 1rem; }
.mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.7rem, 5vw, 2.8rem);
  letter-spacing: -0.03em;
  padding: 0.2rem 1.1rem 0.3rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.same { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--accent); text-align: center; }
.is-active .mark, .is-active .same { will-change: transform, opacity; }

/* 7. Install: a terminal that types its own commands */
.terminal {
  background: var(--board);
  color: var(--board-ink);
  border: 1px solid var(--board-line);
  border-radius: 10px;
  overflow: hidden;
  max-width: 46rem;
  margin: 0 0 1.5rem;
  box-shadow: 0 26px 50px -30px rgb(20 22 58 / 0.7);
}
.term-bar { position: relative; display: flex; align-items: center; gap: 0.9rem; height: 2.7rem; padding-inline: 1rem; border-bottom: 1px solid var(--board-line); }
.dots { display: inline-flex; gap: 0.4rem; }
.dots i { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--board-line); }
.dots i:first-child { background: var(--board-accent); }
.term-title { font-family: var(--display); font-weight: 600; font-size: 0.9rem; color: var(--board-muted); }
.copy {
  position: absolute;
  right: 0.6rem;
  top: 0.4rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--board-ink);
  background: transparent;
  border: 1px solid var(--board-line);
  border-radius: 999px;
  padding: 0.22rem 0.9rem;
  cursor: pointer;
}
.copy:hover { background: var(--board-line); }
.terminal :focus-visible { outline-color: var(--board-accent); }
.terminal pre { background: none; border: 0; border-radius: 0; margin: 0; color: inherit; padding: 1.2rem 1.3rem 1.3rem; }
.prompt { color: var(--board-accent); user-select: none; }
.tl { position: relative; display: inline-block; }
.tl-mask {
  position: absolute;
  inset: 0 -0.3ch 0 0;
  background: var(--board);
  border-left: 2px solid var(--board-accent);
  transform: scaleX(0);
  transform-origin: 100% 50%;
}
.is-active .tl-mask { will-change: transform; }

/* 8. Final call */
.final { margin-top: clamp(3rem, 8vw, 5rem); padding-top: clamp(2.5rem, 6vw, 4rem); border-top: 1px solid var(--line); }
.final h2 { font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.02; letter-spacing: -0.03em; max-width: 14ch; }
.final .btn { font-size: 1.2rem; padding: 0.95rem 1.9rem; }
.is-active .final .btn { will-change: transform; }

/* Motion. The hero says its words one after the other, then the buttons come in; that part is CSS only, so the
   headline is on screen at once even if the script never loads. The rest is the script's job. */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 .w { display: inline-block; animation: word 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i) * 55ms); }
  .hero .actions { animation: rise 0.5s ease both; animation-delay: 0.55s; }
  .hero-layers { animation: layers-in 1.2s ease both; }
}
@keyframes word { from { opacity: 0; transform: translateY(0.5em); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(0.6rem); } to { opacity: 1; transform: none; } }
@keyframes layers-in { from { opacity: 0.2; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  summary::after { transition: none; }
  .hero h1 .w, .hero .actions, .hero-layers { animation: none; }
  .deco { animation: none; transition: none; }
  .tl-mask { display: none; }
}
