/* Stylesheet for the new homepage (nicegui/design/).

   Everything here backs a construction the Figma design depends on and that
   Tailwind utilities cannot express: the two parallax hero layers, the scroll
   reveal, the conic glow border, the consortium map with its percentage-placed
   partner plates, and the focus ring. The brand colours themselves are Tailwind
   tokens, registered in static/design/tailwind_config.js. */

/* Self-hosted, same policy as the rest of the site: no third-party font CDN.
   Archivo is the brand typeface; Inter carries body copy in this design. */
@font-face {
  font-family: "Archivo";
  src: url("/static/design/fonts/Archivo-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/design/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Component classes.

   Written as plain CSS rather than Tailwind @apply on purpose. The runtime
   compiles @apply against the token config, which this page can only register
   after the deferred Tailwind script has loaded; the two race, and a compile that
   loses reports "the font-body class does not exist" and drops the whole rule.
   .link-arrow is on every "Discover the project" style link, so losing it is very
   visible. These values are the compiled result of the design's own utilities. */
.mc-gradient {
  background-image: linear-gradient(118deg, #005381 0%, #005381 52%, #0081a4 100%);
}
.mc-gradient-gold {
  background-image: linear-gradient(90deg, #fac278 0%, #fad69b 100%);
}
.eyebrow {
  font-family: Inter, Roboto, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.link-arrow {
  font-family: Inter, Roboto, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.375;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
@media (min-width: 768px) {
  .link-arrow {
    font-size: 20px;
  }
}
@media (min-width: 1280px) {
  .link-arrow {
    font-size: 22px;
  }
}
.link-arrow:hover {
  opacity: 0.8;
}
.card-glass {
  border-radius: 20px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(131, 201, 201, 0.5);
}

/* Header: fades in on scroll, hides on the way down, returns on the way up.
   The classes are toggled by static/design/behaviour.js. */
#site-header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease,
    transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
#site-header.scrolled {
  background-color: rgba(0, 68, 96, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 24px rgba(0, 0, 51, 0.25);
}
#site-header.header-hidden {
  transform: translateY(-100%);
}

/* Hero art: a 610x673 design box holding two layers that drift at different
   rates. On mobile it is scaled to the content width (342/610) rather than
   cropped, so the cube stays whole. */
.hero-art {
  position: absolute;
  width: 610px;
  height: 673px;
  transform-origin: top right;
  right: 0;
  top: 0;
  transform: scale(0.56);
}
@media (min-width: 768px) {
  .hero-art {
    transform: scale(0.62);
  }
}
@media (min-width: 1280px) {
  .hero-art {
    transform: scale(1);
    right: -7px;
    top: 120px;
  }
}
.px-layer {
  position: absolute;
  will-change: transform;
  pointer-events: auto;
}
/* the hover bob animates this wrapper from JS, so leaving the element eases
   back to rest instead of snapping */
.bob {
  display: block;
}
.px-shape {
  left: 144px;
  top: 0;
  width: 460px;
}
.px-cube {
  left: 0;
  top: 246px;
  width: 200px;
}
.px-shape img {
  animation: idle-float 9s ease-in-out infinite alternate;
}
.px-cube img {
  animation: idle-float 6.5s ease-in-out 0.8s infinite alternate;
}
@keyframes idle-float {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-7px);
  }
}

/* Use-case cards: the blue gradient is the card's only background and the
   photograph blends into it, which is how the design builds them. */
.uc-photo {
  mix-blend-mode: luminosity;
}

/* Scroll reveal. The delay is set per element to stagger a group. */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Hover lift, and the rotating gradient border on the glass cards. */
.float-card {
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.35s ease;
}
.float-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 34px rgba(0, 0, 51, 0.22), 0 0 26px rgba(131, 201, 201, 0.28);
}

@property --glow-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.glow-card {
  position: relative;
}
.glow-card::before {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--glow-angle),
    rgba(131, 201, 201, 0) 0%,
    rgba(131, 201, 201, 0.95) 12%,
    rgba(250, 220, 155, 0.9) 22%,
    rgba(131, 201, 201, 0) 38%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: glow-spin 3.2s linear infinite;
  pointer-events: none;
}
.glow-card:hover::before {
  opacity: 1;
}
@keyframes glow-spin {
  to {
    --glow-angle: 360deg;
  }
}

/* Consortium map: a vector base with partner plates placed in per cent, so the
   whole thing scales with the container. Positions come from design/content/home.yaml. */
.map-stage {
  position: relative;
  aspect-ratio: 833 / 740;
}
.map-stage > img.map-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.logo-plate {
  position: absolute;
  width: 11.144%;
  aspect-ratio: 92.78 / 41.56;
  background: #fff;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.3s ease;
}
.logo-plate img {
  max-width: 86%;
  max-height: 70%;
  object-fit: contain;
}
.logo-plate:hover,
.logo-plate:focus-visible {
  transform: translateY(-3px) scale(1.06);
  z-index: 10;
  box-shadow: 0 8px 20px rgba(0, 0, 51, 0.35), 0 0 16px rgba(250, 220, 155, 0.5);
}

/* Keyboard focus: a two-tone ring that reads on both the light and the dark
   sections. Never set a radius here; outline and shadow follow each element's
   own, and overriding it squares off the pills and cards. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #00556b;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(250, 220, 155, 0.9);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .px-shape img,
  .px-cube img {
    animation: none;
  }
  .glow-card::before {
    animation: none;
  }
  .float-card,
  .logo-plate {
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* Feed entries on /news and /events. The body is collapsed to a teaser; the
   toggle, or an incoming anchor link, swaps in the full text. */
.mc-entry .mc-full {
  display: none;
}
.mc-entry.is-open .mc-full {
  display: block;
}
.mc-entry.is-open .mc-teaser {
  display: none;
}

/* Wiki bodies arrive as markup the feed engine converted, with no classes of
   their own, so their links and lists are styled here. */
.mc-feed-body a {
  color: #0081a3;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mc-feed-body a:hover {
  color: #00556b;
}
.mc-feed-body ul,
.mc-feed-body ol {
  margin: 0.5rem 0 0.5rem 1.25rem;
}
.mc-feed-body ul {
  list-style: disc;
}
.mc-feed-body ol {
  list-style: decimal;
}

/* Markdown rendered into the legal pages. Tailwind's preflight strips list
   markers, link colour and paragraph spacing, so prose needs them back. */
.mc-prose p {
  margin: 0 0 1rem 0;
}
.mc-prose p:last-child {
  margin-bottom: 0;
}
.mc-prose a {
  color: #0081a3;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mc-prose a:hover {
  color: #00556b;
}
.mc-prose ul,
.mc-prose ol {
  margin: 0 0 1rem 1.25rem;
}
.mc-prose ul {
  list-style: disc;
}
.mc-prose ol {
  list-style: decimal;
}
.mc-prose li {
  margin: 0.25rem 0;
}
.mc-prose strong {
  font-weight: 600;
}
