/* Three Tree Software. Phone first; light and dark follow the system setting. */

:root {
  /* Ink and blue come from the contour banner. */
  --bg: #ffffff;
  --surface: #f6f7fb;
  --text: #1c1c1c;
  --muted: #545454;
  --accent: #3550c8;
  --accent-text: #ffffff;
  --line: #e3e4ea;
  --banner-filter: none;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* #0f0f0f is what invert(.94) turns the banner's white into. */
    --bg: #0f0f0f;
    --surface: #18191d;
    --text: #e8e8e8;
    --muted: #ababab;
    --accent: #93a3ff;
    --accent-text: #0f0f0f;
    --line: #2a2b30;
    --banner-filter: invert(0.94) hue-rotate(180deg);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; }
h2 { font-size: 1.35rem; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius);
  z-index: 1;
}
.skip:focus { top: 0.75rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Banner. Image and wordmark both cover the box from the centre, so they line up
   at any size. 4:1 on desktop; on phones the box gets taller and the sides crop. */
.banner {
  position: relative;
  height: clamp(280px, 25vw, 440px);
  overflow: hidden;
}
.banner-art, .banner-title svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.banner-art { object-fit: cover; object-position: 50% 50%; filter: var(--banner-filter); }
.banner-title { margin: 0; }
.banner-title text {
  font-family: "Avenir Next", Montserrat, var(--font);
  text-anchor: middle;
  fill: var(--accent);
  /* Halo in the page colour stops the hatching just short of each letter. */
  stroke: var(--bg);
  stroke-width: 7px;
  stroke-linejoin: round;
  paint-order: stroke fill;
}
.banner-title .wm-big { font-size: 36px; font-weight: 700; }
.banner-title .wm-small { font-size: 19px; font-weight: 300; }

/* Sections */
main > section { padding: 2.25rem 0; }
main > section + section { border-top: 1px solid var(--line); }

.hero { padding-top: 2rem; padding-bottom: 3rem; }
.pitch {
  font-size: clamp(1.75rem, 5.5vw, 2.75rem);
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }

.button {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
}
.button:hover { filter: brightness(1.08); }

.cards, .work { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.work { gap: 1.5rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card p, .work p { margin: 0; color: var(--muted); }
.work li { max-width: 40rem; }

.about p, .contact p { max-width: 40rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; }
.site-footer p { margin: 0; }

@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
  main > section { padding: 3rem 0; }
  .hero { padding-top: 3rem; padding-bottom: 4rem; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .work { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 2.5rem; }
}
