@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@100..900&family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Palette & Constants */
:root {
  --bg-dark: #070709;
  --text-main: #D9D9D0;
  --text-dim: #77766E;
  --accent-color: #D9D9D0;
  --accent-blue: #7FA8F8;
  
  --font-display: 'Big Shoulders Display', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --cabinet-gradient: linear-gradient(155deg, rgba(22, 22, 25, 0.5) 0%, rgba(14, 14, 16, 0.62) 55%, rgba(6, 6, 8, 0.75) 100%);
  --base-shadow: 0 14px 30px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.06);
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.15s ease;
}

/* Base Setup */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background-color: var(--bg-dark);
}

body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: transparent;
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Fullscreen Ambient background */
#bg-ambient-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -2;
  pointer-events: none;
  opacity: 0.15;
  mix-blend-mode: screen;
}

.bg-studio-photo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url('bg_studio.jpg');
  background-size: cover;
  background-position: center;
  filter: grayscale(100%) brightness(0.48) contrast(1.1) blur(1.5px);
  opacity: 0.45;
  z-index: -3;
  pointer-events: none;
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 70% 30%, rgba(7, 7, 9, 0.45) 0%, rgba(4, 4, 6, 0.85) 100%);
  z-index: -1;
  pointer-events: none;
}

/* Fullscreen Container */
.fullscreen-container {
  display: grid;
  grid-template-columns: 1fr minmax(auto, 560px);
  height: 100vh;
  height: 100dvh;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 3rem;
  align-items: center;
  gap: 3.5rem;
  position: relative;
  z-index: 1;
}

/* Branding panel */
.branding-panel {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  width: 100%;
}

.brand-header {
  margin-bottom: 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.brand-logo {
  width: 52px;
  height: 52px;
  margin-bottom: 1.2rem;
  filter: drop-shadow(0 0 12px rgba(127, 168, 248, 0.4));
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.brand-logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 16px rgba(127, 168, 248, 0.6));
}

.brand-title {
  font-family: var(--font-display);
  font-size: 5.5rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 0 35px rgba(255, 255, 255, 0.12);
  cursor: default;
  transition: var(--transition-smooth);
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.brand-title span {
  display: inline-block;
  line-height: 1;
}

.brand-title:hover {
  text-shadow: 0 0 45px rgba(255, 255, 255, 0.35);
}

.brand-subtitle {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 4px;
  color: var(--accent-blue);
  margin-top: 0.4rem;
  text-shadow: 0 0 10px rgba(127, 168, 248, 0.25);
  text-transform: uppercase;
}

.brand-description-intro {
  font-size: 1.3rem;
  color: #e2e8f0;
  line-height: 1.6;
  max-width: 100%;
  width: 100%;
  font-weight: 400;
  transition: opacity 0.4s ease, height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
}

.brand-description-action {
  font-size: 1.05rem;
  color: #e2e8f0;
  line-height: 1.6;
  max-width: 100%;
  width: 100%;
  font-weight: 400;
  transition: opacity 0.4s ease, height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
}

.brand-description-intro {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  margin-bottom: 1.2rem;
}

.brand-description-action {
  text-align: left;
  hyphens: none;
  -webkit-hyphens: none;
  white-space: nowrap;
  margin-bottom: 2.5rem;
}

.brand-description .contact-link {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 0.3rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  line-height: 1;
  border-radius: 0;
}

.branding-actions {
  display: flex;
  gap: 0.8rem;
}

.desktop-only {
  display: flex;
}

.mobile-only {
  display: none !important;
}

.contact-link, .studio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1.6rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.75rem;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  transition: var(--transition-smooth);
}

.contact-link:hover, .studio-btn:hover {
  background: var(--text-main);
  border-color: transparent;
  color: #070709;
  box-shadow: 0 5px 25px rgba(217, 217, 208, 0.2);
  transform: translateY(-2px);
}

.contact-link:active, .studio-btn:active {
  transform: scale(0.95);
}

/* Media Player Panel Column */
.player-panel {
  display: flex;
  justify-content: center;
  width: 100%;
}

.player-layout-wrapper {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: max-width 0.4s ease;
}

