/* commonyard.app's public pages: the landing page, guides and news.
   The colours are the app's own light and dark palettes
   (lib/commonyard/chat/cy_chat_tokens.dart); headings use the app's Fredoka. */

@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka-Variable.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #ffffff;
  --outer: #edebe6;
  --card: #f4f3f0;
  --ink: #15171a;
  --ink-3: #3f4548;
  --muted: #4e5458;
  --brand: #14614a;
  --brand-ink: #14614a;
  --brand-fill: #14614a;
  --on-brand: #ffffff;
  --logo: #0f9444;
  --mint: #dceadf;
  --sky: #e6eef9;
  --sand: #fbeed6;
  --rose: #f8e3e1;
  --hairline: rgba(21, 23, 26, 0.12);
  --shadow: 0 1px 2px rgba(21, 23, 26, 0.06), 0 12px 32px rgba(21, 23, 26, 0.07);
  --blob: 58% 42% 55% 45% / 48% 56% 44% 52%;
  --radius: 22px;
  --display: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #1c1c21;
    --outer: #141418;
    --card: #26262c;
    --ink: #f4efe8;
    --ink-3: #d5cec7;
    --muted: #b8b1ad;
    --brand: #a5c8b2;
    --brand-ink: #a5c8b2;
    --brand-fill: #63d2a6;
    --on-brand: #0d1f17;
    --mint: #1f3128;
    --sky: #1f2633;
    --sand: #33291a;
    --rose: #3a2422;
    --hairline: rgba(244, 239, 232, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--brand-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
  overflow-wrap: break-word;
}

h1 { font-size: clamp(2.3rem, 6.2vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.35rem); }
h3 { font-size: 1.2rem; }

p { margin: 0; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--brand-fill);
  color: var(--on-brand);
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ------------------------------------------------------------ header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.bar,
main > section,
main > article,
.cream-wrap > section,
.footer-grid,
.footer-base {
  width: min(1080px, calc(100% - 32px));
  margin-inline: auto;
}

.bar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.brand img { flex-shrink: 0; border-radius: 10px; background: #fff; }

.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}
.site-nav a:hover { background: var(--card); }
.site-nav a[aria-current="page"] { background: var(--mint); color: var(--ink); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--brand-fill);
  color: var(--on-brand);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.button:hover { filter: brightness(1.08); }
