:root {
  --bg-primary: #fffaf5;
  --bg-secondary: #f9f1e8;
  --bg-card: #ffffff;
  --bg-studio: #fdf6ef;
  --bg-glass: rgba(249, 115, 22, 0.05);
  --bg-glass-hover: rgba(249, 115, 22, 0.09);
  --text-primary: #181310;
  --text-secondary: #574c44;
  --text-muted: #7c6f65;
  --accent-primary: #f97316;
  --accent-primary-light: #fb923c;
  --accent-primary-dark: #c2410c;
  --accent-teal: #0d9488;
  --accent-teal-light: #14b8a6;
  --accent-teal-dark: #0f766e;
  --accent-secondary: #0d9488;
  --success: #0d9488;
  --warning: #d97706;
  --warning-dark: #b45309;
  --error: #dc2626;
  --mo-sun: #ffc93c;
  --mo-sun-d: #d99b0f;
  --mo-sun-ink: #5a4405;
  --mo-line: #eadccf;
  --mo-track: #f3e8de;
  --mo-card-shadow: 0 1px 2px rgba(51, 35, 22, 0.05), 0 16px 34px -22px rgba(51, 35, 22, 0.24);
  --border-color: rgba(51, 35, 22, 0.09);
  --border-focus: rgba(249, 115, 22, 0.45);
  --shadow-sm: 0 1px 2px rgba(51, 35, 22, 0.04);
  --shadow-md: 0 2px 8px rgba(51, 35, 22, 0.06);
  --shadow-lg: 0 6px 20px rgba(51, 35, 22, 0.09);
  --shadow-glow: 0 0 30px rgba(249, 115, 22, 0.22);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  font-family: 'Inter', 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans Myanmar', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: 'Inter', 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans Myanmar', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(900px 520px at 88% -6%, rgba(249, 115, 22, 0.14) 0%, transparent 56%),
    radial-gradient(760px 500px at 2% 2%, rgba(13, 148, 136, 0.12) 0%, transparent 52%),
    var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Tactile Neo-Brutalist / WeShadow UI Components */
.mo-underline {
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  background-image: linear-gradient(rgba(20, 184, 166, 0.34), rgba(20, 184, 166, 0.34));
  background-position: 0 90%;
  background-repeat: no-repeat;
  background-size: 100% 0.32em;
  border-radius: 3px;
}

.mo-card {
  background: var(--bg-card);
  border: 2px solid var(--mo-line);
  box-shadow: var(--mo-card-shadow);
  border-radius: 22px;
}

.mo-btn {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 0 var(--accent-primary-dark);
  border: none;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 80ms, box-shadow 80ms, filter 0.12s;
  cursor: pointer;
}
.mo-btn:hover:not(:disabled) {
  filter: brightness(1.04);
}
.mo-btn:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--accent-primary-dark);
  transform: translateY(3px);
}
.mo-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mo-btn-teal {
  background: var(--accent-teal);
  color: #fff;
  box-shadow: 0 4px 0 var(--accent-teal-dark);
  border: none;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 80ms, box-shadow 80ms, filter 0.12s;
  cursor: pointer;
}
.mo-btn-teal:hover:not(:disabled) {
  filter: brightness(1.05);
}
.mo-btn-teal:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--accent-teal-dark);
  transform: translateY(3px);
}

.mo-btn-sun {
  background: var(--mo-sun);
  color: var(--mo-sun-ink);
  box-shadow: 0 4px 0 var(--mo-sun-d);
  border-radius: 14px;
  font-weight: 800;
  transition: transform 80ms, box-shadow 80ms, filter 0.12s;
  cursor: pointer;
}
.mo-btn-sun:hover:not(:disabled) {
  filter: brightness(1.03);
}
.mo-btn-sun:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--mo-sun-d);
  transform: translateY(3px);
}

.mo-tile {
  background: var(--bg-card);
  border: 2px solid var(--mo-line);
  box-shadow: 0 3px 0 var(--mo-line);
  border-radius: 14px;
  font-weight: 700;
  transition: transform 80ms, box-shadow 80ms, border-color 0.12s, color 0.12s;
  cursor: pointer;
}
.mo-tile:hover:not(:disabled) {
  border-color: rgba(249, 115, 22, 0.5);
  color: var(--accent-primary);
}
.mo-tile:active:not(:disabled) {
  box-shadow: 0 0 0 var(--mo-line);
  transform: translateY(3px);
}

/* Demo Card & Hero Animations */
.demo-card {
  background:
    radial-gradient(130% 90% at 100% 0%, rgba(249, 115, 22, 0.15), transparent 62%),
    radial-gradient(120% 90% at 0% 100%, rgba(13, 148, 136, 0.18), transparent 58%),
    var(--bg-card);
}

.demo-stage {
  background: linear-gradient(145deg, #132a2e 0%, #0f3d3e 48%, #7c2d12 100%);
}

.demo-tint-coral {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.12), var(--bg-card));
}
.demo-tint-teal {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.12), var(--bg-card));
}
.demo-tint-amber {
  background: linear-gradient(135deg, rgba(255, 201, 60, 0.22), var(--bg-card));
}
.demo-tint-mint {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), var(--bg-card));
}

.demo-aura {
  background:
    radial-gradient(closest-side, rgba(249, 115, 22, 0.24), transparent),
    radial-gradient(closest-side, rgba(13, 148, 136, 0.24), transparent);
  filter: blur(26px);
  background-position: 15% 15%, 85% 85%;
  background-repeat: no-repeat;
  background-size: 62% 62%, 58% 58%;
}

