/* Kin, the influenced design system: cream ground, forest text.
   Crown gold appears only in the Crown mark. Fonts are self-hosted (OFL). */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("/fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }

:root {
  --cream: #fbf5e9;
  --paper: #fffdf8;
  --forest: #1e3b2c;
  --forest-hover: #2f5240;
  --moss: #4e5b50;
  --linen: #e3d9c4;
  --oat: #efe6d3;
  --blush: #f6d3c6;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: var(--cream);
  color: var(--forest);
  font: 400 1rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.frame { min-height: 100dvh; display: flex; flex-direction: column; }

/* Forest panel: the wordmark, the lineage and the one-line pitch. */
.panel {
  display: flex; flex-direction: column; gap: 20px;
  background: var(--forest); color: var(--cream);
  padding: 24px 16px 32px;
}
.wordmark { margin: 0; font: 800 28px/1 var(--display); letter-spacing: -0.02em; }
.wordmark span { opacity: 0.6; }
.panel__line { margin: 0; font: 800 clamp(36px, 9vw, 60px)/0.95 var(--display); letter-spacing: -0.02em; }
.panel__sub { margin: 0; max-width: 28rem; font-size: 1.125rem; }

/* The lineage: the Crown, then three generations on half circles below it. */
.art { display: flex; justify-content: center; padding: 0 8px; }
.lineage { display: block; width: 100%; max-width: 420px; aspect-ratio: 400 / 350; overflow: hidden; }
.lineage .e { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.7s var(--ease) forwards; }
.lineage .n { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop 0.5s var(--ease) forwards; }
.lineage .g1 { animation-delay: 0.35s; }
.lineage .e.g1 { animation-delay: 0.2s; }
.lineage .g2 { animation-delay: 0.85s; }
.lineage .e.g2 { animation-delay: 0.7s; }
.lineage .g3 { animation-delay: 1.35s; }
.lineage .e.g3 { animation-delay: 1.2s; }
.lineage .e.g4 { stroke-width: 1; stroke-opacity: 0.5; animation-delay: 1.7s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; scale: 0.4; } to { opacity: 1; scale: 1; } }

/* The step: the pitch, the invite and sharing. */
.step {
  display: flex; flex-direction: column; gap: 24px;
  width: 100%; max-width: 48rem; margin: 0 auto;
  padding: 32px 16px 48px;
}
h1 { margin: 0; font: 800 44px/1 var(--display); letter-spacing: -0.02em; }
.lede { margin: 0; font-size: 1.125rem; color: var(--moss); }

.card {
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
  padding: 24px; border: 3px solid var(--linen); border-radius: 28px; background: var(--paper);
}
.card h2 { margin: 0; font: 800 24px/1.1 var(--display); letter-spacing: -0.01em; }
.card > p { margin: 0; color: var(--moss); }
.card--share { background: transparent; border-style: dashed; }

.cta {
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; margin-top: 4px;
  padding: 0 28px 0 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--forest); color: var(--cream); font: inherit; font-size: 1.125rem; font-weight: 700; text-decoration: none;
}
.cta:hover { background: var(--forest-hover); }
.cta:disabled { opacity: 0.7; cursor: progress; }
.invite .cta { padding: 0 28px; }
.ghost {
  min-height: 48px; padding: 0 22px; border: 3px solid var(--forest); border-radius: 999px;
  background: transparent; color: var(--forest); font: inherit; font-weight: 700; cursor: pointer;
}
.ghost:hover { background: var(--oat); }

