/* tokens */
:root {
  --stone: #f5f4f1;
  --ink: #1c1a17;
  --muted: #5f5b55;
  --lichen: #d9622b;
  --ring: #f6e6d6;
  --pale: #bcb7ae;
  --line: rgb(28 26 23 / 0.14);

  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s6: 48px;
  --s8: 64px;
  --s12: 96px;
  --s16: 128px;

  --t-1: 0.875rem;
  --t0: 1rem;
  --t1: 1.25rem;
  --t2: 1.5625rem;
  --t3: 1.953rem;
  --t4: 2.441rem;

  --max: 1180px;
  --measure: 60ch;
  --font: "Schibsted Grotesk", "Schibsted Fallback", Arial, sans-serif;
}

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
/* arial adjusted to schibsteds metrics so the swap doesnt shift layout */
@font-face {
  font-family: "Schibsted Fallback";
  src: local("Arial");
  size-adjust: 104%;
  ascent-override: 94%;
  descent-override: 25%;
  line-gap-override: 0%;
}

/* seasons the lichen changes colour with the time of year
   the script in each page head sets data-season, without it the page stays autumn orange
   keep these in step with scripts/tint-lichen.py */
[data-season="winter"] { --lichen: #9cc7dc; --ring: #f1f8fb; }
[data-season="spring"] { --lichen: #8fbf5a; --ring: #eef6e3; }
[data-season="summer"] { --lichen: #e8b413; --ring: #fbf1cf; }
[data-season="winter"] :is(.hero__stage, .quote) { background-image: url("images/lichen-winter.svg"); }
[data-season="spring"] :is(.hero__stage, .quote) { background-image: url("images/lichen-spring.svg"); }
[data-season="summer"] :is(.hero__stage, .quote) { background-image: url("images/lichen-summer.svg"); }

/* reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
input, button, textarea { font: inherit; color: inherit; }
ul, ol { padding: 0; list-style: none; }

/* base */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--stone);
  /* keeps the footer at the bottom on short pages */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.75rem, 5.6vw, 4.8rem); letter-spacing: -0.035em; line-height: 1; }
h2 { font-size: clamp(var(--t3), 4vw, 3.2rem); margin-bottom: var(--s6); }
h3 { font-size: var(--t1); letter-spacing: -0.01em; }
p { max-width: var(--measure); }

a { color: var(--ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

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

.skip {
  position: absolute;
  left: var(--s2);
  top: -100px;
  padding: var(--s1) var(--s2);
  background: var(--ink);
  color: var(--stone);
  z-index: 10;
}
.skip:focus { top: var(--s2); }

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--s3);
}
@media (min-width: 600px) {
  .wrap { padding-inline: var(--s6); }
}

/* buttons square one lichen coloured action used everywhere */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 var(--s3);
  border: 1.5px solid var(--ink);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.btn--quote { background: var(--lichen); color: var(--ink); }
.btn--quote:hover { background: var(--ink); color: var(--stone); }
.text-link { font-weight: 600; display: inline-flex; align-items: center; min-height: 50px; }

/* header stays put so the quote button is always one tap away */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--stone);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
  padding-block: 12px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.logo__name { font-weight: 650; }
.logo__web { font-weight: 400; color: var(--muted); }
.logo__mark { width: 40px; height: 40px; flex: none; }
.logo__mark > path { fill: var(--lichen); }
.logo__mark g { stroke: var(--ring); }
.nav { display: flex; align-items: center; gap: var(--s3); }
.nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--t0);
  text-decoration: none;
}
.nav a:not(.btn):hover { text-decoration: underline; }
.nav .btn { min-height: 44px; font-size: var(--t0); }
/* one row on phones so the sticky bar stays short, the quote button is the only link kept */
@media (max-width: 560px) {
  .site-header__inner { flex-wrap: nowrap; }
  .nav li:not(:last-child) { display: none; }
  .logo { font-size: 1.0625rem; gap: 10px; }
  .logo__mark { width: 36px; height: 36px; }
  .nav .btn { padding: 0 var(--s2); }
}