/* 1. Pill Controls Bar */
.player-controls-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40; /* Floating on top of screen content */
  display: flex;
  align-items: stretch; /* Stretch buttons vertically */
  justify-content: center;
  gap: 0; /* Continuous dock with dividers */
  background: linear-gradient(180deg, rgba(16, 16, 20, 0.75) 0%, rgba(8, 8, 10, 0.35) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding: 0; /* Symmetrical edge alignment */
  height: 80px; /* Fixed status-bar height */
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0), inset 0 1px 0 rgba(255, 255, 255, 0);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.player-controls-bar:hover {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.player-ctrl-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1; /* Equal cell width */
  height: 100%;
  border-radius: 0; /* Sharp dock cells */
  transition: var(--transition-fast);
  outline: none;
}

.player-ctrl-btn:first-of-type {
  border-top-left-radius: 11px; /* Match outer rounded corner */
}

.player-ctrl-btn:last-of-type {
  border-top-right-radius: 11px;
}

.player-ctrl-btn svg {
  width: 58px;
  height: 58px;
  transition: transform 0.15s ease;
}

#btn-shuffle svg {
  width: 92px;
  height: 58px;
}

@media (hover: hover) {
  .player-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

.player-ctrl-btn:active {
  background: rgba(255, 255, 255, 0.14);
}

.player-ctrl-btn:active svg {
  transform: scale(0.9);
}

.bar-divider {
  width: 1px;
  height: 100%; /* Stretch completely to draw clean cell borders */
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

/* Shuffle wobble keyframe */
@keyframes rmkShuffleWobble {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(-18deg); }
  45% { transform: rotate(14deg); }
  70% { transform: rotate(-8deg); }
  100% { transform: rotate(0deg); }
}

.rmk-shuffle-wobble {
  animation: rmkShuffleWobble 480ms ease-out;
}

/* 2. Media Cabinet Frame */
.media-cabinet {
  width: 100%;
  border-radius: 24px;
  background: var(--cabinet-gradient);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  flex-direction: column;
  padding: 0.9rem;
  box-sizing: border-box;
  box-shadow: var(--base-shadow);
  border-top: 1px solid rgba(255,255,255,0.18);
  transition: height 0.4s ease, padding 0.4s ease, flex 0.4s ease, border-radius 0.4s ease;
}

/* 3. Screen Box (4:3 aspect ratio) */
.screen-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: #020202;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.6), inset 0 4px 14px rgba(0,0,0,0.7);
  transition: aspect-ratio 0.4s ease, border-radius 0.4s ease;
}

/* Screen elements layers */
#player-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.speaker-layout {
  position: absolute;
  top: 80px;
  left: 0;
  width: 100%;
  height: calc(100% - 80px);
  display: block;
}

.speaker-driver-container {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 82%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  z-index: 1;
}

#speaker-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 95%;
  height: 95%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent-color) 0%, transparent 68%);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 380ms ease, filter 380ms ease, transform 380ms ease;
  filter: blur(16px);
}

#speaker-glow-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40%;
  height: 40%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-color) 70%, white) 0%, transparent 70%);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 380ms ease, filter 380ms ease, transform 380ms ease;
  filter: blur(6px);
}

#speaker-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: visible;
}

#speaker-cone {
  transform-box: fill-box;
  transform-origin: center;
  pointer-events: none;
  transform: scale(0.78);
  transition: transform 0.05s linear;
}

/* Screen overlays when idle / shuffling */
#player-idle-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  pointer-events: none;
  opacity: 1;
  filter: brightness(0.85) contrast(0.9) blur(0.4px);
  transition: opacity 600ms ease;
}

#player-shuffle-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
}

.screen-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.5) 100%);
  z-index: 5;
}

.crt-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.1;
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,0.7) 0px, rgba(0,0,0,0.7) 1px, transparent 1px, transparent 3px);
  z-index: 6;
}

.screen-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,0.07) 0%, transparent 30%);
  z-index: 8;
}

.crt-static-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.9) 0px, rgba(255,255,255,0.9) 1px, rgba(0,0,0,0.9) 1px, rgba(0,0,0,0.9) 2px), repeating-linear-gradient(90deg, rgba(255,255,255,0.45) 0px, rgba(255,255,255,0.45) 1px, transparent 1px, transparent 3px);
  background-size: 100% 3px, 5px 100%;
  mix-blend-mode: overlay;
  z-index: 7;
}

