/* 4vets.dev — expectation page
   Palette sampled from the 4vets logo. Fonts self-hosted (SIL OFL). */

@font-face {
  font-family: "Unbounded";
  src: url("/assets/fonts/unbounded.woff2") format("woff2-variations"),
       url("/assets/fonts/unbounded.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans.woff2") format("woff2-variations"),
       url("/assets/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Base */
  --paper: #FAFBFF;      /* clinical white */
  --ink: #141A3A;        /* deep indigo */
  --ink-2: #4A5275;      /* secondary text */
  --rule: #DDE2F2;
  --focus: #1042E6;      /* logo ".dev" blue */

  /* Spectrum (logo wordmark order) */
  --s-sky: #00ADF8;
  --s-cyan: #01C4DA;
  --s-green: #43E210;
  --s-yellow: #FEBE02;
  --s-orange: #FD6701;
  --s-red: #FC4243;
  --s-magenta: #FD47AC;
  --s-violet: #8A02A0;

  --grid-minor: rgba(16, 66, 230, 0.045);
  --grid-major: rgba(16, 66, 230, 0.085);

  --font-display: "Unbounded", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- ECG paper (hero only) ---------- */
.strip {
  position: relative;
  isolation: isolate;
  padding-bottom: clamp(2rem, 5vw, 4rem);
}
.strip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
  background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
          mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.brand img { width: 44px; height: 44px; }

.lang ul {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.lang a {
  display: block;
  min-width: 2.6rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.lang a:hover { color: var(--ink); background: #EEF1FB; }
.lang a[aria-current="page"] {
  color: var(--paper);
  background: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-top: clamp(2.5rem, 7vw, 6rem);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.5rem;
  padding: 0.35rem 0.9rem 0.35rem 0.7rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
}
.status .dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--s-green);
}
.status .dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--s-green);
  opacity: 0;
  animation: beat 2.4s ease-out 3s infinite;
}
@keyframes beat {
  0%   { transform: scale(0.6); opacity: 0.7; }
  60%  { transform: scale(1.6); opacity: 0; }
  100% { opacity: 0; }
}

h1 {
  margin: 0;
  max-width: 17ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 1.1rem + 3.4vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lead {
  max-width: 58ch;
  margin: 1.5rem 0 2rem;
  font-size: clamp(1.125rem, 1rem + 0.35vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}
.lead strong { color: var(--ink); font-weight: 650; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.4rem;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.button:hover { background: var(--focus); }
.button svg { width: 18px; height: 18px; }

.hero-mark {
  justify-self: end;
  width: min(100%, 420px);
  aspect-ratio: 1;
}
.hero-mark img { width: 100%; height: auto; }

/* ---------- The trace (single orchestrated moment) ---------- */
.trace {
  width: 100%;
  height: clamp(80px, 12vw, 150px);
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  overflow: visible;
}
.trace path {
  fill: none;
  stroke: url(#spectrum);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
/* Monitor sweep: the trace is revealed left to right, once */
.trace {
  clip-path: inset(-20% 0 -20% 0);
  animation: sweep 2.8s cubic-bezier(0.45, 0, 0.2, 1) 0.3s both;
}
@keyframes sweep {
  from { clip-path: inset(-20% 100% -20% 0); }
  to   { clip-path: inset(-20% 0 -20% 0); }
}

/* ---------- Sections ---------- */
main section { padding-block: clamp(3rem, 7vw, 5.5rem); }

h2 {
  margin: 0 0 2.5rem;
  max-width: 24ch;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 1.05rem + 1.1vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  margin: 0.9rem 0 0.4rem;
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.35;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.features p,
.pillars dd {
  margin: 0;
  max-width: 42ch;
  color: var(--ink-2);
}

.blip {
  width: 56px;
  height: 18px;
  color: var(--hue);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.features li:nth-child(1) { --hue: var(--s-sky); }
.features li:nth-child(2) { --hue: var(--s-cyan); }
.features li:nth-child(3) { --hue: var(--s-green); }
.features li:nth-child(4) { --hue: var(--s-orange); }
.features li:nth-child(5) { --hue: var(--s-red); }
.features li:nth-child(6) { --hue: var(--s-magenta); }

.origin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 5rem);
  background-image: linear-gradient(var(--rule), var(--rule));
  background-size: calc(100% - 2 * var(--gutter)) 1px;
  background-position: center top;
  background-repeat: no-repeat;
}
.origin h2 { margin-bottom: 1.25rem; }
.origin > div > p {
  margin: 0;
  max-width: 44ch;
  font-size: 1.125rem;
  color: var(--ink-2);
}

.pillars { margin: 0; }
.pillars div {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--rule);
}
.pillars div:first-child { padding-top: 0.2rem; }
.pillars dt {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.4;
}
.pillars dt { padding-left: 0.85rem; box-shadow: inset 3px 0 0 var(--mark); }
.pillars div:nth-child(1) { --mark: var(--s-cyan); }
.pillars div:nth-child(2) { --mark: var(--s-yellow); }
.pillars div:nth-child(3) { --mark: var(--s-magenta); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2rem 2.5rem;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--ink); text-underline-offset: 3px; }

/* ---------- 404 ---------- */
.notfound {
  min-height: 70vh;
  display: grid;
  align-content: center;
  gap: 1.5rem;
  padding-block: 4rem;
}
.notfound p { margin: 0; color: var(--ink-2); max-width: 50ch; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .origin { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .hero-mark { order: -1; justify-self: start; width: 168px; }
  .features { grid-template-columns: 1fr; gap: 2.25rem; }
  .pillars div { grid-template-columns: 1fr; }
  .pillars dd { padding-left: 0.85rem; }
  .site-header { justify-content: flex-end; }
  .has-hero .brand { display: none; }
  .brand span { display: none; }
}

@media (max-width: 380px) {
  .lang a { min-width: 2.2rem; padding-inline: 0.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  .trace { animation: none; }
  .status .dot::after { animation: none; }
  .button { transition: none; }
}

/* ---------- Utilities ---------- */
.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
