/* Home opening: the earth → Türkiye → city scroll journey and the ŞİMŞEK title, after Dilara's mockups (design/reference). */

/* The section is as long as the journey scrolls; the stage, the name and the controls are fixed to the screen and the
   clip-path of the section cuts them off where it ends, so the content after it slides up over the city. */
.teo-website-journey-section {
  position: relative;
  height: 880vh;
  height: 880svh;
  clip-path: inset(0);
  background: var(--teo-website-background);
}

.teo-website-journey-still .teo-website-journey-section {
  height: 100vh;
  height: 100svh;
  min-height: 560px;
}

/* stage: film, opening still, landing still and shade */

.teo-website-journey-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #020711;
}

/* the end state stands on the landing still alone: if it fails, the glow of a city at night under the name stays (the
   shade darkens it as it darkens the still) */
.teo-website-journey-still .teo-website-journey-stage {
  background: radial-gradient(ellipse 48% 30% at 50% 76%, rgba(255, 176, 92, 0.6), transparent 70%),
    radial-gradient(ellipse 90% 65% at 50% 70%, rgba(42, 107, 255, 0.7), transparent 72%),
    linear-gradient(#020711 25%, #0a1a3f);
}

.teo-website-journey-film,
.teo-website-journey-opening,
.teo-website-journey-landing {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
}

.teo-website-journey-film {
  z-index: 0;
  transform: translateZ(0);
}

.teo-website-journey-landing {
  z-index: 1;
  opacity: var(--teo-journey-landing-opacity, 0);
  transform: scale(var(--teo-journey-landing-scale, 1));
  transform-origin: 50% 55%;
  will-change: transform, opacity;
}

/* Türkiye sits at 55 % of the opening frame: the stills draw towards it when no film frame stands in */
.teo-website-journey-opening {
  z-index: 2;
  opacity: var(--teo-journey-opening-opacity, 1);
  transform: scale(var(--teo-journey-opening-scale, 1));
  transform-origin: 55% 50%;
}

.teo-website-journey-filming .teo-website-journey-opening {
  transition: opacity 0.25s ease;
}

.teo-website-journey-shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(rgba(2, 7, 17, 0.13), transparent 40%, rgba(2, 7, 17, 0.13)),
    rgba(1, 4, 12, var(--teo-journey-dark, 0));
}

/* the name, its tagline and the two actions of the end card */

