/* ============================================================
   MINIM SURF — ONE PAGE HOME
   Brand evolution, not rebrand.
   Raw brand colors remain: #0A0A0F, #E91E8C, #FF2DA0, #00D4AA.
   ============================================================ */

:root {
  --ms-home-action: #FF2DA0;
  --ms-home-action-hover: #FF2DA0;
  --ms-home-secondary-ink: #00D4AA;
  --ms-home-hairline: rgba(255,255,255,.10);
  --ms-home-panel: rgba(255,255,255,.035);
  --ms-home-panel-strong: rgba(255,255,255,.065);
  --ms-home-shadow: 0 24px 80px rgba(0,0,0,.28);
  --ms-home-header-bg: rgba(10,10,15,.78);
  --ms-home-header-bg-strong: rgba(10,10,15,.94);
  --ms-home-focus: #00D4AA;
  /* Dark-mode legibility: derived from the existing Minim Surf neutral scale. */
  --ms-text-muted: #9B9BA7;
}

html[data-theme="light"] {
  --ms-surface-primary: #F7F7FA;
  --ms-surface-secondary: #FFFFFF;
  --ms-surface-tertiary: #ECECF2;
  --ms-surface-glass: rgba(10,10,15,.035);
  --ms-text-primary: #111118;
  --ms-text-secondary: #53535F;
  --ms-text-muted: #6B6B78;
  --ms-border-subtle: rgba(10,10,15,.11);
  --ms-border-accent: rgba(233,30,140,.28);
  --ms-home-action: #C21875;
  --ms-home-action-hover: #A91563;
  --ms-home-secondary-ink: #007C68;
  --ms-home-hairline: rgba(10,10,15,.11);
  --ms-home-panel: rgba(10,10,15,.035);
  --ms-home-panel-strong: rgba(10,10,15,.065);
  --ms-home-shadow: 0 24px 70px rgba(27,24,38,.10);
  --ms-home-header-bg: rgba(247,247,250,.82);
  --ms-home-header-bg-strong: rgba(247,247,250,.96);
  --ms-home-focus: #007C68;
  --ms-shadow-sm: 0 2px 8px rgba(27,24,38,.08);
  --ms-shadow-md: 0 8px 30px rgba(27,24,38,.10);
  --ms-shadow-lg: 0 20px 50px rgba(27,24,38,.14);
  --ms-shadow-glow: 0 0 40px rgba(233,30,140,.18);
}

/* No-JS fallback: use OS preference. Time-based auto requires JS. */
@media (prefers-color-scheme: light) {
  html:not(.js) {
    --ms-surface-primary: #F7F7FA;
    --ms-surface-secondary: #FFFFFF;
    --ms-surface-tertiary: #ECECF2;
    --ms-text-primary: #111118;
    --ms-text-secondary: #53535F;
    --ms-text-muted: #6B6B78;
    --ms-border-subtle: rgba(10,10,15,.11);
    --ms-border-accent: rgba(233,30,140,.28);
    --ms-home-action: #C21875;
    --ms-home-action-hover: #A91563;
    --ms-home-secondary-ink: #007C68;
    --ms-home-hairline: rgba(10,10,15,.11);
    --ms-home-panel: rgba(10,10,15,.035);
    --ms-home-panel-strong: rgba(10,10,15,.065);
    --ms-home-header-bg: rgba(247,247,250,.82);
    --ms-home-header-bg-strong: rgba(247,247,250,.96);
  }
}

html { scroll-padding-top: 92px; }
body { background: var(--ms-surface-primary); color: var(--ms-text-secondary); }

::selection { background: rgba(233,30,140,.28); color: var(--ms-text-primary); }

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ms-home-focus) 70%, transparent);
  outline-offset: 3px;
}

.ms-home-skip {
  position: fixed;
  inset: 12px auto auto 12px;
  z-index: 5000;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ms-text-primary);
  color: var(--ms-surface-primary);
}
.ms-home-skip:focus { transform: translateY(0); }

