/* DataMorphosis — site styles */

:root {
  --bg: oklch(0.986 0.005 250);
  --panel: oklch(0.994 0.003 250);
  --sunken: oklch(0.962 0.008 252);
  --line: oklch(0.83 0.012 252);
  --line-soft: oklch(0.9 0.01 252);
  --ink: oklch(0.21 0.028 262);
  --ink-2: oklch(0.36 0.022 260);
  --ink-3: oklch(0.48 0.02 260);
  --blue: oklch(0.52 0.19 258);
  --blue-deep: oklch(0.39 0.16 260);
  --blue-tint: oklch(0.93 0.035 258);
  --red: oklch(0.5 0.19 25);
  --dark: oklch(0.21 0.024 262);
  --dark-2: oklch(0.26 0.026 262);
  --dark-line: oklch(0.36 0.03 262);
  --on-dark: oklch(0.95 0.008 250);
  --on-dark-2: oklch(0.78 0.025 255);

  --display: "Familjen Grotesk", system-ui, sans-serif;
  --text: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --nav-h: 72px;
  --radius: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line) var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--blue); color: var(--bg); }

h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }

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

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

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 14px;
  border-radius: var(--radius); text-decoration: none; font-weight: 500;
}
.skip:focus { top: 12px; }

/* ---------- Keycap buttons ---------- */

.key {
  --edge: oklch(0.8 0.016 254);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px;
  font-family: var(--display); font-size: 1rem; font-weight: 500; line-height: 1;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow:
    0 3px 0 0 var(--edge),
    0 6px 8px -4px oklch(0.21 0.028 262 / 0.28),
    inset 0 1px 0 0 oklch(1 0 0 / 0.9);
  cursor: pointer;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), background-color 0.12s;
}
.key:hover { background: oklch(1 0 0); }
.key:active, .key[aria-selected="true"] {
  transform: translateY(3px);
  box-shadow:
    0 0 0 0 var(--edge),
    0 1px 2px -1px oklch(0.21 0.028 262 / 0.28),
    inset 0 1px 2px 0 oklch(0.21 0.028 262 / 0.14);
}
.key--primary {
  --edge: var(--blue-deep);
  color: var(--bg); background: var(--blue); border-color: var(--blue-deep);
  box-shadow:
    0 3px 0 0 var(--edge),
    0 6px 8px -4px oklch(0.3 0.12 260 / 0.45),
    inset 0 1px 0 0 oklch(1 0 0 / 0.22);
}
.key--primary:hover { background: oklch(0.47 0.19 258); }
.key--primary:active {
  box-shadow: 0 0 0 0 var(--edge), inset 0 1px 3px 0 oklch(0.2 0.1 260 / 0.5);
}
.key--small { height: 40px; padding: 0 16px; font-size: 0.9375rem; }

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: oklch(0.986 0.005 250 / 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.02em;
  text-decoration: none; color: var(--ink);
}
.brand img { width: 34px; height: auto; }

