:root {
  --tempo-light: #b5f6dc;
  --hermes-rail-height: 104px;
}

#hero.tempo-hero {
  isolation: isolate;
  display: grid;
  grid-template: auto / minmax(0, 1fr);
  align-items: center;
  min-height: max(100svh, 640px);
  padding: calc(var(--header-height) + clamp(28px, 7svh, 88px)) clamp(22px, 6vw, 130px) clamp(54px, 9svh, 125px);
  color: #f0fff8;
  background: #08171d;
}

.tempo-over-hero #navigation { background: #0a1a20db; border-color: #a2dcca24; }
.tempo-over-hero #navigation .nav__brand { color: #effff7; }
.tempo-over-hero #navigation .nav__links, .tempo-over-hero #navigation .nav__cta { background: #193832; color: #effff7; }
.tempo-over-hero #navigation .nav__menu { background: #193832; color: #effff7; }

.tempo-hero__copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 670px;
  justify-self: start;
}

.tempo-hero__byline {
  margin-bottom: clamp(18px, 3.25vw, 44px);
  font: 500 clamp(13px, 1.2vw, 17px)/1.45 var(--font-2);
  color: #cae1db;
}

.tempo-hero__byline span { font-weight: 700; color: #f0fff8; }

#hero-title {
  font: 800 clamp(68px, 8.6vw, 166px)/.85 var(--font-1);
  letter-spacing: -.052em;
}

#hero-title span { color: var(--tempo-light); }

.tempo-hero__lead {
  max-width: 34ch;
  margin-top: clamp(22px, 3.1vw, 44px);
  color: #d0e9e0;
  font: 500 clamp(16px, 1.5vw, 22px)/1.5 var(--font-2);
}

.tempo-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: clamp(18px, 2.6vw, 34px);
}

.tempo-hero__primary, .tempo-hero__secondary {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 99px;
  font: 650 14px/1.2 var(--font-2);
  text-decoration: none;
  cursor: pointer;
}

