/* ==========================================================================
   Virtue Medical LLC - Coming Soon
   Design tokens, layout, and craft. One accent, one radius system,
   two themes (light / dark) via data-theme on <html>.
   ========================================================================== */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("assets/fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens: light (default) ---------- */
:root {
  --bg: #f4f7f5;
  --bg-elev: #ffffff;
  --ink: #0e1a15;
  --ink-soft: #3e4a44;
  --muted: #5b6761;
  --accent: #0c6b57;
  --accent-strong: #0a5847;
  --accent-soft: #e1efe9;
  --hairline: #d7e1dc;
  --btn-fg: #ffffff;
  --mark-fg: #ffffff;
  --ring: #0c6b57;
  --shadow: 0 1px 2px rgb(14 26 21 / 0.06), 0 8px 24px -12px rgb(14 26 21 / 0.18);
  color-scheme: light;
}

/* ---------- Tokens: dark ---------- */
html[data-theme="dark"] {
  --bg: #0a110e;
  --bg-elev: #101a15;
  --ink: #e7f0eb;
  --ink-soft: #b6c4bd;
  --muted: #8a9891;
  --accent: #45c39c;
  --accent-strong: #57cda7;
  --accent-soft: #13312a;
  --hairline: #22322c;
  --btn-fg: #06251c;
  --mark-fg: #062a21;
  --ring: #45c39c;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 28px -12px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

/* No-JS fallback: light is the default; dark only when explicitly requested */
html:not([data-theme]) {
  color-scheme: light;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s ease, color 0.35s ease;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
}

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

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

.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;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--btn-fg);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand:hover .brand-mark {
  transform: scale(1.05);
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-name img {
  display: block;
  padding-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease, color 0.2s ease;
}

.icon-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-button:active {
  transform: scale(0.96);
}

.icon-theme {
  width: 20px;
  height: 20px;
}

.icon-theme-sun {
  display: block;
}

.icon-theme-moon {
  display: none;
}

html[data-theme="light"] .icon-theme-sun {
  display: none;
}

html[data-theme="light"] .icon-theme-moon {
  display: block;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn-ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost:active {
  transform: scale(0.98);
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 56px;
  padding-bottom: 0;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(720px 420px at 50% -10%, var(--accent-soft), transparent 70%),
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 100% 100%, 72px 72px, 72px 72px;
  background-position: center top, center top, center top;
  opacity: 0.7;
  -webkit-mask-image: linear-gradient(to bottom, rgb(0 0 0 / 0.9), transparent 78%);
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / 0.9), transparent 78%);
}

.hero-inner {
  position: relative;
  max-width: 780px;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--bg-elev);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  box-shadow: var(--shadow);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.hero h1 {
  margin-top: 28px;
  font-size: clamp(2.4rem, 5.6vw, 4.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lede {
  margin: 20px auto 0;
  max-width: 44ch;
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---------- Waitlist form ---------- */
.waitlist {
  margin-top: 36px;
}

.waitlist-fields {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: 620px;
  margin: 0 auto;
}

.field {
  flex: 1;
  text-align: left;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--btn-fg);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: default;
}

.form-message {
  margin-top: 12px;
  min-height: 1.5em;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

.form-message.is-error {
  color: #b3261e;
}

html[data-theme="dark"] .form-message.is-error {
  color: #ff8f87;
}

.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

/* ---------- ECG motif ---------- */
.ecg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--hairline);
  overflow: hidden;
}

.ecg::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 140px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: sweep 7s linear infinite;
}

@keyframes sweep {
  from { transform: translateX(-160px); }
  to { transform: translateX(calc(100vw + 160px)); }
}

/* ---------- Capabilities ---------- */
.capabilities {
  padding: 72px 0 64px;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.capability {
  padding: 0 40px;
}

.capability:first-child {
  padding-left: 0;
}

.capability:last-child {
  padding-right: 0;
}

.capability + .capability {
  border-left: 1px solid var(--hairline);
}

.capability h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.capability p {
  margin-top: 8px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--bg-elev);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--accent);
}

/* ---------- Entrance motion ---------- */
.pill,
.hero h1,
.lede,
.waitlist {
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero h1 { animation-delay: 0.08s; }
.lede { animation-delay: 0.16s; }
.waitlist { animation-delay: 0.24s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.capability {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.capability.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body {
    transition: none;
  }

  .pill-dot,
  .ecg::after {
    animation: none;
  }

  .ecg::after {
    opacity: 0;
  }

  .pill,
  .hero h1,
  .lede,
  .waitlist {
    animation: none;
  }

  .capability {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .brand-mark,
  .icon-button,
  .btn-ghost,
  .btn-primary {
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .btn-ghost {
    font-size: 0.85rem;
  }

  .hero {
    padding-top: 48px;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 9vw, 3rem);
  }

  .lede {
    max-width: 40ch;
  }

  .waitlist-fields {
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
  }

  .btn-primary {
    width: 100%;
  }

  .capabilities {
    padding: 48px 0 40px;
  }

  .capability-grid {
    grid-template-columns: 1fr;
  }

  .capability {
    padding: 20px 0;
  }

  .capability + .capability {
    border-left: none;
    border-top: 1px solid var(--hairline);
  }
}

@media (max-width: 400px) {
  .header-actions .btn-ghost {
    padding: 0 12px;
  }
}