.ms-home-header { background: var(--ms-home-header-bg); }
.ms-home-header.is-scrolled { background: var(--ms-home-header-bg-strong); }
.ms-home-header__container { max-width: 1360px; }

.ms-home-theme-slot { display: flex; align-items: center; }
.ms-home-theme {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--ms-border-subtle);
  border-radius: 999px;
  background: var(--ms-home-panel);
  color: var(--ms-text-secondary);
  font: 600 .78rem/1 var(--ms-font-body);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}
.ms-home-theme:hover { border-color: var(--ms-border-accent); color: var(--ms-text-primary); transform: translateY(-1px); }
.ms-home-theme__icon { font-size: 1rem; }

.ms-btn--primary { background: var(--ms-home-action); color: #fff; }
.ms-btn--primary:hover { background: var(--ms-home-action-hover); color: #fff; }
html[data-theme="dark"] .ms-btn--primary,
html[data-theme="dark"] .ms-btn--primary:hover { color: #0A0A0F; }
.ms-btn--secondary { border-color: var(--ms-border-subtle); }
.ms-btn--secondary:hover { border-color: var(--ms-home-action); color: var(--ms-home-action); }
.ms-nav__link::after { background: var(--ms-home-action); }

.ms-home-kicker {
  margin: 0 0 18px;
  color: var(--ms-home-action);
  font-family: var(--ms-font-mono);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ms-home-hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: clamp(140px, 18vh, 210px) 0 clamp(90px, 11vh, 130px);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(233,30,140,.13), transparent 31%),
    radial-gradient(circle at 82% 72%, rgba(0,212,170,.09), transparent 29%),
    var(--ms-surface-primary);
}
.ms-home-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233,30,140,.55), rgba(0,212,170,.38), transparent);
}
.ms-home-hero__mesh {
  position: absolute;
  inset: 0;
  opacity: .34;
  pointer-events: none;
  background-image:
    linear-gradient(var(--ms-home-hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--ms-home-hairline) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 78%);
}
.ms-home-hero__grid {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr);
  gap: clamp(48px, 7vw, 112px);
  align-items: end;
}
.ms-home-hero h1 {
  max-width: 980px;
  font-size: clamp(3.3rem, 7.6vw, 7.5rem);
  line-height: .94;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.ms-home-hero__lead {
  max-width: 760px;
  margin-top: clamp(28px, 4vw, 48px);
  font-size: clamp(1.05rem, 1.5vw, 1.28rem);
  line-height: 1.72;
  color: var(--ms-text-secondary);
}
.ms-home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.ms-home-hero__note {
  max-width: 720px;
  margin-top: 26px;
  padding-left: 16px;
  border-left: 2px solid var(--ms-home-secondary-ink);
  color: var(--ms-text-muted);
  font-size: .94rem;
}
.ms-home-hero__map {
  padding: 22px 0 0 26px;
  border-left: 1px solid var(--ms-home-hairline);
}
.ms-home-map__eyebrow { margin: 0 0 22px; color: var(--ms-text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }
.ms-home-map__list { display: grid; }
.ms-home-map__list li {
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-areas: "n strong" "n small";
  gap: 2px 12px;
  padding: 15px 0;
  border-top: 1px solid var(--ms-home-hairline);
}
.ms-home-map__list li:last-child { border-bottom: 1px solid var(--ms-home-hairline); }
.ms-home-map__list span { grid-area: n; color: var(--ms-home-action); font-family: var(--ms-font-mono); font-size: .72rem; padding-top: 4px; }
.ms-home-map__list strong { grid-area: strong; color: var(--ms-text-primary); font: 600 1rem/1.2 var(--ms-font-display); }
.ms-home-map__list small { grid-area: small; color: var(--ms-text-muted); }

.ms-home-section { position: relative; padding: clamp(84px, 10vw, 148px) 0; background: var(--ms-surface-primary); }
.ms-home-section--soft { background: var(--ms-surface-secondary); }
.ms-home-section--ink { background: #0A0A0F; color: #B8B8C0; }
.ms-home-section--ink h2, .ms-home-section--ink h3, .ms-home-section--ink .ms-home-capability span { color: #fff; }
.ms-home-section--ink .ms-home-kicker { color: #FF2DA0; }
.ms-home-section--ink .ms-home-capability { border-color: rgba(255,255,255,.11); color: #B8B8C0; }
.ms-home-section--ink .ms-home-capability:hover { background: rgba(255,255,255,.04); }
.ms-home-section__intro { max-width: 850px; margin-bottom: clamp(48px, 7vw, 88px); }
.ms-home-section__intro--wide { max-width: 1050px; }
.ms-home-section__intro h2, .ms-home-capabilities-head h2, .ms-home-agents h2, .ms-home-principles h2, .ms-home-contact h2 {
  font-size: clamp(2.4rem, 5.1vw, 5rem);
  line-height: 1.02;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.ms-home-section__intro > p:last-child, .ms-home-capabilities-head > p, .ms-home-agents__copy > p, .ms-home-contact__copy > p {
  margin-top: 24px;
  max-width: 780px;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.72;
}

.ms-home-symptoms { border-top: 1px solid var(--ms-home-hairline); }
.ms-home-symptom {
  display: grid;
  grid-template-columns: 64px minmax(260px, .8fr) minmax(300px, 1fr);
  gap: clamp(18px, 4vw, 60px);
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--ms-home-hairline);
}
.ms-home-symptom > span { color: var(--ms-home-action); font-family: var(--ms-font-mono); font-size: .75rem; }
.ms-home-symptom h3 { font-size: clamp(1.2rem, 2vw, 1.8rem); }
.ms-home-symptom p { color: var(--ms-text-secondary); }

.ms-home-ladder { border-top: 1px solid var(--ms-home-hairline); }
.ms-home-ladder li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 116px;
  padding: 22px 0;
  border-bottom: 1px solid var(--ms-home-hairline);
  transition: padding .22s ease, background .22s ease;
}
.ms-home-ladder li:hover { padding-inline: 16px; background: var(--ms-home-panel); }
.ms-home-ladder__n { color: var(--ms-home-action); font: 700 .74rem/1 var(--ms-font-mono); }
.ms-home-ladder h3 { margin-bottom: 5px; font-size: clamp(1.35rem, 2.4vw, 2rem); }
.ms-home-ladder p { max-width: 800px; color: var(--ms-text-secondary); }
.ms-home-ladder em { color: var(--ms-home-secondary-ink); font: 600 .74rem/1 var(--ms-font-mono); text-transform: uppercase; letter-spacing: .08em; font-style: normal; }

.ms-home-capabilities-head {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(32px, 7vw, 110px);
  align-items: end;
  margin-bottom: 62px;
}
.ms-home-capabilities-head > p { color: #B8B8C0; }
.ms-home-capabilities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid rgba(255,255,255,.11); }
.ms-home-capability {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "title icon" "copy icon";
  gap: 10px 24px;
  padding: clamp(28px, 4vw, 44px) clamp(0px, 3vw, 38px);
  border-bottom: 1px solid rgba(255,255,255,.11);
  color: #B8B8C0;
  text-decoration: none;
}
.ms-home-capability:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.11); padding-left: 0; }
.ms-home-capability span { grid-area: title; font: 650 clamp(1.4rem, 2.5vw, 2.15rem)/1.15 var(--ms-font-display); }
.ms-home-capability p { grid-area: copy; max-width: 580px; }
.ms-home-capability b { grid-area: icon; align-self: center; color: #00D4AA; font-size: 1.4rem; transition: transform .2s ease; }
.ms-home-capability:hover { color: #B8B8C0; }
.ms-home-capability:hover b { transform: translate(3px, -3px); }
.ms-home-capability--static { cursor: default; }
.ms-home-capability--static:hover b { transform: none; }

.ms-home-agents { overflow: hidden; }
.ms-home-agents::before {
  content: "";
  position: absolute;
  width: min(720px, 70vw);
  aspect-ratio: 1;
  right: -25%; top: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,170,.09), transparent 62%);
  pointer-events: none;
}
.ms-home-agents__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(52px, 8vw, 120px); align-items: center; }
.ms-home-checks { margin-top: 34px; border-top: 1px solid var(--ms-home-hairline); }
.ms-home-checks li { position: relative; padding: 14px 0 14px 28px; border-bottom: 1px solid var(--ms-home-hairline); color: var(--ms-text-secondary); }
.ms-home-checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ms-home-secondary-ink); }
.ms-home-agent-flow { position: relative; display: grid; justify-items: stretch; gap: 10px; padding: clamp(26px, 4vw, 42px); border: 1px solid var(--ms-home-hairline); background: var(--ms-home-panel); box-shadow: var(--ms-home-shadow); }
.ms-home-agent-flow > div { padding: 18px 20px; border: 1px solid var(--ms-home-hairline); background: var(--ms-surface-secondary); }
.ms-home-agent-flow > span { justify-self: center; color: var(--ms-home-action); }
.ms-home-agent-flow small { display: block; color: var(--ms-text-muted); font: 600 .7rem/1 var(--ms-font-mono); text-transform: uppercase; letter-spacing: .09em; margin-bottom: 7px; }
.ms-home-agent-flow strong { color: var(--ms-text-primary); font-family: var(--ms-font-display); }
.ms-home-agent-flow__human { border-color: color-mix(in srgb, var(--ms-home-secondary-ink) 45%, transparent) !important; }