/* 4. Waveform timeline scrubber */
.waveform-scrubber {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16%;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 0;
  cursor: pointer;
  touch-action: none;
  z-index: 9;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
}

.waveform-bars-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  pointer-events: none;
}

.waveform-bars-fill {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  clip-path: inset(0 100% 0 0);
  pointer-events: none;
}

.waveform-bar {
  flex: 1;
  border-radius: 1px;
}

.waveform-bars-bg .waveform-bar {
  background: rgba(255, 255, 255, 0.18);
}

.waveform-bars-fill .waveform-bar {
  background: var(--accent-color);
  opacity: 0.85;
}

/* 5. Cabinet Meta metadata bar */
.cabinet-meta {
  text-align: center;
  margin-top: 1.2rem;
  margin-bottom: 0.3rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0 0.8rem;
  overflow: hidden;
  min-width: 0; /* Solves flexbox text overflow bug */
  transition: opacity 0.4s ease, height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
}

.title-marquee-wrapper {
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.subtitle-marquee-wrapper {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.meta-title {
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-block;
  transition: opacity 0.4s ease;
}

.meta-subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  margin-top: 5px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-width: 0;
}

#track-subtitle {
  white-space: nowrap;
  display: inline-block;
  min-width: 0;
  transition: opacity 0.4s ease;
}

#time-label {
  flex-shrink: 0;
  display: inline-block;
}

/* Alternate marquee scrolling keyframe */
@keyframes rmkMarquee {
  0% { transform: translateX(0); }
  15% { transform: translateX(0); } /* Pause at start */
  85% { transform: translateX(var(--marquee-scroll-dist, 0px)); }
  100% { transform: translateX(var(--marquee-scroll-dist, 0px)); } /* Pause at end */
}



/* Tablet & Mobile Adaptive Viewports */
@media (max-width: 1024px) {

  .fullscreen-container {
    gap: 2.5rem;
    padding: 0 2rem;
  }
}

@media (max-width: 768px) {

  .brand-description-intro,
  .brand-description-action {
    font-size: 0.9rem;
  }
  .brand-description-action {
    margin-bottom: 1.5rem;
  }
  .fullscreen-container {
    gap: 1.5rem;
    padding: 0 1.5rem;
  }
}

@media (max-width: 680px) {
  html, body {
    overflow: hidden !important;
  }
  .fullscreen-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    padding: 0.4rem 1rem 1rem 1rem;
    gap: 0.8rem;
    overflow: hidden !important;
  }
  .branding-panel {
    text-align: center;
    align-items: center;
    margin-top: 4.2rem;
    margin-bottom: 0;
    justify-content: flex-start;
    width: 100%;
    max-width: 320px;
  }
  .brand-header {
    margin-bottom: 0.2rem;
    align-items: center;
    width: 100%;
  }
  .brand-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 0.4rem;
  }
  .brand-title {
    font-size: 3.8rem;
    -webkit-text-stroke: 1.6px #ffffff;
  }
  .splash-title {
    font-size: 3.2rem;
  }
  .splash-subtitle {
    font-size: 0.65rem;
    letter-spacing: 3px;
    margin-bottom: 2.5rem;
  }
  .brand-description-intro {
    display: block;
    font-size: 0.92rem;
    line-height: 1.45;
    margin-top: 0.3rem;
    margin-bottom: 0.6rem;
    color: var(--text-dim);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
  }
  .brand-description-action {
    display: block;
    font-size: 0.72rem;
    white-space: nowrap;
    line-height: 1.45;
    margin-top: 0.3rem;
    margin-bottom: 0.6rem;
    color: var(--text-dim);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
  }
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    width: 100%;
    margin-top: 0.8rem;
    margin-bottom: 0.4rem;
  }
  .contact-link, .studio-btn {
    padding: 0.5rem 1.1rem;
    font-size: 0.65rem;
  }
  .player-panel {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }
  .player-layout-wrapper {
    width: 100%;
    max-width: min(480px, 96vw); /* Even larger player on mobile, filling the screen width */
  }
  .media-cabinet {
    padding: 0.7rem;
  }
  .player-ctrl-btn {
    padding: 0.15rem;
  }
  .player-ctrl-btn svg {
    width: 48px;
    height: 48px;
  }
  #btn-shuffle svg {
    width: 76px;
    height: 48px;
  }
  .bar-divider {
    width: 1px;
    height: 100%;
  }
  .cabinet-meta {
    margin-top: 0.8rem;
    margin-bottom: 0.1rem;
  }
  .meta-title {
    font-size: 1.1rem;
  }
  .meta-subtitle {
    font-size: 0.7rem;
  }
}

