/* ==========================================================================
   VALOR Energies — teaser page
   ========================================================================== */

:root {
  --surface: 165 40% 2%;
  --ink: 0 0% 100%;
  --jade-deep: 165 80% 13.5%;
  --jade-mid: 165 72% 31%;
  --jade-light: 100 33% 74%;

  --intro-surface: #05140f;
  --gradient-logo-ring: conic-gradient(from 0deg, #175cff 0%, #18d1e4 22%, #d52edb 43%, #a75ae4 54%, #24d1f1 68%, #1581fd 82%, #175cff 100%);

  --ring-stroke: 19px;
  --ring-hover-shadow: 0 0 14px hsl(var(--ink) / .35);

  /* Intro timing; teaser.js reads these values, so change them only here. */
  --intro-duration: 3.4s;
  --intro-reveal-duration: .8s;

  --font: "Avenir Next", "Nunito Sans", sans-serif;
}

/* --- Base ---------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: hsl(var(--surface));
  color: hsl(var(--ink));
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
}

h1,
h2,
p {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.button:focus-visible {
  outline: 2px solid hsl(var(--ink));
  outline-offset: 2px;
}

/* --- Intro ----------------------------------------------------------------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
}

.intro__veil {
  position: absolute;
  inset: 0;
  background: var(--intro-surface);
}

.intro__centre {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.intro__ring {
  position: relative;
  width: min(400px, 64vw, 54svh);
  aspect-ratio: 1;
  border-radius: 50%;
  animation: intro-ring-in 1.4s cubic-bezier(.2, .7, .2, 1) both;
}

/* The colour gradient turns slowly while the ring itself stays still. */
.intro__ring span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gradient-logo-ring);
  -webkit-mask-image: radial-gradient(farthest-side, transparent 81%, #fff 82%);
  mask-image: radial-gradient(farthest-side, transparent 81%, #fff 82%);
  animation: intro-ring-turn 16s linear infinite;
}

.intro__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68%;
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: intro-logo var(--intro-duration) ease-out both;
}

.intro__words {
  position: absolute;
  top: calc(50% + min(200px, 32vw, 27svh) + 38px);
  width: calc(100% - 48px);
  text-align: center;
  font-size: 24px;
  line-height: 1.4;
  font-weight: 500;
}

.intro__words p {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: intro-words calc(var(--intro-duration) / 2) ease-in-out both;
}

.intro__words p:nth-child(2) {
  animation-delay: calc(var(--intro-duration) / 2);
}

.intro__skip {
  position: absolute;
  right: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  color: hsl(var(--ink) / .7);
  font-size: 12px;
}

.intro__skip:hover,
.intro__skip:focus-visible {
  color: hsl(var(--ink));
  background: hsl(var(--ink) / .08);
}

/* The whole intro fades out, revealing the page underneath. */
.intro.is-revealing {
  pointer-events: none;
  animation: intro-fade-out var(--intro-reveal-duration) ease both;
}

@keyframes intro-ring-in {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes intro-ring-turn {
  to { transform: rotate(360deg); }
}

@keyframes intro-logo {
  0%, 55% { opacity: 0; }
  80%, 100% { opacity: 1; }
}

@keyframes intro-words {
  0%, 100% { opacity: 0; }
  12%, 85% { opacity: 1; }
}

@keyframes intro-fade-out {
  to { opacity: 0; }
}

/* --- Page & stage ---------------------------------------------------------- */

.teaser {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.stage {
  position: relative;
  flex: 1;
  min-height: max(640px, calc(100svh - 50px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Jade glow along the bottom edge. */
.stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: auto 0 0 0;
  height: clamp(380px, 66%, 680px);
  pointer-events: none;
  background:
    radial-gradient(92% 155% at 8% 112%, hsl(var(--jade-deep) / .95), transparent 72%),
    radial-gradient(80% 135% at 92% 116%, hsl(var(--jade-mid) / .7), transparent 74%),
    radial-gradient(58% 100% at 46% 124%, hsl(var(--jade-light) / .3), transparent 68%),
    linear-gradient(to top, hsl(var(--jade-deep) / .5), transparent 62%);
}

.stage.is-static::after {
  background:
    radial-gradient(92% 155% at 8% 112%, hsl(var(--jade-deep) / .8), transparent 72%),
    radial-gradient(80% 135% at 92% 116%, hsl(var(--jade-mid) / .55), transparent 74%),
    linear-gradient(to top, hsl(var(--jade-deep) / .42), transparent 62%);
}

/* --- Video montage --------------------------------------------------------- */

.montage,
.montage__shot,
.montage__shot img,
.montage__shot video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.montage__shot img,
.montage__shot video {
  object-fit: cover;
}

.montage__shot {
  animation: shot-in 1.2s ease both;
}

.montage__shot img {
  filter: saturate(.86);
}

/* Never show the native "tap to play" button when autoplay is blocked
   (e.g. iOS Low Power Mode); the poster image stays visible instead. */
.montage video::-webkit-media-controls,
.montage video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

.montage__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, hsl(var(--surface) / .82), hsl(var(--surface) / .38) 48%, hsl(var(--surface) / .58));
}

.stage.is-closing .montage__shade {
  background: linear-gradient(to bottom, hsl(var(--surface) / .3), hsl(var(--surface) / .58) 55%, hsl(var(--surface) / .65));
}

@keyframes shot-in {
  from { opacity: 0; transform: scale(1.025); }
  to { opacity: 1; transform: scale(1); }
}

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

.header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 34px 48px;
}

.header__logo {
  width: 225px;
  height: auto;
}

.header__contact {
  padding-inline: 20px;
  border: 1px solid hsl(var(--ink) / .25);
  border-radius: 999px;
}

.header__contact:hover {
  background: hsl(var(--ink) / .12);
}

/* --- Film content: ring + slogan ------------------------------------------ */

/* Ring and slogan are stacked in normal flow so they can never overlap. */
.film-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 64px;
  padding: 0 24px 24px;
}

