/*
  Wafflr website. The palette and typefaces are the product's (brand/brand-guidelines.md in the Wafflr repository):
  Ink, Paper, Amber, Teal and Coral, Poppins for headings and Inter for text, both served from this site.
  No script, no third-party request. Dark mode follows the visitor's system.
*/

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/poppins-600.woff2") format("woff2"); }

:root {
  --ink: #14142B;
  --ink-80: #3A3A55;
  --ink-60: #6B6B84;
  --ink-20: #D5D4DE;
  --ink-08: #EEEDF2;
  --paper: #FBF8F3;
  --amber: #F2A93B;
  --amber-deep: #C07F0B;
  --teal: #0FB9A0;
  --coral: #E5484D;

  --bg: var(--paper);
  --bg-alt: #F3EEE6;
  --card: #FFFFFF;
  --text: var(--ink);
  --muted: var(--ink-80);
  --rule: var(--ink-20);
  --good: #0A7364;
  --good-fill: #DAEFE7;
  --good-edge: #A8E2D6;

  --font-body: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Poppins", Montserrat, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --radius: 18px;
  --measure: 70ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101024;
    --bg-alt: #181832;
    --card: #1C1C3A;
    --text: var(--paper);
    --muted: #C9C8D6;
    --rule: #34345A;
    --good: #4FD6C0;
    --good-fill: #102835;
    --good-edge: #104B4F;
    --amber-deep: #D8931F;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

/* A link is the text colour with an underline; on hover the underline thickens and turns amber (owner decision O-7, ADR 0007). */
a { color: var(--text); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 3px; text-decoration-color: var(--amber); }

/* Keyboard focus, everywhere, is amber: a 2px outline on a link or a button, and a field's own border (below). Nothing blue,
   nothing teal. The amber is deeper on the light theme (#C07F0B: 3.2:1 against Paper, 3.3:1 against a card, 2.9:1 against the
   alternate section) than on the dark (#D8931F: 7.2:1), so that it clears the 3:1 a focus indicator needs (ADR 0007 and 0008). */
:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; margin: 0 0 0.6em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); }
h3 { font-size: 1.25rem; font-weight: 500; }

p { margin: 0 0 1.1em; }

.wrap { width: min(1120px, 100% - 3rem); margin-inline: auto; }
.wrap.narrow { width: min(780px, 100% - 3rem); }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--amber); color: var(--ink); padding: 0.6rem 1rem; border-radius: 8px; z-index: 10; }
.skip:focus { left: 0.5rem; }

/* Header and footer */

.site-header { background: var(--ink); color: var(--paper); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.brand { display: inline-flex; }
.brand img { display: block; }
.site-header nav { display: flex; align-items: center; gap: 1.5rem; }
.site-header nav a { color: var(--paper); text-decoration: none; font-weight: 500; }
.site-header nav a:hover { color: var(--amber); }

.site-footer { background: var(--ink); color: var(--ink-20); padding-block: 2.5rem; margin-top: 0; }
.site-footer .footer-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1.5rem 3rem; }
.site-footer .footer-about { display: grid; gap: 0.9rem; }
.site-footer .footer-brand { font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; color: var(--amber); margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding-top: 0.6rem; }
.site-footer a { color: var(--paper); }
/* The small print runs the whole width of the footer, under a rule: it is a line of its own, not a column. */
.site-footer .footer-legal { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--ink-80); }
.site-footer .small { font-size: 0.875rem; color: var(--ink-20); margin: 0; }

/* Buttons */

