* { box-sizing: border-box; }
html, body { height: 100%; }

:root {
  --color-primary-start: #667eea;
  --color-primary-end: #764ba2;
  --color-accent: #00d4ff;
  --color-bg-dark: #0a0e27;
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(255,255,255,0.7);
  --color-text-tertiary: rgba(255,255,255,0.5);
  --color-overlay-light: rgba(255,255,255,0.08);
  --color-overlay-dark: rgba(0,0,0,0.3);
  --spacing-xs: 4px;
  --spacing-sm: 6px;
  --spacing-md: 8px;
  --spacing-lg: 12px;
  --spacing-xl: 16px;
  --spacing-2xl: 24px;
  --spacing-3xl: 32px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #0a0033; /* real fundo via #bg */
  color: var(--color-text-primary);
  overflow: hidden;
}

/* Home (landing) uses scrollable layout */
body.home-page {
  background: var(--color-bg-dark);
  overflow: auto;
}

.box {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 2000;
  background: #FFD700;
  color: #1A0B35;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}

#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(circle at 50% 50%, var(--bg1, #12072F) 0%, var(--bg2, #0E0627) 55%, var(--bg3, #0B0522) 100%);
  background-size: 140% 140%; /* cobre alem das bordas para evitar banding nas extremidades */
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.96; /* fora do FS */
  transition: opacity 0.5s ease, background-size 6s ease-in-out, filter 6s ease-in-out;
}

/* Ondas suaves e gradiente especial para Pintura Viva */
body.theme-pintura-viva #bg {
  background:
    radial-gradient(circle at center,
      #D5B65F 0%,
      #B8943F 16%,
      #6B3FA8 52%,
      #130634 100%);
  animation: pinturaVivaWaves 20s ease-in-out infinite;
  filter: brightness(0.85);
}

@keyframes pinturaVivaWaves {
  0%   { background-size: 130% 130%; }
  50%  { background-size: 170% 170%; }
  100% { background-size: 130% 130%; }
}
body.is-fullscreen #bg { opacity: 1; }

#container {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

#viz {
  width: min(96vw, 96vh);
  height: min(96vw, 96vh);
  display: block;
}

body.theme-gold #controls {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0,0,0,0.55);
  border-radius: 999px;
  color: #ffd700;
  backdrop-filter: blur(8px);
  transition: opacity 240ms ease, transform 240ms ease;
  z-index: 100;
  font-size: 12px;
  letter-spacing: 0.5px;
}
select#moduleSel {
  appearance: none;
  background: linear-gradient(145deg, #12072F 0%, #0B0522 100%);
  color: #FFE773;
  border: 1px solid #FFD700;
  padding: 10px 36px 10px 14px;
  border-radius: 14px;
  box-shadow: 0 0 12px rgba(178,110,255,0.35);
  font-weight: 600;
  letter-spacing: 0.3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23FFD700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
/* Estilo igual para o seletor de modo */
select#modeSel {
  appearance: none;
  background: linear-gradient(145deg, #12072F 0%, #0B0522 100%);
  color: #FFE773;
  border: 1px solid #FFD700;
  padding: 10px 36px 10px 14px;
  border-radius: 14px;
  box-shadow: 0 0 12px rgba(178,110,255,0.35);
  font-weight: 600;
  letter-spacing: 0.3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23FFD700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
select#modeSel:focus-visible {
  outline: 2px solid rgba(249,212,35,.8);
  outline-offset: 3px;
}
select#modeSel option { background-color: #0E0627; color: #EBD36E; }
select#modeSel option:checked { background-color: #33125A; color: #FFE773; }
select#modeSel option:hover { background-color: #4A1C84; color: #FFFFFF; }
select#moduleSel:focus-visible {
  outline: 2px solid rgba(249,212,35,.8);
  outline-offset: 3px;
}
select#moduleSel option {
  background-color: #0E0627;
  color: #EBD36E;
}
select#moduleSel option:checked {
  background-color: #33125A;
  color: #FFE773;
}
select#moduleSel option:hover {
  background-color: #4A1C84;
  color: #FFFFFF;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
