/* Shared design system for the three Moonlight sites.
   Palette and typeface come from the MSP logo and business cards:
   near-black navy, moon cream, gold, and Raleway. */

@font-face {
  font-family: "Raleway";
  src: url("fonts/raleway-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --night: #161623;   /* card and logo background */
  --night-2: #20213a; /* raised surface on night */
  --cream: #e4e0bd;   /* logo lettering */
  --gold: #fcb418;    /* logo arcs and waterline */
  --silver: #a9adbf;  /* secondary text on night */
  --mist: #eef0f5;    /* light section */
  --paper: #fafbfd;   /* lighter section, form fields */
  --slate: #4b5170;   /* secondary text on light */
  --rule: #d3d7e3;
  --measure: 62ch;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
}

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

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

body {
  margin: 0;
  background: var(--night);
  color: var(--night);
  font-family: "Raleway", "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "lnum";
  font-weight: 450;
  font-size: 1.125rem;
  line-height: 1.6;
}

/* Clips the oversized hero mark so the page never scrolls sideways. */
.page { overflow: clip; color: var(--paper); }

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 0.08em; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--gold); text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

h1 {
  font-size: clamp(2.5rem, 7vw, 5.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 14ch;
  color: var(--cream);
}
h2 { font-size: clamp(1.65rem, 3.4vw, 2.4rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.012em; }
h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.25; }

.wrap { padding-inline: var(--gutter); max-width: 82rem; margin-inline: auto; }
.lede { font-size: clamp(1.15rem, 1.9vw, 1.4rem); max-width: 36ch; color: var(--silver); }
.muted { color: var(--slate); }

/* Masthead */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  padding-block: 1.5rem;
  position: relative;
  z-index: 2;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; font-weight: 700; font-size: 1.2rem; color: var(--cream); text-decoration: none; }
.brand .mark { width: 2.9rem; }
.brand .lockup { width: 11.5rem; }
.masthead nav { display: flex; gap: 1.6rem; flex-wrap: wrap; font-size: 1rem; font-weight: 550; }

/* Hero */
.hero { position: relative; padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3rem, 8vw, 6rem); }
.hero-mark {
  position: absolute;
  z-index: 0;
  width: clamp(16rem, 40vw, 34rem);
  max-width: none;
  top: clamp(-1.5rem, -1vw, 0rem);
  right: clamp(-7rem, -6vw, -2rem);
}
.hero > :not(.hero-mark) { position: relative; z-index: 1; }
.hero .lede { margin-top: 1.75rem; }

@media (prefers-reduced-motion: no-preference) {
  .hero-mark { animation: moonrise 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes moonrise {
    from { transform: translateY(4rem) rotate(-14deg); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}

/* Doors: the hub's routing list */
.doors { border-top: 2px solid var(--gold); margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.doors a {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 0.5rem 3rem;
  align-items: baseline;
  padding: 1.6rem 0.75rem;
  margin-inline: -0.75rem;
  border-bottom: 1px solid rgb(169 173 191 / 0.28);
  text-decoration: none;
  background: rgb(22 22 35 / 0.72);
}
.doors a:hover, .doors a:focus-visible { background: var(--night-2); }
.doors .say { font-size: clamp(1.3rem, 2.6vw, 1.9rem); font-weight: 650; line-height: 1.2; color: var(--paper); }
.doors .goes { color: var(--silver); }
.doors .goes strong { display: block; color: var(--cream); font-weight: 700; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 0.1em; text-underline-offset: 0.22em; }

/* Sections sit on light surfaces below the night hero */
.section { position: relative; z-index: 1; padding-block: clamp(3rem, 7vw, 5.5rem); background: var(--mist); color: var(--night); border-top: 1px solid var(--rule); }
.section.paper { background: var(--paper); }
.section > .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 2rem 4rem; align-items: start; }
.section .body > * + * { margin-top: 1.1rem; }
.section .body p { max-width: var(--measure); }
.section :focus-visible, form :focus-visible { outline-color: var(--night); }

/* Services: name left, plain description right */
.services > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 0.4rem 2.5rem; padding-block: 1.5rem; border-bottom: 1px solid var(--rule); }
.services > div:first-child { padding-top: 0; }
.services > div:last-child { border-bottom: 0; padding-bottom: 0; }
.services dd { max-width: 52ch; }
.services dd ul { margin-top: 0.75rem; }
.services dd .note { margin-top: 0.75rem; color: var(--slate); }
.services dd li, .checks li { padding-left: 1.5rem; position: relative; }
.services dd li + li, .checks li + li { margin-top: 0.4rem; }
.services dd li::before, .checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--gold);
}

.serves { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem 2.5rem; }
.serves p { margin-top: 0.4rem; }

.steps { counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); padding-block: 1rem; border-bottom: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 0; }
.steps li::before { content: counter(step); font-weight: 700; font-size: 1.3rem; }
.steps p { max-width: 52ch; }

/* Grid and list children keep their own spacing, not the prose rhythm. */
.section .serves > *, .section .services > *, .section .steps > * { margin-top: 0; }

/* Handoff band between the two businesses */
.handoff { position: relative; z-index: 1; background: var(--night); color: var(--paper); border-top: 2px solid var(--gold); }
.handoff .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; align-items: center; justify-content: space-between; padding-block: clamp(2.25rem, 5vw, 3.5rem); }
.handoff p { max-width: 46ch; font-size: 1.2rem; }

.button {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--gold);
  background: var(--gold);
  color: var(--night);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--night); color: var(--gold); }
.handoff .button:hover { background: var(--cream); border-color: var(--cream); color: var(--night); }

/* Contact form */
form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem; max-width: 40rem; }
form .full { grid-column: 1 / -1; }
label { display: grid; gap: 0.35rem; font-size: 1rem; font-weight: 650; }
input, select, textarea {
  font: inherit;
  font-weight: 450;
  color: var(--night);
  background: var(--paper);
  border: 1.5px solid var(--slate);
  border-radius: 0.4rem;
  padding: 0.7rem 0.8rem;
  width: 100%;
}
textarea { min-height: 8rem; resize: vertical; }
.trap { position: absolute; left: -100vw; }
.form-note { min-height: 1.5em; font-weight: 650; }
.form-note[data-state="error"] { text-decoration: underline wavy; text-underline-offset: 0.25em; }

/* Footer */
.foot { background: var(--night); color: var(--silver); font-size: 1rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem 4rem; justify-content: space-between; align-items: start; padding-block: 2.75rem; }
.foot ul { display: grid; gap: 0.35rem; }
.foot .fine { flex-basis: 100%; font-size: 0.9rem; max-width: 80ch; }

@media (max-width: 46rem) {
  body { font-size: 1.0625rem; }
  .doors a, .section > .wrap, .services > div { grid-template-columns: 1fr; }
  .section > .wrap { gap: 1.5rem; }
  form { grid-template-columns: 1fr; }
  .hero-mark { width: 11rem; top: -10.5rem; right: -3.5rem; opacity: 0.5; }
  .masthead nav { position: relative; z-index: 3; }
}
