/* ============================================
   TongueType Landing Page
   ============================================ */

:root {
  /* Brand */
  --color-primary: #D26AE8;
  --color-primary-light: #E468B0;
  --color-primary-warm: #EE6383;
  --gradient-brand: linear-gradient(135deg, #D26AE8, #E468B0, #EE6383);

  /* Backgrounds */
  --color-bg: #0A0A0F;
  --color-bg-elevated: #111118;
  --color-bg-card: #16161F;
  --color-bg-card-hover: #1C1C28;

  /* Text */
  --color-text: #F0F0F5;
  --color-text-muted: #8888A0;
  --color-text-dim: #767697;

  /* Misc */
  --color-border: #2A2A3A;
  --color-star: #F0C040;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 64px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);

  &:hover {
    color: var(--color-primary);
  }
}

ul {
  list-style: none;
}

/* ---- Skip Link ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--gradient-brand);
  color: #fff;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-size: 0.875rem;

  &:focus {
    top: 0.5rem;
  }
}

/* ---- Container ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  text-decoration: none;
  line-height: 1;

  & i {
    font-size: 1.25rem;
  }

  &.btn-primary {
    background: linear-gradient(135deg, #B055C8, #C45898, #D04E6E);
    color: #fff;
    background-size: 200% 200%;
    background-position: 0% 50%;
    box-shadow: 0 4px 20px rgba(210, 106, 232, 0.3);

    &:hover {
      background-position: 100% 50%;
      box-shadow: 0 6px 30px rgba(210, 106, 232, 0.45);
      transform: translateY(-2px);
      color: #fff;
    }
  }

  &.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);

    &:hover {
      border-color: var(--color-primary-light);
      color: var(--color-primary-light);
      transform: translateY(-2px);
    }
  }

  &.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* ---- Text Utilities ---- */
.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 1rem;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(210, 106, 232, 0.1);
  border: 1px solid rgba(210, 106, 232, 0.25);
  color: var(--color-primary-light);

  & i {
    font-size: 1rem;
  }
}

/* ============================================
   Nav
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: all var(--transition-base);

  &.scrolled {
    background: rgba(10, 10, 15, 0.9);
    border-bottom-color: var(--color-border);
  }

  &.open {
    & .nav-toggle-open {
      display: none;
    }

    & .nav-toggle-close {
      display: block;
    }

    & .nav-links {
      display: flex;
    }
  }
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text);
  text-decoration: none;

  &:hover {
    color: var(--color-text);
  }

  & img {
    border-radius: 6px;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;

  & ul {
    display: flex;
    gap: 1.75rem;
  }

  & a:not(.btn) {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color var(--transition-fast);
  }

  & a:hover,
  & a.active {
    color: var(--color-text);
  }
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.nav-toggle-close {
  display: none;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  padding: 8rem 0 5rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.hero-content {
  flex: 1;

  & h1 {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 1rem 0 1.25rem;
  }
}

.hero-subtitle {
  font-size: 1.1875rem;
  color: var(--color-text-muted);
  max-width: 540px;
  margin-bottom: 2rem;

  & em {
    font-style: italic;
    color: var(--color-text-dim);
  }
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hero-trust {
  font-size: 0.875rem;
  color: var(--color-text-dim);
}

.hero-visual {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-icon {
  width: 280px;
  height: 280px;
  border-radius: 56px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 60px rgba(210, 106, 232, 0.3));
}

.hero-icon-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(210, 106, 232, 0.15) 0%, transparent 70%);
  animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ============================================
   Sections
   ============================================ */
.section {
  padding: 6rem 0;
  scroll-margin-top: var(--nav-height);

  &.section-alt {
    background: var(--color-bg-elevated);
  }
}

.section-heading {
  text-align: center;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 3.5rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition-base);

  &:hover {
    background: var(--color-bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  }

  & h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
  }

  & p {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.65;
  }
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(210, 106, 232, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;

  & i {
    font-size: 1.5rem;
    color: var(--color-primary-light);
  }
}

