/* ocean.css – TC Chemie Greiz: canvas, dive intro and depth gauge (owned by ocean.js) */

#ocean-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;                     /* large viewport: the canvas box never changes when the mobile URL bar moves */
  z-index: 0;
  display: block;
  pointer-events: none;
  background: var(--c-deep, #062a43);
}

/* ------------------------------------------------------------ dive intro */
.dive-intro {
  --dv: var(--dive, 0);               /* ocean.js sets --dive on this element */
  position: relative;
  z-index: 1;
  height: 100vh;                      /* without JS / canvas: one static screen */
  margin: 0;
}
.js .dive-intro { height: 360vh; }    /* scroll-scrubbed jump (the .js class is set in <head>: no layout jump) */
/* short viewports (landscape phones): at least 1900 px, so the way back and the climb-out get enough scroll */
.js .dive-intro { height: max(360vh, 1900px); }

.dive-intro__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;                     /* small viewport: title, motto and hint never hide under the mobile URL bar */
  overflow: hidden;
}

.dive-intro__title {
  position: absolute;
  right: clamp(1.5rem, 6vw, 7rem);
  top: 21vh;
  max-width: min(46rem, 52vw);
  text-align: right;
  color: var(--c-navy, #041421);
  opacity: clamp(0, calc((0.28 - var(--dv)) * 9), 1);
  transform: translate3d(0, calc(var(--dv) * -55vh), 0);
  will-change: transform, opacity;
}

.dive-intro__kicker {
  margin: 0 0 1rem;
  font-family: var(--font-body, "Inter", system-ui, sans-serif);
  font-size: clamp(0.72rem, 0.9vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-ocean, #0b4f75);
}

.dive-intro__kicker::before {
  content: "";
  display: inline-block;
  width: 2.4em;
  height: 2px;
  margin-right: 0.9em;
  vertical-align: middle;
  background: var(--c-coral, #ff6b3d);
  border-radius: 2px;
}

.dive-intro__title h1 {
  margin: 0;
  font-family: var(--font-head, "Outfit", system-ui, sans-serif);
  font-weight: 800;
  font-size: clamp(3rem, 8.2vw, 8.4rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
  background: linear-gradient(170deg, var(--c-navy, #041421) 15%, var(--c-ocean, #0b4f75) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-wrap: balance;
}

.dive-intro__motto {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 13vh;
  padding: 0 1.5rem;
  text-align: center;
  color: var(--c-foam, #e9f8fc);
  opacity: clamp(0, calc((var(--dv) - 0.6) * 9), 1);
  transform: translate3d(0, calc((1 - clamp(0, (var(--dv) - 0.6) * 9, 1)) * 4vh), 0);
  pointer-events: none;
}

.dive-intro__motto p {
  margin: 0;
  font-family: var(--font-head, "Outfit", system-ui, sans-serif);
  font-weight: 700;
  font-size: clamp(2rem, 5.4vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 30px rgba(4, 20, 33, 0.45);
}

.dive-intro__motto strong {
  font-weight: 800;
  background: linear-gradient(100deg, var(--c-sun, #ffd166), var(--c-coral, #ff6b3d));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgba(4, 20, 33, 0.35));
}

.dive-intro__hint {
  position: absolute;
  left: 50%;
  bottom: 4.5vh;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body, "Inter", system-ui, sans-serif);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  /* dark pill: white 12.5 px text on bright water would only reach ~2.5:1 */
  padding: 0.45rem 1rem 0.55rem;
  border-radius: 22px;
  background: rgba(4, 20, 33, 0.48);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: clamp(0, calc((0.07 - var(--dv)) * 18), 1);
  white-space: nowrap;
  pointer-events: none;
}

.dive-intro__hint::after {
  content: "";
  width: 18px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  background: radial-gradient(circle at 50% 30%, #fff 0 3px, transparent 3.5px) no-repeat;
  background-size: 100% 100%;
  animation: ocean-hint 1.8s ease-in-out infinite;
}

@keyframes ocean-hint {
  0%, 100% { background-position: 0 0; }
  50% { background-position: 0 7px; }
}

@media (max-width: 719px) {
  .dive-intro__title {
    left: 1.25rem;
    right: 1.25rem;
    top: 12vh;
    max-width: none;
    text-align: center;
  }
  /* slower rise and an earlier fade: the opaque title is gone before it reaches the header */
  .dive-intro__title {
    transform: translate3d(0, calc(var(--dv) * -22vh), 0);
    opacity: clamp(0, calc((0.15 - var(--dv)) * 12), 1);
  }
  .dive-intro__kicker { font-size: 0.72rem; letter-spacing: 0.16em; margin-bottom: 0.7rem; color: var(--c-navy, #041421); }
  .dive-intro__kicker::before { display: none; }
  .dive-intro__title h1 { font-size: clamp(2.6rem, 13vw, 4rem); }
  .dive-intro__motto { bottom: 16vh; }
}

/* ----------------------------------------------------------- depth gauge */
#depth-gauge {
  position: fixed;
  right: clamp(10px, 1.6vw, 26px);
  top: 50%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 8px 12px;
  border-radius: 999px;
  background: rgba(4, 20, 33, 0.45);
  border: 1px solid rgba(233, 248, 252, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--c-foam, #e9f8fc);
  font-family: var(--font-body, "Inter", system-ui, sans-serif);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(14px, -50%, 0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#depth-gauge.is-on { opacity: 1; transform: translate3d(0, -50%, 0); }

#depth-gauge .dg-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.75;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

#depth-gauge .dg-track {
  position: relative;
  width: 2px;
  height: clamp(120px, 26vh, 240px);
  background: rgba(233, 248, 252, 0.22);
  border-radius: 2px;
}

#depth-gauge .dg-track i {
  position: absolute;
  left: -5px;
  width: 12px;
  height: 1px;
  background: rgba(233, 248, 252, 0.5);
}

#depth-gauge .dg-track i em {
  position: absolute;
  right: 16px;
  top: -0.5em;
  font-style: normal;
  font-size: 0.56rem;
  line-height: 1;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

#depth-gauge .dg-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 0;
  border-radius: 2px;
  background: linear-gradient(var(--c-aqua, #19b8d2), var(--c-coral, #ff6b3d));
}

#depth-gauge .dg-marker {
  position: absolute;
  left: 50%;
  top: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--c-coral, #ff6b3d);
  box-shadow: 0 0 0 3px rgba(255, 107, 61, 0.25), 0 0 14px rgba(255, 107, 61, 0.7);
}

#depth-gauge .dg-value {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#depth-gauge .dg-value b {
  font-family: var(--font-head, "Outfit", system-ui, sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
}

#depth-gauge .dg-value small {
  font-size: 0.58rem;
  opacity: 0.7;
  margin-top: 2px;
}

/* phones and tablets: a slim 3 px progress rail at the right edge instead of the pill – never over the text */
@media (max-width: 1023px) {
  #depth-gauge {
    display: block;
    top: calc(var(--header-h, 66px) + 10px);
    bottom: 12px;
    right: 3px;
    width: 3px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: rgba(233, 248, 252, 0.14);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transform: translate3d(6px, 0, 0);
  }
  #depth-gauge.is-on { transform: none; }
  #depth-gauge .dg-label, #depth-gauge .dg-value, #depth-gauge .dg-track i { display: none; }
  #depth-gauge .dg-track { position: absolute; inset: 0; width: 3px; height: auto; background: none; }
  #depth-gauge .dg-fill { width: 3px; }
  #depth-gauge .dg-marker { width: 8px; height: 8px; margin: -4px 0 0 -4px; box-shadow: 0 0 0 2px rgba(255, 107, 61, 0.25), 0 0 8px rgba(255, 107, 61, 0.6); }
}

/* -------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .dive-intro, .js .dive-intro { height: 100vh; }
  .dive-intro__hint::after { animation: none; }
}

/* reduced motion, no JS, no canvas: a static first screen with a light title on a dark scrim */
html.ocean-reduced .dive-intro, html.ocean-off .dive-intro { height: 100vh; }
html.ocean-reduced .dive-intro__title, html.ocean-off .dive-intro__title, :root:not(.js) .dive-intro__title {
  opacity: 1;
  transform: none;
  color: var(--c-foam, #e9f8fc);
  padding: 1.1rem 1.5rem;
  border-radius: 24px;
  background: rgba(4, 20, 33, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
html.ocean-reduced .dive-intro__title h1, html.ocean-off .dive-intro__title h1, :root:not(.js) .dive-intro__title h1 {
  background: none; -webkit-text-fill-color: currentColor; text-shadow: 0 2px 24px rgba(4, 20, 33, 0.5);
}
html.ocean-reduced .dive-intro__kicker, html.ocean-off .dive-intro__kicker, :root:not(.js) .dive-intro__kicker { color: var(--c-foam, #e9f8fc); }
html.ocean-reduced .dive-intro__motto, html.ocean-off .dive-intro__motto, :root:not(.js) .dive-intro__motto { opacity: 1; transform: none; }
html.ocean-reduced .dive-intro__hint, html.ocean-off .dive-intro__hint, :root:not(.js) .dive-intro__hint { display: none; }
html.ocean-reduced #depth-gauge { transition: none; }
