/*
 * HDGP Tools: the website's Momentum look, adapted for an app.
 * Tokens are copied from hdgrowthpartners.com (src/styles/tokens.css) so the two
 * always read as one brand. Change the brand there first, then mirror it here.
 */

@font-face { font-family: 'Bricolage'; src: url('fonts/bricolage.woff2') format('woff2-variations'); font-weight: 400 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: 'Bricolage HL'; src: url('fonts/bricolage.woff2') format('woff2-variations'); font-weight: 400 800; font-stretch: 75% 100%; font-display: swap; ascent-override: 74%; descent-override: 8%; line-gap-override: 0%; }
@font-face { font-family: 'Inter'; src: url('fonts/inter.woff2') format('woff2-variations'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Martian'; src: url('fonts/martian-mono.woff2') format('woff2-variations'); font-weight: 400 700; font-display: swap; }

:root {
  --mint: #50a684;
  --mint-deep: #2f6b53;
  --ink: #07100c;
  --ink-brand: #040707;
  --muted: #4c5751;
  --canvas: #f4f5f1;
  --surface: #ffffff;
  --line: rgb(7 16 12 / 0.12);
  --sand: #e7b78a;
  --rose: #d6938a;
  --gold: #eed484;
  --slate: #4f758b;
  --radius: 10px;
  --display: 'Bricolage', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'Martian', ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.55 var(--body);
  /* The site's green-bar accounting paper, same subtle tint. */
  background-image: repeating-linear-gradient(to bottom, rgb(80 166 132 / 0.055) 0 2.5rem, transparent 2.5rem 5rem);
}
a { color: var(--mint-deep); }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--mint-deep); outline-offset: 2px; }

/* ---- Type --------------------------------------------------------------- */
.display {
  font-family: var(--display);
  font-weight: 760;
  font-stretch: 88%;
  letter-spacing: -0.012em;
  line-height: 0.9;
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}
.hl {
  font-family: 'Bricolage HL', var(--display);
  background: var(--mint);
  color: var(--ink-brand);
  padding: 0 0.14em;
  border-radius: var(--radius);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.eyebrow {
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font: 600 0.68rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45em 0.8em;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink-brand);
  white-space: nowrap;
}
.pill.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--muted); }
.pill.sand { background: var(--sand); }
.pill.rose { background: var(--rose); }
.pill.gold { background: var(--gold); }
.pill.ink { background: var(--ink); color: var(--canvas); }

/* ---- Layout --------------------------------------------------------------- */
.wrap { max-width: 78rem; margin: 0 auto; padding: 0 var(--gutter); }
main { padding: 2.2rem 0 6rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 2rem; }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
.page-head p { max-width: 38rem; margin: 0.8rem 0 0; color: var(--muted); }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.section { margin-top: 3rem; }
.section > h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.spacer { flex: 1; }

/* ---- Header --------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgb(244 245 241 / 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4.2rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); transition: opacity 0.12s; }
.brand:hover { opacity: 0.75; }
.brand img { width: 2.1rem; height: 2.1rem; }
.brand span { font: 760 1.2rem/1 var(--display); font-stretch: 88%; text-transform: uppercase; letter-spacing: 0.01em; }
.brand span b { color: var(--mint-deep); font-weight: inherit; }
.nav { display: flex; gap: 0.2rem; overflow-x: auto; scrollbar-width: none; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.93rem; padding: 0.45rem 0.75rem; border-radius: 999px; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.nav a:hover { color: var(--ink); background: rgb(80 166 132 / 0.12); }
.nav a[aria-current='page'] { color: var(--ink); background: var(--mint); }
.who { margin-left: auto; display: flex; align-items: center; gap: 0.7rem; font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.who button { background: none; border: 0; color: var(--mint-deep); cursor: pointer; padding: 0.3rem; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .topbar .wrap { flex-wrap: wrap; gap: 0.4rem 1rem; padding-top: 0.6rem; padding-bottom: 0.4rem; }
  .nav { order: 3; width: 100%; margin: 0 -0.5rem; }
  .who .name { display: none; }
}

/* ---- Cards & buttons (the site's ink outline + offset shadow) ------------- */
.card {
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
a.card, button.card { color: inherit; text-decoration: none; display: block; text-align: left; cursor: pointer; width: 100%; font: inherit; }
a.card:hover, button.card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--mint); }
.card.soon { border-style: dashed; box-shadow: none; background: rgb(255 255 255 / 0.55); }
.pad { padding: 1.3rem 1.4rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: var(--radius); padding: 0.8rem 1.2rem; font-weight: 600; font-size: 0.93rem;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--canvas);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.12s var(--ease), background 0.15s, color 0.15s;
}
.btn:hover { background: var(--mint-deep); border-color: var(--mint-deep); }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: rgb(80 166 132 / 0.14); border-color: var(--ink); }
.btn.mint { background: var(--mint); color: var(--ink-brand); border-color: var(--ink); }
.btn.mint:hover { background: #46987a; }
.btn.small { padding: 0.5rem 0.8rem; font-size: 0.84rem; }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; }