.ms-home-process { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--ms-home-hairline); }
.ms-home-process article { min-height: 270px; padding: 26px 22px 24px 0; border-bottom: 1px solid var(--ms-home-hairline); }
.ms-home-process article:not(:last-child) { border-right: 1px solid var(--ms-home-hairline); padding-left: 22px; }
.ms-home-process article:first-child { padding-left: 0; }
.ms-home-process span { color: var(--ms-home-action); font: 700 .72rem/1 var(--ms-font-mono); }
.ms-home-process h3 { margin: 58px 0 12px; font-size: 1.35rem; }
.ms-home-process p { color: var(--ms-text-secondary); font-size: .94rem; }

.ms-home-principles { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(50px, 8vw, 120px); }
.ms-home-principles__list { border-top: 1px solid var(--ms-home-hairline); }
.ms-home-principles__list > div { padding: 24px 0; border-bottom: 1px solid var(--ms-home-hairline); }
.ms-home-principles__list strong { color: var(--ms-text-primary); font: 650 1.2rem/1.2 var(--ms-font-display); }
.ms-home-principles__list p { margin-top: 8px; color: var(--ms-text-secondary); }

.ms-home-contact { background: var(--ms-surface-secondary); }
.ms-home-contact__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(48px, 8vw, 120px); align-items: start; }
.ms-home-contact__copy { position: sticky; top: 120px; }
.ms-home-contact__expect { margin-top: 42px; padding-top: 20px; border-top: 1px solid var(--ms-home-hairline); }
.ms-home-contact__expect span { display: block; color: var(--ms-home-action); font: 700 .7rem/1 var(--ms-font-mono); text-transform: uppercase; letter-spacing: .1em; }
.ms-home-contact__expect strong { display: block; margin: 12px 0; color: var(--ms-text-primary); font-family: var(--ms-font-display); }
.ms-home-contact__expect p { color: var(--ms-text-secondary); font-size: .92rem; }
.ms-home-form { margin: 0; padding: clamp(24px, 4vw, 42px); background: var(--ms-surface-primary); border: 1px solid var(--ms-home-hairline); box-shadow: var(--ms-home-shadow); }
.ms-home-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ms-home-form .ms-form__input { background: var(--ms-surface-secondary); color: var(--ms-text-primary); border-color: var(--ms-border-subtle); }
.ms-home-form .ms-form__input:focus { border-color: var(--ms-home-action); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ms-home-action) 14%, transparent); }
.ms-home-form select.ms-form__input { color-scheme: light dark; }

