:root {
  --bg: #061a2f;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.14);
  --text: #e9f2ff;
  --muted: #c3d4e8;
  --accent: #66d2ff;
  --accent-2: #f6c851;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

body.theme-home {
  background-color: var(--bg);
  background-image: url("./assets/images/background-home.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

body.theme-intro {
  background-color: var(--bg);
  background-image: url("./assets/images/background-intro.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

body.theme-status {
  background-color: var(--bg);
  background-image: url("./assets/images/background-status.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.background,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.background {
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.07), transparent 45%);
  mix-blend-mode: screen;
}

.grain {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  opacity: 0.35;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 18px 7vw;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.home-button {
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.home-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .dot {
  width: 3vw;
  height: 3vw;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(102, 210, 255, 0.8);
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: 0.4px;
}

.brand-text small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.shell {
  position: relative;
  z-index: 1;
  padding: 140px 7vw 80px;
  display: grid;
  place-items: center;
}

.panel {
  width: 94vw;
  max-width: 100%;
  background: linear-gradient(135deg, var(--glass), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  backdrop-filter: blur(18px);
  display: none;
  flex-direction: column;
  gap: 22px;
  position: relative;
  overflow: hidden;
}

.panel.active {
  display: flex;
  animation: fadeIn 0.4s ease;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.08), transparent 35%);
}

.phrase-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form {
  display: none;
}

.phrase-form input {
  flex: 1 1 60%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 16px;
}

.phrase-form button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #03101c;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 30px rgba(102, 210, 255, 0.35);
}

.phrase-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(246, 200, 81, 0.32);
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary,
.secondary {
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #03101c;
  border-color: rgba(255, 255, 255, 0.16);
}

.secondary {
  background: rgba(0, 0, 0, 0.45);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.primary:hover,
.secondary:hover {
  transform: translateY(-1px);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 90vw;
  z-index: 20;
  font-size: 14px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.input-dock {
  position: fixed;
  bottom: 3vh;
  left: 3vw;
  width: 92vw;
  max-width: 100%;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 30;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.input-dock.collapsed {
  transform: translateY(calc(100% - 48px));
}

.dock-toggle {
  width: 100%;
  background: transparent;
  color: var(--text);
  border: none;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 700;
}

.dock-toggle .toggle-icon {
  font-size: 12px;
}

.dock-panel {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.dock-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
  color: var(--accent);
}

.dock-title {
  margin: 0;
  font-size: 16px;
}

.dock-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.dock-card {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
}

.dock-card-title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 14px;
}

.dock-card-body {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dock-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.dock-form input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
}

.dock-form button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #03101c;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
}

.dock-form button:disabled,
.dock-form input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.hidden {
  position: absolute;
  left: -9999px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .shell {
    padding: 120px 20px 60px;
  }

  .panel {
    padding: 24px;
  }

  .phrase-form {
    flex-direction: column;
    align-items: stretch;
  }

  .top-bar {
    padding: 14px 18px;
  }

  .input-dock {
    left: 3vw;
    right: 3vw;
    width: 94vw;
  }

  .input-dock.collapsed {
    transform: translateY(calc(100% - 44px));
  }

  body.theme-home,
  body.theme-intro,
  body.theme-status {
    background-size: cover;
    background-attachment: scroll;
    background-position: center;
  }
}