.tempo-hero__primary { background: var(--tempo-light); color: #10282c; }
.tempo-hero__primary:hover { background: #e6fff4; }
.tempo-hero__secondary { background: #0e222a; border-color: #90b7aa; color: #effff7; }
.tempo-hero__secondary:hover { background: #234c48; }

.tempo-orb {
  position: absolute;
  inset: 0;
  margin: 0;
  background:
    radial-gradient(ellipse at 75% 42%, #39776b, #16383a 34%, transparent 66%),
    radial-gradient(ellipse at 94% 100%, #21445c, transparent 48%),
    #08171d;
}

.tempo-orb::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #08171df8 0%, #08171de8 24%, #08171d7a 43%, transparent 62%),
    linear-gradient(0deg, #08171dd9, transparent 27%);
  pointer-events: none;
  content: "";
}

.tempo-orb__stage {
  position: absolute;
  top: 50%;
  left: 69%;
  width: clamp(850px, 106vw, 1900px);
  aspect-ratio: 1;
  translate: -50% -50%;
}

.tempo-orb__dial {
  position: absolute;
  inset: 9%;
  border: 1px solid #b7ffe740;
  border-radius: 50%;
  background: radial-gradient(circle, #79e5bd25, #79e5bd07 61%, transparent 72%);
}

.tempo-orb__dial::before {
  position: absolute;
  inset: -5%;
  border-radius: 50%;
  background: repeating-conic-gradient(#c0ffe968 0deg 1deg, transparent 1deg 6deg);
  mask-image: radial-gradient(circle, transparent 68%, black 68% 70%, transparent 71%);
  content: "";
}

.tempo-orb__dial::after {
  position: absolute;
  inset: 10%;
  border: 1px solid #b7ffe72c;
  border-radius: 50%;
  content: "";
}

.tempo-orb__portrait {
  position: absolute;
  top: 49%;
  left: 50%;
  translate: -47% -49%;
  width: 57%;
  height: min(65svh, 760px);
  object-fit: contain;
  object-position: center top;
  mask-image: linear-gradient(#000 38%, #000b 67%, transparent 100%);
  filter: saturate(.79) drop-shadow(0 0 35px #9af1c13d);
}

.tempo-orb__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tempo-orb__pause, .tempo-panel__close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #a9e7d349;
  border-radius: 50%;
  background: #0b1d24d9;
  color: #eafff7;
  font: 600 16px/1 system-ui;
  cursor: pointer;
}

.tempo-orb__pause { position: absolute; z-index: 1; top: calc(var(--header-height) + 18px); right: clamp(16px, 3vw, 44px); }
.tempo-orb__pause:hover, .tempo-panel__close:hover { background: #234c48; }

.tempo-avatar {
  display: block;
  width: 56px;
  height: 76px;
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 1px 8px #89f4ca38);
}

.tempo-assistant {
  --tempo-dock-gap: 18px;
  --tempo-dock-bottom: calc(var(--tempo-dock-gap) + max(env(safe-area-inset-bottom), var(--tempo-consent-space, 0px)));
  position: fixed;
  z-index: 41;
  top: 0;
  left: 0;
  transform: translate(var(--hermes-x, 12px), var(--hermes-y, var(--header-height)));
  display: grid;
  justify-items: end;
  width: min(392px, calc(100% - 2 * var(--tempo-dock-gap)));
  pointer-events: none;
  font-family: var(--font-2);
}

.tempo-assistant:has(.tempo-panel:not([hidden])) {
  top: auto;
  left: auto;
  right: max(var(--tempo-dock-gap), env(safe-area-inset-right));
  bottom: var(--tempo-dock-bottom);
  transform: none;
}

body:has(#menu:not([hidden])) .tempo-assistant { z-index: 39; }

body.hermes-on-rail main > section {
  scroll-margin-top: calc(var(--header-height) + var(--hermes-rail-height) + 16px);
}

.tempo-assistant > * { pointer-events: auto; }

.tempo-dock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  justify-self: start;
  width: 100%;
  border: 1px solid #6cb29aaa;
  border-radius: 22px;
  background: #10282cfa;
  color: #f3fffa;
  box-shadow: 0 8px 30px #0e222e57;
}

.tempo-dock.is-compact {
  grid-template-columns: auto 38px;
  width: auto;
  border-radius: 36px;
}

.tempo-launcher {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 9px;
  padding: 7px 3px 7px 8px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.tempo-launcher:hover, .tempo-dock__toggle:hover { background: #234c48; }
.tempo-launcher__words { display: grid; gap: 3px; }
.tempo-launcher__words strong { color: var(--tempo-light); font-size: 13px; line-height: 1.2; }
.tempo-launcher__words [data-tempo-peek] { color: #e5f8f0; font-size: 12px; line-height: 1.36; }

.tempo-dock__toggle {
  display: grid;
  width: 34px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--tempo-light);
  font-size: 22px;
  cursor: pointer;
}

.is-compact .tempo-launcher { min-height: 58px; padding: 4px 0 4px 4px; border-radius: 50%; }
.is-compact .tempo-avatar { width: 42px; height: 56px; }

.tempo-panel {
  display: flex;
  width: 100%;
  max-height: calc(100dvh - var(--tempo-dock-bottom) - 12px);
  flex-direction: column;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #476b67;
  border-radius: 24px;
  background: #10282c;
  color: #f3fff9;
  box-shadow: 0 18px 70px #0e222e54;
}

.tempo-panel__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 7px 14px 7px 8px;
  gap: 10px;
}

.tempo-panel__header h2 { margin: 0; font: 700 21px/1.1 var(--font-1); }
.tempo-panel__header p { color: #c4dbd4; font-size: 11px; }
.tempo-panel__close { font-size: 24px; }
.tempo-panel__header .tempo-avatar { width: 48px; height: 64px; }
.tempo-panel__context { padding: 10px 14px; border-block: 1px solid #84c6b248; background: #193831; }
.tempo-panel__context strong { color: var(--tempo-light); font-size: 12px; }
.tempo-panel__context p, .tempo-message { font-size: 13px; line-height: 1.45; }
.tempo-panel__context .tempo-panel__path { margin-top: 5px; color: var(--tempo-light); font-size: 11px; }

.tempo-panel__log {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 72px;
  max-height: 238px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px;
}

.tempo-message {
  align-self: start;
  max-width: 96%;
  padding: 9px 11px;
  border-radius: 4px 14px 14px;
  background: #234248;
  overflow-wrap: anywhere;
}

.tempo-message--user { align-self: end; border-radius: 14px 4px 14px 14px; background: #d9f6e7; color: #10282c; }
.tempo-message a { display: inline-block; margin-top: 4px; color: var(--tempo-light); font-weight: 650; }
.tempo-panel__choices { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 14px 10px; }

.tempo-panel__choices button {
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid #638e85;
  border-radius: 99px;
  background: transparent;
  color: #e9fff6;
  font-size: 11px;
  cursor: pointer;
}

.tempo-panel__choices button:hover { background: #28544c; }
.tempo-panel__form { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; padding: 0 14px 14px; }
.tempo-panel__form input {
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid #6f938c;
  border-radius: 12px;
  background: #0b1f23;
  color: #fff;
  font-size: 16px;
}

.tempo-panel__form input::placeholder { color: #b3cbc2; }
.tempo-panel__form button { height: 44px; border: 0; border-radius: 12px; background: var(--tempo-light); color: #10282c; font-size: 21px; cursor: pointer; }
.tempo-panel__form button:hover { background: #e7fff4; }
.tempo-assistant :focus-visible, .tempo-orb button:focus-visible { outline: 2px solid var(--tempo-light); outline-offset: 2px; }
.tempo-panel__form button:focus-visible { outline-offset: 3px; }
.tempo-assistant [hidden], .tempo-assistant[hidden], .tempo-hero [hidden] { display: none; }
body:has(.tempo-assistant:not([hidden])) #footer { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

@media (max-width: 899px) {
  #hero.tempo-hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    min-height: max(100svh, 730px);
    padding: calc(var(--header-height) + 34px) clamp(20px, 6vw, 60px) clamp(285px, 43vw, 470px);
  }
  .tempo-hero__copy { max-width: 520px; }
  #hero-title { font-size: clamp(66px, 13vw, 120px); }
  .tempo-hero__lead { max-width: 33ch; }
  .tempo-orb__pause { top: auto; bottom: 111px; }
  .tempo-orb { background: radial-gradient(ellipse at 63% 72%, #3a756a, #16383a 35%, #08171d 73%); }
  .tempo-orb::after {
    background: linear-gradient(180deg, #08171df0 7%, #08171dd9 28%, #08171d64 48%, transparent 66%, #08171dcf 100%);
  }
  .tempo-orb__stage { top: 74%; left: 56%; width: clamp(570px, 112vw, 1050px); }
  .tempo-orb__portrait { top: 52%; height: min(57svh, 510px); }
}

@media (max-width: 540px) {
  #hero.tempo-hero { padding-top: calc(var(--header-height) + 22px); }
  #hero-title { font-size: clamp(57px, 15vw, 80px); }
  .tempo-hero__actions { gap: 8px; }
  .tempo-hero__primary, .tempo-hero__secondary { gap: 7px; padding-inline: 13px; }
  .tempo-orb__stage { top: 75%; }
  .tempo-assistant {
    --tempo-dock-gap: 10px;
  }
  .tempo-launcher .tempo-avatar { width: 47px; height: 68px; }
  .is-compact .tempo-launcher .tempo-avatar { width: 40px; height: 54px; }
  .tempo-panel__choices button { min-height: 40px; }
}

@media (max-width: 760px) {
  body.hermes-on-rail #hero.tempo-hero {
    padding-top: calc(var(--header-height) + var(--hermes-rail-height) + 22px);
    padding-bottom: clamp(340px, 46vw, 410px);
  }
  body.hermes-on-rail .tempo-orb__stage { top: 77%; }
  body.hermes-on-rail .tempo-orb__portrait { height: min(50svh, 440px); }
  .tempo-orb__pause { bottom: 18px; }
}