.nav-links { display: flex; gap: 4px; margin-inline: auto; list-style: none; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: var(--radius);
  font-size: 0.9375rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.nav-links a:hover { background: var(--sunken); color: var(--ink); }

.nav-end { display: flex; align-items: center; gap: 12px; margin-left: auto; }
@media (min-width: 861px) { .nav-links + .nav-end { margin-left: 0; } }

.lang {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius);
}
.lang button {
  font: 500 0.75rem/1 var(--mono); letter-spacing: 0.02em;
  height: 30px; min-width: 38px; padding: 0 8px;
  color: var(--ink-3); background: transparent; border: 0; border-radius: 4px; cursor: pointer;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] {
  color: var(--ink); background: var(--panel);
  box-shadow: 0 1px 2px oklch(0.21 0.028 262 / 0.18);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: min(calc(100svh - var(--nav-h)), 820px);
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .wrap { position: relative; padding-block: 72px; }
.hero-copy { max-width: 560px; }

.hero h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2.75rem, 4.4vw + 1.2rem, 4.5rem);
  line-height: 0.98; letter-spacing: -0.028em;
  text-wrap: balance;
}
.hero-sub {
  margin-top: 24px; max-width: 30em;
  font-size: clamp(1.0625rem, 0.5vw + 1rem, 1.3125rem); line-height: 1.45; color: var(--ink-2);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-note { margin-top: 28px; font-size: 0.875rem; font-weight: 500; color: var(--ink-2); }

/* ---------- Sections ---------- */

.section { position: relative; padding-block: clamp(72px, 9vw, 128px); }
.section > .wrap, .band > .wrap { position: relative; }

.ambient {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; color: var(--blue-deep); opacity: 0.2;
}
.band .ambient { color: var(--on-dark); opacity: 0.17; }
.section--sunken { background: var(--sunken); border-block: 1px solid var(--line-soft); }

.section-head {
  margin-bottom: clamp(32px, 4vw, 56px);
}
.section-head h2, .band h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2rem, 2.6vw + 1.1rem, 3.25rem);
  line-height: 1.05; letter-spacing: -0.028em; text-wrap: balance;
}
.section-head p { font-size: 1.125rem; line-height: 1.5; color: var(--ink-2); max-width: 30em; }

/* ---------- Clients ---------- */

.clients {
  display: grid; grid-template-columns: repeat(3, 1fr);
  list-style: none; margin: 0; padding: 0;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.9) inset, 0 8px 16px -12px oklch(0.21 0.028 262 / 0.25);
  overflow: hidden;
}
.clients li { border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.clients li:nth-child(3n) { border-right: 0; }
.clients li:nth-last-child(-n + 3) { border-bottom: 0; }

.client {
  display: grid; grid-template-rows: 1fr auto; gap: 20px;
  height: 100%; min-height: 196px; padding: 28px 28px 22px;
  text-decoration: none; color: var(--ink);
  transition: background-color 0.2s;
}
.client:hover { background: oklch(1 0 0); }
.client-logo { display: grid; place-items: center; }
.client-logo img {
  max-height: 44px; max-width: min(190px, 78%); width: auto; height: auto;
  filter: grayscale(1) contrast(0.9); opacity: 0.78;
  transition: filter 0.25s, opacity 0.25s;
}
.client-logo img.is-mark { max-height: 56px; }
.client-logo img.is-heavy { opacity: 0.55; }
.client:hover .client-logo img, .client:focus-visible .client-logo img { filter: none; opacity: 1; }
.client-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.client-name { font-weight: 500; font-size: 0.9375rem; }
.client-url { font: 400 0.75rem/1.2 var(--mono); color: var(--ink-3); transition: color 0.2s; }
.client:hover .client-url { color: var(--blue-deep); }

/* ---------- Services ---------- */

.tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.tabs .key {
  height: 64px; padding: 0 14px; justify-content: flex-start;
  font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; white-space: normal; text-align: left; line-height: 1.1;
}
.tabs .key { gap: 10px; }
.tabs .key svg { flex: none; color: var(--ink-3); transition: color 0.15s; }
.tabs .key:hover svg, .tabs .key[aria-selected="true"] svg { color: var(--blue); }
.tabs .key[aria-selected="true"] { background: var(--blue-tint); border-color: var(--blue); color: var(--blue-deep); }

.service { margin-top: 36px; }
.service-desc { font-size: 1.125rem; font-weight: 500; max-width: 36em; min-height: 3.1em; text-wrap: pretty; }

.demo {
  margin-top: 20px;
  background: var(--dark); color: var(--on-dark);
  border: 1px solid oklch(0.14 0.02 262); border-radius: 10px;
  box-shadow: 0 18px 30px -22px oklch(0.21 0.028 262 / 0.7);
  overflow: hidden;
}
.demo-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px;
  padding: 12px 20px; border-bottom: 1px solid var(--dark-line);
  font: 400 0.8125rem/1.3 var(--text); color: var(--on-dark-2);
}
.demo-panes { display: grid; grid-template-columns: 1fr 1fr; }
.pane { min-width: 0; }
.pane + .pane { border-left: 1px solid var(--dark-line); background: var(--dark-2); }
.pane-name {
  padding: 12px 20px; border-bottom: 1px solid var(--dark-line);
  font: 500 0.8125rem/1.3 var(--mono); color: var(--on-dark-2);
}
.pane + .pane .pane-name { color: oklch(0.8 0.1 250); }
.pane pre {
  margin: 0; padding: 24px 20px 28px; min-height: 248px;
  font: 400 0.875rem/1.75 var(--mono); color: var(--on-dark);
  white-space: pre; overflow-x: auto; tab-size: 2;
  scrollbar-color: var(--dark-line) transparent;
}

