/*
 * hqorgs.com
 *
 * One stylesheet, one set of tokens. The page follows the operating system's
 * light or dark setting through the custom properties below, so no template
 * carries a second color for dark and nothing runs before first paint.
 *
 * Color on this site belongs to the products: the chrome is ink on paper, and
 * the only hues are each product's own brand color on its tile and card.
 *
 * Layers, lowest first: page, sticky nav (10), skip link (20).
 */

@font-face {
  font-family: 'Geist';
  src: url('/assets/fonts/geist/geist-latin.9b6f5ff45b27.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/assets/fonts/geist/geist-mono-latin.5f3d6ad60f29.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --paper: #f6f5f1;
  --surface: #fdfcfa;
  --ink: #0c0d10;
  --muted: #55575e;
  --line: rgb(12 13 16 / 0.12);
  --line-strong: rgb(12 13 16 / 0.22);
  --shadow: 0 1px 2px rgb(12 13 16 / 0.06), 0 18px 40px -18px rgb(12 13 16 / 0.28);
  --tint: 7%;

  --radius: 18px;
  --radius-small: 10px;
  --page: 1240px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c0d10;
    --surface: #14151a;
    --ink: #f6f5f1;
    --muted: #a3a5ac;
    --line: rgb(246 245 241 / 0.12);
    --line-strong: rgb(246 245 241 / 0.24);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 18px 40px -18px rgb(0 0 0 / 0.7);
    --tint: 14%;
  }
}

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

[hidden] {
  display: none !important;
}

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

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

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

a {
  color: inherit;
}

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

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

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

.skip {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-small);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.icon {
  display: inline-block;
  flex: none;
  width: 1.15em;
  height: 1.15em;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 550;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button.quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button.quiet:hover {
  border-color: var(--ink);
}

.button.small {
  padding: 0.55rem 1rem;
  font-size: 0.9375rem;
}

/* Navigation */

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

@media (prefers-reduced-transparency: reduce) {
  .nav {
    background: var(--paper);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

/* The mark is ink on paper, so it swaps with the scheme like the page does. */
.brand .mark-dark,
.brand-large .mark-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .brand .mark-light,
  .brand-large .mark-light {
    display: none;
  }

  .brand .mark-dark,
  .brand-large .mark-dark {
    display: block;
  }
}

.nav-links {
  display: none;
  gap: 1.75rem;
  margin-left: auto;
  font-size: 0.9688rem;
  color: var(--muted);
}

.nav-links a {
  text-decoration: none;
  transition: color 140ms ease;
}

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

.nav .button {
  margin-left: auto;
}

@media (min-width: 820px) {
  .nav-links {
    display: flex;
  }

  .nav .button {
    margin-left: 0;
  }
}

/* Hero */

.hero {
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3.5rem, 8vw, 6.5rem);
  overflow: clip;
}

.hero-grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}

@media (min-width: 1000px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
}

.hero h1 {
  font-size: clamp(2.5rem, 4.9vw, 3.9rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero .lede {
  max-width: 34rem;
  margin-top: 1.5rem;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

/*
 * Three real home pages, fanned. The stack is the hero's picture of the
 * claim in the headline: several products, one place.
 */
.fan {
  position: relative;
  aspect-ratio: 16 / 11.5;
  margin-inline: auto;
  width: 100%;
  max-width: 640px;
}

.fan figure {
  position: absolute;
  inset: 0 12% 14% 0;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform-origin: 30% 100%;
}

.fan figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.fan figure:nth-child(1) {
  transform: translate(13%, 15%) rotate(5deg);
}

.fan figure:nth-child(2) {
  transform: translate(7%, 8%) rotate(1.5deg);
}

.fan figure:nth-child(3) {
  transform: rotate(-2deg);
}

/* Section scaffolding */

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

.section-head {
  max-width: 44rem;
  margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
}

.eyebrow {
  margin-bottom: 1rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.section h2 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.section-head p {
  margin-top: 1.1rem;
  font-size: 1.125rem;
  color: var(--muted);
}

/* Products */

.products {
  display: grid;
  gap: 1rem;
}

@media (min-width: 860px) {
  .products {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .product:nth-child(1) { grid-column: span 7; }
  .product:nth-child(2) { grid-column: span 5; }
  .product:nth-child(3) { grid-column: span 5; }
  .product:nth-child(4) { grid-column: span 7; }
  .product:nth-child(5) { grid-column: span 7; }
  .product:nth-child(6) { grid-column: span 5; }
}

.product {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) var(--tint), var(--surface));
  overflow: hidden;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.product:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line-strong));
  box-shadow: var(--shadow);
}

.product-body {
  padding: clamp(1.4rem, 2.6vw, 2rem);
}

.product-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.tile {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 1.3rem;
}

.product h3 {
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.product .category {
  font-size: 0.9063rem;
  color: var(--muted);
}

.product .headline {
  margin-top: 1.4rem;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.product .description {
  max-width: 34rem;
  margin-top: 0.7rem;
  color: var(--muted);
}

.product-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.4rem;
  font-weight: 550;
  font-size: 0.9688rem;
}

.product-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color 140ms ease;
}

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

/* The whole card opens the product; the source link sits above that layer. */
.product-links a.primary::after {
  content: '';
  position: absolute;
  inset: 0;
}

.product-links a.source {
  position: relative;
  color: var(--muted);
}

.shot {
  margin: auto 0 0;
  padding: 0 clamp(1.4rem, 2.6vw, 2rem);
}

.shot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top left;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--surface);
}

