/* Wave Mosaic theme — variables and core visuals follow black-yt/skills/wave-mosaic-web-theme */
:root {
  --bg:              #ffffff;
  --masthead-bg:     #f5f5f5;
  --masthead-border: #e8e8e8;
  --paper-border:    #efefef;
  --paper-hover:     #f7f7f7;
  --h1-border:       #e8e8e8;
  --c-bg-start:      #ffffff;
  --c-bg-end:        #f5f5f5;
  --c-border:        rgba(0, 0, 0, 0.12);
  --c-text:          #1a1a1a;
  --c-hover-start:   #f0f0f0;
  --c-hover-end:     #e8e8e8;
  --c-hover-border:  rgba(0, 0, 0, 0.28);
  --c-hover-text:    #000000;
  --seg-start:       #1a1a1a;
  --seg-end:         #333333;
  --seg-shadow:      rgba(0, 0, 0, 0.22);
  --seg-inactive:    #888888;
  --seg-active-text: #ffffff;
  --glow-rgb:        0, 0, 0;
  --radius:          16px;
  --wrap:            1160px;
}

[data-theme="yellow"] {
  --bg:              #faf8f4;
  --masthead-bg:     #f0ebe1;
  --masthead-border: #e5ddd0;
  --paper-border:    #e8e0d5;
  --paper-hover:     #f0ece4;
  --h1-border:       #ddd6c8;
  --c-bg-start:      #ffffff;
  --c-bg-end:        #faf4ea;
  --c-border:        rgba(140, 95, 35, 0.22);
  --c-text:          #3d2810;
  --c-hover-start:   #f5ede0;
  --c-hover-end:     #ede0cc;
  --c-hover-border:  rgba(140, 95, 35, 0.5);
  --c-hover-text:    #1c1208;
  --seg-start:       #1c1208;
  --seg-end:         #3a2410;
  --seg-shadow:      rgba(28, 18, 8, 0.28);
  --seg-inactive:    #8a7055;
  --seg-active-text: #ffffff;
  --glow-rgb:        180, 128, 40;
}

[data-theme="blue"] {
  --bg:              #f3f5f8;
  --masthead-bg:     #e3e8ef;
  --masthead-border: #d3dae3;
  --paper-border:    #dde4ed;
  --paper-hover:     #e8eef5;
  --h1-border:       #ccd4de;
  --c-bg-start:      #ffffff;
  --c-bg-end:        #edf2fa;
  --c-border:        rgba(38, 88, 155, 0.22);
  --c-text:          #1a3654;
  --c-hover-start:   #e8f0fb;
  --c-hover-end:     #d8e8f8;
  --c-hover-border:  rgba(38, 88, 155, 0.5);
  --c-hover-text:    #102847;
  --seg-start:       #1a3654;
  --seg-end:         #1e4a7a;
  --seg-shadow:      rgba(26, 54, 84, 0.3);
  --seg-inactive:    #6a8aaa;
  --seg-active-text: #ffffff;
  --glow-rgb:        38, 88, 155;
}

[data-theme="dark"] {
  --bg:              #111110;
  --masthead-bg:     #1c1c1a;
  --masthead-border: #2e2e2b;
  --paper-border:    #252522;
  --paper-hover:     #1a1a18;
  --h1-border:       #2e2e2b;
  --c-bg-start:      #1e1e1c;
  --c-bg-end:        #252520;
  --c-border:        rgba(255, 255, 255, 0.1);
  --c-text:          #e8e6df;
  --c-hover-start:   #2a2a26;
  --c-hover-end:     #303028;
  --c-hover-border:  rgba(255, 255, 255, 0.22);
  --c-hover-text:    #ffffff;
  --seg-start:       #e8e6df;
  --seg-end:         #d0cec7;
  --seg-shadow:      rgba(232, 230, 223, 0.12);
  --seg-inactive:    #666660;
  --seg-active-text: #111110;
  --glow-rgb:        220, 210, 180;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background-color: var(--bg);
  color: var(--c-text);
  font-family: "Space Grotesk", "Noto Sans SC", Inter, ui-sans-serif, system-ui, sans-serif;
  transition: background-color .3s ease, color .3s ease;
}

body {
  min-height: 100vh;
  margin: 0;
  background: transparent;
  overflow-x: hidden;
}

/* desktop: the whole page is exactly one screen, no page scroll */
@media (min-width: 981px) {
  html, body { height: 100%; overflow: hidden; }
}

#wave-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

a { color: inherit; }
img { display: block; }

