/* ═══════════════════════════════════════
   HELIA — heliaos.css
   Helia OS Desktop — Light Mode
═══════════════════════════════════════ */

#S-HOS {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(rgba(0,0,0,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.03) 1px, transparent 1px),
    var(--c);
  background-size: 40px 40px, 40px 40px, auto;
  padding: 80px 44px 60px;
}

/* ── TOP TEXT ── */
.HOS-TOP {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  z-index: 10;
}
/* ── MORPH TITLE ── */
.HOS-MORPH {
  position: relative;
  margin: 0 0 24px;
  min-height: clamp(80px, 14vw, 180px);
  perspective: 800px;
}
.HM-STATE {
  text-align: center;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
  transition: transform .7s cubic-bezier(.4,0,.1,1),
              opacity .5s cubic-bezier(.4,0,.1,1);
  transform-origin: center center;
  backface-visibility: hidden;
}

/* Hidden state — warped away */
.HM-STATE.hm-hidden {
  opacity: 0;
  transform: rotateX(-8deg) translateY(-20px) scale(.95);
  pointer-events: none;
}
.HM-STATE.hm-exit {
  opacity: 0;
  transform: rotateX(8deg) translateY(20px) scale(.95);
  pointer-events: none;
}

/* ── Eyebrow ── */
.HM-EY {
  font-family: var(--M);
  font-size: 9px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--m2);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.HM-EY::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--m2);
}

/* ── Big headline ── */
.HM-TI {
  font-size: clamp(30px, 4.5vw, 60px);
  font-weight: 900;
  letter-spacing: -2.5px;
  line-height: 1;
  margin-bottom: 10px;
}
.HM-TI-G {
  color: var(--g);
}

/* ── Description ── */
.HM-SU {
  font-size: 16px;
  color: var(--m);
  font-weight: 300;
  max-width: 560px;
  line-height: 1.7;
}

/* ── DEVICE TOGGLE ── */
.HOS-TOGGLE {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 24px;
  position: relative;
  z-index: 10;
  position: relative;
  z-index: 4;
}
.HOS-TOGGLE-BTN {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--F);
  font-size: 13px;
  font-weight: 600;
  color: var(--m);
  cursor: pointer;
  transition: all .25s cubic-bezier(.16,1,.3,1);
}
.HOS-TOGGLE-BTN:hover {
  background: rgba(255,255,255,.8);
  border-color: rgba(0,0,0,.12);
}
.HOS-TOGGLE-BTN.on {
  background: var(--k);
  color: var(--c);
  border-color: var(--k);
}
.HOS-TOGGLE-BTN.on svg { stroke: var(--c) }

/* ── DESKTOP FRAME ── */
.HOS-DESK {
  max-width: 920px;
  height: min(520px, 62vh);
  margin: 0 auto;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  /* Light wallpaper — subtle gradient */
  background:
    radial-gradient(ellipse at 30% 50%, rgba(139,92,246,.04) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 40%, rgba(45,212,191,.03) 0%, transparent 50%),
    linear-gradient(180deg, #f0ede6 0%, #e8e4db 100%);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 12px 48px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.03);
  transition: max-width .8s cubic-bezier(.4,0,.2,1),
              min-height .8s cubic-bezier(.4,0,.2,1),
              border-radius .6s cubic-bezier(.4,0,.2,1);
  will-change: max-width, min-height, border-radius;
}

/* Canvas behind everything */
.HOS-DESK canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
}

/* ── DESKTOP ICONS ── */
.HOS-ICONS {
  position: absolute;
  top: 12px; left: 12px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 6px;
  max-height: calc(100% - 60px);
  z-index: 3;
}
.HOS-DICON {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 56px;
  padding: 6px 2px;
  border-radius: 8px;
  transition: all .25s;
  cursor: default;
}
/* Icons always visible — no pop-in */
.HOS-DICON.show:hover { background: rgba(0,0,0,.04) }
.HOS-DICON.on { background: rgba(139,92,246,.08) }
.HOS-DICON-IMG {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  position: relative;
}
.HOS-DICON-NAME {
  font-size: 7px;
  font-weight: 600;
  color: var(--k);
  text-align: center;
  line-height: 1.2;
  letter-spacing: -.1px;
}
/* Notification dot on desktop icon */
.HOS-DICON-BADGE {
  position: absolute;
  top: -2px; right: -2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid #fff;
  opacity: 0; transform: scale(0);
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
}
.HOS-DICON-BADGE.show { opacity: 1; transform: scale(1) }

