/* CIV360 holding page */
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #004071;
  --bg-deep: #002B4D;
  --bg-lift: #0A4F86;
  --grid: rgba(255, 255, 255, 0.055);
  --text: #FFFFFF;
  --text-soft: rgba(255, 255, 255, 0.86);
  --text-muted: rgba(255, 255, 255, 0.72);
  --rule: #C71C2D;
  --navy: #004071;
  --red: #C71C2D;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(120% 90% at 50% 38%, var(--bg-lift) 0%, var(--bg) 42%, var(--bg-deep) 100%);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* Fine engineering grid, fading out towards the edges */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 20%, transparent 80%);
          mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 20%, transparent 80%);
}

/* Thin red line along the top edge */
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--red);
}

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(48px, 9vh, 112px) 24px 32px;
}

.hero {
  width: 100%;
  max-width: 760px;
  text-align: center;
}

.logo {
  display: block;
  width: min(clamp(640px, 34vw, 860px), 86vw, 100vh);
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.rule {
  display: block;
  width: 56px;
  height: 3px;
  margin: clamp(36px, 6vh, 56px) auto clamp(24px, 4vh, 32px);
  background: var(--rule);
  border: 0;
  border-radius: 2px;
}

h1 {
  margin: 0 auto;
  max-width: 22em;
  font-size: clamp(1.5rem, 1.05rem + 1.9vw, 2.375rem);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.012em;
  color: var(--text);
  text-wrap: balance;
}

.lede {
  margin: 18px auto 0;
  max-width: 36em;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  font-weight: 450;
  color: var(--text-soft);
  text-wrap: pretty;
}

.foot {
  position: relative;
  z-index: 1;
  padding: 24px 24px max(28px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.foot p { margin: 0; }

/* Large screens: scale the whole block up a little */
@media (min-width: 1800px) and (min-height: 1000px) {
  .hero { max-width: 980px; }
  h1 { font-size: 2.875rem; }
  .lede { font-size: 1.3125rem; }
  .rule { width: 72px; height: 4px; }
  .foot { font-size: 1rem; }
}

/* ---------- Entrance animation (runs once; off for reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .lg-ring,
  .js .lg-civ,
  .js .lg-num,
  .js .lg-tag,
  .js .rule,
  .js h1,
  .js .lede,
  .js .foot { opacity: 0; }

  .js.ready .lg-ring { animation: ring-in 1.8s var(--ease) 0.15s both; }
  .js.ready .lg-civ  { animation: rise 0.9s var(--ease) 0.35s both; }
  .js.ready .lg-num  { animation: rise 0.9s var(--ease) 0.5s both; }
  .js.ready .lg-tag  { animation: fade 0.9s ease-out 1.05s both; }
  .js.ready .rule    { animation: draw 0.8s var(--ease) 1.35s both; }
  .js.ready h1       { animation: rise-lg 0.9s var(--ease) 1.5s both; }
  .js.ready .lede    { animation: rise-lg 0.9s var(--ease) 1.68s both; }
  .js.ready .foot    { animation: fade 0.9s ease-out 2s both; }

  .lg-civ, .lg-num, .lg-tag { transform-box: fill-box; }

  /* the 360 arrow turns once clockwise (the way it points), settling into place */
  @keyframes ring-in {
    from { opacity: 0; transform: rotate(-320deg) scale(0.72); }
    25%  { opacity: 1; }
    to   { opacity: 1; transform: rotate(0deg) scale(1); }
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes rise-lg {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes fade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  @keyframes draw {
    from { opacity: 1; transform: scaleX(0); }
    to   { opacity: 1; transform: scaleX(1); }
  }
}

/* ---------- 404 ---------- */
.err-code {
  margin: 0 0 6px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.logo-sm { width: min(360px, 70vw, 80vh); }
.btn {
  display: inline-block;
  margin-top: 28px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 2px solid currentColor;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.btn:hover { background: var(--text); color: var(--bg); }
.btn:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
