/*
 * NiMe Solutions – site styles.
 * Hand-written, no framework. Brand colours come from the previous site:
 *   background #2a2927, accent #26c2dd, muted text #b7bebe, text white.
 * Dark is the brand default; a light variant follows prefers-color-scheme.
 */

/* ---------- Fonts ---------- */

/* Open Sans, variable weight 300–800, Latin subset, self-hosted (SIL OFL, see fonts/OFL.txt).
   If this file is ever replaced, give the new file a new name: /assets/ is cached as immutable. */
@font-face {
  font-family: "Open Sans";
  src: url("/assets/fonts/open-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched fallback so the swap to Open Sans barely moves the layout. */
@font-face {
  font-family: "Open Sans Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 105.4%;
  ascent-override: 101.4%;
  descent-override: 27.7%;
  line-gap-override: 0%;
}

/* ---------- Design tokens ---------- */

:root {
  color-scheme: dark;

  --font-sans: "Open Sans", "Open Sans Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #2a2927;
  --bg-raised: #33312f;
  --bg-header: rgb(42 41 39 / 0.92);
  --text: #ffffff;
  --muted: #b7bebe;
  --accent: #26c2dd;
  --accent-strong: #5fd6ea; /* hover */
  --on-accent: #1a1918;
  --line: rgb(255 255 255 / 0.14);
  --glow: rgb(38 194 221 / 0.2);
  --grid-line: rgb(255 255 255 / 0.05);

  --radius: 1rem;
  --gutter: clamp(1rem, 5vw, 2rem);
  --measure: 70rem;
  --header-h: 4rem;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;

    --bg: #f4f7f7;
    --bg-raised: #ffffff;
    --bg-header: rgb(244 247 247 / 0.92);
    --text: #1b1d1d;
    --muted: #4a5555;
    --accent: #006f82; /* darker cyan, ≥ 4.5:1 on the light backgrounds */
    --accent-strong: #00505e;
    --on-accent: #ffffff;
    --line: rgb(0 0 0 / 0.14);
    --glow: rgb(38 194 221 / 0.2);
    --grid-line: rgb(0 0 0 / 0.05);
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-block-start: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-block-size: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
p,
dl,
dd,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

svg {
  display: block;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

.wrap {
  inline-size: min(100% - 2 * var(--gutter), var(--measure));
  margin-inline: auto;
}

/* Visually hidden, still read by assistive technology. */
.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background: var(--bg-header);
  border-block-end: 1px solid var(--line);
}

@supports (backdrop-filter: blur(1px)) {
  .site-header {
    backdrop-filter: saturate(160%) blur(12px);
  }
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.5rem;
  min-block-size: var(--header-h);
}

.brand {
  margin-inline-end: auto;
}

.lang {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.25rem;
  padding-inline: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.lang:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* Phones: brand and language switch on the first row, navigation on its own row. The
   header is not sticky there so it does not eat a fifth of the screen. */
@media (max-width: 39.99rem) {
  .site-header {
    position: static;
  }

  .site-header nav {
    order: 3;
    flex-basis: 100%;
    margin-inline: -0.5rem;
    padding-block-end: 0.25rem;
  }

  html {
    scroll-padding-block-start: 1rem;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand svg {
  inline-size: 1.75rem;
  block-size: 1.75rem;
}

/* "Solutions" is only shown from tablet width up; it stays available to screen readers. */
@media (max-width: 39.99rem) {
  .brand-long {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.nav-list {
  display: flex;
  gap: 0.25rem;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  padding-inline: 0.7rem;
  border-radius: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-list a:hover {
  color: var(--text);
  background: var(--line);
}

@media (min-width: 40rem) {
  .nav-list {
    gap: 0.5rem;
  }

  .nav-list a {
    padding-inline: 1rem;
    font-size: 1rem;
  }
}

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

.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding-block: clamp(3.5rem, 10vw, 7rem) clamp(4rem, 10vw, 7.5rem);
  border-block-end: 1px solid var(--line);
}

/* Decorative: soft cyan glow and a faint grid, both pure CSS. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero::before {
  background:
    radial-gradient(60rem 36rem at 85% 0%, var(--glow), transparent 70%),
    radial-gradient(40rem 28rem at 0% 100%, color-mix(in srgb, var(--glow) 60%, transparent), transparent 70%);
}

.hero::after {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 3.5rem 3.5rem;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
}

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

@media (min-width: 56rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}

.prompt {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-block-end: 1.25rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.prompt::before {
  content: ">_";
  content: ">_" / "";
  color: var(--accent);
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(2.75rem, 1.2rem + 7.5vw, 5.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero h1 span {
  color: var(--accent);
}

.tagline {
  max-inline-size: 32rem;
  margin-block-start: clamp(1.25rem, 3vw, 2rem);
  color: var(--muted);
  font-size: clamp(1.2rem, 0.9rem + 1.2vw, 1.65rem);
  font-weight: 300;
  line-height: 1.4;
  text-wrap: balance;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block-start: clamp(1.75rem, 4vw, 2.5rem);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 3rem;
  padding-inline: 1.5rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.button--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.button--ghost:hover {
  background: var(--line);
  border-color: var(--muted);
}

.logo {
  /* Hidden on phones: the brand is already in the header. Shown from 56rem up. */
  display: none;
  aspect-ratio: 1;
  border-radius: 50%;
}

.logo svg {
  inline-size: 100%;
  block-size: 100%;
}

@media (min-width: 56rem) {
  .logo {
    display: block;
    inline-size: min(100%, 22rem);
    justify-self: end;
    box-shadow: 0 0 0 1px var(--line), 0 0 0 0.6rem var(--glow), 0 2rem 5rem rgb(0 0 0 / 0.25);
  }
}

/* Blink the terminal cursor a few times (< 5 s, WCAG 2.2.2), then leave it on. */
@media (prefers-reduced-motion: no-preference) {
  .cursor {
    animation: blink 1s steps(1, end) 4;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

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

.section {
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
}

.section + .section {
  border-block-start: 1px solid var(--line);
}

.section h2 {
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.section h2::before {
  content: ">_";
  content: ">_" / "";
  display: block;
  margin-block-end: 0.6rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
}

.split {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
}

@media (min-width: 48rem) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  }
}

.about-text {
  max-inline-size: 42rem;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
  font-weight: 300;
  line-height: 1.65;
  text-wrap: pretty;
}

/* Pillars under the about text: light, no boxes. */

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.5rem clamp(1.5rem, 4vw, 3rem);
  margin-block-start: clamp(2.5rem, 6vw, 4rem);
}

.pillars li {
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--line);
}

.pillars svg {
  inline-size: 2rem;
  block-size: 2rem;
  margin-block-end: 0.9rem;
  color: var(--accent);
}

.pillars h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.pillars p {
  color: var(--muted);
}

/* Closing call to action above the footer. */

.cta .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}

.cta .actions {
  margin: 0;
}

/* ---------- Footer (legal + contact: plain, deliberately quiet) ---------- */

.site-footer {
  padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
  border-block-start: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  gap: 2rem clamp(2rem, 6vw, 5rem);
}

@media (min-width: 40rem) {
  .footer-grid {
    grid-template-columns: repeat(2, max-content);
  }
}

.site-footer h2 {
  margin-block-end: 0.6rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.2rem 1.25rem;
}

.legal-list dd {
  margin: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: 2.75rem;
  color: var(--text);
  text-decoration-color: var(--line);
  text-underline-offset: 0.25em;
}

.contact-links a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.contact-links svg {
  inline-size: 1.1rem;
  block-size: 1.1rem;
  flex: none;
  color: var(--accent);
}

.copyright {
  margin-block-start: 1.5rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--line);
  font-size: 0.875rem;
}

/* ---------- 404 ---------- */

.not-found {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1.25rem;
  min-block-size: 60vh;
  padding-block: 4rem;
}

.not-found h1 {
  font-size: clamp(2.5rem, 1.2rem + 6vw, 5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}

.not-found h1 span {
  color: var(--accent);
}

.not-found p {
  max-inline-size: 30rem;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 300;
}

/* ---------- Print ---------- */

@media print {
  .site-header,
  .skip-link,
  .actions {
    display: none;
  }

  .hero::before,
  .hero::after {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
