/* wrenchat.co.uk
   Direction: the app is the page. Everything here comes from Wren itself:
   - Colour: Wren's five sidebar inks, chosen with the swatches (CSS only, no
     scripts); neutral white or near-black elsewhere. No second accent.
   - Texture: the contour lines from Wren's sidebar, only on ink.
   - Type: the Mac's own system font, which Wren's interface uses. One face;
     hierarchy from size and weight. Monospace only for code and keys.
   - Shape: macOS window corners (10px) on screenshots, 8px on buttons, no cards.
   - Motion: none beyond hover and the colour change. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  --ground: #ffffff;
  --ground-2: #f4f4f2;
  --text: #1d1d1f;
  --text-2: #5d5d61;
  --line: #dedede;

  /* The ink: Hedgerow unless another swatch is picked. */
  --ink: #1f5a40;
  --on-ink: #ffffff;
  --on-ink-2: rgb(255 255 255 / .78);

  --measure: 34rem;
  --page: 72rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #151515;
    --ground-2: #1e1e1e;
    --text: #f2f2f0;
    --text-2: #a7a7a3;
    --line: #333331;
  }
}

body:has(input[value="kingfisher"]:checked) { --ink: #0e5560; }
body:has(input[value="nightjar"]:checked)   { --ink: #23407a; }
body:has(input[value="robin"]:checked)      { --ink: #9a3b1c; }
body:has(input[value="rook"]:checked)       { --ink: #2f2d29; }

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--text);
  font: 17px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .18em; }
h1, h2 { margin: 0; letter-spacing: -.022em; line-height: 1.1; font-weight: 700; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); }
p { margin: 0; }
code, kbd { font-family: var(--mono); font-size: .86em; }
kbd {
  display: inline-block; min-width: 1.7em; padding: .05em .4em; text-align: center;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  background: var(--ground); color: var(--text); font-family: var(--font); font-size: .8em;
}
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; padding: 8px 12px; background: var(--ground); z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Bar ---------- */
.bar {
  position: absolute; inset: 0 0 auto; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--page); margin: 0 auto; padding: 18px 24px; color: var(--on-ink);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; text-decoration: none; }
.brand img { border-radius: 7px; }
.bar nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.bar nav a { text-decoration: none; color: var(--on-ink-2); }
.bar nav a:hover { color: var(--on-ink); }
.bar nav .bar-download {
  color: var(--on-ink); padding: 6px 14px; border-radius: 8px; border: 1px solid rgb(255 255 255 / .45);
}
.bar nav .bar-download:hover { background: rgb(255 255 255 / .12); }

