/* ═══════════════════════════════════════════════════════════
   EVIVIUM — Concise e-ink landing
   Warm white field · Mono ink · Single-screen layout
   ═══════════════════════════════════════════════════════════ */

:root {
  --paper: #F5F5F3;
  --paper-soft: #EFEBE3;
  --edge: #D6D1C7;
  --ink: #1A1A18;
  --ink-soft: #3F3E3A;
  --ink-muted: #7A776F;
  --ink-faint: #A8A49A;

  --font-sans: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-serif: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max: 960px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --magic: linear-gradient(
    115deg,
    #e85d4c 0%,
    #f0b429 18%,
    #3ecf8e 36%,
    #4aa3ff 54%,
    #9b6dff 72%,
    #ff6bcb 88%,
    #e85d4c 100%
  );
}

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

html {
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* Landing: fill the viewport; scroll if the body does not fit */
body:has(.main) {
  overflow: auto;
  height: auto;
  min-height: 100dvh;
}

em {
  font-family: var(--font-sans);
  font-style: italic;
  font-weight: 400;
}

.mono {
  font-family: var(--mono);
  font-size: 0.8em;
  letter-spacing: 0.04em;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Shell — header/footer full viewport; body stays --max */
.page {
  min-height: 100dvh;
  height: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: visible;
  box-sizing: border-box;
}

/* Contact may grow and scroll */
body:has(.contact-main) {
  overflow: auto;
  height: auto;
  min-height: 100%;
  max-height: none;
}

body:has(.contact-main) .page {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: none;
  overflow: visible;
}

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  color: var(--ink);
}

.header-pronounce {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.4;
}

/* Header mark — multicolor carrot fill (hue-rotate) + line art outline */
.logo-mark {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  line-height: 0;
  /* Slight / -like tilt */
  transform: rotate(-15deg);
  transition: transform 0.35s var(--ease);
}

/* Pre-colored carrot PNG — cycles via hue-rotate (canonical multicolor effect) */
.logo-mark-fill-img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  z-index: 0;
  pointer-events: none;
  animation: magic-hue 2.8s linear infinite;
}

.logo-mark-lines {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo:hover .logo-mark {
  transform: rotate(-15deg) scale(1.06);
}



/* ── Main ── */
.main {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(16px, 3vh, 40px);
  padding: clamp(12px, 2.5vh, 32px) 32px;
  overflow: visible;
}

.intro,
.for {
  width: 100%;
}

.intro-copy {
  min-width: 0;
  width: 100%;
  container-type: inline-size;
  font-family: var(--mono);
}

.intro h1 {
  /* 30 glyphs: "Vitality for Autonomous Fleets" — 1ch each in mono */
  --chars: 30;
  width: 100%;
  max-width: none;
  font-family: var(--mono);
  font-weight: 600;
  /* Parent em/ch → size the line so 30 characters = card-row width */
  font-size: clamp(0.75rem, 4.5vw, 2.85rem);
  font-size: calc(100cqi * 1em / (var(--chars) * 1ch));
  line-height: 1.12;
  letter-spacing: 0;
  text-align: left;
  white-space: nowrap;
}

/* Services — four pillars; multicolor grid lines via hue-rotate (matches carrot) */
.services {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  padding: 1px;
  border: none;
  isolation: isolate;
}

/* Gradient plate behind cards — filter only this layer so text stays mono */
.services::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--magic);
  background-size: 100% 100%;
  animation: magic-hue 2.8s linear infinite;
  pointer-events: none;
}

.service {
  position: relative;
  z-index: 1;
  background: var(--paper);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.service-num {
  color: var(--ink-faint);
  font-size: 0.75rem;
}

.service h2 {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.service p {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* For / platforms */
.for p {
  width: 100%;
  font-family: var(--mono);
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  font-weight: 300;
  color: var(--ink-soft);
  line-height: 1.5;
  letter-spacing: 0;
  text-align: left;
}

/* ── Footer ── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 20px;
  border: none;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.copyright {
  color: var(--ink);
  font-size: 0.85rem;
}

.footer-end {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-def {
  text-align: right;
  line-height: 1.4;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.footer-pronounce {
  color: var(--ink);
}

.footer-meaning {
  color: var(--ink-muted);
  font-weight: 300;
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  border-bottom: none;
  transition: color 0.2s var(--ease);
}

.footer-icon:hover {
  color: var(--ink);
  border-bottom: none;
}

.footer-icon .bi {
  width: 15px;
  height: 15px;
  display: block;
}

.footer-handle {
  display: inline-block;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink-faint);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transform-origin: center;
  transition: transform 0.35s var(--ease);
}

.footer-handle:hover {
  transform: scale(1.06);
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .header {
    padding: 12px;
  }

  .main {
    justify-content: center;
    gap: clamp(12px, 2.5vh, 22px);
    padding: clamp(10px, 2vh, 20px) 20px;
  }

  .service {
    padding: 14px 12px;
  }

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

  .footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
  }

  .footer-end {
    width: 100%;
    justify-content: space-between;
  }
}

/* ── Contact page ── */
.contact-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 4vh, 40px);
  padding: clamp(24px, 4vh, 40px) 0;
  max-width: 32em;
}

.contact-main h1 {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.contact-main .lede {
  margin-bottom: 0;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-field label {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.contact-field input,
.contact-field textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: 0;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s var(--ease);
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-color: var(--ink-muted);
}

.contact-field textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}

.contact-submit {
  align-self: flex-start;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.contact-submit:hover {
  background: transparent;
  color: var(--ink);
}

.contact-note {
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-weight: 300;
}

.contact-note a {
  color: var(--ink);
  border-bottom: 1px solid var(--edge);
  transition: border-color 0.2s;
}

.contact-note a:hover {
  border-bottom-color: var(--ink);
}

@media (max-width: 400px) {
  .services {
    grid-template-columns: 1fr;
  }
}

/* Canonical multicolor motion — full-spectrum hue cycle (matches carrot) */
@keyframes magic-hue {
  0% {
    filter: hue-rotate(0deg) saturate(1.2);
  }
  100% {
    filter: hue-rotate(360deg) saturate(1.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .services::before,
  .logo-mark-fill-img {
    animation: none;
    filter: none;
  }

  .logo:hover .logo-mark {
    transform: rotate(-15deg);
  }

  .footer-handle:hover {
    transform: none;
  }
}
