/* =========================================================
   ALDANTEC — Voice AI
   Premium Dark AI Interface
   ========================================================= */

:root {
  --bg: #080808;
  --card: #111111;
  --border: #222222;
  --text: #ffffff;
  --text-secondary: #8a8a8a;
  --accent: #6366f1;
  --accent-dim: rgba(99, 102, 241, 0.14);

  --font-display: "Manrope", sans-serif;
  --font-body: "Inter", sans-serif;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

::selection {
  background: var(--accent-dim);
  color: var(--text);
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* ============ FADE-IN ============ */

.fade-in {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeIn 0.7s var(--ease) forwards;
}

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

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    animation: none;
    opacity: 1;
    transform: none;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* =========================================================
   HEADER
   ========================================================= */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  justify-self: start;
}

.nav {
  display: flex;
  gap: 32px;
  justify-self: center;
}

.nav__link {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.25s var(--ease);
  position: relative;
}

.nav__link:hover {
  color: var(--text);
}

.nav__link--active {
  color: var(--text);
}

.nav__link--active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -19px;
  height: 2px;
  background: var(--accent);
}

.search-trigger {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-secondary);
  font-size: 13px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}

.search-trigger:hover {
  border-color: #3a3a3a;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.search-trigger__kbd {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 120px 24px 100px;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  translate: -50% 0;
  width: 620px;
  height: 420px;
  background: radial-gradient(closest-side, var(--accent-dim), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(56px, 9vw, 96px);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 24px;
}

.hero__subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 56px;
}

/* ============ CONSOLE (generation block) ============ */

.console {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: left;
  transition: border-color 0.3s var(--ease);
}

.console:focus-within {
  border-color: #3a3a4a;
}

.console__textarea {
  width: 100%;
  height: 150px;
  resize: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}

.console__textarea::placeholder {
  color: #5c5c5c;
}

.console__textarea.shake {
  animation: shake 0.3s var(--ease);
}

@keyframes shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.console__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.console__counter {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.btn-generate {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  transition: transform 0.2s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
  box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
}

.btn-generate:hover {
  background: #7274f2;
  box-shadow: 0 8px 24px -8px rgba(99, 102, 241, 0.55);
}

.btn-generate:active {
  transform: scale(0.97);
}

.btn-generate:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.btn-generate__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  display: none;
  animation: spin 0.7s linear infinite;
}

.btn-generate--loading .btn-generate__spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============ VISUALIZER ============ */

.visualizer {
  margin-top: 28px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.5s var(--ease) forwards;
}

.visualizer__bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 48px;
}

.visualizer__bars span {
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  animation: wave 1.1s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% {
    height: 6px;
    opacity: 0.5;
  }
  50% {
    height: 40px;
    opacity: 1;
  }
}

.visualizer__status {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* =========================================================
   SECTION HEAD (shared)
   ========================================================= */

.section-head {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  margin-bottom: 32px;
}

.section-head__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.section-head__desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* =========================================================
   VOICE PANEL
   ========================================================= */

.voices {
  max-width: 1080px;
  margin: 0 auto;
  padding: 90px 0 20px;
}

.voice-grid {
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.voice-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.voice-card:hover {
  border-color: #333333;
  transform: translateY(-2px);
}

.voice-card--active {
  border-color: rgba(99, 102, 241, 0.4);
}

.voice-card__top {
  margin-bottom: 16px;
}

.voice-card__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 5px 10px;
  border-radius: 8px;
}

.voice-card__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
}

.voice-card__desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 22px;
}

.voice-card__select {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.voice-card__select:hover {
  border-color: #3a3a3a;
  background: rgba(255, 255, 255, 0.03);
}

.voice-card--active .voice-card__select {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* =========================================================
   HISTORY
   ========================================================= */

.history {
  max-width: 1080px;
  margin: 0 auto;
  padding: 90px 0 140px;
}

.history-list {
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: border-color 0.25s var(--ease);
}

.history-item:hover {
  border-color: #2c2c2c;
}

.history-item__text {
  font-size: 14.5px;
  margin-bottom: 4px;
}

.history-item__date {
  font-size: 12px;
  color: var(--text-secondary);
}

.history-item__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.history-item__btn {
  font-size: 12.5px;
  color: var(--text-secondary);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.history-item__btn:hover {
  color: var(--text);
  border-color: #3a3a3a;
}

/* =========================================================
   SEARCH MODAL
   ========================================================= */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

.search-modal[hidden] {
  display: none;
}

.search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s var(--ease) forwards;
}

.search-modal__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalIn 0.22s var(--ease) forwards;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-modal__field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.search-modal__icon {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.search-modal__input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
}

.search-modal__esc {
  font-size: 11px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}

.search-modal__results {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.search-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.search-result:hover,
.search-result--active {
  background: rgba(255, 255, 255, 0.05);
}

.search-result__text {
  font-size: 14px;
  color: var(--text);
}

.search-result__date {
  font-size: 12px;
  color: var(--text-secondary);
}

.search-modal__empty {
  padding: 32px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 32px 40px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.footer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 860px) {
  .header__inner {
    grid-template-columns: auto 1fr;
    padding: 16px 20px;
  }
  .nav {
    display: none;
  }
  .search-trigger {
    justify-self: end;
  }
  .search-trigger__label {
    display: none;
  }

  .hero {
    padding: 80px 20px 70px;
  }

  .voice-grid {
    grid-template-columns: 1fr;
    padding: 0 20px;
  }

  .section-head,
  .history-list {
    padding-left: 20px;
    padding-right: 20px;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .history-item__actions {
    width: 100%;
  }

  .history-item__btn {
    flex: 1;
    text-align: center;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 24px 20px 32px;
  }
}