body.is-fullscreen #controls.hidden { opacity: 0; transform: translate(-50%, 10px); pointer-events: none; }

button {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
}

/* Botao padrao RingLight: Violeta Dourado Invertido */
body.theme-gold .btn-ringlight {
  background: linear-gradient(145deg, #3B006A 0%, #FFE773 90%);
  color: #FFFFFF;
  border: 1px solid #FFD700;
  box-shadow: 0 0 14px #B26EFF;
  border-radius: 999px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.55), 0 0 6px #FFD700;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
  font-weight: 700;
}
body.theme-gold .btn-ringlight:hover { 
  background: linear-gradient(145deg, #5A00A1 10%, #FFD700 95%);
  box-shadow: 0 0 24px #FFD700, 0 0 34px rgba(180,124,255,0.8);
  transform: translateY(-1px);
}
body.theme-gold .btn-ringlight:active {
  transform: translateY(0);
  filter: brightness(0.98);
}
body.theme-gold .btn-ringlight:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}
body.theme-gold .btn-ringlight:focus-visible {
  outline: 2px solid rgba(249,212,35,.8);
  outline-offset: 3px;
}

#timer { color: #fff; font-weight: 700; }
#phase {
  color: #FFE9A6;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  padding: 4px 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 0%, rgba(12,0,32,0.9), rgba(8,0,26,0.9));
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  z-index: 1000;
}
.modal.hidden { display: none; }
.modal-content {
  width: min(90vw, 700px);
  background: radial-gradient(100% 100% at 50% 0%, rgba(18,0,59,0.95), rgba(10,0,48,0.95));
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(255,215,0,0.2);
  padding: 24px;
  color: #eee;
}
.modal-content h2 {
  margin-bottom: 12px;
  color: #ffd700;
}
.modal-text {
  line-height: 1.6;
  color: #f3e5ff;
}
.modal-actions { display: flex; gap: 12px; margin-top: 16px; justify-content: flex-end; }
.modal-actions button { min-width: 96px; }

/* Letterbox removido: fundo cobre 100% com gradiente radial suave */

/* Fullscreen button (re-entry) */
#fsBtn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  opacity: 0.5;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  z-index: 1001;
  display: none;
  transition: opacity 200ms ease;
}
body:not(.is-fullscreen) #fsBtn { display: inline-block; }
#fsBtn:hover { opacity: 0.8; }

/* --- RingLight public: responsive controls + violet theme overrides --- */
#controls{
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
  padding: 12px 16px;
  width: min(96vw, 1100px);
  z-index: 100;
  background: rgba(6, 2, 24, 0.82);
  border: 1px solid rgba(255, 215, 0, 0.24);
  box-shadow: 0 18px 50px rgba(0,0,0,0.45), 0 0 32px rgba(124,76,255,0.35);
  border-radius: 18px;
  backdrop-filter: blur(8px);
}
#controls .ghost{
  background: transparent;
  border: 1px solid #FFD700;
  color: #FFD700;
}
.btn-ringlight{background:linear-gradient(180deg,#240046 0%,#3B0A6E 100%);color:#E9DAFF;border:1px solid #6F38C5;box-shadow:0 0 14px rgba(124,76,255,.45);border-radius:999px;text-shadow:0 1px 2px rgba(0,0,0,.45);transition:all .25s ease;letter-spacing:.3px;font-weight:700}
.btn-ringlight:hover{background:linear-gradient(180deg,#2E005D 0%,#5200A8 100%);box-shadow:0 0 22px rgba(138,84,255,.65);transform:translateY(-1px)}
.btn-ringlight:active{transform:translateY(0);filter:brightness(.98)}
.btn-ringlight:disabled{opacity:.6;cursor:not-allowed;box-shadow:none}
.btn-ringlight:focus-visible{outline:2px solid rgba(178,124,255,.9);outline-offset:3px}
#fsBtn{bottom:72px}
@media (max-width:768px){
  #controls{
    position: static;
    transform: none;
    width: 100%;
    margin: 10px auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  #container{
    flex-direction: column;
    padding: 12px;
    height: auto;
    min-height: 100vh;
  }
  #viz{
    width: 100%;
    max-width: 680px;
    height: auto;
    aspect-ratio: 1/1;
    margin: 0 auto 12px;
  }
  .control-row{
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(120px,1fr));
    gap: 8px;
  }
  .status-block{
    width: 100%;
  }
  #fsBtn{
    position: static;
    align-self: center;
    transform: none;
    margin-top: 6px;
  }
}
@media (max-width:560px){
  #controls{bottom:10px;gap:8px 10px;padding:10px 12px;font-size:11px;width:96vw}
  button,.btn-ringlight{padding:8px 12px}
  select#moduleSel,select#modeSel{padding:8px 32px 8px 12px}
  #fsBtn{right:12px}
}
@media (max-width:380px){
  #controls{font-size:10px;gap:6px 8px}
  button,.btn-ringlight{padding:7px 10px}
}