.button {
  display: inline-block; background: var(--amber); color: var(--ink); font-weight: 600; text-decoration: none;
  padding: 0.85rem 1.6rem; border-radius: 999px; border: 2px solid var(--amber); transition: transform 0.12s ease, background 0.12s ease;
}
.button:hover { background: #F7BC5F; border-color: #F7BC5F; transform: translateY(-1px); }
.button.ghost { background: transparent; color: var(--paper); border-color: var(--ink-60); }
.button.ghost:hover { border-color: var(--amber); color: var(--amber); }
.button.small { padding: 0.45rem 1.1rem; font-size: 0.95rem; }

/* Hero */

.hero {
  position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 85% 30%, #26264F 0%, var(--ink) 60%);
  color: var(--paper); padding-block: clamp(3.5rem, 9vw, 7rem);
}
/* The picture beside the headline is the mark itself, the brand's own artwork for a dark ground (a speech bubble holding
   the three by three grid, the live pocket bottom right), drawn once at full strength. It is never recoloured or faded:
   on a narrow screen, where it would sit behind the words, it is left out, and the logo above says who this is. */
.hero::after {
  content: ""; position: absolute; right: max(1.5rem, calc(50% - 560px)); top: 50%; width: min(28rem, 42vw); aspect-ratio: 1;
  transform: translateY(-50%); background: url("/img/wafflr-app-icon.svg") center / contain no-repeat; pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { max-width: 16ch; }
.hero .lede { max-width: 48ch; font-size: 1.25rem; color: var(--ink-20); }
.eyebrow { font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.85rem; color: var(--amber); margin-bottom: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

@media (max-width: 800px) { .hero::after { display: none; } }

/* Sections and cards */

.section { padding-block: clamp(2.75rem, 6vw, 5rem); }
.section.alt { background: var(--bg-alt); }
.intro { max-width: 68ch; font-size: 1.125rem; color: var(--muted); }

/* A heading and the paragraph that introduces it, side by side on a wide screen: the line of text stays a readable
   length and the space beside it is used, instead of a blank strip down the right. The layout check holds this. */
.section-head { display: grid; gap: 1rem 3rem; }
.section-head h2, .section-head .intro { margin: 0; }
@media (min-width: 900px) { .section-head { grid-template-columns: 5fr 7fr; align-items: end; } }

.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); margin-top: 2rem; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.6rem; }
.card h2, .card h3 { margin-bottom: 0.5em; }
.card h3::before {
  content: ""; display: block; width: 2.4rem; height: 0.5rem; margin-bottom: 0.9rem; border-radius: 99px;
  background: linear-gradient(90deg, var(--amber) 0 70%, var(--teal) 70% 100%);
}
.card p:last-child { margin-bottom: 0; }
.card a { font-weight: 500; }

/* Two columns on a wide screen, so each line is a readable length and the list uses the width of the section. */
.promises { padding-left: 1.4rem; }
@media (min-width: 900px) { .promises { columns: 2; column-gap: 3.5rem; } .promises li { break-inside: avoid; } }
.promises li { margin-bottom: 1rem; padding-left: 0.4rem; }
.promises li::marker { color: var(--amber); font-weight: 600; }

.narrow details { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 1rem 1.3rem; margin-bottom: 0.8rem; }
.narrow summary { cursor: pointer; font-weight: 600; }
.narrow details[open] summary { margin-bottom: 0.6rem; }
.narrow details p { margin: 0; color: var(--muted); }

/* Articles */

.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.4em; }
.prose img, .hero-image { border-radius: var(--radius); }
.hero-image { display: block; margin-bottom: 2rem; border: 1px solid var(--rule); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.97rem; }
.prose th, .prose td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font-weight: 600; background: var(--bg-alt); }
.prose code { background: var(--bg-alt); padding: 0.1em 0.35em; border-radius: 5px; font-family: "JetBrains Mono", "Cascadia Mono", Consolas, Menlo, monospace; font-size: 0.9em; }
.prose pre { background: var(--ink); color: var(--paper); padding: 1.1rem 1.3rem; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose blockquote { margin: 1.5rem 0; padding: 0.2rem 1.2rem; border-left: 4px solid var(--amber); color: var(--muted); }
.prose .lede { font-size: 1.2rem; color: var(--muted); }

.meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.6rem; }
.crumbs { font-size: 0.92rem; color: var(--muted); margin-bottom: 1.2rem; }

.toc { background: var(--bg-alt); border-radius: 14px; padding: 1rem 1.4rem; margin: 1.5rem 0 2rem; }
.toc p { font-weight: 600; margin-bottom: 0.4rem; }
.toc ol { margin: 0; padding-left: 1.3rem; }

.shot { margin: 1.6rem 0; }
.shot img { width: 100%; border: 1px solid var(--rule); box-shadow: 0 8px 28px rgba(20, 20, 43, 0.12); }
.shot figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; }

/* Forms */

.form { max-width: 34rem; margin-top: 1.5rem; }
.form label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.form input[type="email"], .form input[type="text"] {
  width: 100%; font: inherit; color: var(--text); background: var(--card); border: 2px solid var(--rule);
  border-radius: 12px; padding: 0.8rem 1rem; margin-bottom: 1rem;
}
.form input:focus { border-color: var(--amber-deep); outline: 2px solid transparent; }
.form .button { cursor: pointer; font: inherit; font-weight: 600; margin-top: 0.4rem; }
.problem { background: var(--card); border: 2px solid var(--coral); border-radius: 12px; padding: 0.8rem 1rem; }
/* A message that something worked: the one place the site uses teal for what teal means, as the console's good tokens do. */
.notice { border-radius: 12px; padding: 0.8rem 1rem; }
.notice.good { background: var(--good-fill); border: 1px solid var(--good-edge); border-left: 4px solid var(--good); color: var(--text); }
.notice.good strong { color: var(--good); }
.small { font-size: 0.92rem; color: var(--muted); }
/* The box only a form-filling robot sees. It is moved off the page rather than hidden, so a robot still finds it. */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin-bottom: 0.45rem; }
.articles li { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.articles a { display: block; font-weight: 600; font-size: 1.1rem; }
.articles span { color: var(--muted); }

.post img { border-radius: 12px; display: block; margin-bottom: 1rem; }
.post h2 { font-size: 1.3rem; }
.post h2 a { color: var(--text); text-decoration: none; }
.post h2 a:hover { text-decoration: underline 3px var(--amber); text-underline-offset: 2px; }

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

@media print {
  .site-header, .site-footer, .hero::after, .skip { display: none; }
  body { background: #fff; color: #000; }
}
