/* Inter 5.3.0, latin subset, variable weight and optical size (SIL OFL 1.1, see fonts/OFL-Inter.txt). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}

:root {
  --paper: #f6f3ec;
  --ink: #1d1c1a;
  --ink-soft: #4a4843;
  --ink-quiet: #6f6b63;
  --accent: #97502c;
  --whatsapp: #25d366;
  --selection: #e6dccb;
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(1.5rem, 6vw, 6.5rem);
  --top: clamp(1.5rem, 4vw, 3.25rem);
  --icon-size: 1.25rem;
  --row-gap: 0.75rem;
  --home-columns: minmax(0, 34rem) minmax(0, 28rem);
  --home-column-gap: clamp(3rem, 6vw, 7rem);
  --headline-size: clamp(2.5rem, 1.75rem + 2.5vw, 3.5rem);
}

/* The same warm paper and ink, turned down for a dark system theme; every text colour keeps WCAG AA. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1a18;
    --ink: #eeeae2;
    --ink-soft: #c9c4ba;
    --ink-quiet: #a39e94;
    --accent: #e3a07a;
    --selection: #4a3b2e;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--selection); }

h1, h2, h3, p, ul { margin: 0; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: color-mix(in srgb, var(--accent) 30%, transparent);
  overflow-wrap: anywhere;
}

a:hover,
a:focus-visible {
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0.25em;
  border-radius: 2px;
}

/* The official wordmark alone, top left. */
.masthead {
  padding: var(--top) var(--gutter) 0;
}

.masthead a {
  display: inline-block;
}

.logo {
  display: block;
  width: auto;
  height: clamp(1.75rem, 1.5rem + 0.6vw, 2.125rem);
}

main {
  margin-inline: var(--gutter);
  padding-block: clamp(2.5rem, 5vw, 3.5rem) clamp(2rem, 4vw, 3rem);
}

/* One column on the left; the rest of the width stays open. */
.hero,
.section {
  max-width: 34rem;
}

h1 {
  font-weight: 550;
  font-size: var(--headline-size);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.body {
  margin-top: 1.25rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.body + .body {
  margin-top: 0.75rem;
}

/*
 * The two ways to reach Zywor share one column system: an icon column of --icon-size and a
 * --row-gap before the label. Each link lays itself out on exactly those columns, so the icons,
 * and the labels after them, start at the same x, and each link is only as wide as its label.
 */
.contact {
  display: grid;
  grid-template-columns: var(--icon-size) auto;
  justify-content: start;
  column-gap: var(--row-gap);
  margin-top: 2rem;
}

.contact a {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--icon-size) auto;
  column-gap: var(--row-gap);
  align-items: center;
  justify-self: start;
}

.row-icon {
  display: block;
  width: var(--icon-size);
  height: var(--icon-size);
}

/* WhatsApp is the main way in: a stronger weight and the accent colour. */
.cta {
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.4;
  text-decoration: none;
}

.cta:hover .label,
.cta:focus-visible .label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

/* WhatsApp's own glyph, in WhatsApp's own green: its brand terms do not allow recolouring. */
.cta .whatsapp {
  fill: var(--whatsapp);
}

/* On a narrow phone the label wraps; the glyph stays beside its first line, where it sits when it does not. */
.cta .row-icon {
  align-self: start;
  margin-top: calc((1.4em - var(--icon-size)) / 2);
}

.cta-note {
  grid-column: 2;
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  color: var(--ink-quiet);
  text-wrap: pretty;
}

.email {
  margin-top: 1rem;
  font-weight: 500;
  color: var(--ink-soft);
}

/* Further sections of the homepage: below the hero when narrow, a second column beside it when wide. */
.section {
  margin-top: 3rem;
}

@media (min-width: 64rem) {
  .home {
    display: grid;
    grid-template-columns: var(--home-columns);
    grid-template-rows: auto 1fr;
    column-gap: var(--home-column-gap);
    row-gap: 1.25rem;
    align-items: start;
  }

  /* The headline stands alone above the text under it; the side column starts halfway down the headline. */
  .hero {
    grid-row: 1 / span 2;
    display: grid;
    grid-template-rows: subgrid;
    row-gap: inherit;
  }

  .intro > .body:first-child {
    margin-top: 0;
  }

  /* Spanning into the flexible second row, the side column never makes the headline's row taller. Half of a
     two-line headline is one line: 1.1 times its size. */
  .side {
    grid-row: 1 / span 2;
    padding-top: calc(1.1 * var(--headline-size));
  }

  .side .section:first-child {
    margin-top: 0;
  }

  .side .section + .section {
    margin-top: 2rem;
  }
}

h2 {
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

/* A section's heading is a quiet label; the items under it carry the weight. */
.section h2 {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-quiet);
}

.section .body {
  margin-top: 0.75rem;
}

.ideas {
  list-style: none;
  padding: 0;
  margin-top: 0.75rem;
  display: grid;
  gap: 1rem;
}

h3 {
  font-weight: 600;
  font-size: 1em;
  line-height: 1.4;
}

.ideas p {
  margin-top: 0.125rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* The legal pages: the same page, with a narrower column of plain text. */
.legal {
  max-width: 36rem;
}

.legal h1 {
  font-size: clamp(2rem, 1.6rem + 1.4vw, 2.5rem);
}

.legal h2 {
  margin-top: 2.25rem;
  font-size: 1.125rem;
}

.legal p {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.legal .lede {
  margin-top: 1.25rem;
}

/* The place on the left, the legal pages and contact on the right; stacked when narrow. Items share a text baseline,
   since a link's taller hit area would otherwise sit its text lower than the sentence beside it. */
.colophon {
  margin-inline: var(--gutter);
  padding-block: 0 var(--top);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 2rem;
  font-size: 0.875rem;
  color: var(--ink-quiet);
}

.colophon nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.5rem;
}

/* On the wide homepage the legal links start where the second column starts. */
@media (min-width: 64rem) {
  .home + .colophon {
    display: grid;
    grid-template-columns: var(--home-columns);
    justify-content: start;
    column-gap: var(--home-column-gap);
  }
}

/* The homepage's web chat button is fixed at the bottom right; room below the footer lets its links scroll clear of it. */
.home + .colophon { padding-bottom: calc(var(--top) + 3.5rem); }

.colophon a {
  /* A taller hit area, so each link meets the 24px minimum target size. */
  padding-block: 0.125rem;
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--ink-quiet) 40%, transparent);
}

.colophon a:hover,
.colophon a:focus-visible {
  color: var(--ink);
  text-decoration-color: currentColor;
}
