/* Knit site in the knit-pinterest-scan-4x5 ad's palette (Pinterest Gestalt values, from the ad's lib/tokens.js).
   Two radii: --r-card (images, cards, dialog, inputs) and --r-pill (pills, chips, buttons). Avatars are circles. */
@font-face {
  font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap;
  src: url("assets/fonts/knit-bricolage-600-latin.woff2") format("woff2");
}

:root {
  --c-canvas: #FFFFFF;
  --c-ink: #000000;
  --c-subtle: #62625B;
  --c-secondary: #E5E5E0;
  --c-secondary-pressed: #CECEC5;
  --c-soft: #F6F6F3;
  --c-hairline: #C8C8C1;
  --c-interactive: #91918C;
  --c-selected: #33332E;
  --c-red: #E60023;
  --c-red-hover: #CC001F;
  --c-red-pressed: #B2001B;
  --c-badge-bg: #FFEBEB;
  --c-badge-ink: #B60C0C;
  --c-focus: #435EE5;
  --c-white: #FFFFFF;
  --c-chip-a: #FFE0CC; --c-chip-b: #C7F0DA; --c-chip-c: #DBE1FF; --c-chip-d: #FBDFFF;

  --f-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --f-knit: "Bricolage Grotesque", var(--f-ui);

  --t-display: 60px; --t-heading: 28px; --t-title: 20px; --t-body: 16px; --t-label: 15px; --t-small: 14px; --t-meta: 12px;
  --r-card: 16px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px; --s12: 48px; --s24: 96px;
  --h-ctl: 48px; --h-ctl-sm: 40px; --avatar: 32px;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --d-fast: 150ms; --d-base: 200ms;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--c-canvas); color: var(--c-ink);
  font: 400 var(--t-body)/1.5 var(--f-ui); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; object-fit: cover; }
a { color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -64px; z-index: 30; padding: var(--s2) var(--s4); background: var(--c-ink); color: var(--c-white); border-radius: var(--r-pill); }
.skip:focus { top: var(--s4); }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }

.ic { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ic svg, .g svg { width: 100%; height: 100%; display: block; fill: currentColor; }

.wordmark {
  font-family: var(--f-knit); font-weight: 600; letter-spacing: -0.02em; line-height: 1;
  font-size: var(--t-heading); text-decoration: none; color: var(--c-ink);
}
.wordmark.md { font-size: 40px; }
.wordmark.sm { font-size: 22px; }

/* ---------- pills ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: var(--h-ctl-sm); padding: 0 var(--s4); border: 0; border-radius: var(--r-pill);
  font-size: var(--t-label); font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color var(--d-fast) var(--ease-out), transform var(--d-fast) var(--ease-out);
}
.pill:active { transform: scale(0.97); }
.pill.lg { height: var(--h-ctl); padding: 0 var(--s6); font-size: var(--t-body); }
.pill.wide { width: 100%; }
.pill.red { background: var(--c-red); color: var(--c-white); }
.pill.red:hover { background: var(--c-red-hover); }
.pill.red:active { background: var(--c-red-pressed); }
.pill.gray { background: var(--c-secondary); color: var(--c-ink); }
.pill.gray:hover { background: var(--c-secondary-pressed); }
.pill.selected { background: var(--c-selected); color: var(--c-white); }
.pill .ic { width: 18px; height: 18px; }

.icbtn {
  display: inline-grid; place-items: center; width: var(--h-ctl-sm); height: var(--h-ctl-sm); flex: none;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  transition: background-color var(--d-fast) var(--ease-out);
}
.icbtn:hover { background: var(--c-secondary); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s4);
  height: 80px; padding: 0 var(--s6); background: var(--c-canvas);
}
.topnav { display: flex; gap: var(--s1); }
.navlink {
  display: inline-flex; align-items: center; height: var(--h-ctl); padding: 0 var(--s4); border-radius: var(--r-pill);
  font-weight: 600; text-decoration: none; transition: background-color var(--d-fast) var(--ease-out);
}
.navlink:hover { background: var(--c-secondary); }
.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); height: var(--h-ctl); padding: 0 var(--s4);
  border-radius: var(--r-card); background: var(--c-secondary); color: var(--c-subtle);
}
.search:focus-within { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent;
  font: inherit; color: var(--c-ink);
}
/* The ring is drawn on the whole pill by .search:focus-within. */
.search input:focus-visible { outline: 2px solid transparent; }
.search input::placeholder { color: var(--c-subtle); }
.topcta { display: flex; gap: var(--s2); }

/* ---------- hero ---------- */
.hero { position: relative; padding: var(--s12) var(--s6) 0; text-align: center; }
.hero-copy { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: var(--t-display); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.cycle { display: inline-block; color: var(--c-red); transition: opacity var(--d-base) var(--ease-out), transform var(--d-base) var(--ease-out); }
.cycle.out { opacity: 0; transform: translateY(12px); }
.dots { display: flex; justify-content: center; gap: var(--s2); margin-top: var(--s6); }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--c-secondary); transition: background-color var(--d-base) var(--ease-out); }
.dots i.on { background: var(--c-red); }
.lede { margin-top: var(--s6); font-size: var(--t-title); line-height: 1.45; color: var(--c-subtle); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3); margin-top: var(--s8); }