/* Height-based constraint queries to protect short screens / landscape monitors */
@media (max-height: 580px) {
  html, body {
    overflow: hidden !important;
  }
  .fullscreen-container {
    padding: 1rem !important;
    gap: 1rem !important;
  }
  .brand-title {
    font-size: 2.2rem !important;
  }
  .branding-panel {
    max-width: 230px !important;
  }
  .brand-description-intro,
  .brand-description-action {
    display: block !important;
    font-size: 0.75rem !important;
    line-height: 1.3 !important;
    margin-top: 0.2rem !important;
    margin-bottom: 0.4rem !important;
    color: var(--text-dim) !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    font-weight: 300 !important;
  }
  .player-layout-wrapper {
    max-width: min(280px, 60vh) !important;
  }
  .contact-link, .studio-btn {
    padding: 0.45rem 1rem !important;
    font-size: 0.6rem !important;
  }
}

/* ==========================================================================
   10. Old-fashioned Wooden Window & Studio Screen layout
   ========================================================================== */
.wooden-window-wrapper {
  display: none !important;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 20; /* Sits above speaker layout and video player */
  display: flex;
  pointer-events: none;
  perspective: 1200px;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.wooden-window-wrapper.window-visible {
  opacity: 1;
  transform: scale(1);
}

.wooden-window-wrapper.window-open {
  pointer-events: none;
}

.window-pane {
  flex: 1;
  height: 100%;
  position: relative;
  box-sizing: border-box;
  background-image: url('weathered_wood_texture.jpg');
  background-size: cover;
  background-position: center;
  padding: 10px;
  gap: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr; /* 3 rows, 2 columns = 6 panes */
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), opacity 1s ease;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.left-pane {
  transform-origin: left center;
  box-shadow: inset -5px 0 15px rgba(0,0,0,0.5), inset 0 0 20px rgba(0,0,0,0.8);
}

.right-pane {
  transform-origin: right center;
  box-shadow: inset 5px 0 15px rgba(0,0,0,0.5), inset 0 0 20px rgba(0,0,0,0.8);
}

/* Wood Mullions (Ristikon varjot ja korostukset) */
.wooden-mullion {
  display: none; /* Handled perfectly by parent padding & grid-gap! */
}

/* Glass pane styling */
.pane-glass {
  position: relative;
  background: rgba(140, 180, 200, 0.05);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.95), inset 0 0 2px rgba(0, 0, 0, 0.8), 0 1px 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  border-radius: 2px;
}

/* Glass reflections */
.pane-glass::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0) 100%);
  transform: rotate(15deg);
  pointer-events: none;
}

/* Swung open window state */
.wooden-window-wrapper.window-open .left-pane {
  transform: rotateY(-125deg);
  opacity: 0.15; /* Transparent look when open at the sides */
  box-shadow: none;
}

.wooden-window-wrapper.window-open .right-pane {
  transform: rotateY(125deg);
  opacity: 0.15;
  box-shadow: none;
}

/* Wooden frame border on the very screen boundary */
.wooden-window-frame {
  position: absolute;
  inset: 0;
  border: 10px solid transparent;
  border-image-source: url('weathered_wood_texture.jpg');
  border-image-slice: 24;
  border-image-repeat: round;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  z-index: 21;
}

/* Latch in the center */
.window-latch {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 24px;
  background: #1e1d1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.6);
  border-radius: 3px;
  z-index: 26;
  transition: opacity 0.3s ease, transform 0.4s ease;
  pointer-events: none;
}

.window-latch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  width: 32px;
  height: 5px;
  background: #121210;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.wooden-window-wrapper.window-open .window-latch {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8) rotate(45deg);
}