/* masthead */
.wm-masthead {
  position: sticky;
  top: 0;
  z-index: 900;
  background-color: var(--masthead-bg);
  border-bottom: 1px solid var(--masthead-border);
  transition: background-color .25s ease, border-color .25s ease;
}
.wm-masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(var(--wrap), calc(100% - 32px));
  margin-inline: auto;
  min-height: 60px;
}
.wm-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--c-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.01em;
}
.wm-brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--masthead-border);
  background: #fff;
}
.wm-masthead__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.lang-toggle {
  border: 1px solid var(--masthead-border);
  background: transparent;
  color: var(--c-text);
  border-radius: 7px;
  padding: 5px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.lang-toggle:hover { background: rgba(var(--glow-rgb), .07); border-color: var(--c-hover-border); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border-radius: 9999px;
  background: var(--seg-start);
  color: var(--seg-active-text);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(var(--glow-rgb), .16);
  transition: transform .15s ease, box-shadow .15s ease;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(var(--glow-rgb), .22); }

/* single stage */
.stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: calc(100vh - 61px);
  height: calc(100dvh - 61px);
  padding: clamp(16px, 3vh, 40px) 0;
  overflow: hidden;
}
.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: 56px;
  width: min(var(--wrap), calc(100% - 48px));
  height: 100%;
  margin-inline: auto;
}

/* left: intro + feature list */
.intro { max-width: 460px; }
.wm-eyebrow {
  margin: 0 0 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(var(--glow-rgb), .62);
}
[data-theme="dark"] .wm-eyebrow { color: rgba(220, 210, 175, .62); }
h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -.025em;
}
.intro-sub {
  margin: 0 0 26px;
  font-size: clamp(15.5px, 1.5vw, 18px);
  line-height: 1.6;
  color: rgba(var(--glow-rgb), .72);
}
[data-theme="dark"] .intro-sub { color: rgba(232, 230, 223, .72); }

.tour-list { display: grid; gap: 6px; }
.tour-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.tour-item:hover { background: rgba(var(--glow-rgb), .045); }
.tour-item.active {
  border-color: var(--c-hover-border);
  background: linear-gradient(135deg, var(--c-bg-start), var(--c-bg-end));
  box-shadow: 0 10px 28px rgba(var(--glow-rgb), .1);
}
.tour-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--glow-rgb), .16);
}
.tour-no {
  flex-shrink: 0;
  padding-top: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  color: rgba(var(--glow-rgb), .42);
}
.tour-item.active .tour-no { color: rgba(var(--glow-rgb), .8); }
.tour-copy { display: flex; flex-direction: column; gap: 3px; }
.tour-copy strong { font-size: 15.5px; font-weight: 600; }
.tour-copy span {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(var(--glow-rgb), .66);
}
[data-theme="dark"] .tour-copy span { color: rgba(232, 230, 223, .66); }

.wm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 9999px;
  border: 1px solid var(--c-border);
  background: linear-gradient(135deg, var(--c-bg-start), var(--c-bg-end));
  color: var(--c-text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.wm-btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--seg-start), var(--seg-end));
  color: var(--seg-active-text);
  box-shadow: 0 10px 30px rgba(var(--glow-rgb), .18);
}
.wm-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(var(--glow-rgb), .26);
}
.stage-cta {
  margin-top: 24px;
  padding: 13px 26px;
  font-size: 15.5px;
}

/* right: animated chat */
.wm-panel {
  border: 1px solid var(--c-border);
  border-radius: 20px;
  background: linear-gradient(135deg, var(--c-bg-start), var(--c-bg-end));
  box-shadow: 0 26px 70px rgba(0, 0, 0, .11);
}
.tour-demo {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 640px;
  overflow: hidden;
}
.tour-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(var(--glow-rgb), .66);
}
[data-theme="dark"] .tour-head { color: rgba(232, 230, 223, .66); }
.tour-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  background: #fff;
}
.tour-name { font-weight: 600; }
.tour-online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: rgba(var(--glow-rgb), .58);
}
.tour-online i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3fbf6f;
  box-shadow: 0 0 0 3px rgba(63, 191, 111, .14);
}
.tour-pause {
  margin-left: auto;
  border: 1px solid var(--c-border);
  background: transparent;
  color: inherit;
  border-radius: 9999px;
  padding: 4px 11px;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.tour-pause:hover { background: rgba(var(--glow-rgb), .07); border-color: var(--c-hover-border); }

.tour-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 24px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.tour-bubble {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 15px;
  border: 1px solid var(--c-border);
  background: linear-gradient(135deg, var(--c-bg-start), var(--c-bg-end));
  font-size: 13.8px;
  line-height: 1.65;
  animation: tourIn .28s ease both;
}
.tour-bubble p { margin: 0; }
.tour-bubble--user {
  align-self: flex-end;
  border-color: transparent;
  background: linear-gradient(135deg, var(--seg-start), var(--seg-end));
  color: var(--seg-active-text);
  border-bottom-right-radius: 5px;
}
.tour-bubble--bot {
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}
.tour-bubble--typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 52px;
}
.tour-bubble--typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(var(--glow-rgb), .4);
  animation: tourBlink 1.1s infinite ease-in-out;
}
[data-theme="dark"] .tour-bubble--typing i { background: rgba(232, 230, 223, .45); }
.tour-bubble--typing i:nth-child(2) { animation-delay: .16s; }
.tour-bubble--typing i:nth-child(3) { animation-delay: .32s; }
.tour-note {
  align-self: center;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: rgba(var(--glow-rgb), .5);
  animation: tourIn .28s ease both;
}
[data-theme="dark"] .tour-note { color: rgba(232, 230, 223, .5); }
.tour-file {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 84%;
  padding: 9px 12px;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  border-bottom-left-radius: 5px;
  background: linear-gradient(135deg, var(--c-bg-start), var(--c-bg-end));
  animation: tourIn .28s ease both;
}
.tour-file-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .02em;
}
.tour-file-icon[data-kind="ppt"] { background: #c8472b; }
.tour-file-icon[data-kind="doc"] { background: #2b579a; }
.tour-file-icon[data-kind="xls"] { background: #217346; }
.tour-file-icon[data-kind="pdf"] { background: #b32424; }
.tour-file-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tour-file-meta strong {
  font-size: 12.8px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-all;
}
.tour-file-meta small {
  font-size: 10.5px;
  color: rgba(var(--glow-rgb), .55);
}
[data-theme="dark"] .tour-file-meta small { color: rgba(232, 230, 223, .55); }
.tour-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -.12em;
  background: currentColor;
  animation: tourBlinkCaret .8s steps(1) infinite;
}
.tour-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--c-border);
  font-size: 11.5px;
  color: rgba(var(--glow-rgb), .55);
}
[data-theme="dark"] .tour-foot { color: rgba(232, 230, 223, .55); }
.tour-dots { display: inline-flex; gap: 4px; }
.tour-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(var(--glow-rgb), .28);
  animation: tourBlink 1.4s infinite ease-in-out;
}
.tour-dots i:nth-child(2) { animation-delay: .2s; }