.masonry {
  position: relative; columns: 6 200px; column-gap: var(--s4); max-width: 1440px; margin: var(--s12) auto 0;
  max-height: 760px; overflow: hidden; text-align: left;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.pin { break-inside: avoid; margin: 0 0 var(--s4); animation: rise 600ms var(--ease-out) both /* deliberate */; }
.pin img { width: 100%; height: auto; border-radius: var(--r-card); background: var(--c-secondary); }
.pin-cap { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s1) 0; }
.pin-cap b { font-size: var(--t-small); font-weight: 600; }
.chip-sm { padding: var(--s1) var(--s3); border-radius: var(--r-pill); background: var(--c-secondary); font-size: var(--t-meta); font-weight: 600; white-space: nowrap; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

/* ---------- how ---------- */
.how { max-width: 1120px; margin: 0 auto; padding: var(--s12) var(--s6) var(--s24); }
.how h2, .groups-head h2 { font-size: var(--t-heading); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.how h2 { text-align: center; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s8); margin: var(--s8) 0 0; padding: 0; }
.steps li { display: flex; gap: var(--s4); align-items: flex-start; }
.step-n {
  display: grid; place-items: center; width: var(--h-ctl-sm); height: var(--h-ctl-sm); flex: none; border-radius: 50%;
  background: var(--c-selected); color: var(--c-white); font-weight: 700;
}
.steps h3 { font-size: var(--t-title); line-height: 1.3; font-weight: 700; }
.steps p { margin-top: var(--s1); color: var(--c-subtle); max-width: 36ch; }

/* ---------- explore ---------- */
.explore {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: var(--s8); align-items: start;
  max-width: 1120px; margin: 0 auto; padding: 0 var(--s6) var(--s24);
}
.groups-head { text-align: center; }
.sub { color: var(--c-subtle); margin-top: var(--s1); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin: var(--s6) 0 var(--s4); }
.chip {
  height: var(--h-ctl-sm); padding: 0 var(--s4); border: 0; border-radius: var(--r-pill); cursor: pointer;
  font-size: var(--t-label); font-weight: 600; transition: filter var(--d-fast) var(--ease-out);
}
.chip:hover { filter: brightness(0.95); }
.chip.k-all { background: var(--c-secondary); }
.chip.k-making { background: var(--c-chip-a); }
.chip.k-food { background: var(--c-chip-b); }
.chip.k-outdoors { background: var(--c-chip-c); }
.chip.k-thrift { background: var(--c-chip-d); }
.chip[aria-pressed="true"] { background: var(--c-selected); color: var(--c-white); }

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: var(--s4); padding: var(--s2); border-radius: var(--r-card); cursor: pointer;
  transition: background-color var(--d-fast) var(--ease-out);
}
.row:hover { background: var(--c-soft); }
.row[aria-current="true"] { background: var(--c-secondary); }
.row-main { flex: 1; min-width: 0; }
.row-top { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.rn { font-size: 17px; line-height: 1.4; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { padding: 2px var(--s2); border-radius: var(--r-pill); background: var(--c-badge-bg); color: var(--c-badge-ink); font-size: var(--t-meta); font-weight: 700; white-space: nowrap; }
.rmeta { font-size: var(--t-small); line-height: 1.45; color: var(--c-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfriends { display: flex; align-items: center; gap: var(--s2); margin-top: 2px; font-size: var(--t-small); color: var(--c-subtle); }
.row .pill { flex: none; }
.row .pill.joined { background: var(--c-selected); }

.collage { display: flex; gap: 2px; flex: none; overflow: hidden; border-radius: var(--r-card); background: var(--c-white); }
.collage.lg { width: 96px; height: 64px; }
.collage.md { width: 60px; height: 40px; border-radius: var(--s2); }
.collage .cbig { height: 100%; aspect-ratio: 1; }
.collage .csmall { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.collage .csmall img { flex: 1; width: 100%; min-height: 0; }

.stack { display: inline-flex; flex: none; }
.stack img { width: var(--avatar); height: var(--avatar); border-radius: 50%; border: 2px solid var(--c-white); margin-left: -10px; }
.stack img:first-child { margin-left: 0; }
.stack.xs img { width: 24px; height: 24px; margin-left: -8px; }
.stack.xs img:first-child { margin-left: 0; }

.skel { display: flex; align-items: center; gap: var(--s4); padding: var(--s2); }
.skel i { display: block; border-radius: var(--r-card); background: var(--c-soft); animation: pulse 1.2s ease-in-out infinite /* deliberate */; }
.skel .s-thumb { width: 96px; height: 64px; }
.skel .s-lines { flex: 1; display: grid; gap: var(--s2); }
.skel .s-l1 { width: 55%; height: 16px; }
.skel .s-l2 { width: 80%; height: 12px; }
.skel .s-btn { width: 64px; height: var(--h-ctl-sm); border-radius: var(--r-pill); }
@keyframes pulse { 50% { opacity: 0.5; } }

.empty { padding: var(--s12) var(--s4); text-align: center; color: var(--c-subtle); }
.empty .pill { margin-top: var(--s4); }
.more { display: flex; justify-content: center; margin-top: var(--s4); }

/* ---------- preview (group chat) ---------- */
.preview {
  position: sticky; top: 96px; display: flex; flex-direction: column; height: min(640px, calc(100vh - 120px));
  border: 1px solid var(--c-hairline); border-radius: var(--r-card); overflow: hidden; background: var(--c-canvas);
}
.ch-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--c-secondary); }
.ch-text { flex: 1; min-width: 0; }
.ch-name { font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-meta { font-size: var(--t-meta); color: var(--c-subtle); }
.ch-body { flex: 1; overflow-y: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); overscroll-behavior: contain; }
.day { text-align: center; font-size: var(--t-meta); color: var(--c-subtle); margin: var(--s2) 0; }
.sys { align-self: center; display: inline-flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s3); border-radius: var(--r-pill); background: var(--c-soft); font-size: var(--t-meta); color: var(--c-subtle); }
.sys b { color: var(--c-red); }
.msg { display: flex; gap: var(--s2); align-items: flex-end; max-width: 88%; }
.msg > img { width: var(--avatar); height: var(--avatar); border-radius: 50%; flex: none; }
.msg-col { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.mname { font-size: var(--t-meta); color: var(--c-subtle); padding-left: var(--s1); }
.bubble { padding: var(--s2) var(--s3); border-radius: var(--r-card); background: var(--c-secondary); line-height: 1.45; }
.photo { position: relative; width: 220px; }
.photo img { width: 100%; height: auto; border-radius: var(--r-card); }
.heart { position: absolute; left: var(--s2); bottom: calc(-1 * var(--s2)); display: inline-flex; align-items: center; gap: 2px; padding: 2px var(--s2); border-radius: var(--r-pill); background: var(--c-secondary); border: 2px solid var(--c-white); font-size: var(--t-meta); font-weight: 600; }
.heart .ic { width: 12px; height: 12px; color: var(--c-red); }
.event { width: 240px; border: 1px solid var(--c-hairline); border-radius: var(--r-card); overflow: hidden; }
.event img { width: 100%; height: 120px; }
.event-b { padding: var(--s3); }
.ev-title { font-weight: 700; }
.ev-meta { font-size: var(--t-small); color: var(--c-subtle); }
.ev-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s2); }
.ev-count { display: flex; align-items: center; gap: var(--s2); font-size: var(--t-meta); color: var(--c-subtle); }
.event .pill { height: 32px; padding: 0 var(--s3); font-size: var(--t-small); }

.composer { display: flex; align-items: center; gap: var(--s2); padding: var(--s3); border-top: 1px solid var(--c-secondary); }
.composer input {
  flex: 1; min-width: 0; height: var(--h-ctl-sm); padding: 0 var(--s4); border: 2px solid var(--c-interactive); border-radius: var(--r-pill);
  font: inherit; background: var(--c-canvas); cursor: pointer;
}
.send { display: grid; place-items: center; width: var(--h-ctl-sm); height: var(--h-ctl-sm); border: 0; border-radius: 50%; background: var(--c-secondary); color: var(--c-interactive); cursor: pointer; }

/* ---------- red band ---------- */
.band { display: flex; flex-direction: column; align-items: center; gap: var(--s6); padding: var(--s24) var(--s6); background: var(--c-red); color: var(--c-white); text-align: center; }
.band-knit { font-family: var(--f-knit); font-weight: 600; letter-spacing: -0.02em; line-height: 1; font-size: clamp(96px, 16vw, 200px); }
.band h2 { font-size: var(--t-heading); font-weight: 500; }

/* ---------- google button ---------- */
.gbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s3); width: 100%; max-width: 320px;
  height: var(--h-ctl); padding: 0 var(--s6); border: 1px solid var(--c-hairline); border-radius: var(--r-pill);
  background: var(--c-white); color: var(--c-ink); font-weight: 600; cursor: pointer;
  transition: background-color var(--d-fast) var(--ease-out), transform var(--d-fast) var(--ease-out);
}
.gbtn:hover { background: var(--c-soft); }
.gbtn:active { transform: scale(0.98); }
.gbtn.on-red { border-color: var(--c-white); }
.gbtn[aria-busy="true"] { cursor: progress; }
.g { width: 20px; height: 20px; flex: none; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--c-secondary); border-top-color: var(--c-ink); animation: spin 700ms linear infinite /* deliberate */; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s6); padding: var(--s8) var(--s6); color: var(--c-subtle); font-size: var(--t-small); }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ---------- dialog ---------- */
.modal {
  width: min(484px, calc(100vw - var(--s8))); padding: var(--s12) var(--s8) var(--s8); border: 0; border-radius: var(--r-card);
  text-align: center; color: var(--c-ink);
}
.modal::backdrop { background: rgb(0 0 0 / 0.6); }
.modal[open] { animation: pop var(--d-base) var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } }
.modal .close { position: absolute; right: var(--s3); top: var(--s3); }
.view { display: flex; flex-direction: column; align-items: center; }
.view[hidden] { display: none; }
.modal h2 { margin-top: var(--s4); font-size: 32px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.modal h2:focus:not(:focus-visible) { outline: 2px solid transparent; }
.modal .sub { margin: var(--s2) 0 var(--s6); max-width: 34ch; }
.legal { margin-top: var(--s6); max-width: 36ch; font-size: var(--t-meta); color: var(--c-subtle); }
.legal a { font-weight: 600; color: var(--c-ink); }
.switch { margin-top: var(--s4); font-size: var(--t-small); }
.linkbtn { border: 0; padding: 0; background: none; font-weight: 700; text-decoration: underline; cursor: pointer; }
.soon-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--c-badge-bg); color: var(--c-red); }
.soon-ic .ic { width: 32px; height: 32px; }
.modal .wide { max-width: 320px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .topnav { display: none; }
  .explore { grid-template-columns: minmax(0, 1fr); }
  .preview { position: relative; top: 0; height: 560px; }
  .steps { grid-template-columns: 1fr; gap: var(--s6); }
}
@media (max-width: 640px) {
  .top { padding: 0 var(--s3); gap: var(--s3); height: 64px; }
  .hide-sm { display: none; }
  .hero { padding-top: var(--s8); }
  .hero h1 { font-size: 40px; }
  .lede { font-size: var(--t-body); }
  .masonry { columns: 2 140px; column-gap: var(--s2); max-height: 560px; }
  .pin { margin: 0 0 var(--s2); }
  .collage.lg { width: 72px; height: 48px; }
  .rn { font-size: var(--t-body); }
  .modal { padding: var(--s12) var(--s6) var(--s6); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
