/* ==========================================================================
   peaty.dev — studio index
   Source of truth: docs/design_handoff_peaty_identity/README.md
                    docs/design_handoff_peaty_identity/Peaty Site v3.dc.html
   Static page. No JavaScript. All interaction is CSS hover.
   ========================================================================== */

:root {
  --butter: #F4E9C1;   /* page ground */
  --cream:  #FBF6E4;   /* light card */
  --olive:  #3B3822;   /* text, dark card, logo */
  --muted:  #6B6438;   /* secondary text, hover */
  --light:  #B3AC85;   /* body text on dark */
  --yellow: #F2DA1B;   /* accent only, never a field */
  --rule:   #DFD0A0;   /* footer border */

  --display: Anton, Impact, "Haettenschweiler", sans-serif;
  --sans: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;

  --shell: 1120px;
  --pad-x: 44px;
  --band: 88px;
}

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

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

body {
  margin: 0;
  background: var(--butter);
  color: var(--olive);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Hold the footer at the bottom of the window on short pages. Without this
     the footer floats mid-screen on the 404 page and on a near-empty index,
     leaving a band of dead ground beneath it. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

/* A flex item with an auto cross-axis margin does not stretch, and .shell sets
   `margin: 0 auto`. Without this the header collapses to its content width and
   drifts to the middle of the window. max-width still centres it. */
body > .shell { width: 100%; }

img { max-width: 100%; }

a { color: var(--olive); text-decoration: none; }
a:hover { color: var(--muted); }

h1, h2, p { margin: 0; }

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.bar {
  padding-top: 26px;
  padding-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.bar__logo img {
  height: 44px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pill {
  background: var(--olive);
  color: var(--butter);
  padding: 10px 20px;
  border-radius: 999px;
  transition: background-color .2s ease, color .2s ease;
}

.pill:hover {
  background: var(--yellow);
  color: var(--olive);
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  padding-top: 72px;
  padding-bottom: var(--band);
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  align-items: end;
}

.hero__title {
  font-family: var(--display);
  font-size: 88px;
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}

.hero__note {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  padding-bottom: 10px;
  text-wrap: pretty;
}

/* ── App cards ───────────────────────────────────────────────────────────── */

.apps {
  padding-bottom: var(--band);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.card {
  border-radius: 28px;
  padding: 40px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.card--light { background: var(--cream); color: var(--olive); }
.card--dark  { background: var(--olive);  color: var(--butter); }

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card__icon {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  display: block;
}

.chip {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.chip--dark   { background: var(--olive);  color: var(--butter); }
.chip--yellow { background: var(--yellow); color: var(--olive); }

.card__body { margin-top: auto; }

.card__name {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.card__tagline {
  font-size: 19px;
  font-weight: 500;
  margin-top: 8px;
}

.card__text {
  font-size: 16px;
  line-height: 1.6;
  margin-top: 12px;
  text-wrap: pretty;
}

.card--light .card__text { color: var(--muted); }
.card--dark  .card__text { color: var(--light); }

.card__link {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 3px;
  align-self: flex-start;
  transition: border-bottom-color .2s ease;
}

.card--light .card__link { color: var(--olive); }
.card--dark  .card__link { color: var(--butter); }

.card--light .card__link:hover { border-bottom-color: var(--olive); }
.card--dark  .card__link:hover { border-bottom-color: var(--butter); }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.foot {
  border-top: 1px solid var(--rule);
  padding: 34px 0;
}

.foot__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.foot__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.foot__brand img {
  height: 30px;
  width: auto;
  display: block;
}

.foot__links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

/* ==========================================================================
   Blog — post index and article
   Source of truth: docs/design_handoff_peaty_blog/README.md
                    docs/design_handoff_peaty_blog/Peaty Blog.dc.html
                    docs/design_handoff_peaty_blog/Peaty Article.dc.html
   The header, footer, .shell and the tokens above are shared with the index.
   Article bodies are written as bare <p>, <h2>, <ul>, <blockquote> inside
   .post — no classes, so a post is plain HTML to write by hand.
   ========================================================================== */

:root {
  --faint: #C7BC90;  /* hairline in the article meta row */
  --read: 760px;     /* article reading column, padding included */
}

/* ── Post index ─────────────────────────────────────────────────────────── */

/* The page head is the studio hero at a shorter bottom margin. */
.hero--blog { padding-bottom: 56px; }

.entries {
  padding-bottom: var(--band);
  display: flex;
  flex-direction: column;
}

.entry {
  position: relative;
  display: grid;
  grid-template-columns: 130px 1fr 120px;
  gap: 28px;
  align-items: baseline;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
}

/* The list closes itself, so adding a post never means editing a border. */
.entry:last-child { border-bottom: 1px solid var(--rule); }

/* The hover tint is a panel behind the row, not the row's own background. It
   overhangs the text on all four sides, so nothing touches a cream edge. The
   row keeps its padding, so the hairlines and the text stay where they are. */
.entry::before {
  content: "";
  position: absolute;
  inset: 8px -24px;
  z-index: -1;
  border-radius: 16px;
  background: var(--cream);
  opacity: 0;
  transition: opacity .15s ease;
}

.entry:hover::before { opacity: 1; }

.entry:hover { color: var(--olive); }

.entry__date { font-size: 14px; color: var(--muted); }

.entry__title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.05;
  text-transform: uppercase;
}

.entry__standfirst {
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 8px;
  max-width: 560px;
  text-wrap: pretty;
}

.entry__tag {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-align: right;
}

/* Shown only while no post exists. Delete it with the first entry. */
.entries__empty {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 26px 0;
  font-size: 16px;
  color: var(--muted);
}

/* ── Article ─────────────────────────────────────────────────────────────── */

.read {
  max-width: var(--read);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.post__head {
  padding-top: 72px;
  padding-bottom: 40px;
}

.post__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.post__rule {
  width: 18px;
  height: 1px;
  background: var(--faint);
}

.post__title {
  font-family: var(--display);
  font-size: 58px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  margin-top: 22px;
  text-wrap: balance;
}

.post__standfirst {
  font-size: 21px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 20px;
  text-wrap: pretty;
}

.post {
  padding-bottom: var(--band);
  font-size: 18px;
  line-height: 1.7;
  color: var(--olive);
}

.post p { margin: 0 0 22px; text-wrap: pretty; }

.post h2 {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.1;
  text-transform: uppercase;
  margin: 44px 0 16px;
}

.post ul,
.post ol {
  margin: 0 0 22px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post blockquote {
  margin: 36px 0;
  padding: 28px 32px;
  background: var(--cream);
  border-radius: 20px;
  font-size: 22px;
  line-height: 1.45;
  text-wrap: pretty;
}

.post blockquote p:last-child { margin-bottom: 0; }

/* h3 is a sub-point inside a section. Figtree, not the display face, so it
   never competes with an h2. */
.post h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin: 32px 0 12px;
}

/* Comparison tables. They scroll inside their own box rather than widening
   the reading column. */
.post .table {
  margin: 32px 0;
  overflow-x: auto;
  border-radius: 20px;
  background: var(--cream);
}

.post table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 15px;
  line-height: 1.45;
}

.post th,
.post td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

.post th {
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.post tbody tr:last-child td { border-bottom: 0; }

.post a {
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 1px;
}

.post img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  margin: 36px 0;
}

/* ── Learn section ───────────────────────────────────────────────────────────
   Evergreen guides. Same article shell as a blog post, with two additions: an
   FAQ block and an updated date instead of a published one. Reachable from
   the footer, not from the header nav.

   A .post__lang rule for a French language switch was removed when French was
   deferred. See the FRENCH section of WRITING.md.
   ────────────────────────────────────────────────────────────────────────── */

/* Learn index rows carry no date, so they drop the blog's first column. */
.entry--learn { grid-template-columns: 1fr 120px; }

@media (max-width: 800px) {
  .entry--learn { grid-template-columns: 1fr; }
}

/* One question per row, hairline between. The answers stay body-sized. */
.post .faq {
  margin: 0 0 22px;
  border-top: 1px solid var(--rule);
}

.post .faq__item {
  border-bottom: 1px solid var(--rule);
  padding: 22px 0;
}

.post .faq__q {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 10px;
}

.post .faq__item p:last-child { margin-bottom: 0; }

/* The three links every guide owes: landing page, why-post, sibling guide. */
.post .related {
  margin: 36px 0 0;
  padding: 24px 28px;
  background: var(--cream);
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.6;
}

.post .related h2 {
  font-size: 15px;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 14px;
}

.post .related ul {
  margin: 0;
  padding-left: 20px;
  gap: 8px;
}

/* The sign-up block that closes a post. Quieter than body copy, no rule of
   its own — the article foot below it already draws one. */
.post__cta {
  margin-top: 44px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  font-style: italic;
}

.post__cta p { margin: 0 0 12px; }
.post__cta p:last-child { margin-bottom: 0; }

.post__foot {
  margin-top: 48px;
  padding-top: 26px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

/* The foot link is a .post descendant, so cancel the body-link underline. */
.post .post__back {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 3px;
}

.post__by { font-size: 15px; color: var(--muted); }

/* ── Narrow ──────────────────────────────────────────────────────────────────
   The handoff designed desktop only. Both fixed grids collapse to one column
   below 800px, and the 88px headline scales down rather than overflowing.
   ────────────────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero__title { font-size: clamp(44px, 9.5vw, 88px); }
  .post__title { font-size: clamp(34px, 6.4vw, 58px); }
}

@media (max-width: 800px) {
  :root { --pad-x: 24px; --band: 56px; }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 48px;
    align-items: start;
  }

  .hero__note { padding-bottom: 0; max-width: 34em; }

  .apps { grid-template-columns: 1fr; }

  .card { padding: 32px; min-height: 0; gap: 22px; }

  .card__body { margin-top: 8px; }

  .hero--blog { padding-bottom: 32px; }

  .entry {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 22px 0;
  }

  /* The page gutter is 24px here. Keep the panel inside it. */
  .entry::before { inset: 6px -12px; border-radius: 12px; }

  .entry__tag { text-align: left; }

  .post__head { padding-top: 48px; padding-bottom: 28px; }

  .post__standfirst { font-size: 19px; }
}

@media (max-width: 560px) {
  .bar { gap: 16px; flex-wrap: wrap; }
  .bar__logo img { height: 36px; }
  .nav { gap: 18px; font-size: 13px; }
  .pill { padding: 9px 16px; }

  .card__icon { width: 64px; height: 64px; border-radius: 16px; }
  .card__name { font-size: 34px; }

  .foot__inner { flex-direction: column; align-items: flex-start; gap: 18px; }
  .foot__links { flex-wrap: wrap; gap: 16px; }

  .entry__title { font-size: 24px; }
  .post { font-size: 17px; }
  .post h2 { font-size: 26px; margin-top: 36px; }
  .post blockquote { padding: 22px 24px; font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .pill, .card__link, .entry::before { transition: none; }
}