/* Principles */

.principles {
  list-style: none;
  margin: 0;
  padding: 0;
}

.principles li {
  display: grid;
  gap: 0.5rem 2rem;
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--line);
}

.principles li:first-child {
  border-top: 0;
  padding-top: 0;
}

.principles h3 {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.principles h3 .icon {
  color: var(--muted);
}

.principles p {
  max-width: 32rem;
  font-size: 1.125rem;
  color: var(--muted);
}

@media (min-width: 860px) {
  .principles li {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: baseline;
  }
}

/* Stacks */

.stacks-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 900px) {
  .stacks-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}

.stacks-grid p {
  margin-top: 1.1rem;
  font-size: 1.125rem;
  color: var(--muted);
}

.stacks-grid .button {
  margin-top: 1.75rem;
}

/* The code panel is a terminal in both schemes, so its colors are fixed. */
.code {
  border-radius: var(--radius);
  background: #0c0d10;
  color: #e9e8e3;
  border: 1px solid rgb(246 245 241 / 0.14);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.9063rem;
  line-height: 1.9;
}

.code-bar {
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid rgb(246 245 241 / 0.12);
  color: #a3a5ac;
  font-size: 0.8125rem;
}

.code pre {
  margin: 0;
  padding: 1.1rem 1.25rem 1.3rem;
  overflow-x: auto;
  font: inherit;
}

.code .comment {
  color: #8b8d94;
}

.code .key {
  color: #f6f5f1;
}

/* Closing list */

.directory {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.directory a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-block: clamp(0.9rem, 2vw, 1.4rem);
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: padding-left 220ms ease, color 220ms ease;
}

.directory a:hover {
  padding-left: 0.75rem;
  color: var(--brand);
}

.directory .name {
  font-size: clamp(1.9rem, 5.2vw, 4rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.045em;
}

.directory .category {
  display: none;
  color: var(--muted);
}

.directory .host {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.9063rem;
  color: var(--muted);
}

@media (min-width: 760px) {
  .directory .category {
    display: inline;
  }
}

/* Dark paper needs the brand colors a step lighter to stay readable as text. */
@media (prefers-color-scheme: dark) {
  .directory a:hover {
    color: color-mix(in srgb, var(--brand) 62%, #fff);
  }
}

/* Footer */

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

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-left: auto;
}

.footer a {
  text-decoration: none;
}

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

/*
 * Motion. Two moves, both about hierarchy: the hero's stack deals itself out
 * once so the eye lands on it after the headline, and each product card rises
 * as it enters so the grid reads one product at a time. Neither runs for a
 * visitor who asked for less motion.
 */
@media (prefers-reduced-motion: no-preference) {
  .fan figure {
    animation: deal 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .fan figure:nth-child(1) {
    --to: translate(13%, 15%) rotate(5deg);
    animation-delay: 120ms;
  }

  .fan figure:nth-child(2) {
    --to: translate(7%, 8%) rotate(1.5deg);
    animation-delay: 220ms;
  }

  .fan figure:nth-child(3) {
    --to: rotate(-2deg);
    animation-delay: 320ms;
  }

  @keyframes deal {
    from {
      opacity: 0;
      transform: translate(4%, 22%) rotate(0deg);
    }

    to {
      opacity: 1;
      transform: var(--to);
    }
  }

  @supports (animation-timeline: view()) {
    .product {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }

    @keyframes rise {
      from {
        opacity: 0;
        translate: 0 28px;
      }

      to {
        opacity: 1;
        translate: 0 0;
      }
    }
  }
}

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

  .button,
  .product,
  .directory a {
    transition: none;
  }
}