.status-block{
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  gap: 6px;
}
.status-block .timer{
  font-weight: 700;
  letter-spacing: 0.5px;
}
.phase-line{
  color: #FFE9A6;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.state-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 12px;
  background: linear-gradient(120deg, rgba(255,215,0,0.25), rgba(255,255,255,0.04));
  color: #FFF3C0;
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.beat-label{
  color: #D7E3FF;
  font-size: 13px;
}
.control-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* --- Home / Landing (Design System v1) --- */
.home-shell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
.home-header{
  position:sticky;
  top:0;
  z-index:10;
  background:rgba(10,14,39,0.98);
  border-bottom:1px solid rgba(255,255,255,0.08);
  backdrop-filter:blur(10px);
}
.home-header-inner{
  max-width:1200px;
  margin:0 auto;
  padding:var(--spacing-md) var(--spacing-xl);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--spacing-lg);
}
.home-logo{
  display:flex;
  align-items:center;
  gap:var(--spacing-md);
}
.home-logo-mark{
  width:28px;
  height:28px;
  border-radius:999px;
  background:linear-gradient(135deg,var(--color-primary-start),var(--color-primary-end));
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  color:#fff;
  box-shadow:0 0 18px rgba(102,126,234,0.6);
}
.home-logo-title{
  font-weight:700;
  font-size:15px;
}
.home-logo-tagline{
  font-size:11px;
  color:var(--color-text-secondary);
}
.home-nav{
  display:flex;
  gap:var(--spacing-md);
  font-size:13px;
  padding:6px 10px;
  border:1px solid rgba(255,255,255,0.12);
  border-radius:999px;
  background:rgba(255,255,255,0.04);
}
.home-nav-link{
  color:var(--color-text-secondary);
  text-decoration:none;
  padding:6px 10px;
  border-radius:999px;
  transition:background 0.2s ease,color 0.2s ease;
}
.home-nav-link:hover{
  background:rgba(255,255,255,0.06);
  color:var(--color-text-primary);
}
.home-nav-link.is-active{
  background:rgba(0,212,255,0.15);
  color:var(--color-accent);
}

.home-main{
  flex:1;
}
.home-hero{
  padding:var(--spacing-3xl) var(--spacing-xl);
  background:radial-gradient(circle at 0% 0%,rgba(102,126,234,0.4),transparent 55%),
             radial-gradient(circle at 100% 100%,rgba(0,212,255,0.25),transparent 55%),
             #0a0e27;
  position: relative;
}
.home-hero::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(135deg, rgba(10,14,39,0.35), rgba(10,14,39,0.75));
  pointer-events:none;
}
.home-hero-inner{
  max-width:1200px;
  margin:0 auto;
  position: relative;
  z-index: 1;
}
.home-hero-text{
  max-width:640px;
}
.home-hero-title{
  font-size:32px;
  font-weight:700;
  margin-bottom:var(--spacing-md);
  background:linear-gradient(135deg,var(--color-primary-start),var(--color-primary-end));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}