/* Ask for an invite. */
.invite { display: flex; flex-direction: column; gap: 16px; width: 100%; margin-top: 4px; }
.row { display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 700; }
.field input, .field textarea {
  width: 100%; padding: 12px 16px; border: 3px solid var(--linen); border-radius: 18px;
  background: var(--paper); color: var(--forest); font: inherit;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder, .field textarea::placeholder { color: var(--moss); opacity: 0.7; }
.field input:hover, .field textarea:hover { border-color: var(--moss); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--forest); }
/* Problems look like the app's: blush with a dashed forest edge, never colour alone. */
.field [aria-invalid] { border-style: dashed; border-color: var(--forest); background: #fdf1ec; }
.error { margin: 0; padding: 12px 16px; border: 2px dashed var(--forest); border-radius: 22px; background: var(--blush); font-weight: 700; }
.hint { margin: 0; font-size: 0.875rem; color: var(--moss); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile:empty { display: none; }
.done { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 16px 20px; border-radius: 22px; background: var(--oat); }
.done:focus { outline: none; }
.done p { margin: 0; }
.done__title { font: 800 22px/1.15 var(--display); }

/* Share: one tile per platform. */
.shares { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; margin: 4px 0 0; padding: 0; list-style: none; }
.share {
  display: flex; align-items: center; gap: 10px; min-height: 52px;
  padding: 6px 18px 6px 6px; border: 3px solid var(--linen); border-radius: 999px;
  background: var(--paper); font-weight: 700; text-decoration: none;
}
.share:hover { border-color: var(--forest); }
.chip { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--oat); }
.share-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.status { font-size: 0.875rem; color: var(--moss); }

/* Share on Instagram (desktop): the card and the steps. */
.sheet {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0;
  border: 3px solid var(--linen); border-radius: 28px; background: var(--paper); color: var(--forest);
}
.sheet::backdrop { background: rgb(30 59 44 / 0.55); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 0 24px; }
.sheet__head h2 { display: flex; align-items: center; gap: 12px; margin: 0; font: 800 24px/1.1 var(--display); }
.close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--oat); color: var(--forest); cursor: pointer; }
.close:hover { background: var(--linen); }
.sheet__body { display: grid; gap: 24px; padding: 16px 24px 24px; }
.sheet__body img { display: block; width: 100%; max-width: 260px; height: auto; border-radius: 18px; }
.sheet__steps { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.sheet__steps p { margin: 0; }
.sheet__steps ol { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; }
.sheet__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 4px; }
.sheet__actions .cta { margin: 0; padding: 0 28px; }
.sheet__actions .ghost { display: inline-flex; align-items: center; text-decoration: none; }
.link { padding: 0; border: 0; background: none; color: var(--forest); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (min-width: 640px) { .sheet__body { grid-template-columns: 240px 1fr; align-items: start; } }

/* Queries on the left, follow on the right; they stack only when there is no room. */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 20px; border-top: 2px solid var(--linen); color: var(--moss); }
.foot p { margin: 0; }
.foot p a { color: var(--forest); text-underline-offset: 2px; }
/* Follow: small icon-only links, labelled for screen readers. */
.follows { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-left: auto; }
.follows span { font-size: 0.875rem; font-weight: 700; color: var(--forest); }
.follows ul { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.follow {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--linen); background: var(--paper);
}
.follow:hover { border-color: var(--forest); }

/* Phones: the five logos in one row; the names stay for screen readers. */
@media (max-width: 559px) {
  .shares { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .share { justify-content: center; padding: 6px; border-radius: 20px; min-height: 60px; }
  .share__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (min-width: 560px) { .row { grid-template-columns: 1fr 1fr; } }

@media (min-width: 768px) {
  .frame { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr); }
  .panel { position: sticky; top: 0; height: 100dvh; min-height: 640px; gap: 20px; padding: 40px 48px 48px; }
  .wordmark { font-size: 32px; }
  .art { flex: 1; min-height: 0; align-items: center; padding: 0; }
  .lineage { max-width: 100%; width: auto; height: 100%; max-height: 480px; }
  .panel__line { font-size: 44px; }
  .panel__sub { font-size: 1.25rem; }
  .step { justify-content: center; padding: 56px 48px; }
  h1 { font-size: 60px; }
  .lede { font-size: 1.25rem; }
}
/* Full desktop: all five platforms in one row. */
@media (min-width: 1100px) {
  .panel__line { font-size: 56px; }
  .shares { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .share { flex-direction: column; justify-content: center; gap: 8px; padding: 14px 8px 12px; border-radius: 24px; font-size: 0.9375rem; text-align: center; }
  .chip { width: 44px; height: 44px; }
  .chip svg { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-delay: 0s !important; }
}
