/* parallax-hero.css — Floating Parallax Scene (Hero) */

/* ─── Scene ─────────────────────────────────────────────── */
#parallax-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Fixed-size cluster — same as original 900×600 scene,
   so all %-positions inside match test-header.html exactly */
#device-cluster {
  position: absolute;
  top: 50%;
  left: 36%;
  transform: translateY(-50%);
  transform-origin: left center;
  width: 900px;
  height: 600px;
  perspective: 1200px;
  z-index: 2;
  pointer-events: none;
}

/* Radial glow */
#parallax-scene::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: radial-gradient(ellipse 60% 50% at 65% 55%,
    rgba(99, 60, 255, 0.22) 0%,
    rgba(60, 120, 255, 0.12) 51%,
    transparent 90%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Parallax layer system ──────────────────────────────── */
.p-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.08s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}
.smartphone-wrap, .tablet-wrap, .editor-wrap, .smartwatch-wrap {
  pointer-events: auto;
  z-index: 2;
  position: absolute;
}

/* ─── Device base ────────────────────────────────────────── */
.p-device {
  position: relative;
  border-radius: 22px;
  will-change: transform;
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1),
              box-shadow .35s ease;
}
.p-device:hover {
  transform: scale(1.07);
  z-index: 20;
}

/* Device float wrappers */
.smartphone-wrap,
.tablet-wrap,
.editor-wrap {
  position: absolute;
}
.smartphone-wrap { top: 8%; left: 45%; animation: ph-float-a 5.2s ease-in-out infinite; }
.tablet-wrap     { top:  14%; left: 56%; animation: ph-float-c 6s   ease-in-out infinite; }
.editor-wrap     { top: 53%; left: 49%; animation: ph-float-d 5.6s ease-in-out infinite; }

/* ─── Smartphone ─────────────────────────────────────────── */
.p-smartphone {
  width: 130px;
  height: 254px;
  border-radius: 24px;
  background: linear-gradient(160deg, #1e1e2e 0%, #141420 100%);
  border: 1.5px solid rgba(255,255,255,.12);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.6),
    0 30px 80px rgba(0,0,0,.65),
    0 8px 24px rgba(0,0,0,.4),
    inset 0 1px 0 rgba(255,255,255,.07);
}
.p-smartphone::before {
  content: '';
  position: absolute;
  top: 10px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 6px;
  background: rgba(0,0,0,.8);
  border-radius: 10px;
}
.phone-screen {
  position: absolute;
  inset: 5px;
  border-radius: 16px;
  overflow: hidden;
}
.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.phone-elements {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.8);
  width: 110%;
  pointer-events: none;
  transition: transform .4s cubic-bezier(.34, 1.4, .64, 1);
  z-index: 10;
}
.phone-elements img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.35));
}
.smartphone-wrap:hover .phone-elements {
  transform: translate(-50%, -50%) scale(1.25);
}

/* ─── Smartwatch ─────────────────────────────────────────── */
.smartwatch-wrap {
  position: absolute;
  top: 53%;
  left: 37%;
  animation: ph-float-b 4.8s ease-in-out infinite;
}
.p-smartwatch {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #2a2a2a 0%, #0e0e0e 60%, #080808 100%);
  border: 1.5px solid rgba(255,255,255,.08);
  box-shadow:
    0 0 0 2px #060606,
    0 0 0 3px rgba(255,255,255,.06),
    0 24px 64px rgba(0,0,0,.85),
    0 6px 18px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.1);
  position: relative;
}
.watch-band {
  position: absolute;
  left: 25px;
  width: 67px;
  height: 50px;
  background: linear-gradient(180deg, #1c1c1c 0%, #111111 100%);
  border: 1px solid rgba(255,255,255,.05);
}
.watch-band-top {
  top: -36px;
  border-radius: 12px 12px 0 0;
  clip-path: polygon(10px 0%, calc(100% - 10px) 0%, 100% 100%, 0% 100%);
}
.watch-band-bot {
  bottom: -36px;
  border-radius: 0 0 12px 12px;
  clip-path: polygon(0% 0%, 100% 0%, calc(100% - 10px) 100%, 10px 100%);
}
.watch-screen {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #050508;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#wcanvas {
  display: block;
  width: 95px;
  height: 95px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: opacity .25s ease;
}
.smartwatch-wrap:hover #wcanvas {
  opacity: 0;
}
.watch-vinyl {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #08080f;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.smartwatch-wrap:hover .watch-vinyl {
  opacity: 1;
}
.vinyl-disc {
  width: 95px; height: 95px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 28%, rgba(0,0,0,.45) 29%, rgba(0,0,0,.45) 30%, transparent 31%),
    radial-gradient(circle at 50% 50%, transparent 36%, rgba(0,0,0,.35) 37%, rgba(0,0,0,.35) 38%, transparent 39%),
    radial-gradient(circle at 50% 50%, transparent 44%, rgba(0,0,0,.3)  45%, rgba(0,0,0,.3)  46%, transparent 47%),
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(0,0,0,.25) 53%, rgba(0,0,0,.25) 54%, transparent 55%),
    url('images/startpage/album cover.jpg') center/cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 4px 16px rgba(0,0,0,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ph-spin 3s linear infinite;
  animation-play-state: paused;
}
.smartwatch-wrap:hover .vinyl-disc {
  animation-play-state: running;
}
.vinyl-label {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #08080f;
  box-shadow: 0 0 0 1px rgba(255,255,255,.25);
}
.watch-track {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  text-align: center;
  font-size: 6.5px;
  line-height: 1.7;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .3s ease .1s, transform .3s ease .1s;
  pointer-events: none;
  font-family: -apple-system, 'SF Pro Display', sans-serif;
}
.smartwatch-wrap:hover .watch-track {
  opacity: 1;
  transform: translateY(0);
}
.watch-crown {
  position: absolute;
  right: -6px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 16px;
  background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 100%);
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 2px 0 6px rgba(0,0,0,.5);
}