.home-hero-subtitle{
  font-size:18px;
  font-weight:600;
  color:var(--color-accent);
  margin-bottom:var(--spacing-md);
}
.home-hero-body{
  font-size:14px;
  color:var(--color-text-secondary);
  line-height:1.8;
  margin-bottom:var(--spacing-xl);
}
.home-hero-feature{
  margin-top: var(--spacing-2xl);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-xl);
}
.feature-card{
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255,215,0,0.25);
  background: linear-gradient(145deg, rgba(51,19,95,0.75), rgba(24,12,55,0.9));
  box-shadow: 0 18px 52px rgba(0,0,0,0.45);
  min-height: 220px;
}
.feature-card img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
  filter: blur(1px);
}
.feature-card .content{
  position: relative;
  z-index: 1;
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feature-card h3{
  margin: 0;
  font-size: 18px;
  color: #FFE773;
}
.feature-card p{
  margin: 0;
  color: #E7E0FF;
  font-size: 14px;
  line-height: 1.6;
}
.feature-card .actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.home-hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap:var(--spacing-md);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 24px;
  border-radius:8px;
  border:none;
  font-weight:600;
  font-size:14px;
  cursor:pointer;
  text-decoration:none;
  transition:all 0.25s ease;
}
.btn-primary{
  background:linear-gradient(135deg,var(--color-primary-start),var(--color-primary-end));
  color:#fff;
  box-shadow:0 10px 25px rgba(102,126,234,0.4);
}
.btn-primary:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 30px rgba(102,126,234,0.5);
}
.btn-secondary{
  background:var(--color-overlay-light);
  color:var(--color-accent);
  border:1px solid rgba(0,212,255,0.3);
}
.btn-secondary:hover{
  background:rgba(0,212,255,0.15);
  border-color:var(--color-accent);
}
.btn-outline{
  background:rgba(255,255,255,0.04);
  color:rgba(255,255,255,0.7);
  border:2px solid rgba(255,255,255,0.2);
  padding:10px 18px;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
}
.btn-outline.active{
  background:linear-gradient(135deg,var(--color-primary-start),var(--color-primary-end));
  color:#fff;
  border-color:var(--color-accent);
  box-shadow:0 0 10px rgba(0,212,255,0.4);
}

.home-section{
  padding:var(--spacing-3xl) var(--spacing-xl) var(--spacing-3xl);
}
.home-section-inner{
  max-width:1200px;
  margin:0 auto;
}
.home-section-header{
  max-width:720px;
  margin:0 auto var(--spacing-2xl);
  text-align:center;
}
.home-section-title{
  font-size:24px;
  font-weight:700;
  margin-bottom:var(--spacing-md);
  color:var(--color-accent);
}
.home-section-subtitle{
  font-size:14px;
  color:var(--color-text-secondary);
}

.home-modules-grid,
.fragments-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:var(--spacing-2xl);
}
.card{
  background:var(--color-overlay-light);
  border:1px solid rgba(255,255,255,0.15);
  border-radius:12px;
  padding:var(--spacing-xl);
  display:flex;
  flex-direction:column;
  gap:var(--spacing-md);
  height:100%;
  box-shadow:0 12px 30px rgba(0,0,0,0.25);
}
.card-primary{
  background:linear-gradient(135deg,rgba(102,126,234,0.18),rgba(118,75,162,0.18));
}
.card-icon{
  font-size:20px;
  opacity:0.9;
}
.card-title{
  font-size:18px;
  font-weight:600;
}
.card-description{
  font-size:13px;
  color:var(--color-text-secondary);
  flex:1;
}
.card-cta{
  align-self:flex-start;
}
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(255,255,255,0.08);
  font-size:10px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:var(--color-text-secondary);
}
.fragment-card{
  max-width:720px;
  margin:0 auto;
}
.fragment-controls{
  margin-top:var(--spacing-lg);
  padding-top:var(--spacing-md);
  border-top:1px solid rgba(255,255,255,0.16);
  display:flex;
  flex-wrap:wrap;
  gap:var(--spacing-md);
  align-items:center;
  justify-content:space-between;
}
.fragment-status{
  font-size:11px;
  color:var(--color-text-tertiary);
  display:flex;
  flex-direction:column;
  gap:2px;
}