/* ── DOCK (bottom bar) ── */
.HOS-DOCK {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  padding: 5px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  z-index: 12;
}
.HOS-DI {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--k);
  transition: all .25s cubic-bezier(.16,1,.3,1);
}
.HOS-DI:hover { background: rgba(0,0,0,.05); transform: translateY(-2px) }
.HOS-DI.on { background: rgba(0,0,0,.06) }

/* ── WINDOWS ── */
.HOS-WIN {
  position: absolute;
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 8px 32px rgba(0,0,0,.07);
  overflow: hidden;
  opacity: 0;
  transform: scale(.93) translateY(6px);
  transition: opacity .5s cubic-bezier(.4,0,.2,1),
              transform .5s cubic-bezier(.4,0,.2,1),
              top .7s cubic-bezier(.4,0,.2,1),
              left .7s cubic-bezier(.4,0,.2,1),
              width .7s cubic-bezier(.4,0,.2,1),
              height .7s cubic-bezier(.4,0,.2,1),
              box-shadow .3s;
  z-index: 4;
  will-change: transform, opacity, top, left, width, height;
}
.HOS-WIN.show { opacity: 1; transform: scale(1) translateY(0) }
.HOS-WIN.front { z-index: 8; box-shadow: 0 12px 44px rgba(0,0,0,.1) }

/* Desktop positions */
#HOS-W-CHAT  { top: 20px;  left: 80px;  width: 220px; height: 240px }
#HOS-W-CAL   { top: 40px;  right: 16px; width: 210px; height: 230px }
#HOS-W-DASH  { top: 130px; left: 160px; width: 250px; height: 220px }
#HOS-W-LAGER { top: 70px;  left: 220px; width: 230px; height: 210px }
.HOS-WIN.flash { box-shadow: 0 0 0 2px rgba(139,92,246,.25), 0 12px 44px rgba(0,0,0,.1) }

