/* T1 site style. The tokens and components are described in docs/design/t1-website.md ("Visual style"). */

:root {
  --ink: #14202e;
  --ink-muted: #4b5866;
  --paper: #ffffff;
  --surface: #f3f5f7;
  --rule: #d4dae0;
  --field-border: #6b7785;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-soft: #e3f1ef;
  --on-ink: #ffffff;
  --on-ink-muted: #c3ccd5;
  --on-ink-rule: #2c3a4a;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;

  --page: 68rem;
  --measure: 40rem;
  --radius: 0.375rem;
}

/* Base */

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  /* Keep the footer at the bottom of the window on short pages */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-3);
}

h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3rem);
  max-width: 22ch;
}

h2 {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
}

h3 {
  font-size: 1.1875rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 var(--space-3);
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.prose {
  max-width: var(--measure);
}

.lead {
  font-size: 1.25rem;
  color: var(--ink-muted);
  max-width: var(--measure);
}

/* A short technical label above a heading or on a card */
.label {
  display: inline-block;
  margin: 0 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--accent-dark);
}

.tag {
  display: inline-block;
  padding: 0.125rem var(--space-2);
  border-radius: var(--radius);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-dark);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--ink);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* On a phone the navigation takes its own row under the name and button */
@media (max-width: 47.99rem) {
  .site-nav {
    order: 3;
    flex-basis: 100%;
  }
}

@media (min-width: 48rem) {
  .site-nav {
    margin-left: auto;
  }
}

/* Buttons */

.button,
button {
  display: inline-block;
  padding: 0.6875rem 1.25rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
button:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: var(--paper);
}

.button-secondary {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
}

/* Page sections */

main {
  display: block;
  flex: 1 0 auto;
}

.section {
  padding: var(--space-6) 0;
}

.section + .section {
  border-top: 1px solid var(--rule);
}

.section-band {
  background: var(--surface);
}

.section + .section-band,
.section-band + .section {
  border-top: 0;
}

.hero {
  padding: var(--space-6) 0;
}

@media (min-width: 48rem) {
  .hero {
    padding: var(--space-7) 0 var(--space-6);
  }

  .section {
    padding: var(--space-7) 0;
  }
}

/* Cards: a grid of service areas or case studies */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--paper);
}

.card h3 {
  margin-bottom: var(--space-2);
}

.card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.card p:last-child {
  margin-bottom: 0;
}

/* Result: the working result a customer gets */

.result {
  padding: var(--space-5) var(--space-4);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--on-ink);
}

.result p {
  color: var(--on-ink-muted);
  max-width: var(--measure);
}

.result .label {
  color: var(--on-ink-muted);
}

@media (min-width: 48rem) {
  .result {
    padding: var(--space-6);
  }
}

/* A list of what's done, each with a tick */

.checks {
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: var(--space-2);
}

.checks li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--accent);
}

.result .checks li::before {
  color: var(--on-ink);
}

/* Case study: problem, what was built, result */

.case {
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
}

.case dl {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-3) 0 0;
}

.case dt {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-dark);
}

.case dd {
  margin: 0;
}

@media (min-width: 48rem) {
  .case dl {
    grid-template-columns: 10rem 1fr;
    gap: var(--space-3) var(--space-4);
  }
}

/* Questions and answers */

.qa {
  max-width: var(--measure);
}

.qa dt {
  font-weight: 700;
  margin-top: var(--space-4);
}

.qa dt:first-child {
  margin-top: 0;
}

.qa dd {
  margin: var(--space-1) 0 0;
}

/* Enquiry prompt at the end of a content page */

.prompt {
  padding: var(--space-6) 0;
  background: var(--surface);
  border-top: 1px solid var(--rule);
}

.prompt h2 {
  max-width: 28ch;
}

.prompt p {
  max-width: var(--measure);
}

/* Form */

form {
  max-width: 36rem;
  margin-top: var(--space-4);
}

.field {
  margin: 0 0 var(--space-4);
}

label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: 600;
}

.optional {
  font-weight: 400;
  color: var(--ink-muted);
}

input,
textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

.hidden {
  position: absolute;
  left: -10000px;
}

/* Footer */

.site-footer {
  padding: var(--space-6) 0 var(--space-5);
  background: var(--ink);
  color: var(--on-ink-muted);
  font-size: 0.9375rem;
}

.site-footer a {
  color: var(--on-ink);
}

.site-footer a:hover {
  color: var(--on-ink);
  text-decoration-thickness: 2px;
}

.site-footer a:focus-visible {
  outline-color: var(--on-ink);
}

.site-footer .wordmark {
  color: var(--on-ink);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--space-5);
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li {
  margin-bottom: var(--space-2);
}

.footer-heading {
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--on-ink-muted);
}

.footer-base {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--on-ink-rule);
}

.footer-base p {
  margin: 0;
}

/* Style reference page only: a frame round each sample */

.sample {
  margin: var(--space-3) 0 var(--space-5);
  border: 1px dashed var(--field-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.swatch {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.swatch span {
  display: block;
  height: 3.5rem;
}

.swatch code {
  display: block;
  padding: var(--space-2);
}