.home-phases-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:var(--spacing-md);
  justify-items:center;
}
.home-phase-item{
  display:flex;
  justify-content:center;
}
.phase-pill{
  pointer-events:none;
}

.home-footer{
  padding:var(--spacing-xl) var(--spacing-xl) var(--spacing-2xl);
  border-top:1px solid rgba(255,255,255,0.08);
  background:#050713;
}
.home-footer-inner{
  max-width:1200px;
  margin:0 auto;
  font-size:11px;
  color:var(--color-text-tertiary);
}
.home-footer-text{
  margin-bottom:4px;
}

@media (max-width:720px){
  .home-header-inner{
    flex-direction:column;
    align-items:flex-start;
  }
  .home-nav{
    width:100%;
    justify-content:flex-start;
    flex-wrap:wrap;
  }
  .home-hero{
    padding:var(--spacing-2xl) var(--spacing-lg);
  }
  .home-section{
    padding:var(--spacing-2xl) var(--spacing-lg);
  }
  .home-phases-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width:480px){
  .home-phases-grid{
    grid-template-columns:1fr;
  }
}

.stage-banner{
  position:sticky;
  top:0;
  z-index:3000;
  padding:10px 16px;
  text-align:center;
  background:linear-gradient(90deg,#6a2c91,#0d6b8a);
  color:#fff;
  font-size:12px;
  font-weight:700;
  letter-spacing:0.04em;
  border-bottom:1px solid rgba(255,255,255,0.18);
}

.home-note{
  max-width:820px;
  margin:0 auto;
}

.status-inline{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  margin-top:var(--spacing-lg);
}

.status-inline .badge{
  font-size:11px;
  letter-spacing:0.04em;
}

.hero-origin-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-bottom:var(--spacing-lg);
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(255,255,255,0.05);
  color:var(--color-text-secondary);
  text-decoration:none;
  font-size:12px;
  letter-spacing:0.03em;
  transition:all 0.2s ease;
}

.hero-origin-link:hover{
  color:#fff;
  border-color:rgba(0,212,255,0.35);
  background:rgba(0,212,255,0.1);
  transform:translateY(-1px);
}

.badge-stable{
  background:rgba(77,208,140,0.16);
  border-color:rgba(77,208,140,0.45);
  color:#99f1bf;
}

.badge-beta{
  background:rgba(255,215,0,0.12);
  border-color:rgba(255,215,0,0.38);
  color:#ffe773;
}

.badge-exploratory{
  background:rgba(0,212,255,0.12);
  border-color:rgba(0,212,255,0.38);
  color:#8de8ff;
}

/* --- Public shell v1.0 overrides --- */
:root{
  --color-bg-dark:#090615;
  --color-bg-panel:#140b2d;
  --color-bg-panel-strong:#1b0f3b;
  --color-primary-start:#2f1357;
  --color-primary-end:#4a1d83;
  --color-primary-edge:#7a4ccc;
  --color-accent:#ffd873;
  --color-accent-soft:#ffefb2;
  --color-focus:#55d7ff;
  --color-text-primary:#f8f5ff;
  --color-text-secondary:rgba(248,245,255,0.76);
  --color-text-tertiary:rgba(248,245,255,0.56);
  --color-overlay-light:rgba(255,255,255,0.05);
  --color-overlay-dark:rgba(8,4,22,0.78);
}