.teo-website-journey-identity {
  position: fixed;
  top: 34vh;
  top: 34svh;
  left: 50%;
  z-index: 5;
  width: calc(100% - 120px);
  max-width: 1200px;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

/* the site sets every h1 to weight 500; the name is Syncopate 700 */
.teo-website-journey .teo-website-journey-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  font-family: 'Syncopate', var(--teo-website-font-display);
  font-weight: 700;
  font-size: clamp(40px, 7.8vw, 112px);
  line-height: 1.5;
  letter-spacing: 0;
  color: #fff;
  text-shadow: 0 6px 12px #000, 0 0 35px rgba(38, 141, 255, 0.4);
  filter: drop-shadow(0 10px 24px #000);
}

.teo-website-journey-letter {
  flex: none;
  opacity: var(--teo-journey-reveal, 0);
  transform: translateY(calc((1 - var(--teo-journey-reveal, 0)) * 24px));
}

.teo-website-journey-tagline {
  margin: 28px 0 0;
  font-family: var(--teo-website-font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 2;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #e5eaf3;
  text-shadow: 0 2px 12px #000;
  opacity: var(--teo-journey-caption, 0);
}

.teo-website-journey-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
  opacity: var(--teo-journey-caption, 0);
  visibility: hidden;
}

.teo-website-journey-named .teo-website-journey-actions {
  visibility: visible;
  pointer-events: auto;
}

.teo-website-journey-actions .teo-website-button {
  min-height: 46px;
  padding: 0 22px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.teo-website-journey-actions .teo-website-button:not(.teo-website-button-primary) {
  background: rgba(216, 233, 255, 0.06);
  border-color: rgba(186, 215, 255, 0.3);
  color: #deefff;
}

/* the lightning of the arrival: a photographic flash and a glow on the name */

.teo-website-journey-flash {
  position: fixed;
  inset: 0;
  z-index: 6;
  height: 100vh;
  height: 100svh;
  pointer-events: none;
  opacity: 0;
  background: url('../../images/journey/journey-lightning.webp') center 48% / cover no-repeat;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(transparent 2%, #000 16%, #000 77%, transparent 100%);
  mask-image: linear-gradient(transparent 2%, #000 16%, #000 77%, transparent 100%);
}

.teo-website-journey-striking .teo-website-journey-flash {
  animation: teo-website-journey-flash 1050ms linear both;
}

.teo-website-journey-striking .teo-website-journey-title {
  animation: teo-website-journey-discharge 1200ms linear both;
}

@keyframes teo-website-journey-flash {
  0% { opacity: 0; }
  3% { opacity: 1; }
  8% { opacity: 0.65; }
  12% { opacity: 1; }
  22% { opacity: 0.5; }
  44% { opacity: 0.19; }
  100% { opacity: 0; }
}

@keyframes teo-website-journey-discharge {
  0% { text-shadow: 0 6px 12px #000, 0 0 35px rgba(38, 141, 255, 0.4); }
  4%, 14% { text-shadow: 0 0 5px #fff, 0 0 18px #d2eeff, 0 0 40px #60baff, 0 0 90px #1581ff, 0 0 160px #1365ed; }
  9% { text-shadow: 0 0 15px #bbdfff, 0 0 65px #339cff; }
  45% { text-shadow: 0 0 25px rgba(115, 188, 255, 0.6), 0 0 80px rgba(40, 127, 255, 0.33); }
  100% { text-shadow: 0 6px 12px #000, 0 0 35px rgba(38, 141, 255, 0.4); }
}

/* scroll instruction and play button, at the start only */

.teo-website-journey-instructions {
  position: fixed;
  left: 50%;
  bottom: max(7vh, 35px);
  bottom: max(7svh, 35px);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 14px #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s, visibility 0.45s, bottom 0.3s;
}

.teo-website-journey-at-start .teo-website-journey-instructions {
  opacity: 1;
  visibility: visible;
}

.teo-website-journey-mouse {
  position: relative;
  width: 23px;
  height: 36px;
  border: 1px solid rgba(230, 241, 255, 0.7);
  border-radius: 15px;
}

.teo-website-journey-mouse i {
  position: absolute;
  top: 7px;
  left: 9.5px;
  width: 2px;
  height: 7px;
  border-radius: 2px;
  background: #e6f4ff;
  animation: teo-website-journey-wheel 1.8s ease infinite;
}

.teo-website-journey-instructions p {
  margin: 12px 0 18px;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.08em;
  color: #e5efff;
}

.teo-website-journey-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 38px;
  min-height: 46px;
  padding: 12px 23px;
  border: 1px solid rgba(215, 232, 255, 0.5);
  border-radius: 4px;
  background: rgba(7, 19, 41, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font: 500 13px/1.2 var(--teo-website-font-body);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.teo-website-journey-play:hover,
.teo-website-journey-play:focus-visible {
  background: #dcecff;
  color: #071329;
}

@keyframes teo-website-journey-wheel {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  45% { opacity: 1; }
  75% { opacity: 0; transform: translateY(10px); }
}

/* pause (while playing by itself) and skip, bottom right */

.teo-website-journey-controls {
  position: fixed;
  right: 32px;
  bottom: 28px;
  z-index: 16;
  display: flex;
  gap: 10px;
  transition: bottom 0.3s;
}

.teo-website-journey-control {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(184, 215, 255, 0.33);
  border-radius: 4px;
  background: rgba(5, 17, 38, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #e8f3ff;
  font: 500 13px/1.2 var(--teo-website-font-body);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.45s, visibility 0.45s;
}

.teo-website-journey-control:hover,
.teo-website-journey-control:focus-visible {
  background: #dcecff;
  color: #071329;
}

.teo-website-journey-pause {
  display: none;
}

.teo-website-journey-autoplay .teo-website-journey-pause {
  display: inline-flex;
}

.teo-website-journey-skip {
  background: rgba(5, 17, 38, 0.55);
  opacity: 0;
  visibility: hidden;
}

.teo-website-journey-loaded .teo-website-journey-skip {
  opacity: 1;
  visibility: visible;
}

.teo-website-journey-named .teo-website-journey-skip,
.teo-website-journey-passed .teo-website-journey-skip,
.teo-website-journey-still .teo-website-journey-skip {
  opacity: 0;
  visibility: hidden;
}

/* the loader: 13 blocks and a percent over the stage for a moment; it never stops the page */

.teo-website-journey-loader {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020b17;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s, visibility 0.55s;
}

.teo-website-journey-loading .teo-website-journey-loader {
  opacity: 1;
  visibility: visible;
  transition: none;
}

.teo-website-journey-loader-panel {
  width: min(352px, calc(100vw - 72px));
  color: #d8e4ff;
  font: 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.15em;
}

.teo-website-journey-loader-percent {
  display: block;
  margin: 0 0 13px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.teo-website-journey-loader-blocks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.teo-website-journey-loader-blocks i {
  display: block;
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  background: #d8e4ff;
  opacity: 0.12;
  transition: opacity 0.16s ease;
}

.teo-website-journey-loader-blocks i.teo-website-journey-lit {
  opacity: 1;
}

.teo-website-journey-loader-text {
  display: block;
  margin: 13px 0 0;
  text-transform: uppercase;
}

/* past the journey the fixed layers rest */

.teo-website-journey-passed .teo-website-journey-stage,
.teo-website-journey-passed .teo-website-journey-identity,
.teo-website-journey-passed .teo-website-journey-flash {
  visibility: hidden;
}

/* the end of the journey as a still: reduced motion or a failed load */

.teo-website-journey-still .teo-website-journey-instructions,
.teo-website-journey-still .teo-website-journey-controls,
.teo-website-journey-still .teo-website-journey-loader,
.teo-website-journey-still .teo-website-journey-flash {
  display: none;
}

.teo-website-journey-end {
  position: absolute;
  top: 100%;
  left: 0;
  width: 1px;
  height: 0;
  outline: none;
}

/* the site header fades in with the name while the journey is on the page; hovering or tabbing into it shows it */

body.teo-website-journey-active .teo-website-header {
  opacity: var(--teo-website-journey-nav, 1);
  transition: opacity 0.25s ease;
}

body.teo-website-journey-active .teo-website-header:hover,
body.teo-website-journey-active .teo-website-header:focus-within,
body.teo-website-journey-active .teo-website-header.teo-website-menu-open {
  opacity: 1;
}

/* a touch screen has no hover to bring the hidden header back, so its links take no taps until it shows (scrolling up
   shows it: TeoWebsiteJourney.onScrolled) */
@media (hover: none) {
  body.teo-website-journey-nav-hidden .teo-website-header:not(.teo-website-menu-open):not(:focus-within) .teo-website-header-bar {
    pointer-events: none;
  }
}

/* where the header is the word mark and the menu button, the button stays on screen and takes taps all through the
   journey; the word mark and the solid layer fade with the name as the whole header does on wider screens */
@media (max-width: 1024px) {
  body.teo-website-journey-active .teo-website-header {
    opacity: 1;
  }

  body.teo-website-journey-active .teo-website-header .teo-website-brand {
    transition: opacity 0.25s ease;
  }

  body.teo-website-journey-active .teo-website-header:not(:hover):not(:focus-within):not(.teo-website-menu-open) .teo-website-brand,
  body.teo-website-journey-active .teo-website-header.teo-website-header-solid:not(:hover):not(:focus-within):not(.teo-website-menu-open)::before {
    opacity: var(--teo-website-journey-nav, 1);
  }

  body.teo-website-journey-active .teo-website-header .teo-website-menu-button {
    pointer-events: auto;
  }
}

/* the consent banner sits at the bottom of a first visit and publishes the room it takes (its height and its distance
   from the edge) as --teo-website-consent-height: the start controls move above it */

body:has(.teo-website-consent) .teo-website-journey-instructions {
  bottom: max(7svh, calc(var(--teo-website-consent-height, 112px) + 24px));
}

body:has(.teo-website-consent) .teo-website-journey-controls {
  bottom: calc(var(--teo-website-consent-height, 112px) + 12px);
}

@media (max-width: 760px) {
  .teo-website-journey-section {
    height: 800vh;
    height: 800svh;
  }

  .teo-website-journey-identity {
    top: 37vh;
    top: 37svh;
    width: calc(100% - 40px);
  }

  .teo-website-journey .teo-website-journey-title {
    font-size: 8vw;
  }

  .teo-website-journey-tagline {
    margin-top: 22px;
    font-size: 12px;
    letter-spacing: 0.16em;
  }

  .teo-website-journey-actions .teo-website-button {
    min-height: 44px;
    padding: 0 18px;
    font-size: 12px;
  }

  .teo-website-journey-instructions {
    bottom: 86px;
    width: calc(100% - 40px);
  }

  .teo-website-journey-instructions p {
    margin: 10px 0 14px;
  }

  .teo-website-journey-controls {
    right: 16px;
    bottom: 18px;
  }

  .teo-website-journey-control {
    padding: 8px 14px;
  }

  /* the instructions span the screen here: they keep the gap they have above the skip button without the banner */
  body:has(.teo-website-consent) .teo-website-journey-instructions {
    bottom: calc(var(--teo-website-consent-height, 112px) + 80px);
  }
}

/* landscape phones: the name and the start controls move closer to the edges */
@media (orientation: landscape) and (max-height: 520px) {
  .teo-website-journey-identity {
    top: 22vh;
    top: 22svh;
  }

  .teo-website-journey .teo-website-journey-title {
    font-size: 7vw;
  }

  .teo-website-journey-tagline {
    margin-top: 8px;
  }

  .teo-website-journey-actions {
    margin-top: 10px;
  }

  .teo-website-journey-instructions {
    bottom: 16px;
  }

  .teo-website-journey-mouse {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .teo-website-journey-mouse i {
    animation: none;
  }

  .teo-website-journey-opening,
  .teo-website-journey-instructions,
  .teo-website-journey-loader,
  .teo-website-journey-loader-blocks i,
  body.teo-website-journey-active .teo-website-header,
  body.teo-website-journey-active .teo-website-header .teo-website-brand {
    transition: none;
  }
}
