/* ==========================================================================
   Moon Love Events — one-page site
   Section order follows the Website Build Specifications, p.2.
   ========================================================================== */

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

/* The `hidden` attribute must win over any display: grid/flex we set later
   (.form, .site-nav and .form-status all rely on it). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 400 var(--fs-body)/var(--lh-body) var(--font);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: var(--tracking-display); }
p { margin: 0; }

a { color: inherit; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ml-navy); color: var(--ml-white);
  padding: 14px 20px; font-size: var(--fs-small);
}
.skip-link:focus { left: 8px; top: 8px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --- Layout primitives ---------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
@media (max-width: 640px) { .shell { padding-inline: var(--gutter-mobile); } }

.section { padding-block: var(--section-y); }
.section--warm { background: var(--surface-warm); }
.section--dark { background: var(--surface-dark); color: var(--text-on-dark); }

/* --- Eyebrow -------------------------------------------------------------- */

.eyebrow {
  display: flex; align-items: center; gap: .7em;
  margin: 0 0 1.1rem;
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ml-gold-ink);          /* accessible on light grounds */
}
.eyebrow::before {
  content: ""; flex: none;
  width: 28px; height: 2px;
  background: var(--ml-gold);          /* full-strength gold rule is fine */
}
.section--dark .eyebrow,
.hero .eyebrow { color: var(--ml-gold); }   /* 6.80:1 on navy */

/* --- Headings ------------------------------------------------------------- */

.display  { font-size: var(--fs-display); line-height: var(--lh-tight); }
.headline { font-size: var(--fs-h2);      line-height: var(--lh-snug); }

/* Spec p.4: "headline sizing that avoids awkward single-word wraps".
   balance evens out the lines so a headline never drops one trailing word
   onto a line of its own. Degrades to normal wrapping where unsupported. */
.display, .headline { text-wrap: balance; }
.headline--measure { max-width: 24ch; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 62ch;
}
.section--dark .lead, .hero .lead { color: var(--text-on-dark-muted); }

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap-min);
  padding: .8em 1.6em;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: 700 var(--fs-small)/1 var(--font);
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .18s var(--ease);
}
.btn:active { transform: translateY(1px); }

/* Gold fill + navy label = 6.80:1 */
.btn--primary { background: var(--ml-gold); border-color: var(--ml-gold); color: var(--ml-navy); }
.btn--primary:hover { background: #C39234; border-color: #C39234; }

.btn--ghost { background: transparent; border-color: var(--ml-navy); color: var(--ml-navy); }
.btn--ghost:hover { background: var(--ml-navy); color: var(--ml-white); }

/* On navy grounds */
.btn--ghost-light { background: transparent; border-color: rgba(255,253,249,.5); color: var(--ml-white); }
.btn--ghost-light:hover { background: var(--ml-white); border-color: var(--ml-white); color: var(--ml-navy); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2.25rem; }

/* --- Header --------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ml-white);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  display: flex; align-items: center; gap: 24px;
  min-height: 92px;
}
.site-header__logo { margin-right: auto; display: block; line-height: 0; }
.site-header__logo img { height: 58px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: inline-flex; align-items: center;
  min-height: var(--tap-min);
  padding: 0 14px;
  font-size: var(--fs-small); font-weight: 500;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius);
}
.site-nav a:hover { color: var(--ml-gold-ink); }

.nav-toggle { display: none; }

/* --- Hero ----------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--ml-navy);
  color: var(--text-on-dark);
  padding-block: clamp(5rem, 3rem + 9vw, 10rem);
}
.hero__inner { position: relative; z-index: 2; }
.hero__copy  { max-width: 44rem; }
.hero .display { color: var(--ml-white); max-width: 15ch; }
.hero .lead { margin-top: 1.6rem; }

/* Approved crescent, cropped and bled off the right edge so it reads as an
   abstract mark rather than a decorative moon. Sits behind the copy at low
   opacity and is hidden where it would crowd the text. */
.hero__crescent {
  position: absolute; z-index: 1;
  top: 50%; right: 3%;
  transform: translateY(-50%);
  height: 82%; width: auto;
  opacity: .85;
  pointer-events: none;
}
/* Gold over navy goes muddy at low opacity, so the crescent is never faded --
   it is either full strength and clear of the copy, or absent. Below 900px the
   headline spans the full column, so there is no clear space left for it. */
/* The hero copy is capped at 44rem. Below ~1000px there is no longer clear
   space beside it, and a faded gold crescent over navy reads as muddy olive
   rather than Civic Gold -- so the crescent is hidden rather than shrunk. */
@media (max-width: 1000px) {
  .hero__crescent { display: none; }
}

/* --- Principles strip ----------------------------------------------------- */

.principles { background: var(--surface-warm); border-block: 1px solid var(--rule); }
.principles__grid {
  display: grid; gap: var(--card-gap);
  grid-template-columns: repeat(3, 1fr);
  padding-block: clamp(2.5rem, 2rem + 2vw, 3.5rem);
}
.principle__title {
  font-size: var(--fs-h3); font-weight: 700; line-height: 1.25;
  margin-bottom: .4rem;
}
.principle__body { color: var(--text-muted); font-size: var(--fs-small); }

/* --- About (two-column editorial) ----------------------------------------- */

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  align-items: start;
}
.about__grid .prose { margin-top: 0; }
@media (max-width: 900px) { .about__grid { grid-template-columns: 1fr; } }

