@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #eef1f4;
  --ink: #101827;
  --muted: #566074;
  --rule: #d3d9e1;
  --signal: #2342ff;
  --gutter: clamp(18px, 4vw, 40px);
  --gap: 24px;
  /* Tile width follows the window height so all tiles (four rows of two) fit in one view. */
  --tile-w: clamp(280px, calc((100vh - 512px) * 0.6667), 560px);
  color-scheme: light;
}

@supports (height: 100svh) {
  :root { --tile-w: clamp(280px, calc((100svh - 512px) * 0.6667), 560px); }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: linear-gradient(#f8fafc, var(--paper) 460px) no-repeat, var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.page {
  width: min(calc(2 * var(--tile-w) + var(--gap)), calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  padding: 28px 0 40px;
}

/* Header */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 32px;
}

.top h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5.2vw, 4.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.tagline {
  margin: 10px 0 0;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--muted);
}

.contact {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s;
}

.contact:hover { background: var(--signal); }

/* One segment per app. The segment of the tile you hover lights up. */
.spectrum {
  display: flex;
  gap: 6px;
  margin: 20px 0 24px;
  height: 6px;
  align-items: center;
}

.spectrum span {
  flex: 1;
  height: 4px;
  border-radius: 3px;
  background: var(--c);
  transition: opacity 0.25s, height 0.25s;
}

/* App tiles */

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

.app {
  display: block;
  text-decoration: none;
  border-radius: 16px;
}

.shot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 8 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: var(--fallback, #28324a);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 39, 0.14), 0 10px 22px -12px rgba(16, 24, 39, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.shot .fallback {
  font-size: clamp(1.2rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 39, 0.1);
  pointer-events: none;
}

.app:hover .shot,
.app:focus-visible .shot {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(16, 24, 39, 0.14), 0 22px 34px -14px var(--glow, rgba(16, 24, 39, 0.4));
}

.caption {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: baseline;
  padding: 12px 2px 0;
}

.caption h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.app:hover .caption h2 {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent, var(--signal));
}

.caption .where { margin: 0; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }

.caption .what {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--muted);
}

/* Footer (below the first view) */

.foot {
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px 48px;
}

.foot h2 { margin: 0 0 6px; font-size: 0.95rem; font-weight: 700; }
.foot p { margin: 0; max-width: 46ch; color: var(--muted); }
.foot a { color: var(--ink); text-underline-offset: 4px; }
.foot a:hover { color: var(--signal); }

.legal {
  grid-column: 1 / -1;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  font-size: 0.875rem;
  color: var(--muted);
}

/* 404 page */

.simple { max-width: 560px; margin: 0 auto; padding: 96px var(--gutter); }
.simple h1 { margin: 0 0 12px; font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.simple p { margin: 0 0 24px; color: var(--muted); }

/* Small screens */

@media (max-width: 620px) {
  .apps { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr; }
}

/* Spectrum highlight (progressive enhancement) */

@supports selector(:has(a)) {
  .page:has(.apps li:hover) .spectrum span,
  .page:has(.apps a:focus-visible) .spectrum span { opacity: 0.25; }

  .page:has(.apps li:nth-child(1):hover) .spectrum span:nth-child(1),
  .page:has(.apps li:nth-child(2):hover) .spectrum span:nth-child(2),
  .page:has(.apps li:nth-child(3):hover) .spectrum span:nth-child(3),
  .page:has(.apps li:nth-child(4):hover) .spectrum span:nth-child(4),
  .page:has(.apps li:nth-child(5):hover) .spectrum span:nth-child(5),
  .page:has(.apps li:nth-child(6):hover) .spectrum span:nth-child(6),
  .page:has(.apps li:nth-child(7):hover) .spectrum span:nth-child(7) { opacity: 1; height: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .shot, .spectrum span, .contact { transition: none; }
  .app:hover .shot, .app:focus-visible .shot { transform: none; }
}