.opening {
  width: min(560px, 100%);
  text-align: center;
}

.opening__slogan {
  font-size: clamp(26px, 1.8vw, 34px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .01em;
  white-space: nowrap;
}

.opening__slogan span {
  font-size: 1.32em;
  line-height: 1;
}

/* Visible from the start, so visitors get the message without waiting for the closing screen. */
.opening__launch {
  display: inline-block;
  margin-top: 20px;
  padding: 7px 16px;
  border: 1px solid hsl(var(--ink) / .3);
  border-radius: 999px;
  background: hsl(var(--surface) / .35);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* --- Ring (emblem) --------------------------------------------------------- */

.emblem {
  position: relative;
  flex-shrink: 0;
  /* Scales with both viewport width and height so slogan and footer always fit. */
  width: clamp(320px, min(31vw, 100svh - 440px), 470px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  container-type: inline-size;
}

.ring-quarter {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.ring-quarter:nth-child(1) { --flow-a: #18d1e4; --flow-b: #d52edb; --flow-glow: rgba(24, 209, 228, .45); }
.ring-quarter:nth-child(2) { --flow-a: #a75ae4; --flow-b: #24d1f1; --flow-glow: rgba(167, 90, 228, .45); }
.ring-quarter:nth-child(3) { --flow-a: #1581fd; --flow-b: #175cff; --flow-glow: rgba(21, 129, 253, .45); }
.ring-quarter:nth-child(4) { --flow-a: #175cff; --flow-b: #18d1e4; --flow-glow: rgba(23, 92, 255, .45); }

.ring-quarter__art,
.ring-quarter__flow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(farthest-side, transparent calc(100% - var(--ring-stroke) - 1px), #fff calc(100% - var(--ring-stroke)));
  mask-image: radial-gradient(farthest-side, transparent calc(100% - var(--ring-stroke) - 1px), #fff calc(100% - var(--ring-stroke)));
}

.ring-quarter__art {
  background: var(--gradient-logo-ring);
  transition: opacity .35s ease, filter .25s ease;
}

@property --flow-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.ring-quarter__flow {
  background: conic-gradient(from var(--flow-angle), transparent 0deg, transparent 5deg, var(--flow-a) 9deg, var(--flow-b) 13deg, transparent 17deg, transparent 360deg);
  animation: ring-flow 3.8s linear infinite;
  opacity: .95;
  filter: brightness(1.55) drop-shadow(0 0 7px var(--flow-glow));
}

.ring-quarter.is-dimmed .ring-quarter__art {
  opacity: .38;
}

.ring-quarter.is-dimmed .ring-quarter__flow {
  opacity: 0;
  transition: opacity .35s ease;
}

.ring-quarter.is-selected .ring-quarter__art,
.ring-quarter:hover .ring-quarter__art {
  filter: brightness(1.25) drop-shadow(var(--ring-hover-shadow));
}

.ring-quarter:focus-visible {
  outline: none;
}

.ring-quarter:focus-visible .ring-quarter__art {
  filter: brightness(1.5) drop-shadow(var(--ring-hover-shadow));
}

.ring-quarter:focus-visible::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px dashed hsl(var(--ink));
  border-radius: 50%;
  pointer-events: none;
}

@keyframes ring-flow {
  to { --flow-angle: 360deg; }
}

/* Stacks all children in one grid cell; only the .is-active child is shown.
   The stack keeps the size of its largest child, so switching never shifts the layout. */
.stack {
  display: grid;
}

.stack > * {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s;
}

.stack > .is-active {
  opacity: 1;
  visibility: visible;
}

/* Value labels in the four corners, next to their quarter of the ring. */
.ring-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ring-label {
  position: absolute;
  pointer-events: auto;
  padding: 4px 0;
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition: opacity .3s ease, visibility .3s;
}

/* Labels stay out of sight until the visitor hovers or uses the ring. */
.emblem:hover .ring-label,
.emblem:focus-within .ring-label,
.emblem.has-selection .ring-label {
  opacity: .72;
  visibility: visible;
}

.emblem .ring-label:hover,
.emblem .ring-label.is-active {
  opacity: 1;
}

.emblem.has-selection .ring-label:not(.is-active) {
  opacity: .35;
}

.ring-label--top-right { top: 3%; left: 80%; }
.ring-label--bottom-right { bottom: 3%; left: 80%; }
.ring-label--bottom-left { bottom: 3%; right: 80%; }
.ring-label--top-left { top: 3%; right: 80%; }

/* Text in the middle of the ring. teaser.js lowers --copy-scale per value
   when a long text would otherwise run into the ring. */
.ring-copy {
  position: relative;
  width: 66%;
  place-items: center;
  text-align: center;
  pointer-events: none;
}

.ring-copy__logo {
  width: 100%;
  height: auto;
}

.ring-copy__value {
  --copy-scale: 1;
}

.ring-copy__title {
  font-size: calc(clamp(15px, 5.6cqi, 26px) * var(--copy-scale));
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

.ring-copy__quote {
  margin-top: .7em;
  font-size: calc(clamp(11px, 3.6cqi, 16px) * var(--copy-scale));
  line-height: 1.45;
  text-wrap: balance;
}

.ring-hint {
  position: absolute;
  top: calc(100% + 18px);
  width: 100%;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}

/* --- Closing ------------------------------------------------------------- */

.closing {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 24px 72px;
  text-align: center;
}

.closing__copy {
  max-width: 650px;
  animation: copy-in 1s ease both;
}

.closing__logo {
  width: min(360px, 78vw);
  height: auto;
  margin: 0 auto 40px;
}

.closing__title {
  font-size: 64px;
  font-weight: 600;
  line-height: 1.02;
  text-wrap: balance;
}

.closing__subtitle {
  margin-top: 22px;
  font-size: 18px;
  line-height: 1.6;
  opacity: .76;
}

@keyframes copy-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Phase dots -------------------------------------------------------------- */

.stage-footer {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  padding: 16px 48px 26px;
}

.phase-dots {
  display: flex;
  gap: 6px;
}

.phase-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: hsl(var(--ink) / .3);
  transition: width .4s ease, background-color .4s ease;
}

.phase-dots span.is-active {
  width: 22px;
  background: hsl(var(--ink) / .9);
}

.stage.is-static .phase-dots {
  visibility: hidden;
}

.legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 48px;
  background: hsl(var(--jade-deep));
  border-top: 1px solid hsl(var(--jade-mid) / .4);
  font-size: 11px;
  letter-spacing: .02em;
  color: #ffffffd9;
}

/* --- Mobile ---------------------------------------------------------------- */

@media (max-width: 640px) {
  :root {
    --ring-stroke: 13px;
  }

  .intro__words {
    font-size: 20px;
  }

  .stage {
    min-height: max(640px, calc(100svh - 92px));
  }

  .header {
    padding: 24px;
  }

  .header__logo {
    width: 160px;
  }

  .header__contact {
    padding-inline: 12px;
    font-size: 11px;
  }

  .header__contact svg {
    width: 13px;
  }

  .montage__shade {
    background: linear-gradient(to bottom, hsl(var(--surface) / .7), hsl(var(--surface) / .28) 48%, hsl(var(--surface) / .72));
  }

  .film-content {
    gap: 56px;
  }

  .emblem {
    width: min(78vw, 320px);
  }

  .ring-hint {
    top: calc(100% + 12px);
    font-size: 11px;
  }

  .opening__slogan {
    font-size: 23px;
  }

  .ring-label {
    font-size: 10px;
    letter-spacing: .06em;
  }

  .opening__launch {
    margin-top: 16px;
    padding: 6px 12px;
    font-size: 10.5px;
    letter-spacing: .05em;
  }

  .closing__title {
    font-size: 36px;
  }

  .stage-footer {
    padding: 12px 24px 22px;
  }

  .legal {
    padding: 14px 24px;
  }
}

/* --- Reduced motion ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .intro {
    display: none;
  }

  .ring-quarter__flow {
    animation: none;
    opacity: 0;
  }
}