.button-small { min-height: 40px; padding: 8px 16px; font-size: 0.92rem; }
.button-quiet {
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.eyebrow {
  margin-bottom: 12px;
  color: var(--brand-ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lead {
  margin-top: 18px;
  max-width: 44rem;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  line-height: 1.55;
}

/* --------------------------------------------------------------- home -- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  padding-block: clamp(40px, 8vw, 96px) clamp(32px, 6vw, 72px);
}

.hero h1 { max-width: 13ch; }

.hero-note { margin-top: 18px; color: var(--muted); font-size: 0.95rem; }

.yard-mock {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 26px;
  border-radius: var(--blob);
  background: var(--mint);
}

.mock-card {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--canvas);
  box-shadow: var(--shadow);
}
.mock-card:nth-child(2) { margin-left: 26px; }
.mock-card:nth-child(3) { margin-right: 26px; }

.mock-kind {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.mock-q {
  margin-top: 4px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.25;
}
.mock-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 7px 12px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--card);
  font-size: 0.88rem;
  font-weight: 600;
}
.mock-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--share);
  background: color-mix(in srgb, var(--logo) 26%, transparent);
}
.mock-row span { position: relative; }
.mock-hold {
  position: relative;
  margin-top: 10px;
  padding: 9px 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--card);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.mock-hold::before {
  content: "";
  position: absolute;
  inset: 0 38% 0 0;
  background: color-mix(in srgb, var(--logo) 32%, transparent);
}
.mock-hold span { position: relative; }
.mock-game {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mock-ball {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--blob);
  background: var(--sand);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}
.mock-play {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-fill);
  color: var(--on-brand);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.band {
  padding-block: clamp(40px, 7vw, 80px);
}

.band-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px 32px;
  margin-bottom: 26px;
}
.band-head p { max-width: 34rem; color: var(--muted); }

.doors {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.door {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--card);
}
.door .mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: var(--blob);
  background: var(--canvas);
  color: var(--brand-ink);
  box-shadow: var(--shadow);
}
.door .label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.door h3 { margin-top: 4px; }
.door p { margin-top: 8px; color: var(--muted); font-size: 0.97rem; }

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tile {
  display: block;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--canvas);
  color: inherit;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--hairline), var(--shadow); }
.tile .swatch {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--ink);
}
.tile p { margin-top: 8px; color: var(--muted); font-size: 0.97rem; }
.tile .go { margin-top: 12px; color: var(--brand-ink); font-weight: 700; font-size: 0.92rem; }
.s-mint { background: var(--mint); }
.s-sky { background: var(--sky); }
.s-sand { background: var(--sand); }
.s-rose { background: var(--rose); }

.cream-wrap { background: var(--outer); }
.cream-wrap .link-list a,
.cream-wrap .news-list a { background: var(--canvas); }
.cream-wrap .link-list a:hover,
.cream-wrap .news-list a:hover { background: var(--mint); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
}
.split > div > p + p { margin-top: 14px; }
.split p { color: var(--ink-3); }

.checks {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.checks li {
  position: relative;
  padding: 14px 16px 14px 46px;
  border-radius: 16px;
  background: var(--card);
}
.checks li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 19px;
  width: 16px;
  height: 16px;
  border-radius: var(--blob);
  background: var(--logo);
}
.checks strong { display: block; }
.checks span { color: var(--muted); font-size: 0.95rem; }

.rys {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: clamp(22px, 4vw, 36px);
  border-radius: 28px;
  background: var(--sky);
}
.rys .badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--blob);
  background: var(--canvas);
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
}
.rys p { margin-top: 10px; color: var(--ink-3); max-width: 46rem; }

/* ---------------------------------------------------------- lists ----- */

.link-list,
.news-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.link-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.link-list a,
.news-list a {
  display: block;
  height: 100%;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}
.link-list a:hover,
.news-list a:hover { background: var(--mint); }
.link-list h3, .news-list h3, .news-list h2 { font-size: 1.12rem; }
.news-list h2 { font-size: 1.3rem; }
.link-list p,
.news-list p { margin-top: 6px; color: var(--muted); font-size: 0.95rem; }
.news-list time {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------- faq ---- */

.faq { display: grid; gap: 10px; }
.faq details {
  border-radius: 18px;
  background: var(--card);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--brand-ink);
}
.faq details[open] summary::after { content: "–"; }
.faq summary h3 { font-size: 1.08rem; }
.faq .answer { padding: 0 20px 18px; color: var(--ink-3); }
.faq .answer p + p { margin-top: 10px; }

/* -------------------------------------------------- index + article --- */

.index-head { padding-block: clamp(28px, 6vw, 64px) 12px; }
.index-head h1 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); max-width: 18ch; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chips a {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}
.chips a:hover { background: var(--mint); }

.index-section { padding-block: 22px; }
.index-section h2 { margin-bottom: 16px; font-size: clamp(1.4rem, 3vw, 1.8rem); }

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
}
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: 0.6; }
.crumbs a { color: var(--muted); }

.doc { padding-block: clamp(24px, 5vw, 56px) 8px; }
.doc-head,
.prose { max-width: 44rem; }
.doc-head h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
.doc-head .meta { margin-top: 14px; color: var(--muted); font-size: 0.9rem; }

.prose { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--hairline); }
.prose > * + * { margin-top: 16px; }
.prose h2 { margin-top: 38px; font-size: 1.55rem; }
.prose h3 { margin-top: 28px; }
.prose ul,
.prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 8px; }
.prose ol { counter-reset: step; list-style: none; padding-left: 0; }
.prose ol > li {
  position: relative;
  padding: 12px 16px 12px 56px;
  border-radius: 16px;
  background: var(--card);
  counter-increment: step;
}
.prose ol > li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--blob);
  background: var(--brand-fill);
  color: var(--on-brand);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
}
.prose strong { color: var(--ink); }
.prose code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--card);
  font-size: 0.9em;
}
.note {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--mint);
  color: var(--ink);
}