/* --- Prose ---------------------------------------------------------------- */

.prose { display: grid; gap: 1.35rem; max-width: 68ch; margin-top: 2rem; }
.prose p { color: var(--text-muted); font-size: var(--fs-lead); line-height: 1.7; }

/* --- Cards ---------------------------------------------------------------- */

.cards { display: grid; gap: var(--card-gap); margin-top: 3rem; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--ml-white);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ml-gold);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 1.2rem + 1vw, 2.25rem);
}
.card__num {
  display: block;
  font-size: var(--fs-small); font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--ml-gold-ink);
  margin-bottom: .9rem;
}
.card__title { font-size: var(--fs-h3); line-height: 1.25; margin-bottom: .6rem; }
.card__body  { color: var(--text-muted); font-size: var(--fs-small); }

/* --- Featured work -------------------------------------------------------- */

.featured__grid {
  display: grid; gap: clamp(2rem, 1rem + 4vw, 4rem);
  grid-template-columns: 1fr 1fr;
  align-items: center;
  margin-top: 2.5rem;
}
.featured__panel {
  background: var(--ml-navy-deep);
  border-radius: var(--radius);
  padding: clamp(2rem, 1.5rem + 3vw, 3.5rem);
  display: grid; place-items: center;
  min-height: 300px;
  text-align: center;
}
.featured__panel img { width: min(190px, 60%); }
.featured__placeholder {
  margin-top: 1.5rem; font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--ml-gold);
}
.featured__link {
  display: inline-flex; align-items: center; gap: .55em;
  min-height: var(--tap-min);
  margin-top: 1.75rem;
  font-weight: 700; font-size: var(--fs-small);
  color: var(--ml-navy);
  text-decoration: none;
  border-bottom: 2px solid var(--ml-gold);
  align-self: start;
}
.featured__link:hover { color: var(--ml-gold-ink); }
.featured__link svg { width: 14px; height: 14px; flex: none; }

/* --- Contact -------------------------------------------------------------- */

.contact { background: var(--ml-navy); color: var(--text-on-dark); }
.contact__grid {
  display: grid; gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  grid-template-columns: 1fr 1fr;
  align-items: start;
  margin-top: 2.5rem;
}
.contact .headline { color: var(--ml-white); }

.form { display: grid; gap: 1.15rem; }
.field { display: grid; gap: .5rem; }
.field > label {
  font-size: var(--fs-small); font-weight: 700;
  color: var(--ml-white);
}
.field .req { color: var(--ml-gold); }

.field input, .field select, .field textarea {
  width: 100%;
  min-height: var(--tap-min);
  padding: .75rem .9rem;
  font: 400 var(--fs-body)/1.5 var(--font);
  color: var(--ml-white);
  background: rgba(255,253,249,.06);
  border: 1px solid rgba(255,253,249,.28);
  border-radius: var(--radius);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: rgba(255,253,249,.55); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ml-gold);
  background: rgba(255,253,249,.1);
}
.field select {
  appearance: none;
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23FFFDF9' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}
.field select option { color: var(--ml-navy); background: var(--ml-white); }

.form .btn { width: 100%; margin-top: .5rem; }

.form-note { font-size: var(--fs-eyebrow); color: var(--text-on-dark-muted); }

.form-status {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--ml-gold);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: rgba(213,162,63,.1);
  color: var(--ml-white);
  font-size: var(--fs-small);
}

.field-error {
  font-size: var(--fs-eyebrow);
  color: #F0B9B0;
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: #F0B9B0; }

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  background: var(--ml-navy-deep);
  color: var(--text-on-dark-muted);
  padding-block: 3.5rem 2.5rem;
}
.site-footer__inner {
  display: flex; flex-wrap: wrap; gap: 24px;
  align-items: center; justify-content: space-between;
}
.site-footer img { height: 46px; width: auto; }
.site-footer__copy { font-size: var(--fs-small); }
.to-top {
  display: inline-flex; align-items: center; gap: .5em;
  min-height: var(--tap-min);
  font-size: var(--fs-small); font-weight: 700;
  color: var(--ml-white); text-decoration: none;
}
.to-top:hover { color: var(--ml-gold); }

/* ==========================================================================
   Responsive — spec p.4
   Tablet: multi-column grids to two columns; stack featured + contact.
   Mobile: single column, 16px side padding, 44px tap targets.
   ========================================================================== */

@media (max-width: 1024px) {
  .cards--4 { grid-template-columns: repeat(2, 1fr); }
  .featured__grid, .contact__grid { grid-template-columns: 1fr; }
  .featured__panel { order: -1; }
}

@media (max-width: 860px) {
  .cards--3, .principles__grid { grid-template-columns: repeat(2, 1fr); }

  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: var(--tap-min); min-height: var(--tap-min);
    background: transparent; border: 1px solid var(--rule);
    border-radius: var(--radius); cursor: pointer;
  }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ml-white);
    border-bottom: 1px solid var(--rule);
    padding: 8px var(--gutter-mobile) 16px;
  }
  .site-nav a { padding: 0; }
  .site-nav .btn { margin-top: 10px; }
  .site-header__inner { position: relative; }
}

@media (max-width: 620px) {
  .cards--3, .cards--4, .principles__grid { grid-template-columns: 1fr; }
  .btn-row .btn { width: 100%; }
  .hero .display { max-width: none; }
}