/* Window topbar */
.HOS-WTB {
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 5px;
  border-bottom: 1px solid rgba(0,0,0,.04);
  background: rgba(255,255,255,.5);
}
.HOS-WTB-DOT { width: 7px; height: 7px; border-radius: 50% }
.HOS-WTB-DOT:nth-child(1) { background: #ff5f57 }
.HOS-WTB-DOT:nth-child(2) { background: #febc2e }
.HOS-WTB-DOT:nth-child(3) { background: #28c840 }
.HOS-WTB-TITLE {
  font-family: var(--M);
  font-size: 8px;
  font-weight: 600;
  color: var(--m);
  letter-spacing: .5px;
  margin-left: 4px;
}

/* Window content */
.HOS-WC { padding: 8px }

/* ── PLACEHOLDER SHAPES ── */
.HOS-PH-BAR { height: 6px; border-radius: 3px; background: rgba(0,0,0,.04) }
.HOS-PH-BUBBLE {
  padding: 6px 8px; border-radius: 8px; margin-bottom: 4px;
  background: rgba(0,0,0,.03);
}
.HOS-PH-BUBBLE.out { margin-left: 20%; background: rgba(139,92,246,.06) }
.HOS-PH-SEARCH {
  height: 24px; border-radius: 7px;
  background: rgba(0,0,0,.02);
  border: 1px solid rgba(0,0,0,.04);
  margin-bottom: 6px;
}
.HOS-PH-INPUT {
  height: 22px; border-radius: 7px;
  background: rgba(0,0,0,.02);
  border: 1px solid rgba(0,0,0,.04);
  margin-top: 6px;
  display: flex; align-items: center; padding: 0 6px; gap: 4px;
}
.HOS-PH-ICON-SQ {
  width: 12px; height: 12px; border-radius: 3px; background: rgba(0,0,0,.04);
}

/* Calendar */
.HOS-CAL-GRID { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; margin-bottom: 6px }
.HOS-CAL-DAY {
  aspect-ratio: 1; border-radius: 4px; background: rgba(0,0,0,.02);
  display: flex; align-items: center; justify-content: center;
  font-size: 6px; color: var(--m); font-family: var(--M);
}
.HOS-CAL-DAY.hi { background: rgba(139,92,246,.08); color: var(--g) }
.HOS-CAL-DAY.today { background: var(--g); color: #fff }
.HOS-CAL-EV { display: flex; align-items: center; gap: 4px; padding: 3px 0 }
.HOS-CAL-EV-DOT { width: 4px; height: 4px; border-radius: 50%; flex-shrink: 0 }
.HOS-CAL-EV-BAR { height: 4px; border-radius: 2px; background: rgba(0,0,0,.04); flex: 1 }

/* Dashboard */
.HOS-DASH-TILES { display: flex; gap: 4px; margin-bottom: 6px }
.HOS-DASH-TILE { flex: 1; padding: 6px; border-radius: 6px; background: rgba(0,0,0,.02) }
.HOS-DASH-TILE-N { font-family: var(--M); font-size: 12px; font-weight: 700; color: var(--k) }
.HOS-DASH-TILE-L { font-size: 6px; color: var(--m); text-transform: uppercase; letter-spacing: .5px }
.HOS-CHART { display: flex; align-items: flex-end; gap: 3px; height: 36px; margin-bottom: 6px }
.HOS-CHART-BAR { flex: 1; border-radius: 2px 2px 0 0; background: rgba(139,92,246,.12) }
.HOS-TROW { display: flex; gap: 4px; padding: 3px 0; border-bottom: 1px solid rgba(0,0,0,.03); align-items: center }
.HOS-TROW-DOT { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0 }
.HOS-TROW-BAR { height: 4px; border-radius: 2px; background: rgba(0,0,0,.04) }

/* Alert */
.HOS-ALERT {
  padding: 4px 8px; border-radius: 5px; font-size: 7px; font-weight: 600;
  color: rgba(234,88,12,.8); background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.12); margin-bottom: 6px;
  display: flex; align-items: center; gap: 4px;
}
.HOS-ALERT.success {
  color: rgba(34,197,94,.8); background: rgba(34,197,94,.06);
  border-color: rgba(34,197,94,.12);
}

/* ── AI COMMAND BAR ── */
.HOS-CMD {
  position: absolute;
  top: 35%; left: 50%;
  transform: translateX(-50%);
  width: 60%;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 12px 40px rgba(0,0,0,.1), 0 0 40px rgba(139,92,246,.04);
  z-index: 50;
  opacity: 0;
  transform: translateX(-50%) scale(.95);
  transition: all .35s cubic-bezier(.16,1,.3,1);
}
.HOS-CMD.show { opacity: 1; transform: translateX(-50%) scale(1) }
.HOS-CMD-TOP { display: flex; align-items: center; gap: 6px; margin-bottom: 4px }
.HOS-CMD-ICON {
  width: 16px; height: 16px; border-radius: 4px;
  background: rgba(139,92,246,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: var(--g);
}
.HOS-CMD-LABEL {
  font-family: var(--M); font-size: 7px; font-weight: 600;
  color: var(--m); letter-spacing: 1px; text-transform: uppercase;
}
.HOS-CMD-TEXT { font-size: 12px; color: var(--k); font-weight: 500; min-height: 16px }
.HOS-CMD-CURSOR {
  display: inline-block; width: 1px; height: 13px;
  background: var(--g); margin-left: 1px;
  animation: hosCBlink .6s infinite; vertical-align: text-bottom;
}
@keyframes hosCBlink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }

/* ═══════════════════════════════════════
   PHONE MORPH — no frame, just narrower
═══════════════════════════════════════ */

.HOS-DESK.phone {
  max-width: 300px;
  min-height: min(480px, 62vh);
  border-radius: 24px;
}

/* In phone: fade out desktop icons + cmd */
.HOS-DESK.phone .HOS-ICONS,
.HOS-DESK.phone .HOS-CMD {
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}

/* Windows morph to stacked cards — JS sets top per window */
.HOS-DESK.phone .HOS-WIN {
  left: 12px !important;
  width: calc(100% - 24px) !important;
  height: 70px !important;
  border-radius: 10px;
  z-index: 4;
  transition: top .5s cubic-bezier(.4,0,.2,1),
              left .5s cubic-bezier(.4,0,.2,1),
              width .5s cubic-bezier(.4,0,.2,1),
              height .5s cubic-bezier(.4,0,.2,1),
              box-shadow .3s,
              opacity .4s !important;
}
.HOS-DESK.phone .HOS-WC {
  overflow: hidden;
  max-height: 40px;
  transition: max-height .5s cubic-bezier(.4,0,.2,1);
}
/* Expand active card */
.HOS-DESK.phone .HOS-WIN.front {
  height: 140px !important;
  z-index: 6 !important;
  box-shadow: 0 6px 24px rgba(0,0,0,.07);
}
.HOS-DESK.phone .HOS-WIN.front .HOS-WC {
  max-height: 110px;
}

/* Voice elements hidden */
.HOS-VOICE { display: none }

/* ── FLOATING APPS (tight around phone, fade pattern like network outer ring) ── */
.HOS-FLOAT {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.HOS-FLOAT-APP {
  position: absolute;
  width: 36px; height: 36px;
  border-radius: 9px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
}
/* Fade pattern: closer = more visible, further = ghostly */
.HOS-FLOAT-APP.show:nth-child(-n+4) { opacity: .55 }
.HOS-FLOAT-APP.show:nth-child(n+5) { opacity: .3 }
.HOS-FLOAT-APP.show { transform: scale(1) }
.HOS-FLOAT-APP.show:nth-child(1) { animation: hosF1 3.5s ease-in-out infinite; transition-delay: 0s }
.HOS-FLOAT-APP.show:nth-child(2) { animation: hosF2 4s ease-in-out infinite; transition-delay: .08s }
.HOS-FLOAT-APP.show:nth-child(3) { animation: hosF1 4.2s ease-in-out infinite; transition-delay: .16s }
.HOS-FLOAT-APP.show:nth-child(4) { animation: hosF2 3.8s ease-in-out infinite; transition-delay: .24s }
.HOS-FLOAT-APP.show:nth-child(5) { animation: hosF1 4.5s ease-in-out infinite; transition-delay: .1s }
.HOS-FLOAT-APP.show:nth-child(6) { animation: hosF2 3.6s ease-in-out infinite; transition-delay: .18s }
.HOS-FLOAT-APP.show:nth-child(7) { animation: hosF1 4.1s ease-in-out infinite; transition-delay: .26s }
.HOS-FLOAT-APP.show:nth-child(8) { animation: hosF2 3.9s ease-in-out infinite; transition-delay: .06s }
@keyframes hosF1 { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-5px) } }
@keyframes hosF2 { 0%,100% { transform: translate(0) } 50% { transform: translate(-3px,-4px) } }
.HOS-FLOAT-APP img { width: 16px; height: 16px }

/* ── STORE BADGES (Flutter/NCTA style) ── */
.HOS-STORES {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  position: relative;
  z-index: 3;
  opacity: 0;
  transform: translateY(10px);
  transition: all .6s cubic-bezier(.16,1,.3,1);
  flex-wrap: wrap;
}
.HOS-STORES.show { opacity: 1; transform: translateY(0) }
.HOS-STORE {
  font-family: var(--M);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 10px 18px;
  background: var(--k);
  color: var(--c);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
  border: none;
  cursor: pointer;
}
.HOS-STORE:hover { background: var(--g); color: #fff }
.HOS-STORE svg { flex-shrink: 0 }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  #S-HOS { padding: 60px 16px 40px }
  .HOS-MORPH { min-height: clamp(80px, 20vw, 140px) }
  .HM-TI { font-size: clamp(24px, 6vw, 40px) }
  .HM-SU { font-size: 14px }
  .HOS-TOGGLE-BTN { padding: 6px 14px; font-size: 12px }
  .HOS-TOGGLE { margin-bottom: 16px }
  .HOS-DESK { height: min(400px, 55vh) }
  .HOS-DESK.phone { max-width: 260px; height: min(440px, 60vh) }
  .HOS-ICONS { gap: 4px }
  .HOS-DICON { width: 44px; padding: 4px 1px }
  .HOS-DICON-IMG { width: 28px; height: 28px; font-size: 13px; border-radius: 7px }
  .HOS-DICON-NAME { font-size: 6px }
  .HOS-CMD { width: 80% }
  .HOS-DI { width: 26px; height: 26px; font-size: 12px }
  .HOS-FLOAT-APP { width: 30px; height: 30px }
  .HOS-FLOAT-APP img { width: 14px; height: 14px }
  .HOS-STORE { padding: 8px 14px; font-size: 8px }
}
