/* Fonts are self-hosted: no third-party request, no tracking. */
@font-face {
  font-family: "Familjen Grotesk";
  src: url("/fonts/familjen-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Familjen Grotesk";
  src: url("/fonts/familjen-grotesk-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

/* Wordmark only */
@font-face {
  font-family: "M PLUS Rounded 1c";
  src: url("/fonts/m-plus-rounded-1c-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --font: "Familjen Grotesk", ui-sans-serif, sans-serif;

  --bg: #f6f2e8;
  --bg-alt: #eee8d9;
  --ink: #1f2019;
  --muted: #5a5b4f;
  --line: #d8d0bc;
  --accent: #a65300;
  /* Taken from the logo */
  --yuzu: #fbd334;
  --leaf: #2a7d3a;
  --orange: #f29400;

  --wrap: 70rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1.0625rem, .35vw + 1rem, 1.1875rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: -.025em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

a {
  color: inherit;
  text-decoration-color: var(--yuzu);
  text-decoration-thickness: 3px;
  text-underline-offset: .18em;
  transition: color .2s, text-decoration-color .2s;

  &:hover {
    color: var(--accent);
    text-decoration-color: var(--orange);
  }
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--yuzu);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.narrow {
  max-width: calc(44rem + var(--gutter) * 2);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: .5rem 1rem;
  background: var(--ink);
  color: var(--bg);

  &:focus {
    top: 1rem;
  }
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 2rem;
  padding-block: .75rem;
}

/* Wordmark on the left, the slice on the right: "tech" sits under the missing wedge */
.brand {
  display: inline-flex;
  align-items: flex-end;
  font-size: 1.6rem;
  text-decoration: none;

  img {
    display: block;
    width: auto;
    height: 2.8em;
    margin-left: -.95em;
  }

  &:hover {
    color: inherit;
  }
}

.brand-name {
  position: relative;
  z-index: 1;
  margin-bottom: .3em;
  font-family: "M PLUS Rounded 1c", var(--font);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 1rem;

  a {
    text-decoration: none;
  }

  .nav-cta {
    padding: .35rem 1rem;
    border-radius: 999px;
    background: var(--yuzu);
    font-weight: 600;

    &:hover {
      color: var(--ink);
      background: var(--orange);
    }
  }
}

@media (max-width: 40rem) {
  .brand {
    font-size: 1.35rem;
  }

  .site-nav {
    gap: 1rem;
    font-size: .95rem;

    a:not(.nav-cta) {
      display: none;
    }
  }
}

/* Buttons */

.button {
  display: inline-block;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, color .2s;

  &:hover {
    color: var(--ink);
    background: var(--yuzu);
  }
}

/* Hero */

.hero {
  padding-block: clamp(2.5rem, 8vw, 6rem) clamp(3rem, 8vw, 6rem);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem clamp(2rem, 6vw, 5rem);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  line-height: 1;
  letter-spacing: -.04em;
}

.hero-text p {
  max-width: 36rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  text-align: justify;
}

.hero-text .lead {
  margin-top: 1.75rem;
  font-size: 1.2em;
  line-height: 1.5;
  text-align: start;
  color: var(--ink);
}

.hero-actions {
  margin-top: 2rem !important;
}

.hero-visual {
  grid-row: 1;
  grid-column: 2;
  position: relative;
  margin: 0;
  max-width: 26rem;
  justify-self: center;

  img {
    display: block;
    width: 100%;
    rotate: -6deg;
    transition: rotate 1.2s var(--ease);
  }

  &:hover img {
    rotate: 8deg;
  }
}

/* The slice is already in the header on small screens */
@media (max-width: 48rem) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: none;
  }
}

/* Sections */

.section {
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  margin-bottom: clamp(2rem, 5vw, 3rem);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  letter-spacing: -.035em;
}

.approach {
  background: var(--bg-alt);

  h2 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    letter-spacing: 0;
    color: var(--accent);
  }

  p {
    margin: 1.25rem 0 0;
    color: var(--muted);
    text-align: justify;
  }

  .big {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.3;
    text-align: start;
    letter-spacing: -.02em;
    font-weight: 500;
    color: var(--ink);
  }
}

/* Projects */

.stories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: clamp(2.5rem, 6vw, 5rem);
}

.story {
  padding-top: 1.5rem;
  border-top: 4px solid var(--orange);

  &:nth-child(2) {
    border-color: var(--leaf);
  }

  h3 {
    margin-bottom: 1rem;
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  }

  p {
    margin: 0 0 1rem;
    color: var(--muted);
    text-align: justify;
  }
}

.story-meta {
  margin-bottom: .5rem !important;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink) !important;
}