body.home-page{
  background:
    radial-gradient(circle at 0% 0%, rgba(94,41,161,0.28), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(255,216,115,0.1), transparent 26%),
    linear-gradient(180deg, #0b0718 0%, #090615 100%);
  color:var(--color-text-primary);
}

.site-header{
  position:sticky;
  top:0;
  z-index:30;
  background:rgba(10,7,24,0.88);
  border-bottom:1px solid rgba(255,216,115,0.14);
  backdrop-filter:blur(16px);
}

.site-header-inner,
.site-footer-inner{
  max-width:1240px;
  margin:0 auto;
  padding:14px 20px;
}

.site-header-inner{
  display:grid;
  grid-template-columns:auto minmax(0, 1fr) auto;
  align-items:center;
  gap:18px;
}

.site-brand{
  display:inline-flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:var(--color-text-primary);
}

.site-brand-mark{
  width:34px;
  height:34px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  font-weight:800;
  color:#fff6dd;
  background:linear-gradient(135deg, #35135e 0%, #6c2fb4 100%);
  border:1px solid rgba(255,216,115,0.4);
  box-shadow:0 0 24px rgba(108,47,180,0.42);
}

.site-brand-copy{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.site-brand-title{
  font-size:15px;
  font-weight:700;
}

.site-brand-tagline{
  font-size:11px;
  color:var(--color-text-tertiary);
}

.site-nav,
.app-topbar-nav{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
}

.site-nav{
  justify-content:center;
}

.site-nav-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:9px 14px;
  border-radius:999px;
  text-decoration:none;
  color:var(--color-text-secondary);
  border:1px solid transparent;
  transition:background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.site-nav-link:hover{
  color:var(--color-text-primary);
  background:rgba(255,255,255,0.04);
  border-color:rgba(255,216,115,0.18);
}

.site-nav-link.is-active{
  color:var(--color-accent);
  background:rgba(255,216,115,0.08);
  border-color:rgba(255,216,115,0.26);
  box-shadow:0 0 18px rgba(255,216,115,0.08);
}

.site-socials{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
}

.site-social-link{
  position:relative;
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  color:#f3ecff;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:999px;
  transition:transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.site-social-link:hover{
  transform:translateY(-1px);
  background:rgba(255,216,115,0.08);
  border-color:rgba(255,216,115,0.34);
  box-shadow:0 10px 22px rgba(0,0,0,0.24);
}

.site-social-link:focus-visible,
.site-nav-link:focus-visible,
.btn:focus-visible,
.hero-origin-link:focus-visible,
.guide-anchor:focus-visible{
  outline:2px solid rgba(85,215,255,0.95);
  outline-offset:3px;
}

.site-social-icon{
  width:18px;
  height:18px;
  display:inline-flex;
}

.site-social-icon svg{
  width:18px;
  height:18px;
}

.site-social-badge{
  position:absolute;
  right:-2px;
  bottom:-4px;
  min-width:18px;
  height:18px;
  padding:0 4px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  font-size:9px;
  font-weight:800;
  color:#fff;
  background:#5e2da1;
  border:1px solid rgba(255,255,255,0.22);
}

.site-social-link--dj .site-social-badge{ background:#6f2ab3; }
.site-social-link--lq .site-social-badge{ background:#2c6579; }
.site-social-link--tq .site-social-badge{ background:#8b6714; }

.site-footer{
  margin-top:auto;
  border-top:1px solid rgba(255,216,115,0.14);
  background:rgba(6,4,15,0.95);
}

.site-footer-inner{
  display:grid;
  gap:16px;
  text-align:center;
}

.site-footer-copy{
  margin:0;
  font-size:12px;
  color:var(--color-text-secondary);
}

.site-footer-disclaimer{
  margin:0;
  font-size:11px;
  color:var(--color-text-tertiary);
}

.site-socials-footer{
  justify-content:center;
}

.home-hero{
  background:
    radial-gradient(circle at 10% 10%, rgba(92,42,150,0.42), transparent 46%),
    radial-gradient(circle at 100% 0%, rgba(255,216,115,0.12), transparent 24%),
    linear-gradient(180deg, #0d081c 0%, #090615 100%);
}

.home-hero::after{
  background:linear-gradient(135deg, rgba(8,5,20,0.16), rgba(8,5,20,0.64));
}

.home-hero-title{
  background:linear-gradient(135deg, #fff7df 0%, #ffd873 34%, #c08cff 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}

.home-hero-subtitle,
.home-section-title{
  color:var(--color-accent);
}

.feature-card{
  border:1px solid rgba(255,216,115,0.22);
  background:linear-gradient(145deg, rgba(34,16,69,0.82), rgba(16,10,39,0.96));
}

.feature-card h3{
  color:var(--color-accent);
}

.btn{
  min-height:46px;
  padding:12px 22px;
  border-radius:999px;
  font-weight:700;
  letter-spacing:0.02em;
  border:1px solid transparent;
}

.btn-primary{
  color:#fff8e7;
  background:linear-gradient(135deg, #2f1357 0%, #4b1d86 100%);
  border-color:rgba(255,216,115,0.42);
  box-shadow:0 12px 28px rgba(31,10,60,0.36), 0 0 18px rgba(255,216,115,0.12);
}

.btn-primary:hover{
  transform:translateY(-2px);
  background:linear-gradient(135deg, #3a1768 0%, #59249b 100%);
  box-shadow:0 16px 34px rgba(31,10,60,0.46), 0 0 22px rgba(255,216,115,0.16);
}

.btn-secondary{
  color:#fff8e7;
  background:linear-gradient(135deg, #2f1357 0%, #4b1d86 100%);
  border-color:rgba(255,216,115,0.42);
  box-shadow:0 12px 28px rgba(31,10,60,0.36), 0 0 18px rgba(255,216,115,0.12);
}

.btn-secondary:hover{
  transform:translateY(-2px);
  color:#fff8e7;
  background:linear-gradient(135deg, #3a1768 0%, #59249b 100%);
  border-color:rgba(255,216,115,0.42);
  box-shadow:0 16px 34px rgba(31,10,60,0.46), 0 0 22px rgba(255,216,115,0.16);
}

.btn-ghost{
  color:var(--color-text-secondary);
  background:transparent;
  border-color:rgba(255,255,255,0.14);
}

.btn-ghost:hover{
  color:var(--color-text-primary);
  background:rgba(255,255,255,0.04);
}

.card{
  background:linear-gradient(180deg, rgba(17,11,38,0.88) 0%, rgba(12,8,30,0.96) 100%);
  border:1px solid rgba(255,255,255,0.1);
}

.card-primary{
  background:linear-gradient(180deg, rgba(38,17,73,0.94) 0%, rgba(18,10,43,0.98) 100%);
  border-color:rgba(255,216,115,0.16);
}

.card-description{
  line-height:1.65;
}

.status-inline{
  justify-content:flex-start;
}

.hero-origin-link{
  color:#f4e8be;
  background:rgba(255,216,115,0.08);
  border:1px solid rgba(255,216,115,0.26);
}

.hero-origin-link:hover{
  color:#fff5d3;
  border-color:rgba(255,216,115,0.46);
  background:rgba(255,216,115,0.14);
}

.home-inline-note{
  margin-top:24px;
  display:grid;
  gap:10px;
  text-align:left;
}

.home-inline-note p{
  margin:0;
  line-height:1.7;
  color:var(--color-text-secondary);
}

.inline-note-links{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.inline-note-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:8px 14px;
  border-radius:999px;
  text-decoration:none;
  color:var(--color-accent);
  border:1px solid rgba(255,216,115,0.24);
  background:rgba(255,255,255,0.04);
}

.inline-note-link:hover{
  color:#fff4c8;
  background:rgba(255,216,115,0.08);
}

.guide-anchors{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:18px;
}

.guide-anchor{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:8px 14px;
  border-radius:999px;
  text-decoration:none;
  color:var(--color-text-secondary);
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.04);
}

.guide-anchor:hover{
  color:var(--color-accent);
  border-color:rgba(255,216,115,0.26);
}

.guide-section h2,
.guide-section h3{
  color:var(--color-accent-soft);
}

.section-actions{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:14px;
}

.roadmap-card{
  position:relative;
}

.roadmap-card::before{
  content:'Em validação';
  position:absolute;
  top:18px;
  right:18px;
  padding:4px 10px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  letter-spacing:0.06em;
  text-transform:uppercase;
  color:#fff2c4;
  border:1px solid rgba(255,216,115,0.26);
  background:rgba(255,216,115,0.08);
}

.app-page{
  overflow:hidden;
}

.app-topbar{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:220;
  background:rgba(8,5,20,0.74);
  border-bottom:1px solid rgba(255,216,115,0.14);
  backdrop-filter:blur(14px);
}

.app-topbar-inner{
  max-width:1400px;
  margin:0 auto;
  padding:10px 16px;
  display:grid;
  grid-template-columns:auto minmax(0, 1fr) auto;
  align-items:center;
  gap:14px;
}

.site-brand-app .site-brand-title{
  font-size:14px;
}

.site-brand-app .site-brand-tagline{
  font-size:10px;
}

.app-topbar-link{
  min-height:34px;
  padding:7px 12px;
  font-size:13px;
}

.site-socials-compact{
  gap:6px;
}

.site-socials-compact .site-social-link{
  width:34px;
  height:34px;
}

body.app-page #container{
  padding-top:68px;
}

.box{
  background:linear-gradient(180deg, rgba(19,12,42,0.88) 0%, rgba(12,8,30,0.96) 100%);
  border:1px solid rgba(255,255,255,0.12);
}

body.theme-gold .btn-ringlight,
.btn-ringlight{
  background:linear-gradient(180deg, #2f1357 0%, #4b1d86 100%);
  color:#fff8e7;
  border:1px solid rgba(255,216,115,0.42);
  box-shadow:0 0 18px rgba(75,29,134,0.45);
  text-shadow:0 1px 2px rgba(0,0,0,0.45);
}

body.theme-gold .btn-ringlight:hover,
.btn-ringlight:hover{
  background:linear-gradient(180deg, #3a1768 0%, #59249b 100%);
  box-shadow:0 0 24px rgba(255,216,115,0.18), 0 0 28px rgba(89,36,155,0.52);
}

body.theme-gold .btn-ringlight.ghost,
#controls .ghost{
  background:rgba(10,7,24,0.82);
  color:var(--color-accent);
  border:1px solid rgba(255,216,115,0.34);
}

@media (max-width:1080px){
  .site-header-inner,
  .app-topbar-inner{
    grid-template-columns:1fr;
    justify-items:start;
  }

  .site-nav,
  .app-topbar-nav{
    justify-content:flex-start;
  }

  .site-socials,
  .site-socials-compact{
    justify-content:flex-start;
  }
}

@media (max-width:720px){
  .site-header-inner,
  .site-footer-inner{
    padding:14px 16px;
  }

  .site-nav{
    width:100%;
  }

  .site-socials{
    width:100%;
    overflow-x:auto;
    padding-bottom:4px;
    flex-wrap:nowrap;
  }

  .site-socials::-webkit-scrollbar{
    height:6px;
  }

  .site-socials::-webkit-scrollbar-thumb{
    background:rgba(255,216,115,0.18);
    border-radius:999px;
  }

  .guide-anchors,
  .section-actions,
  .inline-note-links{
    flex-direction:column;
    align-items:stretch;
  }

  .guide-anchor,
  .inline-note-link{
    width:100%;
  }

  .home-hero-actions{
    flex-direction:column;
    align-items:stretch;
  }

  .app-topbar{
    position:static;
  }

  body.app-page #container{
    padding-top:0;
  }
}
