/* ============================================================
   commDAT.com — full-screen site
   Palette sampled from the dark-mode logo:
     cyan #03d4ff   blue #0071fe   backdrop navy #031732
   ============================================================ */

:root {
  --navy-950: #020c1f;
  --navy-900: #031732;   /* the navy the dark logo was drawn against */
  --navy-850: #062246;
  --navy-800: #0a3160;

  --cyan:      #03d4ff;
  --cyan-soft: #6ce6ff;
  --blue:      #0071fe;
  --blue-lift: #3d97ff;
  --cyan-glow: rgba(3, 212, 255, 0.42);

  --ink:    #e8f4ff;
  --ink-dim:#a2c6e2;
  --muted:  #6d95b8;

  --edge:   rgba(3, 212, 255, 0.15);
  --edge-hi:rgba(3, 212, 255, 0.30);

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(18px, 3.4vw, 54px);
}

* { box-sizing: border-box; }

/* Author rules here set `display` on flex children, which would otherwise beat
   the UA stylesheet's [hidden]. Keeps `hidden` meaning hidden. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 8%, #0b3a66 0%, #05203f 42%, var(--navy-950) 100%);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------- simulation layers ---------------- */

/* The renderer draws at half the display size; the browser scales it back up
   with no smoothing. That hard upscale is the whole 16-bit treatment — the UI
   above it stays crisp and un-pixelated. */
#sim {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Keeps the copy readable over the moving grid. */
.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(56% 44% at 50% 46%,
      rgba(3, 19, 42, 0.86) 0%,
      rgba(3, 19, 42, 0.56) 44%,
      rgba(3, 19, 42, 0.08) 76%,
      rgba(3, 19, 42, 0) 100%),
    linear-gradient(to bottom,
      rgba(2, 12, 31, 0.82) 0%,
      rgba(2, 12, 31, 0) 22%,
      rgba(2, 12, 31, 0) 66%,
      rgba(2, 12, 31, 0.88) 100%);
}

/* ---------------- layout shell ---------------- */

.shell {
  position: relative;
  z-index: 3;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: clamp(14px, 2.2vw, 30px) var(--gutter) clamp(14px, 2vw, 26px);
}

/* ---------------- top bar ---------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* The dark-mode lockup sits straight on the background — no plate needed. */
.brand {
  display: inline-flex;
  text-decoration: none;
  transition: filter 0.35s ease, transform 0.35s ease;
  filter: drop-shadow(0 0 22px rgba(3, 212, 255, 0.18));
}

/* 25% up from clamp(22px, 2.4vw, 30px). The asset is 624x132, which covers the
   38px maximum at 3x DPR (38 x 3 = 114px) with headroom to spare. */
.brand img {
  height: clamp(27px, 3vw, 38px);
  width: auto;
  display: block;
}

.brand:hover {
  transform: translateY(-1px);
  filter: drop-shadow(0 0 30px rgba(3, 212, 255, 0.42));
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 30px);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav a,
.nav .nav-link {
  color: var(--ink-dim);
  text-decoration: none;
  padding: 6px 2px;
  position: relative;
  transition: color 0.25s ease;
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav a::after,
.nav .nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--cyan);
  transition: right 0.3s ease;
}

.nav a:hover, .nav .nav-link:hover { color: #fff; }
.nav a:hover::after, .nav .nav-link:hover::after { right: 0; }

.nav .nav-cta {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--edge-hi);
  background: rgba(6, 34, 70, 0.72);
  color: var(--ink);
}

.nav .nav-cta::after { display: none; }

.nav .nav-cta:hover {
  border-color: var(--cyan);
  background: rgba(3, 212, 255, 0.16);
  box-shadow: 0 0 26px var(--cyan-glow);
}

/* ---------------- hero ---------------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(12px, 1.5vh, 22px);
  padding-bottom: clamp(8px, 3vh, 40px);
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 8.2vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  font-weight: 800;
  text-shadow: 0 6px 46px rgba(2, 12, 34, 0.85);
}

/* Cyan → blue, left to right, the same run as "comm" → "DAT" in the wordmark.
   Unused while the headline is one plain word — wrap any part of the h1 in
   <em> to give it the gradient. */
h1 em {
  font-style: normal;
  background: linear-gradient(96deg, var(--cyan) 0%, #38b0ff 52%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 34px rgba(3, 212, 255, 0.35));
}

/* ---------------- immersive mode ---------------- */
/* Fades the page chrome so the routing fabric is the whole screen. */

.shell > * {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

body.immersive .shell > * {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

body.immersive .veil {
  opacity: 0.25;
  transition: opacity 0.8s ease;
}

.veil { transition: opacity 0.8s ease; }

.exit-immersive {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: clamp(20px, 4vh, 46px);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--edge-hi);
  background: rgba(4, 24, 50, 0.86);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  animation: fadeUp 0.7s 0.35s ease forwards;
}

.exit-immersive[hidden] { display: none; }

.exit-immersive:hover { color: #fff; border-color: var(--cyan); }

.exit-immersive kbd {
  font: inherit;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--edge-hi);
  background: rgba(3, 212, 255, 0.14);
  color: var(--ink);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------- responsive ---------------- */

@media (max-width: 620px) {
  .nav .nav-link { display: none; }
}

@media (max-width: 720px) {
  h1 { letter-spacing: -0.03em; }
}

/* ---------------- a11y ---------------- */

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .brand:hover { transform: none; }
}