/* hero */
.hero { padding-block: var(--s4) var(--s12); }
.hero__grid { display: grid; gap: var(--s6); align-items: center; }
.hero__copy h1 { margin-bottom: var(--s3); }
.lead { font-size: var(--t1); color: var(--muted); margin-bottom: var(--s4); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }

/* the lichen one bold organic field the phone sits on */
.hero__stage {
  background: url("images/lichen.svg") center / cover var(--lichen);
  padding: var(--s8) var(--s3) var(--s6);
  margin-inline: calc(var(--s3) * -1);
}
@media (min-width: 600px) {
  .hero__stage { margin-inline: calc(var(--s6) * -1); }
}
@media (min-width: 900px) {
  .hero { padding-block: var(--s4) var(--s16); }
  .hero__grid { grid-template-columns: 1.1fr 1fr; gap: var(--s4); }
  .hero__stage {
    margin: 0 calc((100vw - min(100vw, var(--max))) / -2 - var(--s6)) 0 0;
    padding: var(--s12) var(--s8) var(--s8);
    border-radius: 46% 0 0 38% / 30% 0 0 34%;
  }
}

/* phone viewer */
.viewer {
  border: 0;
  padding: 0;
  min-width: 0;
  display: grid;
  justify-items: center;
}
.viewer__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.phone {
  width: min(270px, 70vw);
  aspect-ratio: 288 / 600;
  padding: 10px;
  background: var(--ink);
  border-radius: 44px;
  position: relative;
}
.phone::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  translate: -50% 0;
  width: 70px;
  height: 20px;
  border-radius: 10px;
  background: var(--ink);
  z-index: 2;
}
.phone__screen {
  position: relative;
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  background: var(--ink);
}

.screen {
  position: absolute;
  inset: 28px 0 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease, visibility 0s linear 150ms;
}
.screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
#c-plumber:checked ~ .phone .screen--plumber,
#c-garage:checked ~ .phone .screen--garage,
#c-cafe:checked ~ .phone .screen--cafe,
#c-shop:checked ~ .phone .screen--shop {
  opacity: 1;
  visibility: visible;
  transition: opacity 150ms ease;
}

.viewer__switch {
  display: flex;
  margin-top: var(--s3);
  background: var(--stone);
  border: 1.5px solid var(--ink);
}
.viewer__switch label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-size: var(--t-1);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.viewer__switch label + label { border-left: 1.5px solid var(--ink); }
.viewer__switch label:hover { background: var(--ring); }
#c-plumber:checked ~ .viewer__switch [for="c-plumber"],
#c-garage:checked ~ .viewer__switch [for="c-garage"],
#c-cafe:checked ~ .viewer__switch [for="c-cafe"],
#c-shop:checked ~ .viewer__switch [for="c-shop"] {
  background: var(--ink);
  color: var(--stone);
}
#c-plumber:focus-visible ~ .viewer__switch [for="c-plumber"],
#c-garage:focus-visible ~ .viewer__switch [for="c-garage"],
#c-cafe:focus-visible ~ .viewer__switch [for="c-cafe"],
#c-shop:focus-visible ~ .viewer__switch [for="c-shop"] {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* work big images staggered captions beside them */
.work { padding-block: var(--s8); }
.work__item { display: grid; gap: var(--s2); margin-bottom: var(--s8); }
.work__item img { width: 100%; border: 1.5px solid var(--ink); }
.work__caption h3 { font-size: var(--t2); margin-bottom: 4px; }
.work__caption p { color: var(--muted); }
.concepts { color: var(--muted); }
.concepts a { color: var(--ink); }
@media (min-width: 900px) {
  .work { padding-block: var(--s12); }
  .work__item { grid-template-columns: repeat(12, 1fr); gap: var(--s3); align-items: end; margin-bottom: var(--s12); }
  .work__item picture { grid-column: 1 / span 8; }
  .work__caption { grid-column: 9 / span 4; padding-bottom: var(--s2); }
  .work__item--flip picture { grid-column: 5 / span 8; grid-row: 1; }
  .work__item--flip .work__caption { grid-column: 1 / span 4; grid-row: 1; text-align: right; justify-self: end; }
}