/* ---------- Hero: Wren's window on its own ink ---------- */
.hero {
  background: var(--ink) url(images/contours.svg) -60px -40px / 620px 620px;
  color: var(--on-ink);
  padding: 120px 24px 0;
  transition: background-color .25s;
}
.hero-copy { max-width: var(--page); margin: 0 auto; }
.hero h1 { font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.1rem); max-width: 13em; letter-spacing: -.03em; }
.lede { margin-top: 20px; max-width: var(--measure); font-size: clamp(1.08rem, 1rem + .4vw, 1.25rem); color: var(--on-ink-2); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 32px; }
.button {
  display: inline-block; padding: 12px 22px; border-radius: 8px;
  background: var(--on-ink); color: var(--ink); font-weight: 650; text-decoration: none;
  transition: background-color .25s, color .25s;
}
.button:hover { background: #ececea; }
.quiet-link { color: var(--on-ink); font-weight: 500; }
.meta { margin-top: 18px; font-size: 14px; color: var(--on-ink-2); }

.window {
  max-width: var(--page); margin: 56px auto 0; position: relative; top: 0;
  border-radius: 10px 10px 0 0; overflow: hidden;
  /* A light frame, so the window's own ink sidebar doesn't melt into the ground. */
  box-shadow: 0 0 0 1px rgb(255 255 255 / .28), 0 24px 70px rgb(0 0 0 / .35);
}
.window picture { display: none; }
.window picture[data-ink="hedgerow"],
body:has(input[value="kingfisher"]:checked) .window picture[data-ink="kingfisher"],
body:has(input[value="nightjar"]:checked) .window picture[data-ink="nightjar"],
body:has(input[value="robin"]:checked) .window picture[data-ink="robin"],
body:has(input[value="rook"]:checked) .window picture[data-ink="rook"] { display: block; }
body:has(input[name="ink"]:not([value="hedgerow"]):checked) .window picture[data-ink="hedgerow"] { display: none; }

/* The swatches sit on the page ground, just under the window. */
.inks {
  max-width: var(--page); margin: 0 auto; padding: 18px 24px 0; border: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  color: var(--text);
}
.inks legend { float: left; margin-right: 8px; padding: 0; font-size: 15px; color: var(--text-2); }
.inks label { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.inks input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.inks label:nth-of-type(1) .swatch { background: #1f5a40; }
.inks label:nth-of-type(2) .swatch { background: #0e5560; }
.inks label:nth-of-type(3) .swatch { background: #23407a; }
.inks label:nth-of-type(4) .swatch { background: #9a3b1c; }
.inks label:nth-of-type(5) .swatch { background: #2f2d29; }
.inks input:checked + .swatch { box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--text); }
.inks label:has(input:checked) { font-weight: 650; }
.inks input:focus-visible + .swatch { outline: 3px solid var(--text); outline-offset: 4px; }

/* ---------- Features ---------- */
.features { max-width: var(--page); margin: 0 auto; padding: 96px 24px 24px; }
.feature {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center;
  padding: 48px 0;
}
.feature:nth-of-type(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature:nth-of-type(even) .feature-text { order: 2; }
.feature-text p { margin-top: 14px; color: var(--text-2); max-width: var(--measure); }
.feature-text .shortcut { color: var(--text); font-size: 15px; }
.shot { margin: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 11; box-shadow: 0 0 0 1px var(--line), 0 18px 50px rgb(0 0 0 / .12); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
/* Each picture is cropped to the part that matters. */
.shot-unreads img { object-position: 100% 0; width: 140%; max-width: none; height: auto; margin-left: -40%; }
.shot-thread img  { width: 128%; max-width: none; height: auto; margin-left: -28%; }
.shot-group img   { width: 150%; max-width: none; height: auto; margin-left: -28%; }

.also { padding: 64px 0 24px; border-top: 1px solid var(--line); margin-top: 32px; }
.also dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 28px 48px; margin: 28px 0 0; }
.also dt { font-weight: 650; }
.also dd { margin: 4px 0 0; color: var(--text-2); }

/* ---------- Text sections ---------- */
.private, .before, .it { max-width: var(--page); margin: 0 auto; padding: 72px 24px; }
.private > *, .before > *, .it > * { max-width: 40rem; }
.private p, .it > p { margin-top: 16px; color: var(--text-2); }
.private { border-top: 1px solid var(--line); }
.private ul, .before ul { margin: 20px 0 0; padding-left: 1.2em; }
.private li, .before li { margin-top: 10px; }
.before li { color: var(--text-2); }
.before strong { color: var(--text); }
.it { background: var(--ground-2); max-width: none; }
.it > * { margin-left: max(0px, calc((100% - var(--page)) / 2)); }
.it ol { margin: 24px 0 0; padding-left: 1.3em; }
.it li { margin-top: 14px; padding-left: 4px; color: var(--text-2); }
.it li strong { color: var(--text); }
.it code { background: var(--ground); padding: 1px 5px; border-radius: 4px; }
.links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 28px; }
.links a { font-weight: 600; color: var(--text); }

/* ---------- Get Wren ---------- */
.get {
  background: var(--ink) url(images/contours.svg) 40% 30% / 620px 620px; color: var(--on-ink);
  text-align: center; padding: 88px 24px; transition: background-color .25s;
}
.get img { margin: 0 auto 20px; border-radius: 16px; }
.get p { margin-top: 10px; color: var(--on-ink-2); }
.get .actions { justify-content: center; }

/* ---------- Footer ---------- */
.foot { max-width: var(--page); margin: 0 auto; padding: 32px 24px 48px; font-size: 14px; color: var(--text-2); }
.foot p + p { margin-top: 6px; }

/* ---------- 404 ---------- */
.not-found {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 16px;
  max-width: 34rem; margin: 0 auto; padding: 24px;
}
.not-found img { border-radius: 16px; }
.not-found h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); }
.not-found p { color: var(--text-2); }
.not-found .button { background: var(--ink); color: var(--on-ink); }

/* ---------- Narrow screens ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .bar { padding: 14px 16px; }
  .bar nav a:not(.bar-download) { display: none; }
  .hero { padding: 96px 16px 0; }
  .window { margin-top: 40px; }
  .inks { padding: 16px 16px 0; }
  .inks legend { float: none; width: 100%; margin-bottom: 4px; }
  .features { padding: 56px 16px 8px; }
  .feature { grid-template-columns: 1fr; gap: 24px; padding: 32px 0; }
  .feature:nth-of-type(even) { grid-template-columns: 1fr; }
  .feature:nth-of-type(even) .feature-text { order: 0; }
  .private, .before, .it { padding: 56px 16px; }
  .get { padding: 64px 16px; }
  .foot { padding: 28px 16px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero, .get, .button { transition: none; }
}