/* ---- Demo Video ---- */
.demo-video {
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);

  & video,
  & img {
    width: 100%;
    display: block;
    border-radius: 0;
  }
}

.demo-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  color: var(--color-text-dim);

  & i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--color-primary-light);
    opacity: 0.5;
  }

  & p {
    font-size: 0.9375rem;
  }
}

/* ---- Features Grid ---- */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.card-full {
  grid-column: 1 / -1;
  display: flex;
  gap: 3rem;
  align-items: center;
}

.card-feature-content {
  flex: 1;

  & .card-icon {
    margin-bottom: 1.25rem;
  }

  & h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
  }

  & p {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.65;
  }
}

.card-feature-visual {
  flex-shrink: 0;
  width: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Waveform animation */
.waveform-demo {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 80px;
}

.waveform-bar {
  width: 6px;
  border-radius: 3px;
  background: var(--gradient-brand);
  animation: waveform 1.2s ease-in-out infinite;

  &:nth-child(1) { height: 20px; animation-delay: 0s; }
  &:nth-child(2) { height: 35px; animation-delay: 0.1s; }
  &:nth-child(3) { height: 55px; animation-delay: 0.2s; }
  &:nth-child(4) { height: 40px; animation-delay: 0.3s; }
  &:nth-child(5) { height: 70px; animation-delay: 0.4s; }
  &:nth-child(6) { height: 50px; animation-delay: 0.5s; }
  &:nth-child(7) { height: 30px; animation-delay: 0.6s; }
  &:nth-child(8) { height: 60px; animation-delay: 0.7s; }
  &:nth-child(9) { height: 45px; animation-delay: 0.8s; }
  &:nth-child(10) { height: 25px; animation-delay: 0.9s; }
  &:nth-child(11) { height: 50px; animation-delay: 1.0s; }
  &:nth-child(12) { height: 35px; animation-delay: 1.1s; }
}

@keyframes waveform {
  0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ============================================
   How It Works — Steps
   ============================================ */
.steps {
  display: flex;
  gap: 2rem;
  justify-content: center;
}

.step {
  flex: 1;
  max-width: 320px;
  text-align: center;
  text-wrap: balance;
  padding: 2rem 1.5rem;

  & h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
  }

  & p {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
  }
}

.step-number {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: 1rem;
}

.step-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(210, 106, 232, 0.1);
  border: 1px solid rgba(210, 106, 232, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;

  & i {
    font-size: 1.75rem;
    color: var(--color-primary-light);
  }
}

/* ============================================
   Benefits (Why TongueType)
   ============================================ */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.benefit {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  transition: all var(--transition-base);

  &:hover {
    background: var(--color-bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  }

  & h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 0.625rem;
  }

  & p {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
  }
}

.benefit-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(210, 106, 232, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;

  & i {
    font-size: 1.5rem;
    color: var(--color-primary-light);
  }
}

/* ============================================
   Testimonials
   ============================================ */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.testimonial {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);

  &:hover {
    background: var(--color-bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  }

  & blockquote {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
  }
}

.testimonial-stars {
  display: flex;
  gap: 0.125rem;
  margin-bottom: 1rem;

  & i {
    font-size: 1.125rem;
    color: var(--color-star);
  }
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  & div {
    line-height: 1.3;
  }

  & cite {
    font-style: normal;
    font-weight: 600;
    font-size: 0.9375rem;
    display: block;
  }

  & span {
    font-size: 0.8125rem;
    color: var(--color-text-dim);
  }
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;

  img {
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;
  }
}

/* ============================================
   FAQ
   ============================================ */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  padding-inline: 1.5rem;
  background: var(--color-bg-card);
  transition: background var(--transition-fast);
  interpolate-size: allow-keywords;

  &:hover {
    background: var(--color-bg-card-hover);
  }

  &[open] {
    padding-block-end: 1.25rem;

    & > summary::before {
      rotate: 90deg;
    }
  }

  &::details-content {
    height: 0;
    overflow: hidden;
    transition:
      height 200ms ease,
      content-visibility 200ms ease allow-discrete;
  }

  &[open]::details-content {
    height: auto;
  }

  @starting-style {
    &[open]::details-content {
      height: 0;
    }
  }

  & summary {
    display: block;
    position: relative;
    margin-inline: -1.5rem;
    padding: 1.25rem 2.75rem 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.0625rem;
    cursor: pointer;
    user-select: none;
    list-style: none;

    &::-webkit-details-marker {
      display: none;
    }

    &::before {
      content: '';
      position: absolute;
      top: calc(50% - 0.5em);
      right: 1.25rem;
      width: 1em;
      height: 1em;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M9 6l6 6l-6 6' /%3E%3C/svg%3E");
      background-position: center;
      background-size: 1.25em;
      background-repeat: no-repeat;
      transform-origin: center;
      transition: rotate 200ms ease;
    }

    & ~ * {
      margin-block-start: 0;
    }
  }
}