@keyframes tourIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes tourBlink {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-1px); }
}
@keyframes tourBlinkCaret { 50% { opacity: 0; } }

/* theme switcher */
#theme-switcher {
  position: fixed;
  bottom: 1.5em;
  right: 1.5em;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--masthead-bg);
  border: 1px solid var(--masthead-border);
  border-radius: 9999px;
  padding: 9px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .12);
  transition: background .3s ease, border-color .3s ease;
}
.theme-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform .15s ease, box-shadow .15s ease;
}
.theme-dot[data-theme="white"]  { background: #ffffff; border-color: #c8c8c8; }
.theme-dot[data-theme="yellow"] { background: #e8d5a0; border-color: #c4a060; }
.theme-dot[data-theme="blue"]   { background: #a8c4e8; border-color: #5e8ec8; }
.theme-dot[data-theme="dark"]   { background: #2a2a26; border-color: #585852; }
.theme-dot.active {
  transform: scale(1.35);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--masthead-border);
}
.theme-dot:hover:not(.active) { transform: scale(1.18); }

/* responsive: phones and tablets scroll normally */
@media (max-width: 980px) {
  .stage {
    height: auto;
    min-height: 0;
    padding: 30px 0 calc(52px + env(safe-area-inset-bottom));
    overflow: visible;
  }
  .stage-grid { grid-template-columns: 1fr; gap: 30px; height: auto; }
  .intro { display: contents; }
  .intro-copy { order: 1; max-width: 620px; }
  .intro-sub { margin-bottom: 0; }
  .tour-list { order: 2; }
  .tour-demo { order: 3; height: auto; max-height: none; }
  .stage-cta { order: 4; margin-top: 0; }
  .tour-chat { flex: none; height: 380px; }
}

/* short desktop windows: tighten spacing so everything still fits on one screen */
@media (min-width: 981px) and (max-height: 720px) {
  .wm-eyebrow { margin-bottom: 8px; }
  h1 { font-size: 38px; margin-bottom: 8px; }
  .intro-sub { margin-bottom: 16px; font-size: 15px; }
  .tour-list { gap: 4px; }
  .tour-item { padding: 8px 12px; }
  .tour-copy strong { font-size: 14.5px; }
  .tour-copy span { font-size: 12px; }
  .stage-cta { margin-top: 16px; padding: 10px 22px; font-size: 14.5px; }
  .tour-head { padding: 9px 14px; }
  .tour-foot { padding: 8px 14px; }
  .tour-chat { padding: 18px 16px; }
}
@media (min-width: 981px) and (max-height: 560px) {
  .wm-eyebrow { display: none; }
  .intro-sub { margin-bottom: 12px; }
}
@media (max-width: 620px) {
  .stage-grid { width: calc(100% - 32px); }
  .wm-masthead__inner { gap: 10px; }
  .wm-brand { font-size: 16px; }
  .wm-brand img { width: 29px; height: 29px; }
  .nav-cta { padding: 7px 11px; font-size: 12.5px; }
  .lang-toggle { padding: 5px 8px; font-size: 12px; }
  h1 { font-size: 34px; }
  .intro-sub { margin-bottom: 20px; }
  .tour-item { padding: 11px 12px; }
  .tour-chat { height: 340px; padding: 18px 14px; }
  .tour-bubble { font-size: 13.5px; }
  .stage-cta { width: 100%; }
  #theme-switcher { bottom: 1em; right: 1em; padding: 8px 12px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .wm-btn, .tour-item { transition: none; }
}