/* ─── Tablet ─────────────────────────────────────────────── */
.p-tablet {
  width: 386px;
  height: 237px;
  border-radius: 18px;
  background: linear-gradient(160deg, #0a0a0a 0%, #0f0f1e 100%);
  border: 1.5px solid rgba(255,255,255,.1);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.6),
    0 30px 80px rgba(0,0,0,.7),
    0 8px 24px rgba(0,0,0,.4),
    inset 0 1px 0 rgba(255,255,255,.06);
}
.tacho-ui {
  position: absolute;
  inset: 8px 10px;
  border-radius: 10px;
  background: url('images/startpage/tachostation.png') center/contain no-repeat;
  background-color: #06060b;
  overflow: hidden;
}
.tacho-gif {
  position: absolute;
  top: 53%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 68%;
  object-fit: cover;
  z-index: 1;
}
.tacho-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0,0,0,0);
  transition: background .3s ease;
  pointer-events: none;
  z-index: 3;
}
.tablet-wrap:hover .tacho-overlay {
  background: rgba(0,0,0,.35);
}
.tacho-glare {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(148deg,
    rgba(255,255,255,0.16) 0%,
    rgba(255,255,255,.09) 9%,
    transparent 32%
  );
}
.tacho-glare::before {
  content: '';
  position: absolute;
  top: -18px; left: -30px;
  width: 55%; height: 42px;
  background: rgba(255,255,255,.08);
  transform: rotate(-28deg);
  filter: blur(70px);
  border-radius: 50%;
}
.tacho-glare::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 40%; height: 35%;
  background: radial-gradient(ellipse at 80% 90%, rgba(255,255,255,.06) 0%, transparent 60%);
}
.tacho-datetime {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.tacho-day  { font-size: 8px; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; }
.tacho-date { font-size: 8px; font-weight: 700; letter-spacing: -.01em; }
.tacho-time { font-size: 8px; font-weight: 400; letter-spacing: .02em; opacity: .85; }
.tablet-popup {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -46%) scale(.92);
  width: 190px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,.7), 0 4px 12px rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .3s ease, transform .3s cubic-bezier(.34,1.2,.64,1);
  pointer-events: none;
  z-index: 20;
}
.tablet-popup img { display: block; width: 100%; }
.tablet-wrap:hover .tablet-popup {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ─── Code Editor ────────────────────────────────────────── */
.p-editor {
  width: 315px;
  height: 242px;
  border-radius: 14px;
  background: #0d0d16;
  border: 1.5px solid rgba(255,255,255,.08);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.6),
    0 30px 80px rgba(0,0,0,.65),
    inset 0 1px 0 rgba(255,255,255,.05);
  overflow: hidden;
  transition: height .28s cubic-bezier(.4, 0, .2, 1),
              transform .35s cubic-bezier(.34, 1.56, .64, 1),
              box-shadow .35s ease;
}
.editor-wrap:hover .p-editor {
  height: 296px;
}
.editor-bar {
  height: 26px;
  background: #131320;
  border-bottom: 1px solid rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
}
.ed-dot { width: 7px; height: 7px; border-radius: 50%; }
.ed-dot:nth-child(1) { background: rgba(239,68,68,.7); }
.ed-dot:nth-child(2) { background: rgba(234,179,8,.7); }
.ed-dot:nth-child(3) { background: rgba(34,197,94,.7); }
.ed-tab {
  margin-left: 8px;
  height: 18px; padding: 0 10px;
  border-radius: 4px 4px 0 0;
  background: rgba(99,102,241,.15);
  border: 1px solid rgba(99,102,241,.2);
  border-bottom: none;
  font-size: 8px;
  color: rgba(255,255,255,.5);
  display: flex; align-items: center;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.editor-code {
  padding: 8px 14px 6px;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 8.5px;
  line-height: 1.7;
  color: rgba(255,255,255,.7);
}
.e-kw  { color: #c678dd; }
.e-fn  { color: #61afef; }
.e-var { color: #e06c75; }
.editor-code table { border-collapse: collapse; }
.editor-code td:first-child {
  color: rgba(255,255,255,.15);
  padding-right: 10px;
  user-select: none;
  text-align: right;
  min-width: 16px;
}
.terminal-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 0 10px;
}
.terminal-shell {
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 10px;
  line-height: 1.65;
}
.terminal-log {
  overflow: hidden;
  height: 0;
  transition: height .28s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.editor-wrap:hover .terminal-log {
  height: 52px;
}
.terminal-live {
  height: 22px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 0;
  white-space: nowrap;
  overflow: hidden;
}
.terminal-log .t-line {
  display: flex;
  gap: 0;
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
}
.terminal-log .t-line.new { animation: ph-fadein .15s ease; }
.t-lnum { color: rgba(255,255,255,.15); min-width: 20px; text-align: right; margin-right: 10px; user-select: none; }
.t-kw   { color: #c678dd; }
.t-fn   { color: #61afef; }
.t-key  { color: #e06c75; }
.t-num  { color: #d19a66; }
.t-pun  { color: rgba(255,255,255,.4); }
.p-cursor {
  display: inline-block;
  width: 1px; height: 9px;
  background: #6366f1;
  vertical-align: middle;
  animation: ph-blink 1.1s step-end infinite;
}

/* ─── Ambient orbs ───────────────────────────────────────── */
.p-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.p-orb-1 {
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(99,60,255,.18) 0%, transparent 70%);
  top: -5%; left: 30%;
  filter: blur(20px);
  animation: ph-float-a 7s ease-in-out infinite;
}
.p-orb-2 {
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(60,120,255,.14) 0%, transparent 70%);
  bottom: 5%; right: 20%;
  filter: blur(14px);
  animation: ph-float-b 5.5s ease-in-out infinite;
}

/* ─── Keyframes ──────────────────────────────────────────── */
@keyframes ph-float-a {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-12px) rotate(.5deg); }
  66%       { transform: translateY(-6px) rotate(-.3deg); }
}
@keyframes ph-float-b {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  40%       { transform: translateY(-9px) rotate(-.4deg); }
  70%       { transform: translateY(-16px) rotate(.3deg); }
}
@keyframes ph-float-c {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-14px) rotate(.4deg); }
}
@keyframes ph-float-d {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  45%       { transform: translateY(-10px) rotate(-.5deg); }
  80%       { transform: translateY(-5px) rotate(.2deg); }
}
@keyframes ph-spin {
  to { transform: rotate(360deg); }
}
@keyframes ph-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
@keyframes ph-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─────────────────────────────────────────── */

/* ≥1400px: center text + devices as one composed unit
   Composition = 1100px; left edge = (100vw - 1100px) / 2
   Text occupies first ~440px, cluster starts at +480px       */
@media (min-width: 1400px) {
  .hero-content {
    padding-left: calc((100vw - 1100px) / 2);
    padding-right: 2rem;
    max-width: calc((100vw - 1100px) / 2 + 440px);
  }
  #device-cluster {
    left: calc((100vw - 1100px) / 2 + 480px);
    transform: translateY(-50%);
  }
}

/* 861–1399px: keep text from overlapping devices, scale cluster down */
@media (min-width: 861px) and (max-width: 1399px) {
  .hero-content {
    max-width: clamp(300px, 35vw, 520px);
  }
}

/* Scale cluster as viewport narrows — origin: left center keeps it anchored */
@media (max-width: 1399px) {
  #device-cluster {
    transform: translateY(-50%) scale(0.88);
  }
}
@media (max-width: 1200px) {
  #device-cluster {
    transform: translateY(-50%) scale(0.75);
  }
}
@media (max-width: 1024px) {
  #device-cluster {
    transform: translateY(-50%) scale(0.62);
  }
}

/* Hide cluster below 860px, restore hero text width */
@media (max-width: 860px) {
  #parallax-scene {
    display: none;
  }
  .hero-content {
    max-width: 860px;
  }
}