.faq-answer p {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.7;
}

/* ============================================
   Final CTA
   ============================================ */
.cta-section {
  background: linear-gradient(180deg, var(--color-bg) 0%, rgba(210, 106, 232, 0.06) 50%, var(--color-bg) 100%);
  text-align: center;
  padding: 7rem 0;
}

.cta-inner {
  & h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
  }

  & p {
    color: var(--color-text-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
  }

  & .hero-ctas {
    justify-content: center;
  }
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);

  & p {
    font-size: 0.875rem;
    color: var(--color-text-dim);
  }

  & a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--color-text-dim);

    &:hover {
      color: var(--color-text-muted);
    }
  }

  & .footer-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(0.4);
  }
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================
   Coming Soon Dialog
   ============================================ */
.coming-soon-dialog {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  padding: 0;
  max-width: 28rem;
  width: calc(100% - 2rem);
  margin: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);

  &[open] {
    display: flex;
    opacity: 1;
    transform: scale(1);
    transition:
      opacity 200ms ease,
      transform 200ms ease;

    @starting-style {
      opacity: 0;
      transform: scale(0.95);
    }
  }

  &::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 1;
    transition: opacity 200ms ease;

    @starting-style {
      opacity: 0;
    }
  }
}

.coming-soon-content {
  padding: 2.5rem;
  text-align: center;

  & h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
  }

  & p {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 1rem;
    text-wrap: balance;
  }

  & .coming-soon-muted {
    font-size: 0.875rem;
    color: var(--color-text-dim);
    margin-bottom: 1.5rem;
  }

  & .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   Scroll Animations
   ============================================ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;

  &.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Focus
   ============================================ */
:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .waveform-bar {
    animation: none;
  }

  .hero-icon-glow {
    animation: none;
  }

  .card:hover,
  .benefit:hover,
  .testimonial:hover,
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-full {
    flex-direction: column;
    gap: 2rem;
  }

  .card-feature-visual {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    padding: 1.5rem;
    flex-direction: column;
    gap: 1rem;

    & ul {
      flex-direction: column;
      gap: 0;

      & li a {
        display: block;
        padding: 0.75rem 0;
      }
    }

    & .btn {
      width: 100%;
      justify-content: center;
    }
  }

  .hero {
    padding: 6rem 0 3rem;
    min-height: auto;
  }

  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
    gap: 2rem;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-icon {
    width: 180px;
    height: 180px;
    border-radius: 36px;
  }

  .hero-icon-glow {
    width: 260px;
    height: 260px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .steps {
    flex-direction: column;
    align-items: center;
  }

  .step {
    max-width: 100%;
  }

  .section {
    padding: 4rem 0;
  }

  .section-heading {
    margin-bottom: 2.5rem;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 1rem;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .hero-ctas {
    flex-direction: column;

    & .btn {
      width: 100%;
      justify-content: center;
    }
  }

  .cta-inner .hero-ctas {
    flex-direction: column;
    align-items: center;

    & .btn {
      width: 100%;
      max-width: 300px;
    }
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}