label.field { display: block; margin-bottom: 0.9rem; }
label.field > span { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.input, textarea.input, select.input {
  width: 100%; padding: 0.75rem 0.9rem; border-radius: var(--radius);
  border: 1.5px solid rgb(7 16 12 / 0.25); background: var(--surface);
}
.input:focus { outline: none; border-color: var(--mint-deep); box-shadow: 0 0 0 3px rgb(80 166 132 / 0.25); }
textarea.input { min-height: 7rem; resize: vertical; }

/* ---- Hub tiles ------------------------------------------------------------ */
.tile { display: flex; flex-direction: column; gap: 0.6rem; min-height: 12.5rem; padding: 1.4rem; }
.tile h3 { font-size: 1.75rem; margin-top: 0.35rem; }
.tile p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.tile .foot { margin-top: auto; display: flex; align-items: center; gap: 0.5rem; }
.tile .num { font: 760 2.8rem/1 var(--display); font-stretch: 88%; }

/* ---- Library ---------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.4rem; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0.4rem 0.9rem; font-size: 0.86rem; cursor: pointer; }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.kit-card .thumb { aspect-ratio: 4 / 5; background: var(--canvas) center / cover no-repeat; border-bottom: 1.5px solid var(--ink); border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0; position: relative; }
.kit-card .thumb .pill { position: absolute; top: 0.7rem; left: 0.7rem; }
.kit-card .meta { padding: 0.9rem 1rem 1rem; }
.kit-card h3 { font: 700 1.02rem/1.25 var(--body); margin: 0.25rem 0 0.3rem; }

dialog.sheet {
  width: min(64rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem);
  padding: 0; border: 1.5px solid var(--ink); border-radius: var(--radius);
  box-shadow: 8px 8px 0 var(--ink); background: var(--canvas); color: var(--ink);
}
dialog.sheet::backdrop { background: rgb(7 16 12 / 0.55); }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: start; gap: 1rem; padding: 1.2rem 1.4rem; background: var(--canvas); border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.sheet-body { padding: 1.4rem; display: grid; gap: 1.6rem; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 820px) { .sheet-body { grid-template-columns: 1fr; } }
.x { margin-left: auto; background: none; border: 1.5px solid var(--ink); border-radius: 999px; width: 2.4rem; height: 2.4rem; cursor: pointer; font-size: 1.2rem; flex: none; }
.files { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
.file { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.file .pic { aspect-ratio: 1; background: #e9ebe5 center / contain no-repeat; display: grid; place-items: center; font: 600 0.75rem var(--mono); color: var(--muted); }
.file .cap { padding: 0.5rem 0.6rem; font-size: 0.78rem; display: flex; gap: 0.4rem; align-items: center; justify-content: space-between; }
.file .cap a { font-weight: 600; white-space: nowrap; }
.caption { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; margin-bottom: 0.8rem; }
.caption header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.caption p { margin: 0; white-space: pre-wrap; font-size: 0.93rem; }
.notes { display: grid; gap: 0.6rem; margin-top: 0.8rem; }
.note { border-left: 4px solid var(--mint); background: var(--surface); padding: 0.6rem 0.8rem; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.9rem; }
.note.changes { border-color: var(--sand); }
.note b { font-weight: 600; }

/* ---- Brand Hub ------------------------------------------------------------ */
.swatch { overflow: hidden; }
.swatch .chip-color { height: 6.5rem; border-bottom: 1.5px solid var(--ink); }
.swatch .info { padding: 0.8rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.swatch code { font: 500 0.82rem var(--mono); }
.fact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 1rem; align-items: start; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact .v { font: 760 2rem/1 var(--display); font-stretch: 88%; }
.fact .t { white-space: pre-wrap; font-size: 0.95rem; }

/* ---- Toast ----------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 140%); background: var(--ink); color: var(--canvas); padding: 0.75rem 1.1rem; border-radius: var(--radius); font-size: 0.92rem; z-index: 100; transition: transform 0.3s var(--ease); box-shadow: 4px 4px 0 var(--mint); }
.toast.show { transform: translate(-50%, 0); }

/* ---- Ideas & bugs button --------------------------------------------------- */
#ideas-btn { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 60; display: inline-flex; align-items: center; gap: 0.45rem; background: var(--mint); color: var(--ink-brand); border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); border-radius: 999px; padding: 0.65rem 1rem; font-weight: 700; font-size: 0.88rem; cursor: pointer; transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease); }
#ideas-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; margin-bottom: 1rem; }
.seg button { border: 0; background: var(--surface); padding: 0.5rem 1rem; cursor: pointer; font-weight: 600; font-size: 0.88rem; }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--canvas); }
.shots { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.6rem; }
.shots .t { position: relative; width: 4rem; height: 4rem; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.shots .t img { width: 100%; height: 100%; object-fit: cover; }
.shots .t button { position: absolute; top: 2px; right: 2px; width: 1.2rem; height: 1.2rem; border-radius: 50%; border: 0; background: rgb(7 16 12 / 0.8); color: #fff; font-size: 0.7rem; cursor: pointer; padding: 0; }

/* ---- Tables (admin) ------------------------------------------------------- */
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; font-size: 0.9rem; }
table.list th, table.list td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font: 600 0.7rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: var(--canvas); }
.table-scroll { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
