/* Fraudfried marketing site. One stylesheet for every language version. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  /* Surfaces */
  --paper: #f5f4f0;
  --raised: #fbfaf7;
  --band: #ebe9e3;

  /* Text */
  --ink: #14161b;
  --ink-soft: #444954;
  --ink-mute: #5d6370;

  /* Lines */
  --rule: #d8d5cd;
  --rule-strong: #b9b5ab;

  /* Accent: one colour, used sparingly */
  --accent: #2542c9;
  --accent-strong: #1a3099;
  --accent-wash: #e3e7f8;

  /* Graph */
  --node: #a6aab3;
  --edge: #d3d0c8;

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --text-display: clamp(2.5rem, 1.5rem + 4.4vw, 5.25rem);

  /* Space */
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 3rem);
  --section: clamp(5rem, 3rem + 8vw, 10rem);
  --content: 76rem;

  --radius: 6px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 160ms;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  hyphens: auto;
  -webkit-hyphens: auto;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--accent-wash);
  color: var(--ink);
}

.sprite {
  position: absolute;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--text-sm);
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 0.75rem;
}

.wrap {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand svg {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 2rem);
  font-size: var(--text-sm);
}

@media (max-width: 24rem) {
  .lang a,
  .lang span {
    min-width: 2.25rem;
    padding-inline: 0.25rem;
  }
}

.lang {
  display: flex;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.lang a,
.lang span {
  display: inline-block;
  min-width: 2.75rem;
  padding: 0.5rem 0.5rem;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius);
}

.lang span {
  color: var(--ink);
  background: var(--band);
}

.lang a {
  color: var(--ink-mute);
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

.lang a:hover {
  color: var(--ink);
  background: var(--band);
}

.header-contact {
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 220ms var(--ease);
}

.header-contact:hover {
  background-size: 100% 1px;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3rem;
  padding: 0.75rem 1.375rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  font-size: var(--text-base);
  text-decoration: none;
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.button:hover {
  background: var(--accent);
}

.button:active {
  background: var(--accent-strong);
  transform: translateY(1px);
}

.button svg {
  width: 1.125rem;
  height: 1.125rem;
  transition: transform 220ms var(--ease);
}

.button:hover svg {
  transform: translateX(3px);
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 4.5rem - 5.5rem);
  min-height: calc(100svh - 4.5rem - 5.5rem);
  padding-block: clamp(3rem, 2rem + 4vw, 6rem);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(3rem, 6vw, 4rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.25rem, 1.3rem + 3.2vw, 4.25rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.04em;
  max-width: 19ch;
  text-wrap: balance;
}

.hero h1 .quiet {
  display: block;
  color: var(--accent);
}

.hero .lede {
  margin-top: 2rem;
  max-width: 34rem;
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--ink-soft);
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2.75rem;
}

.hero .actions .kicker {
  user-select: all;
}

@media (min-width: 60rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
}

/* ---------- Graph figure ---------- */

.graph {
  margin: 0;
  position: relative;
}

.graph-canvas {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 34rem;
  margin-inline: auto;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) * 2);
  overflow: hidden;
}

.graph-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
}

.graph figcaption {
  max-width: 34rem;
  margin: 1rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  letter-spacing: 0;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-item svg {
  width: 0.75rem;
  height: 0.75rem;
  flex: none;
}

/* SVG parts; colours live here, geometry lives in graph.js */

.g-edge {
  stroke: var(--edge);
  stroke-width: 1;
}

.g-node {
  fill: var(--node);
}

.g-link {
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
}

.g-hit {
  fill: var(--accent);
}

.g-halo {
  fill: var(--accent-wash);
  fill-opacity: 0.7;
  stroke: var(--accent);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.g-tag-bg {
  fill: var(--ink);
}

.g-tag-text {
  fill: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* Choreography. Final state is the default; motion only adds the way in. */

@media (prefers-reduced-motion: no-preference) {
  .graph.is-live .g-edge,
  .graph.is-live .g-node {
    animation: g-fade 700ms var(--ease) both;
  }

  .graph.is-live .g-link {
    stroke-dasharray: var(--len);
    animation: g-draw 900ms var(--ease) both;
  }

  .graph.is-live .g-hit {
    animation: g-ignite 600ms var(--ease) both;
  }

  .graph.is-live .g-halo {
    transform-box: fill-box;
    transform-origin: center;
    animation: g-halo 900ms var(--ease) both;
  }

  .graph.is-live .g-tag {
    animation: g-rise 500ms var(--ease) both;
  }
}

@keyframes g-fade {
  from { opacity: 0; }
}

@keyframes g-draw {
  from { stroke-dashoffset: var(--len); }
  to { stroke-dashoffset: 0; }
}

@keyframes g-ignite {
  from { fill: var(--node); }
}

@keyframes g-halo {
  from { opacity: 0; transform: scale(0.85); }
}

@keyframes g-rise {
  from { opacity: 0; transform: translateY(6px); }
}

/* ---------- Contact ---------- */

.contact {
  padding-block: var(--section);
  background: var(--band);
}

.contact p {
  margin-top: 1.25rem;
  max-width: 40rem;
  font-size: var(--text-xl);
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.contact p strong {
  color: var(--ink);
  font-weight: 600;
}

.mail {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin-top: 2.5rem;
  font-size: min(var(--text-2xl), 8vw);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  padding-bottom: 0.15em;
  transition: color var(--fast) var(--ease), background-size 320ms var(--ease);
}

.mail svg {
  width: 0.7em;
  height: 0.7em;
  flex: none;
  transition: transform 220ms var(--ease);
}

.mail:hover {
  color: var(--accent);
  background-size: 100% 2px;
}

.mail:hover svg {
  transform: translate(3px, -3px);
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 2rem 2.5rem;
  font-size: var(--text-xs);
  color: var(--ink-mute);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-footer a {
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
  transition: color var(--fast) var(--ease);
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