.ms-home-footer { background: #0A0A0F; color: #B8B8C0; }
.ms-home-footer .ms-logo, .ms-home-footer .ms-footer__copy { color: #fff; }
.ms-home-footer__top { display: flex; justify-content: space-between; gap: 40px; padding-bottom: 42px; }
.ms-home-footer__top > div:first-child p { max-width: 440px; margin-top: 14px; color: #8F8F9C; }
.ms-home-footer__links { display: flex; flex-wrap: wrap; gap: 14px 28px; align-content: start; }
.ms-home-footer__links a, .ms-home-footer .ms-footer__bottom a { color: #B8B8C0; }
.ms-home-footer__links a:hover, .ms-home-footer .ms-footer__bottom a:hover { color: #FF2DA0; }

/* Progressive enhancement: content is visible if JavaScript is unavailable. */
html:not(.js) [data-reveal] { opacity: 1 !important; transform: none !important; }

@media (max-width: 1080px) {
  .ms-home-hero__grid, .ms-home-agents__grid, .ms-home-contact__grid, .ms-home-principles { grid-template-columns: 1fr; }
  .ms-home-hero__map { max-width: 660px; }
  .ms-home-capabilities-head { grid-template-columns: 1fr; }
  .ms-home-process { grid-template-columns: repeat(2, 1fr); }
  .ms-home-process article { border-right: 1px solid var(--ms-home-hairline); padding-left: 20px; }
  .ms-home-contact__copy { position: static; }
}

@media (max-width: 900px) {
  .ms-home-header .ms-nav__list { background: var(--ms-home-header-bg-strong); }
  .ms-home-theme-slot { justify-content: center; }
  .ms-home-nav-cta { min-width: 180px; }
  .ms-home-hero { min-height: auto; }
  .ms-home-hero h1 { font-size: clamp(3rem, 12vw, 5.6rem); }
}

@media (max-width: 760px) {
  :root { --ms-container-padding: 20px; }
  .ms-home-hero { padding-top: 130px; }
  .ms-home-hero__grid { gap: 52px; }
  .ms-home-actions { flex-direction: column; align-items: stretch; }
  .ms-home-actions .ms-btn { width: 100%; }
  .ms-home-symptom { grid-template-columns: 42px 1fr; }
  .ms-home-symptom p { grid-column: 2; }
  .ms-home-ladder li { grid-template-columns: 48px 1fr; }
  .ms-home-ladder em { grid-column: 2; justify-self: start; }
  .ms-home-capabilities { grid-template-columns: 1fr; }
  .ms-home-capability:nth-child(odd) { border-right: 0; }
  .ms-home-capability { padding-inline: 0; }
  .ms-home-process { grid-template-columns: 1fr; }
  .ms-home-process article { min-height: auto; border-right: 0 !important; padding: 26px 0 !important; }
  .ms-home-process h3 { margin-top: 22px; }
  .ms-home-form__row { grid-template-columns: 1fr; gap: 0; }
  .ms-home-footer__top { flex-direction: column; }
  .ms-home-footer__links { flex-direction: column; }
  .ms-home-theme__label { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .ms-home-ladder li:hover { padding-inline: 0; }
}

@media (forced-colors: active) {
  .ms-home-hero__mesh { display: none; }
  .ms-home-theme, .ms-home-agent-flow, .ms-home-agent-flow > div, .ms-home-form { border: 1px solid CanvasText; }
}