/* Studio content revealed under the window */
.studio-screen-layout {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  background: rgba(7, 8, 9, 0.96);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.studio-screen-layout.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.studio-screen-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 0.8rem;
  box-sizing: border-box;
}

/* Mini scrollbar */
.studio-screen-scroll::-webkit-scrollbar {
  width: 4px;
}
.studio-screen-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.studio-screen-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}

.close-window-btn {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  z-index: 35;
  transition: var(--transition-fast);
  padding: 0;
}

.close-window-btn svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (hover: hover) {
  .close-window-btn:hover {
    transform: rotate(90deg);
    opacity: 0.8;
  }
}

.close-window-btn:active {
  transform: scale(0.9) rotate(90deg);
  opacity: 0.7;
}

.studio-screen-header {
  margin-top: 0.2rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.4rem;
}

.studio-screen-header h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0;
  color: var(--text-main);
}

.studio-screen-header p {
  font-size: 0.65rem;
  color: var(--accent-blue);
  letter-spacing: 2px;
  margin: 0.1rem 0 0 0;
}

.studio-screen-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 1.2rem 0;
  font-weight: 300;
}

/* Horizontal scrolling mini gallery */
.studio-screen-gallery {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.6rem;
  margin-bottom: 1.2rem;
  scrollbar-width: none;
}

.studio-screen-gallery::-webkit-scrollbar {
  display: none;
}

.screen-gallery-item {
  flex: 0 0 180px;
  scroll-snap-align: start;
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.screen-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screen-gallery-item span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  padding: 0.4rem 0.6rem;
  font-size: 0.6rem;
  color: var(--text-main);
}

/* Specs/Services cards */
.studio-screen-specs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.screen-spec-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0.8rem;
  box-sizing: border-box;
}

.screen-spec-card h5 {
  font-size: 0.85rem;
  color: var(--text-main);
  margin: 0 0 0.3rem 0;
  font-weight: 600;
}

.screen-spec-card p {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin: 0;
  font-weight: 300;
}

/* ==========================================================================
   11. Studio Mode Active Animations & Sizing Shifts
   ========================================================================== */

/* Hiding controls bar inside the screen when active */
body.studio-active .player-controls-bar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
}