/* statement */
.statement { padding-block: var(--s8) var(--s12); }
.statement p {
  font-size: clamp(var(--t3), 4.4vw, 3.6rem);
  font-weight: 520;
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 22ch;
  margin-bottom: var(--s4);
}

/* questions */
.faq { padding-block: var(--s8); border-top: 1.5px solid var(--ink); }
.faq__grid { display: grid; gap: var(--s3); }
.faq h2 { margin-bottom: 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  min-height: 60px;
  padding-block: var(--s2);
  font-size: var(--t1);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; padding-left: var(--s2); font-size: var(--t2); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: var(--s3); color: var(--muted); }
@media (min-width: 900px) {
  .faq { padding-block: var(--s12); }
  .faq__grid { grid-template-columns: repeat(12, 1fr); }
  .faq h2 { grid-column: 1 / span 4; }
  .faq__list { grid-column: 5 / span 8; }
}

/* quote the form sits on the lichen */
.quote {
  background: url("images/lichen.svg") center / cover var(--lichen);
  padding-block: var(--s8);
}
.quote__card {
  background: var(--stone);
  border: 1.5px solid var(--ink);
  padding: var(--s4) var(--s3);
  display: grid;
  gap: var(--s6);
}
.quote__intro h2 { margin-bottom: var(--s3); }
.quote__intro p { margin-bottom: var(--s2); }
.quote__email { font-size: var(--t1); font-weight: 600; overflow-wrap: anywhere; }
@media (min-width: 600px) {
  .quote__card { padding: var(--s6); }
}
@media (min-width: 900px) {
  .quote { padding-block: var(--s16); }
  .quote__card { grid-template-columns: 1fr 1.2fr; gap: var(--s8); max-width: 980px; margin-inline: auto; }
}

.form { display: grid; gap: var(--s3); }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: var(--t0); }
.field input, .field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.field textarea { resize: vertical; }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }

/* inner page head */
.page-head { padding-block: var(--s6) var(--s8); }
.page-head h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); margin-bottom: var(--s2); }
.page-head__meta { font-size: var(--t-1); color: var(--muted); margin-bottom: var(--s3); }
.page-head__lead { font-size: var(--t1); max-width: 48ch; }
.thanks__back { margin-top: var(--s3); }

/* legal pages */
.legal { display: grid; gap: var(--s6); padding-block: var(--s6) var(--s8); border-top: 1.5px solid var(--ink); }
.legal__toc h2 { font-size: var(--t0); margin-bottom: var(--s1); }
.legal__toc ol { list-style: decimal; padding-left: 1.4em; color: var(--muted); }
.legal__toc a { display: inline-block; padding-block: 6px; font-size: var(--t0); }
.prose section { padding-top: var(--s4); scroll-margin-top: var(--s2); }
.prose section + section { margin-top: var(--s2); }
.prose h2 { font-size: var(--t2); margin-bottom: var(--s2); }
.prose p, .prose ul { margin-bottom: var(--s2); }
.prose ul { list-style: disc; padding-left: 1.2em; max-width: var(--measure); }
.prose li + li { margin-top: var(--s1); }
.legal-table { width: 100%; border-collapse: collapse; margin-bottom: var(--s3); font-size: var(--t0); }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); }
.legal-table th { font-weight: 600; color: var(--muted); }
@media (min-width: 900px) {
  .page-head { padding-block: var(--s8) var(--s12); }
  .legal { grid-template-columns: repeat(12, 1fr); gap: var(--s3); padding-block: var(--s8) var(--s12); }
  .legal__toc { grid-column: 1 / span 3; position: sticky; top: 96px; align-self: start; padding-top: var(--s4); }
  .prose { grid-column: 5 / span 8; }
}

/* footer */
.site-footer { background: var(--ink); color: var(--pale); padding-block: var(--s6); font-size: var(--t-1); }
.site-footer p { max-width: none; }
.site-footer a { color: var(--stone); }
.site-footer :focus-visible { outline-color: var(--stone); }
.footer-links { display: flex; gap: var(--s3); margin-top: var(--s1); }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
