/* =========================================================
   REDESIGN Sp. z o.o. — redsgn.uk
   Vanilla CSS. No frameworks. Petrol/teal clinical system.
   ========================================================= */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/space-grotesk-500.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/space-grotesk-600.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/space-grotesk-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-600.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f4;
  --ink: #0b1c20;
  --ink-soft: #3d4f52;
  --ink-faint: #6a7b7e;
  --accent: #0b6e74;
  --accent-strong: #075257;
  --accent-tint: #e4eff0;
  --line: rgba(11, 110, 116, 0.16);
  --line-soft: rgba(11, 28, 32, 0.08);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-text: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --maxw: 1120px;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 10px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset-ish ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

/* ---------- Accessibility helpers ---------- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}
section {
  padding-block: clamp(3.5rem, 9vw, 7rem);
}
.eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
  background: var(--btn-bg);
  color: #fff;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
  will-change: transform;
}
.btn:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px rgba(7, 82, 87, 0.7);
}
.btn:active {
  transform: translateY(0);
}
.btn--ghost {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--line);
}
.btn--ghost:hover {
  background: var(--accent-tint);
  box-shadow: none;
  color: var(--accent-strong);
}
.btn svg {
  transition: transform 0.2s var(--ease);
}
.btn:hover svg {
  transform: translateX(3px);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-decoration: none;
}
.brand__mark {
  width: 28px;
  height: 28px;
  flex: none;
}
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav__links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s var(--ease);
}
.nav__links a:hover {
  color: var(--accent-strong);
}
.nav__toggle {
  display: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3.5rem, 8vw, 6.5rem) 0;
  overflow: hidden;
}
.hero__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
}
.hero h1 {
  font-size: clamp(2.6rem, 7.2vw, 5rem);
  font-weight: 700;
  max-width: 15ch;
}
.hero h1 .accent {
  color: var(--accent);
}
.hero__sub {
  margin: 1.5rem 0 0;
  font-size: clamp(1.1rem, 2.2vw, 1.375rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero__cta {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.hero__note {
  font-size: 0.9rem;
  color: var(--ink-faint);
}

/* ---------- Signature: ECG / pulse divider ---------- */
.ecg {
  width: 100%;
  height: clamp(48px, 8vw, 72px);
  overflow: hidden;
  color: var(--accent);
}
.ecg svg {
  width: 100%;
  height: 100%;
}
.ecg__base {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
}
.ecg__sweep {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 140 1060;
  filter: drop-shadow(0 0 5px rgba(11, 110, 116, 0.55));
  animation: ecg-sweep 6s linear infinite;
}
@keyframes ecg-sweep {
  from {
    stroke-dashoffset: 1200;
  }
  to {
    stroke-dashoffset: 0;
  }
}
.hero .ecg {
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

/* ---------- What we do ---------- */
.services__grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  margin-top: 2.5rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: 0 18px 40px -28px rgba(11, 28, 32, 0.45);
}
.card__icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}
.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* ---------- How we work ---------- */
.process {
  background: var(--surface);
  border-block: 1px solid var(--line-soft);
}
.process__head {
  max-width: 40ch;
}
.steps {
  list-style: none;
  counter-reset: step;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 1.75rem 1.5rem 1.75rem 0;
  border-top: 2px solid var(--line);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}
.steps li h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- About ---------- */
.about__grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: 1fr;
  align-items: start;
}
.about p {
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.5;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 24ch;
}
.about__lead {
  max-width: none;
}
.about__body p {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 52ch;
}
@media (min-width: 800px) {
  .about__grid {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

/* ---------- Contact / Footer ---------- */
.contact {
  text-align: center;
}
.contact h2 {
  font-size: clamp(2rem, 5vw, 3.25rem);
}
.contact__mail {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 4vw, 2rem);
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 2px solid var(--line);
  padding-bottom: 4px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.contact__mail:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 2.5rem;
  color: var(--ink-faint);
  font-size: 0.9rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer__legal {
  margin: 0;
  line-height: 1.6;
}
.site-footer__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer__links a {
  color: var(--ink-soft);
  text-decoration: none;
}
.site-footer__links a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

/* ---------- Load orchestration (single moment) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
}
.is-ready .reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.is-ready .reveal[data-d="1"] {
  transition-delay: 0.08s;
}
.is-ready .reveal[data-d="2"] {
  transition-delay: 0.18s;
}
.is-ready .reveal[data-d="3"] {
  transition-delay: 0.3s;
}
.is-ready .reveal[data-d="4"] {
  transition-delay: 0.42s;
}

/* ---------- Responsive: header nav collapse ---------- */
@media (max-width: 760px) {
  .nav__links {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--pad) 1rem;
    transform: translateY(-140%);
    transition: transform 0.3s var(--ease);
    box-shadow: 0 20px 40px -30px rgba(11, 28, 32, 0.6);
  }
  .nav__links.is-open {
    transform: translateY(0);
  }
  .nav__links li {
    border-top: 1px solid var(--line-soft);
  }
  .nav__links li:first-child {
    border-top: 0;
  }
  .nav__links a {
    display: block;
    padding: 0.85rem 0;
    font-size: 1.05rem;
  }
  .nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    cursor: pointer;
  }
  .nav {
    gap: 0.75rem;
  }
  .header-cta {
    display: none;
  }
}
@media (max-width: 420px) {
  .header-cta {
    display: none;
  }
}

/* ---------- Legal pages (privacy / terms) ---------- */
.legal {
  max-width: 720px;
  padding-block: clamp(2.5rem, 7vw, 5rem);
}
.legal .back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}
.legal .back:hover {
  color: var(--accent-strong);
}
.legal h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin-bottom: 0.5rem;
}
.legal .updated {
  color: var(--ink-faint);
  font-size: 0.9rem;
  margin: 0 0 2.5rem;
}
.legal h2 {
  font-size: 1.3rem;
  margin: 2.25rem 0 0.6rem;
}
.legal p,
.legal li {
  color: var(--ink-soft);
}
.legal ul {
  padding-left: 1.2rem;
}
.legal li {
  margin-bottom: 0.4rem;
}
.legal h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.5rem 0 0.4rem;
  color: var(--ink);
}
.legal .lead {
  font-size: 1.15rem;
  color: var(--ink);
}
.legal .callout {
  background: var(--accent-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}
.legal .callout p {
  margin: 0;
  color: var(--ink);
}
.legal .toc {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem 1rem 2.4rem;
  margin: 0 0 2.5rem;
}
.legal .toc li {
  margin-bottom: 0.25rem;
}
.table-scroll {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.legal table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 0.95rem;
}
.legal th,
.legal td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
}
.legal thead th {
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.legal tbody tr:last-child td {
  border-bottom: 0;
}
.legal td:first-child {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .ecg__sweep {
    stroke-dasharray: none;
    opacity: 0.9;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
