:root {
  --paper: #f5f3ee;
  --paper-2: #ebe8e0;
  --card: #fbfaf7;
  --ink: #16150f;
  --ink-2: #3d3b33;
  --muted: #6f6b60;
  --line: #dedad0;
  --line-strong: #c9c4b7;
  --ember: #d4461c;
  --on-ink: #f5f3ee;

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gutter: 24px;
  --gap: 20px;
  --radius: 16px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12110e;
    --paper-2: #1b1a16;
    --card: #191814;
    --ink: #f1eee6;
    --ink-2: #cfcbc0;
    --muted: #9a958a;
    --line: #2c2a24;
    --line-strong: #403d35;
    --ember: #f0683f;
    --on-ink: #12110e;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: 8px;
  z-index: 20;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.mark .tile {
  fill: var(--ink);
}

.mark .glyph {
  fill: var(--paper);
}

.mark .spark {
  fill: var(--ember);
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 15px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: var(--paper-2);
  color: var(--ink);
}

/* Hero */

.hero {
  padding-block: clamp(72px, 12vw, 148px) clamp(56px, 8vw, 96px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember);
}

.hero h1 {
  margin-top: 24px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 9.5vw, 116px);
  line-height: 0.96;
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: italic;
  color: var(--muted);
}

.lede {
  margin-top: 32px;
  max-width: 34em;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.55;
  color: var(--ink-2);
}

.lede a {
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.lede a:hover {
  text-decoration-color: currentColor;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding-inline: 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--ink) 86%, var(--paper));
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 400;
}

.btn-ghost:hover {
  border-color: var(--ink);
}

/* Sections */

.section {
  padding-block: clamp(64px, 9vw, 112px);
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px 48px;
  align-items: end;
  margin-bottom: 48px;
}

.section-label {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head h2 {
  margin-top: 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1;
  letter-spacing: -0.015em;
}

.section-head > p {
  color: var(--ink-2);
  max-width: 30em;
  justify-self: end;
}

/* Family tree connecting the parent to its products */

.tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--line-strong);
}

.tree-root {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 13px;
}

.tree-root .mark {
  width: 20px;
  height: 20px;
}

.tree-root::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  height: 24px;
  border-left: 1px solid currentColor;
  color: var(--line-strong);
}

.tree-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  width: 100%;
  height: 24px;
  margin-top: 24px;
}

.tree-rail::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc((100% - 2 * var(--gap)) / 6);
  right: calc((100% - 2 * var(--gap)) / 6);
  border-top: 1px solid currentColor;
}

.tree-rail i {
  justify-self: center;
  border-left: 1px solid currentColor;
}

/* Products */

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.product {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.product::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.product:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -24px rgb(0 0 0 / 0.25);
}

.product:hover::before {
  opacity: 1;
}

.product-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo-tile {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  overflow: hidden;
  flex: none;
}

.logo-tile svg,
.logo-tile img {
  width: 100%;
  height: 100%;
}

.logo-anyport {
  background: #6d28d9;
  padding: 9px;
}

.logo-oneqr {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgb(30 39 97 / 0.12);
  padding: 9px;
}

.logo-typing-guru {
  background: #dfeaf4;
}

.category {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.product h3 {
  margin-top: 28px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.product-tagline {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink-2);
}

.product-body {
  margin-top: 16px;
  font-size: 15.5px;
  color: var(--muted);
}

.product-for {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}

.product-for span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 8px;
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 24px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

/* The whole card is the link target. */
.product-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.product-link .arrow {
  transition: transform 0.2s ease;
}

.product:hover .product-link .arrow {
  transform: translate(2px, -2px);
}

.product:focus-within {
  border-color: var(--ink);
}

.product-link:focus-visible {
  outline: none;
}

/* Approach */

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: principle;
}

.principles li {
  padding-top: 20px;
  border-top: 1px solid var(--ink);
  counter-increment: principle;
}

.principles li::before {
  content: counter(principle, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ember);
}

.principles h3 {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.1;
}

.principles p {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 16px;
}

/* Contact */

.contact {
  text-align: center;
}

.contact h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 10vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.contact h2 em {
  color: var(--muted);
}

.contact p {
  max-width: 32em;
  margin: 24px auto 0;
  color: var(--ink-2);
}

.contact-email {
  display: inline-block;
  margin-top: 32px;
  font-family: var(--mono);
  font-size: clamp(18px, 3vw, 26px);
  text-decoration: underline;
  text-decoration-color: var(--ember);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.contact-email:hover {
  color: var(--ember);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 32px 40px;
  font-size: 14px;
  color: var(--muted);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 13px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

/* 404 */

.not-found {
  min-height: calc(100vh - 64px - 105px);
  display: grid;
  align-content: center;
  padding-block: 96px;
}

.not-found h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.not-found p {
  margin-top: 20px;
  color: var(--ink-2);
}

.not-found .btn {
  margin-top: 32px;
  justify-self: start;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Responsive */

@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
    margin-inline: auto;
  }

  .tree {
    display: none;
  }

  .principles {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .section-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-head > p {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 16px;
  }

  body {
    font-size: 16px;
  }

  .site-nav a:not(:last-child) {
    display: none;
  }

  .product {
    padding: 22px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