/* ---------- Contact band ---------- */

.band { position: relative; overflow: hidden; background: var(--dark); color: var(--on-dark); padding-block: clamp(80px, 10vw, 144px); }
.band .wrap { display: grid; grid-template-columns: 7fr 5fr; gap: 40px 64px; align-items: start; }
.band h2 { color: var(--on-dark); }
.band p { font-size: 1.125rem; line-height: 1.55; color: var(--on-dark-2); max-width: 30em; text-wrap: pretty; }
.band-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 32px; }
.band .key--primary { --edge: oklch(0.34 0.14 260); border-color: oklch(0.34 0.14 260); }
.band-mail {
  font: 400 0.875rem/1.3 var(--mono); color: var(--on-dark);
  text-decoration: underline; text-decoration-color: var(--dark-line); text-underline-offset: 5px;
}
.band-mail:hover { text-decoration-color: var(--on-dark); }
.band :focus-visible { outline-color: var(--on-dark); }

/* ---------- Footer ---------- */

.footer { padding-block: 64px 28px; overflow: hidden; }
.footer-row {
  display: grid; grid-template-columns: 3fr 6fr 3fr; gap: 24px; align-items: start;
}
.footer p { font-size: 1.0625rem; color: var(--ink-2); max-width: 26em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; padding: 0; margin: 16px 0 0; }
.footer-links a {
  font-size: 0.875rem; font-weight: 500; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px;
}
.footer-links a:hover { text-decoration-color: var(--ink); }
.footer-copy { font: 400 0.8125rem/1.6 var(--text); color: var(--ink-3); text-align: right; }
.wordmark {
  margin: 56px 0 0; min-height: 120px;
  font: 500 10px/1 var(--mono); letter-spacing: 0;
  color: oklch(0.55 0.09 258); white-space: pre; user-select: none;
  overflow: hidden; cursor: crosshair; touch-action: pan-y;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .tabs { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero { display: block; min-height: 0; }
  .hero .wrap { padding-block: 48px 0; }
  .hero-copy { max-width: none; }
  .hero-field-space { height: 330px; }
  .section-head, .band .wrap { grid-template-columns: 1fr; }
  .clients { grid-template-columns: repeat(2, 1fr); }
  .clients li:nth-child(3n) { border-right: 1px solid var(--line-soft); }
  .clients li:nth-child(2n) { border-right: 0; }
  .clients li:nth-last-child(-n + 3) { border-bottom: 1px solid var(--line-soft); }
  .clients li:nth-last-child(-n + 2) { border-bottom: 0; }
  .client { min-height: 160px; padding: 22px 18px 16px; }
  .client-meta { flex-direction: column; gap: 4px; }
  .demo-panes { grid-template-columns: 1fr; }
  .pane + .pane { border-left: 0; border-top: 1px solid var(--dark-line); }
  .pane pre { min-height: 0; font-size: 0.8125rem; }
  .footer-row { grid-template-columns: 1fr; }
  .footer-copy { text-align: left; }
}

@media (max-width: 520px) {
  .nav .brand span { display: none; }
  .wordmark { display: none; }
  .tabs { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tabs .key { height: 56px; font-size: 1rem; }
  .hero-actions .key { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