/* Hiding cabinet metadata when active */
body.studio-active .cabinet-meta {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hide cabinet metadata when active and let screen box grow but maintain 4:3 aspect ratio */
body.studio-active .screen-box {
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  max-height: 100% !important;
  width: auto !important;
  max-width: 100% !important;
  flex: none !important;
}

/* Tablet and Mobile adjustments (max-width: 1024px) */
@media (max-width: 1024px) {
  /* Shift to column layout at 1024px width */
  .fullscreen-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.5rem 1rem 1.5rem;
    height: 100vh;
    height: 100dvh;
    overflow: hidden !important;
  }

  /* Split screen space exactly 50% / 50% vertically */
  .branding-panel {
    flex: 1;
    height: 50%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
    margin-top: 1.5rem;
  }

  .brand-header {
    margin-bottom: 0.4rem;
    align-items: center;
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
    margin-bottom: 0.4rem;
  }

  .brand-title {
    font-size: 4.8rem !important;
    -webkit-text-stroke: 1.5px #ffffff !important;
  }

  .splash-title {
    font-size: 3.8rem;
  }

  .brand-description-intro {
    display: block;
    font-size: 1.25rem !important;
    line-height: 1.6 !important;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
  }

  .brand-description-action {
    display: block;
    font-size: 1.15rem !important;
    line-height: 1.55;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    font-weight: 700 !important;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    width: 100%;
    margin-top: 0.6rem;
    margin-bottom: 0.2rem;
  }

  .contact-link, .studio-btn {
    padding: 0.5rem 1.1rem;
    font-size: 0.65rem;
  }

  .player-panel {
    flex: 1;
    height: 50%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
  }

  .player-layout-wrapper {
    width: 100%;
    height: auto;
    max-width: min(540px, 94vw);
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .media-cabinet {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.8rem;
    border-radius: 20px;
    box-sizing: border-box;
  }

  /* Make sure the screen box maintains 4:3 aspect ratio and never collapses using padding-bottom hack */
  .screen-box {
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 75% !important; /* 4:3 Ratio */
    aspect-ratio: auto !important;
    border-radius: 12px;
    flex: none !important;
    overflow: hidden;
  }

  body.studio-active .screen-box {
    overflow: visible !important;
  }

  .cabinet-meta {
    margin-top: 0.6rem;
    margin-bottom: 0.1rem;
  }

  .meta-title {
    font-size: 1.25rem;
  }

  .meta-subtitle {
    font-size: 0.85rem;
  }

  /* Center branding elements inside branding panel when active */
  body.studio-active .branding-panel {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: center !important;
    width: 100% !important;
  }

  body.studio-active .brand-header {
    margin-bottom: 0.2rem !important;
    align-items: center !important;
    text-align: center !important;
  }

  body.studio-active .branding-actions {
    justify-content: center !important;
    width: 100% !important;
    margin-top: 0.4rem !important;
  }

  /* Hide the description text to allow player to expand up to the RMKSOUND header */
  body.studio-active .brand-description-intro,
  body.studio-active .brand-description-action {
    opacity: 0;
    pointer-events: none;
    height: 0;
    margin: 0 !important;
    padding: 0;
    overflow: hidden;
  }
}

/* Tiny screen adjustments (width <= 680px) */
@media (max-width: 680px) {
  .branding-panel {
    margin-top: 5rem !important;
    margin-bottom: 0 !important;
    justify-content: flex-start !important;
    max-width: min(360px, 92vw) !important;
  }
  .brand-title {
    font-size: 4.4rem !important;
    -webkit-text-stroke: 1.8px #ffffff !important;
  }
  .brand-description-intro {
    font-size: 1.12rem !important;
    line-height: 1.55 !important;
    color: #e2e8f0 !important;
    font-weight: 400 !important;
  }
  .brand-description-action {
    font-size: 1.05rem !important;
    color: #e2e8f0 !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
  }
  .nav-item {
    font-size: 1.35rem !important;
  }
  .nav-separator {
    font-size: 1.35rem !important;
  }
  .player-instruction-text {
    font-size: 1.1rem !important;
  }
  .meta-title {
    font-size: 1.35rem !important;
  }
  .meta-subtitle {
    font-size: 0.88rem !important;
  }
  .studio-screen-header h3 {
    font-size: 1.7rem !important;
  }
  .studio-screen-header p {
    font-size: 0.82rem !important;
  }
  .studio-screen-desc {
    font-size: 0.98rem !important;
    line-height: 1.6 !important;
    font-weight: 400 !important;
  }
  .screen-spec-card h5 {
    font-size: 1.08rem !important;
  }
  .screen-spec-card p {
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
  }
  .screen-gallery-item span {
    font-size: 0.78rem !important;
  }
  .player-layout-wrapper {
    max-width: min(480px, 96vw) !important;
  }

  /* Mobile fullscreen overrides when CV/METSÄ/STUDIO is active */
  body.studio-active .player-panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1000 !important;
    background: #060608 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  body.studio-active .player-layout-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.studio-active .media-cabinet {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0px !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: var(--cabinet-gradient) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
  }

  body.studio-active .screen-box {
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 0 !important;
    border-radius: 0px !important;
    aspect-ratio: auto !important;
    flex: 1 !important;
  }

  body.studio-active .studio-screen-layout {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0px !important;
  }
}


/* ==========================================================================
   13. Navigation Menu Bar Styles
   ========================================================================== */
.main-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.2rem;
  width: 100%;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  padding: 0.4rem 0;
  transition: var(--transition-fast);
  text-transform: uppercase;
  position: relative;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--text-main);
  transition: width 0.3s ease;
}

.nav-item:hover {
  color: var(--text-main);
}

.nav-item.active {
  color: var(--text-main);
}

.nav-item.active::after {
  width: 100%;
}

.nav-separator {
  color: rgba(255, 255, 255, 0.15);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  pointer-events: none;
}

.branding-contact-footer {
  margin-top: 1.5rem;
  width: 100%;
}

@media (max-width: 1024px) {
  .main-nav-bar {
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 0;
  }
  .nav-item {
    font-size: 1.45rem !important;
  }
  .nav-separator {
    font-size: 1.45rem !important;
  }
}

/* ==========================================================================
   14. Player Initial Instruction Styles
   ========================================================================== */