.stack {
  font-size: .9rem;
}

.also {
  max-width: 48rem;
  margin-top: clamp(3rem, 7vw, 5rem);

  h3 {
    font-size: 1.35rem;
  }

  p {
    margin: .75rem 0 0;
    color: var(--muted);
    text-align: justify;
  }

  strong {
    color: var(--ink);
    font-weight: 600;
  }
}

/* Open source */

.oss-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 2rem clamp(2rem, 6vw, 5rem);

  > div p {
    margin: 0 0 1rem;
    color: var(--muted);
    text-align: justify;
  }
}

.oss {
  margin: 0;
  padding: 0;
  list-style: none;

  li {
    padding-block: 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);

    &:first-child {
      padding-top: 0;
    }
  }

  li > a:first-child {
    font-weight: 700;
    font-size: 1.15em;
    color: var(--ink);
  }
}

@media (max-width: 48rem) {
  .oss-inner {
    grid-template-columns: 1fr;
  }
}

/* Clients */

/* Every tile has the same height; each logo is fitted into the same box */
.client-logos {
  --tile: 7rem;
  --logo: 2.6rem;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;

  li {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--tile);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    background: #fff;
  }

  img {
    display: block;
    width: 100%;
    height: min(100%, var(--logo) * var(--scale, 1));
    object-fit: contain;
    filter: grayscale(100%);
    opacity: .75;
    transition: filter .3s, opacity .3s;
  }

  li:hover img {
    filter: none;
    opacity: 1;
  }
}

@media (max-width: 40rem) {
  .client-logos {
    --tile: 4rem;
    --logo: 1.25rem;

    gap: .5rem;

    li {
      padding: .5rem .6rem;
      border-radius: .75rem;
    }
  }
}

/* Contact */

.contact {
  background: var(--yuzu);
  padding-block: clamp(3.5rem, 9vw, 6rem);

  a:hover {
    color: inherit;
    text-decoration-color: currentColor;
  }

  h2 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    letter-spacing: -.04em;
  }

  p {
    max-width: 34rem;
  }
}

.contact-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: end;
  gap: 1.5rem clamp(2rem, 6vw, 5rem);
}

.contact-links {
  a {
    text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent);
  }

  p {
    margin: 1rem 0 0;
    font-weight: 600;
  }
}

.contact-email {
  font-size: clamp(1.35rem, 3.4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}

@media (max-width: 48rem) {
  .contact-inner {
    grid-template-columns: 1fr;
  }
}

/* Footer */

.site-footer {
  padding-block: 2.5rem 3rem;
  font-size: .9rem;
  color: var(--muted);
}

.site-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem 2rem;
  align-items: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: 0;
  line-height: 1.45;

  strong {
    color: var(--ink);
  }

  img {
    flex: none;
    width: 2.5rem;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-meta {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: .8rem;
}

@media (max-width: 48rem) {
  .site-footer-inner {
    grid-template-columns: 1fr;
  }
}

/* Content pages: extensions, privacy policies */

.prose-page {
  max-width: calc(46rem + var(--gutter) * 2);
  padding-block: clamp(3rem, 8vw, 5rem);
  min-height: 60vh;
}

.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);

  h1 {
    font-size: clamp(2.2rem, 5.5vw, 3.5rem);
    letter-spacing: -.04em;
  }
}

.kicker {
  margin: 0 0 .75rem;
  font-weight: 600;
  color: var(--accent);
}

.page-subtitle {
  margin: 1rem 0 0;
  font-size: 1.15em;
  color: var(--muted);
}

.prose {
  overflow-wrap: break-word;

  h2,
  h3 {
    margin: 2.5rem 0 .75rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.35rem;
  }

  > :first-child {
    margin-top: 0;
  }

  ul,
  ol {
    padding-left: 1.25rem;
  }

  li {
    margin-block: .45rem;
  }

  li::marker {
    color: var(--orange);
  }

  .button {
    margin-block: .5rem 1rem;
  }
}

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

  html {
    scroll-behavior: auto;
  }
}
