/* URMA opening screen.
 *
 * The animated mark is the hero. Its SVG already carries the whole argument:
 * a trace is cut, a pulse travels the full route, the break seals green. The
 * layout gets out of its way — big mark, headline, and a four-stage caption
 * that runs on the SAME 3.8s clock as the SVG so the words and the sealing
 * are one motion, not two.
 *
 * Everything is CSS; no JS drives the hero.
 */

:root {
  --home-header-height: 104px;
  /* One clock for the whole hero — matches the SVG's internal 3.8s loop. */
  --urma-cycle: 3.8s;
}

.header { height: var(--home-header-height); }
.masthead { height: 100%; min-height: 0; padding-block: 12px; }

.opening-screen {
  min-height: calc(100vh - var(--home-header-height));
  min-height: calc(100svh - var(--home-header-height));
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  background: var(--paper);
  color: var(--ink);
}

/* ---- the stage ---------------------------------------------------------- */

.urma-hero {
  min-height: 0;
  display: grid;
  /* The mark is square-ish and self-limiting; the copy needs the long side.
   * Fixed-ish mark track + free copy track stops the headline being squeezed
   * into one-word-per-line. */
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(20px, 3.4vmin, 48px) clamp(20px, 4.5vw, 64px);
  position: relative;
  overflow: hidden;
}

/* Faint grid: an evidence board, not a dashboard. Sits under everything. */
.urma-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgb(241 240 232 / 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(241 240 232 / 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  /* Fade the grid out toward the edges so it never reads as a table. */
  mask-image: radial-gradient(ellipse 80% 75% at 38% 50%, #000 35%, transparent 78%);
  pointer-events: none;
}

.urma-hero > * { position: relative; }

/* ---- the mark ----------------------------------------------------------- */

.urma-stage {
  display: grid;
  place-items: center;
  min-width: 0;
}

.urma-stage img {
  display: block;
  width: min(100%, clamp(220px, 30vw, 400px));
  height: auto;
  aspect-ratio: 1;
}

/* The mark carries its own exact brand colours (urma-mark.svg). Do NOT
 * override --urma / --signal here: theming them turned the rear frame and
 * the repair pulse olive instead of the ROSINT green #51ff0d. */

/* A slow halo breathing on the same clock — the record "holding". */
.urma-stage {
  position: relative;
}

.urma-stage::after {
  content: "";
  position: absolute;
  width: min(74%, 380px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(214 250 82 / 0.13), transparent 68%);
  animation: urma-breathe var(--urma-cycle) ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes urma-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  55% { transform: scale(1.06); opacity: 1; }
}

/* ---- the words ---------------------------------------------------------- */

.urma-copy {
  min-width: 0;
  /* Hold an editorial measure — without this the headline runs to the
   * viewport edge on wide screens. */
  max-width: 62ch;
}

.urma-copy h1 {
  /* Sized off the column, not the viewport, so it cannot outgrow its track
   * and wrap to one word per line. */
  font-size: clamp(32px, 4vw, 64px);
  line-height: 1.0;
  letter-spacing: -.05em;
  font-weight: 600;
  text-wrap: balance;
}

.urma-copy h1 em {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--lime);
}

.urma-copy .hero-sub {
  margin-top: clamp(12px, 1.8vmin, 20px);
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.55;
  color: var(--muted);
  max-width: 46ch;
}

/* ---- the synced cycle --------------------------------------------------- */

/* Four stages on the SVG's clock. Each lights for a quarter of the loop, so
 * the words track the pulse as it travels the trace and seals the break. */
.urma-cycle {
  margin-top: clamp(14px, 2.2vmin, 24px);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
}

.urma-cycle li {
  font: 12px/1 var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
  padding: 9px 13px;
  border: 1px solid var(--line);
  color: var(--muted);
  animation: urma-stage-on var(--urma-cycle) linear infinite;
}

.urma-cycle li:nth-child(1) { animation-delay: calc(var(--urma-cycle) * -0.00); }
.urma-cycle li:nth-child(2) { animation-delay: calc(var(--urma-cycle) * -0.75); }
.urma-cycle li:nth-child(3) { animation-delay: calc(var(--urma-cycle) * -0.50); }
.urma-cycle li:nth-child(4) { animation-delay: calc(var(--urma-cycle) * -0.25); }

@keyframes urma-stage-on {
  0%, 18% {
    color: var(--dark);
    background: var(--lime);
    border-color: var(--lime);
  }
  28%, 100% {
    color: var(--muted);
    background: transparent;
    border-color: var(--line);
  }
}

.urma-note {
  margin-top: clamp(12px, 1.8vmin, 20px);
  font: 11px/1.5 var(--mono);
  letter-spacing: .04em;
  color: var(--muted);
  max-width: 52ch;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.urma-actions {
  margin-top: clamp(14px, 2.2vmin, 24px);
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

/* ---- ticker ------------------------------------------------------------- */

.opening-screen > .ticker { margin: 0; }
.opening-screen .ticker > .wrap {
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.opening-screen .ticker span {
  justify-content: center;
  padding: 16px 8px !important;
  font-size: 14px;
  border-bottom: 0;
}
.opening-screen .ticker b { display: none; }

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

@media (max-width: 900px) {
  .urma-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: clamp(18px, 4vmin, 36px);
    padding-block: clamp(28px, 6vmin, 48px);
  }

  .urma-stage { order: -1; }

  .urma-stage img { width: min(72vw, 320px); }

  .urma-copy { max-width: 32ch; }

  .urma-cycle { justify-content: center; }

  .urma-note {
    text-align: left;
    margin-inline: auto;
    padding-left: 0;
    border-left: 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .urma-actions { justify-content: center; }
}

@media (max-width: 560px) {
  /* Four even chips on two rows beats three-plus-an-orphan. */
  .urma-cycle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 300px;
    margin-inline: auto;
  }
  .urma-cycle li {
    padding: 9px 6px;
    font-size: 11px;
    letter-spacing: .08em;
    text-align: center;
  }
  .urma-stage img { width: min(78vw, 260px); }

  /* The grid reads as hard boxes at this width — soften it out. */
  .urma-hero::before { background-size: 48px 48px; opacity: .5; }
}

/* Short/landscape screens: keep the whole thing on one screen. */
@media (max-height: 620px) and (min-width: 901px) {
  .urma-stage img { width: min(100%, clamp(200px, 28vw, 340px)); }
  .urma-copy h1 { font-size: clamp(32px, 4.4vw, 56px); }
}

@media (prefers-reduced-motion: reduce) {
  .urma-stage::after,
  .urma-cycle li {
    animation: none;
  }
  /* Without motion, show the cycle as a plain sourced list, first stage lit. */
  .urma-cycle li:first-child {
    color: var(--dark);
    background: var(--lime);
    border-color: var(--lime);
  }
}