/* Screenshots: the app as a phone shows it, drawn with made-up people and
   yards. A whole screen is narrower than a crop of one card; two or three in
   a row sit side by side, and scroll sideways on a phone. */
.prose > .shots { margin-top: 26px; }
.shots {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.shot {
  flex: 0 1 390px;
  max-width: 390px;
  margin: 0;
}
.shot-tall { flex-basis: 270px; max-width: 270px; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--hairline), var(--shadow);
}
.shot-tall img { border-radius: 30px; }
.shot figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.more {
  padding-block: 40px 8px;
}
.more h2 { margin-bottom: 16px; font-size: 1.5rem; }
.more > p { margin-top: 16px; font-weight: 700; }

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-block: 48px 64px;
  padding: clamp(22px, 4vw, 34px);
  border-radius: 28px;
  background: var(--mint);
}
.cta-line {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  line-height: 1.2;
  max-width: 24ch;
}

/* ------------------------------------------------------------ founder -- */

.profile {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(28px, 6vw, 64px);
  align-items: center;
  padding-block: clamp(36px, 7vw, 80px) 16px;
}
.profile figure { margin: 0; }
.profile figure img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 28px;
  background: var(--card);
}
.profile figcaption { margin-top: 10px; color: var(--muted); font-size: 0.88rem; text-align: center; }

.facts {
  margin: 0;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--card);
}
.facts div { padding: 10px 0; border-top: 1px solid var(--hairline); }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.facts dd { margin: 2px 0 0; font-weight: 600; }

/* ------------------------------------------------------------- footer -- */

.site-footer {
  margin-top: 24px;
  padding-block: 44px 28px;
  background: var(--outer);
  color: var(--ink-3);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr));
  gap: 28px;
}
.footer-brand p { margin-top: 12px; max-width: 26rem; }
.footer-grid nav { display: grid; align-content: start; gap: 8px; min-width: 0; }
.footer-grid h2 {
  margin-bottom: 4px;
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-grid nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; overflow-wrap: anywhere; }
.footer-grid nav a:hover { text-decoration: underline; }
.quiet { color: var(--muted); font-size: 0.92rem; }
.footer-base { margin-top: 32px; color: var(--muted); font-size: 0.88rem; }

/* ------------------------------------ questions, words and practice -- */

.more-link { margin-top: 18px; font-weight: 700; }

.prose > .qa + .qa { margin-top: 34px; }
.qa > * + * { margin-top: 12px; }
.prose .qa h2 { margin-top: 0; font-size: 1.3rem; }

.glossary { margin: 0; }
.glossary > div {
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
  scroll-margin-top: 24px;
}
.glossary > div:first-child { border-top: 0; padding-top: 4px; }
.glossary > div:target {
  margin-inline: -14px;
  padding-inline: 14px;
  border-radius: 14px;
  background: var(--mint);
}
.glossary dt {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--brand-ink);
}
.glossary dd { margin: 6px 0 0; }
.glossary dd > * + * { margin-top: 8px; }

.prose .topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-left: 0;
  list-style: none;
}
.prose .topics li + li { margin-top: 0; }
.topics li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--card);
  font-weight: 600;
}
.topics .count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* -------------------------------------------------------------- narrow -- */

@media (max-width: 900px) {
  .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .hero,
  .split,
  .profile { grid-template-columns: minmax(0, 1fr); }
  .yard-mock { max-width: 460px; }
  .link-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .bar { gap: 8px; min-height: 58px; }
  .brand span { display: none; }
  .brand { flex-shrink: 0; }
  .site-nav { margin-left: 0; gap: 0; }
  .site-nav a { padding: 8px 6px; }
  .button-small { margin-left: auto; padding: 8px 14px; }
  .button-small .wide { display: none; }
  .doors,
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .rys { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prose .topics { grid-template-columns: minmax(0, 1fr); }
  .shots-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: -16px;
    padding: 2px 16px 10px;
  }
  .shots-row .shot { flex: 0 0 72%; scroll-snap-align: center; }
  .mock-card:nth-child(2) { margin-left: 12px; }
  .mock-card:nth-child(3) { margin-right: 12px; }
  .yard-mock { padding: 18px; }
}

@media (max-width: 359px) {
  .site-nav a[href="/news/"] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile { transition: none; }
}