@keyframes demoWord {
  0%, 8% {
    color: var(--text-primary);
    background-size: 0% 0.34em;
  }
  14%, 82% {
    color: var(--text-primary);
    background-size: 100% 0.34em;
  }
  100% {
    color: var(--text-primary);
    background-size: 100% 0.34em;
  }
}
.demo-word {
  background-image: linear-gradient(rgba(249, 115, 22, 0.48), rgba(249, 115, 22, 0.48));
  background-position: 0 88%;
  background-repeat: no-repeat;
  background-size: 0% 0.34em;
  border-radius: 2px;
  animation: 5s linear infinite demoWord;
}

@keyframes demoProgress {
  0% { width: 4%; }
  90%, 100% { width: 100%; }
}
.demo-progress {
  animation: 5s linear infinite demoProgress;
}

@keyframes demoBar {
  0%, 100% { transform: scaleY(0.28); }
  50% { transform: scaleY(1); }
}
.demo-bar {
  transform-origin: bottom;
  animation: 0.9s ease-in-out infinite demoBar;
}

@keyframes demoPop {
  0%, 55% {
    opacity: 0.35;
    transform: scale(0.92);
  }
  68% {
    opacity: 1;
    transform: scale(1.08);
  }
  78%, 100% {
    opacity: 1;
    transform: scale(1);
  }
}
.demo-pop {
  animation: 5s ease-out infinite demoPop;
}

@keyframes demoPlayPulse {
  0% { opacity: 0.55; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(2); }
}
.demo-play-pulse {
  animation: 2.4s ease-out infinite demoPlayPulse;
}

@keyframes demoPlayBob {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
.demo-play-bob {
  animation: 2.4s ease-in-out infinite demoPlayBob;
}

@keyframes demoFigureSway {
  0%, 100% { transform: translate(-50%, 0) rotate(-1.5deg); }
  50% { transform: translate(-50%, -3px) rotate(1.5deg); }
}
.demo-figure {
  animation: 3.4s ease-in-out infinite demoFigureSway;
}

@keyframes demoFloatA {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-11px) rotate(-1deg); }
}
@keyframes demoFloatB {
  0%, 100% { transform: translateY(0) rotate(4deg); }
  50% { transform: translateY(9px) rotate(1deg); }
}
@keyframes demoFloatC {
  0%, 100% { transform: translate(0, 0) rotate(-2deg); }
  50% { transform: translate(-6px, -8px) rotate(3deg); }
}
.demo-float-a { animation: 6s ease-in-out infinite demoFloatA; }
.demo-float-b { animation: 7.5s ease-in-out infinite demoFloatB; }
.demo-float-c { animation: 9s ease-in-out infinite demoFloatC; }

/* YouTube URL Input Section */
.input-card {
  background: var(--bg-card);
  max-width: 820px;
  box-shadow: var(--mo-card-shadow);
  border: 2px solid var(--mo-line);
  border-radius: 20px;
  margin-left: auto;
  margin-right: auto;
  padding: 10px;
  position: relative;
  transition: border-color 0.2s;
}
.input-card:focus-within {
  border-color: rgba(249, 115, 22, 0.55);
}

.url-input {
  background: var(--bg-secondary);
  width: 100%;
  font-size: 15px;
  color: var(--text-primary);
  border: 2px solid transparent;
  border-radius: 14px;
  outline: none;
  padding: 14px 96px 14px 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.url-input:focus {
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}

/* Stress & Prosody Cues in WeShadow Studio */
.word-token {
  display: inline-block;
  padding: 2px 4px;
  margin: 0 1px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  position: relative;
}
.word-token:hover {
  background: rgba(249, 115, 22, 0.14);
  color: var(--accent-primary-dark);
}
.word-token.active-word {
  background: rgba(249, 115, 22, 0.32);
  color: #181310;
  transform: translateY(-1px);
}
.stress-primary {
  text-decoration: underline;
  text-decoration-color: #f97316;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
  font-weight: 800;
}
.stress-secondary {
  text-decoration: underline;
  text-decoration-color: #eab308;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  font-weight: 700;
}
.stress-reduced {
  text-decoration: underline dotted;
  text-decoration-color: #0d9488;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  opacity: 0.85;
}
.pause-mark {
  display: inline-block;
  color: #94a3b8;
  font-weight: 700;
  margin: 0 3px;
  font-size: 0.85em;
  user-select: none;
}
.link-arc {
  display: inline-block;
  color: #0d9488;
  font-weight: 700;
  margin: 0 -2px;
  transform: translateY(4px);
  font-size: 0.85em;
  user-select: none;
}

/* Popular Video Cards */
.video-card {
  background: var(--bg-card);
  border: 2px solid var(--mo-line);
  border-radius: 18px;
  padding: 7px 7px 10px;
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
  box-shadow: 0 2px 5px rgba(51, 35, 22, 0.05), 0 12px 22px -14px rgba(51, 35, 22, 0.22);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.video-card:hover {
  transform: translateY(-4px);
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: 0 6px 14px -2px rgba(51, 35, 22, 0.09), 0 16px 28px -14px rgba(51, 35, 22, 0.3);
}

/* Custom Scrollbar */
.custom-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(124, 111, 101, 0.3);
  border-radius: 999px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 111, 101, 0.5);
}