.player-instruction-overlay {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 1;
}

.player-instruction-overlay.fade-out {
  opacity: 0;
  transform: translateY(8px);
}

.player-instruction-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  text-align: center;
  max-width: 90%;
  padding: 0 1rem;
  animation: syncFlash 1.6s infinite ease-in-out;
}

@keyframes syncFlash {
  0%, 100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.8;
  }
}



/* ==========================================================================
   16. Email Inline Menu Typography Style
   ========================================================================== */
.email-nav-link {
  font-family: var(--font-display) !important;
  font-weight: 800 !important;
  font-size: 1.3rem; /* Sychronized with brand-description font-size */
  color: #ffffff !important;
  text-decoration: none !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  border-bottom: 2px solid transparent !important;
  transition: var(--transition-fast) !important;
  display: inline-block;
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  vertical-align: baseline !important;
}

.email-nav-link:hover {
  color: var(--accent-blue) !important;
  text-shadow: 0 0 12px rgba(127, 168, 248, 0.6) !important;
}

.email-slash {
  color: rgba(255, 255, 255, 0.15);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  margin: 0 0.4rem;
  pointer-events: none;
  user-select: none;
  display: inline-block;
}

/* Media query responsive resizing for email typography */
@media (max-width: 1024px) {
  .email-nav-link, .email-slash {
    font-size: 1.05rem !important;
  }
}

@media (max-width: 680px) {
  .email-nav-link, .email-slash {
    font-size: 0.92rem !important;
  }
}

@media (max-height: 580px) {
  .email-nav-link, .email-slash {
    font-size: 0.75rem !important;
  }
}

/* Landscape mobile/tablet query to prevent vertical overflow and enable side-by-side layout */
@media (max-height: 520px) and (orientation: landscape) {
  html, body {
    overflow: hidden !important;
  }
  
  .fullscreen-container {
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0.8rem 1.5rem !important;
    gap: 2rem !important;
    height: 100vh !important;
    height: 100dvh !important;
  }
  
  .branding-panel {
    flex: 1 !important;
    max-width: 280px !important;
    text-align: left !important;
    align-items: flex-start !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    height: auto !important;
  }
  
  .brand-header {
    align-items: flex-start !important;
    margin-bottom: 0.8rem !important;
  }
  
  .brand-logo {
    display: none !important;
  }
  
  .brand-title {
    font-size: 2.2rem !important;
    -webkit-text-stroke: 1px #ffffff !important;
    text-align: left !important;
  }
  
  .main-nav-bar {
    margin-bottom: 1rem !important;
    justify-content: flex-start !important;
    flex-direction: row !important;
    gap: 0.4rem !important;
  }
  
  .nav-item {
    font-size: 0.8rem !important;
  }
  
  .nav-separator {
    font-size: 0.8rem !important;
  }
  
  .brand-description-intro {
    display: none !important;
  }
  
  .brand-description-action {
    display: block !important;
    font-size: 0.72rem !important;
    margin-bottom: 0 !important;
    white-space: nowrap !important;
    text-align: left !important;
  }
  
  .player-panel {
    flex: 1.2 !important;
    max-width: 380px !important;
    height: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
  
  .player-layout-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
  
  .media-cabinet {
    padding: 0.5rem !important;
    border-radius: 16px !important;
    height: auto !important;
  }
  
  .screen-box {
    aspect-ratio: 4 / 3 !important;
    width: 100% !important;
    height: auto !important;
    padding-bottom: 0 !important;
  }
  
  .cabinet-meta {
    margin-top: 0.4rem !important;
    margin-bottom: 0 !important;
  }
  
  .meta-title {
    font-size: 0.95rem !important;
  }
  
  .meta-subtitle {
    font-size: 0.65rem !important;
  }

  /* Fullscreen override in active state in landscape mode */
  body.studio-active .player-panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    z-index: 1000 !important;
    background: #060608 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  body.studio-active .player-layout-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.studio-active .media-cabinet {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0px !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: var(--cabinet-gradient) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
  }

  body.studio-active .screen-box {
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 0 !important;
    border-radius: 0px !important;
    aspect-ratio: auto !important;
    flex: 1 !important;
  }

  body.studio-active .studio-screen-layout {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0px !important;
  }
}
