/* RCKeyBoard visual and responsive refinements */

:root {
  --bg-primary: #080b12;
  --bg-secondary: #101521;
  --bg-surface: rgba(16, 22, 36, 0.94);
  --bg-surface-hover: rgba(23, 31, 48, 0.98);
  --bg-surface-card: rgba(17, 23, 37, 0.94);
  --accent: #68dec9;
  --accent-2: #9a8cf5;
  --accent-3: #fb7185;
  --accent-gradient: linear-gradient(135deg, #68dec9 0%, #6ac6db 52%, #9a8cf5 100%);
  --accent-glow: rgba(104, 222, 201, 0.2);
  --border: rgba(148, 163, 184, 0.15);
  --border-light: rgba(226, 232, 240, 0.18);
  --border-hover: rgba(104, 222, 201, 0.46);
  --max-w: 1220px;
}

body.light-mode {
  --bg-primary: #f7f8fc;
  --bg-secondary: #eef1f7;
  --bg-surface: rgba(255, 255, 255, 0.96);
  --bg-surface-hover: #fff;
  --bg-surface-card: rgba(255, 255, 255, 0.96);
  --accent: #087f77;
  --accent-2: #6255c5;
  --accent-3: #d94667;
  --accent-gradient: linear-gradient(135deg, #087f77 0%, #397cae 52%, #6255c5 100%);
  --accent-glow: rgba(8, 127, 119, 0.16);
  --border: rgba(15, 23, 42, 0.1);
  --border-light: rgba(15, 23, 42, 0.14);
  --border-hover: rgba(8, 127, 119, 0.38);
}

html {
  scroll-padding-top: 112px;
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(104, 222, 201, 0.06), transparent 30rem),
    radial-gradient(circle at 88% 18%, rgba(154, 140, 245, 0.07), transparent 34rem),
    var(--bg-primary);
}

body.light-mode {
  background:
    radial-gradient(circle at 12% 0%, rgba(8, 127, 119, 0.06), transparent 30rem),
    radial-gradient(circle at 88% 18%, rgba(98, 85, 197, 0.05), transparent 34rem),
    var(--bg-primary);
}

main {
  overflow: clip;
}

.skip-link {
  position: fixed;
  z-index: 2001;
  top: 0.75rem;
  inset-inline-start: 0.75rem;
  transform: translateY(-180%);
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  background: var(--text);
  color: var(--bg-primary);
  font-weight: 700;
  transition: transform 0.18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.bg-mesh-wrap {
  display: none;
}

.bg-grid-overlay {
  opacity: 0.52;
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.topbar-wrapper {
  top: 1rem;
  padding-inline: 1.25rem;
}

.topbar {
  height: 68px;
  padding: 0.5rem 0.7rem 0.5rem 1.25rem;
  border-radius: 20px;
  background: rgba(9, 13, 25, 0.9);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 18px 48px -28px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.light-mode .topbar {
  background: rgba(255, 255, 255, 0.94);
}

body.scrolled .topbar {
  height: 62px;
  background: rgba(7, 10, 20, 0.96);
}

body.light-mode.scrolled .topbar {
  background: rgba(255, 255, 255, 0.98);
}

.nav-links {
  gap: 0.1rem;
  padding: 0.22rem;
  background: transparent;
  border-color: transparent;
}

.nav-link {
  padding: 0.48rem 0.72rem;
  font-size: 0.82rem;
}

.nav-link.active {
  background: rgba(104, 222, 201, 0.1);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(104, 222, 201, 0.18);
}

.nav-cta {
  height: 42px;
  padding-inline: 1rem;
  font-size: 0.84rem;
}

.hero,
.features,
.demo-section,
.comparison-section,
.theme-showcase,
.gallery,
.faq-section,
.store-preview,
.footer,
.page-header,
.page-content {
  width: min(var(--max-w), calc(100% - 3rem));
}

.hero {
  min-height: min(780px, 100svh);
  padding: 9.5rem 0 5.5rem;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: clamp(2.5rem, 6vw, 6rem);
}

.hero-copy {
  max-width: 700px;
}

.hero-copy h1 {
  max-width: 680px;
  margin-bottom: 1.3rem;
  font-size: clamp(3rem, 5.2vw, 5rem);
  line-height: 0.99;
  letter-spacing: -0.055em;
}

.hero-copy p {
  max-width: 590px;
  font-size: 1.06rem;
  line-height: 1.72;
}

.hero-badges span {
  background: transparent;
  color: var(--muted);
}

.btn {
  height: 52px;
  padding-inline: 1.4rem;
  border-radius: 14px;
  font-size: 0.92rem;
}

.btn-primary {
  box-shadow: 0 12px 30px -16px var(--accent-glow-indigo), 0 8px 22px -14px var(--accent-glow);
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  max-width: 560px;
}

.stat-card {
  min-width: 0;
  padding: 0.75rem 0.85rem;
  gap: 0.55rem;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.035);
}

.stat-content strong {
  font-size: 1.12rem;
}

.stat-content span {
  font-size: 0.72rem;
  line-height: 1.25;
}

.hero-visual::before,
.hero-visual::after {
  border-color: rgba(104, 222, 201, 0.13);
}

.hero-visual::before {
  box-shadow: 0 0 80px rgba(104, 222, 201, 0.05), inset 0 0 80px rgba(154, 140, 245, 0.045);
}

.phone-glow-aura {
  animation: none;
  filter: blur(34px);
  opacity: 0.3;
}

.phone-card {
  animation: none;
}

.floating-badge {
  animation: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 2rem;
  padding-inline-start: 1.15rem;
}

.section-heading h2 {
  font-size: clamp(2rem, 3.7vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.section-subtext {
  max-width: 650px;
  font-size: 1rem;
}

.demo-section,
.features,
.comparison-section,
.theme-showcase,
.gallery,
.faq-section,
.store-preview {
  padding-block: 6rem 3.5rem;
}

.simulator-wrapper,
.comparison-table-wrap,
.preview-card,
.footer-shell {
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 24px 64px -38px rgba(0, 0, 0, 0.78), 0 0 34px -28px var(--accent-glow);
}

.simulator-wrapper {
  border-radius: 24px;
}

.simulator-screen {
  padding: clamp(1.2rem, 4vw, 2.2rem);
}

.feature-grid {
  gap: 1rem;
}

.feature-card {
  min-height: 240px;
  padding: 1.55rem;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(24, 31, 50, 0.88), rgba(12, 17, 29, 0.92));
  border-color: rgba(148, 163, 184, 0.16);
}

body.light-mode .feature-card {
  background: linear-gradient(145deg, #fff, #f2f5fa);
}

.feature-card:nth-child(1),
.feature-card:nth-child(4) {
  background: linear-gradient(145deg, rgba(20, 49, 54, 0.72), rgba(12, 17, 29, 0.94));
}

body.light-mode .feature-card:nth-child(1),
body.light-mode .feature-card:nth-child(4) {
  background: linear-gradient(145deg, #eefaf8, #f4f6fb);
}

.feature-card h3 {
  font-size: 1.12rem;
}

.feature-card p {
  font-size: 0.92rem;
}

.comparison-table-wrap {
  border-radius: 22px;
}

.comparison-table th,
.comparison-table td {
  padding: 1.05rem 1.25rem;
}

.theme-card,
.identity-card,
.faq-item,
.gallery-item,
.store-card {
  border-color: rgba(148, 163, 184, 0.17);
}

.theme-card {
  border-radius: 21px;
}

.theme-media {
  border-radius: 19px 19px 0 0;
}

.theme-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.65), 0 0 24px -20px var(--accent-glow);
}

.theme-media img {
  transition: transform 0.35s var(--ease);
}

.theme-card:hover .theme-media img {
  transform: scale(1.035);
}

.theme-preview-overlay {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.theme-info {
  padding: 1.35rem;
}

.gallery-item {
  border-radius: 21px;
}

.faq-item {
  border-radius: 17px;
}

.faq-question {
  font-size: 1rem;
}

.preview-card {
  border-radius: 26px;
  padding: clamp(1.8rem, 4vw, 3.25rem);
}

.store-card {
  border-radius: 20px;
}

.footer-shell {
  border-radius: 22px;
}

.mobile-menu-overlay {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: calc(6rem + env(safe-area-inset-top));
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.theme-card[hidden] {
  display: none !important;
}

:where(.hero-grid, .feature-grid, .identity-grid, .theme-grid, .gallery-grid, .bento-subpage, .preview-card) > * {
  min-width: 0;
}

:where(.hero-copy, .section-heading, .theme-info, .page-content) {
  overflow-wrap: anywhere;
}

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-color: color-mix(in srgb, var(--accent) 78%, white);
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .hero {
    min-height: auto;
    padding-top: 9rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-visual {
    min-height: 500px;
  }

  .feature-grid,
  .theme-grid,
  .gallery-grid,
  .bento-subpage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 88px;
  }

  .hero,
  .features,
  .demo-section,
  .comparison-section,
  .theme-showcase,
  .gallery,
  .faq-section,
  .store-preview,
  .footer,
  .page-header,
  .page-content {
    width: min(var(--max-w), calc(100% - 2rem));
  }

  .topbar-wrapper {
    top: max(0.55rem, env(safe-area-inset-top));
    padding-inline: 0.65rem;
  }

  .topbar {
    height: 58px;
    padding: 0.4rem 0.5rem 0.4rem 0.8rem;
    border-radius: 18px;
  }

  .brand-name {
    font-size: 0.98rem;
  }

  .nav-actions {
    gap: 0.4rem;
  }

  .language-toggle,
  .theme-toggle,
  .mobile-menu-toggle {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 11px;
  }

  .language-toggle .language-label,
  .language-toggle .dropdown-chevron {
    display: none;
  }

  .language-menu {
    right: 0;
    left: auto;
    width: min(280px, calc(100vw - 1.5rem));
  }

  .mobile-menu-overlay {
    justify-content: flex-start;
    padding-inline: 1rem;
  }

  .mobile-menu-body {
    max-width: 520px;
    gap: 1.25rem;
    text-align: start;
  }

  .mobile-nav-links {
    gap: 0.3rem;
  }

  .mobile-nav-link {
    padding: 0.75rem 0.9rem;
    font-size: 1.05rem;
    border: 1px solid transparent;
  }

  .hero {
    padding: 8rem 0 2.6rem;
  }

  .hero-grid {
    gap: 2.4rem;
    text-align: start;
  }

  .hero-copy {
    align-items: flex-start;
  }

  .pill {
    align-self: flex-start;
  }

  .hero-copy h1 {
    font-size: clamp(2.55rem, 8vw, 4rem);
  }

  .hero-copy p {
    font-size: 1rem;
  }

  .hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hero-actions .btn {
    flex: 1 1 220px;
  }

  .hero-visual {
    min-height: 430px;
  }

  .hero-visual::before {
    width: 360px;
    height: 360px;
  }

  .hero-visual::after {
    width: 270px;
    height: 270px;
  }

  .phone-card-wrap {
    max-width: 276px;
  }

  .floating-badge {
    display: none;
  }

  .demo-section,
  .features,
  .comparison-section,
  .theme-showcase,
  .gallery,
  .faq-section,
  .store-preview {
    padding-top: 5rem;
  }

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

  .section-heading h2 {
    font-size: clamp(1.85rem, 6vw, 2.45rem);
  }

  .simulator-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .sim-header-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .theme-selector-pills {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
  }

  .theme-selector-pills::-webkit-scrollbar,
  .theme-filter-bar::-webkit-scrollbar,
  .sim-suggestions::-webkit-scrollbar {
    display: none;
  }

  .sim-label {
    align-items: flex-start;
    gap: 0.35rem;
    flex-direction: column;
  }

  .sim-suggestions {
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .comparison-table-wrap {
    margin-inline: -0.1rem;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .comparison-table {
    min-width: 640px;
  }

  .preview-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    text-align: start;
  }

  .preview-copy {
    align-items: flex-start;
  }

  .footer-shell {
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .hero,
  .features,
  .demo-section,
  .comparison-section,
  .theme-showcase,
  .gallery,
  .faq-section,
  .store-preview,
  .footer,
  .page-header,
  .page-content {
    width: min(var(--max-w), calc(100% - 1.25rem));
  }

  .hero {
    padding-top: 7.25rem;
  }

  .hero-copy h1 {
    font-size: clamp(2.25rem, 10.5vw, 3.2rem);
  }

  .hero-badges {
    gap: 0.35rem;
  }

  .hero-badges span {
    padding: 0.33rem 0.55rem;
    font-size: 0.7rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .hero-actions .btn {
    width: 100%;
    flex: 0 0 auto;
  }

  .stats {
    gap: 0.35rem;
  }

  .stat-card {
    padding: 0.65rem 0.45rem;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 0.2rem;
  }

  .stat-icon {
    font-size: 1.1rem;
  }

  .stat-content strong {
    font-size: 0.98rem;
  }

  .stat-content span {
    font-size: 0.64rem;
  }

  .hero-visual {
    min-height: 350px;
  }

  .hero-visual::before {
    width: 300px;
    height: 300px;
  }

  .hero-visual::after {
    width: 230px;
    height: 230px;
  }

  .phone-card-wrap {
    max-width: min(232px, 70vw);
    transform: none !important;
  }

  .phone-card {
    border-width: 6px;
    border-radius: 30px;
    padding: 5px;
  }

  .phone-screen {
    border-radius: 22px;
  }

  .feature-grid,
  .identity-grid,
  .theme-grid,
  .gallery-grid,
  .bento-subpage {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .feature-card {
    min-height: auto;
  }

  .theme-toolbar {
    align-items: stretch;
  }

  .theme-filter-bar {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .theme-search-box,
  .theme-search-box input,
  .theme-search-box input:focus {
    width: 100%;
  }

  .theme-search-box input:focus {
    box-shadow: none;
  }

  .simulator-wrapper {
    border-radius: 20px;
  }

  .simulator-header {
    padding: 0.85rem 0.8rem;
  }

  .sim-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sound-toggle-btn {
    align-self: flex-start;
  }

  .simulator-screen {
    padding: 0.85rem 0.55rem;
    gap: 1rem;
  }

  .sim-telemetry-bar {
    padding: 0.5rem 0.65rem;
  }

  .sim-telemetry-item {
    gap: 0.2rem;
  }

  .sim-telemetry-label {
    font-size: 0.62rem;
  }

  .sim-telemetry-val {
    font-size: 0.9rem;
  }

  .sim-input-wrapper input {
    height: 48px;
    padding-inline: 0.9rem 3rem;
    font-size: 0.93rem;
  }

  .sim-keyboard-frame {
    padding: 0.55rem 0.3rem;
    border-radius: 16px;
  }

  .sim-keys-rows {
    gap: 0.32rem;
  }

  .sim-row {
    gap: 2px;
  }

  .key {
    min-width: 0;
    height: 36px;
    border-radius: 6px;
    font-size: 0.78rem;
  }

  .key-shift,
  .key-backspace,
  .key-special,
  .key-enter,
  .key-space {
    max-width: none;
  }

  .key-space {
    font-size: 0.63rem;
    letter-spacing: 0.04em;
  }

  .spacebar-trackpad-hint {
    font-size: 0.64rem;
  }

  .faq-question {
    padding: 1rem 1.05rem;
    font-size: 0.94rem;
  }

  .faq-answer {
    padding: 0 1.05rem;
  }

  .faq-item.open .faq-answer {
    padding-bottom: 1.1rem;
  }

  .preview-card {
    padding: 1.5rem 1rem;
    border-radius: 22px;
  }

  .footer-shell {
    flex-direction: column;
    text-align: start;
    align-items: stretch;
    padding: 1.6rem 1.1rem;
    border-radius: 22px;
  }

  .footer-links {
    gap: 0.8rem 1rem;
  }

  .back-to-top {
    inset-inline-end: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
  }

  .lightbox-modal {
    padding: 0.75rem;
  }

  .lightbox-content {
    padding: 1.1rem;
    border-radius: 20px;
  }

  .lightbox-image-wrap img {
    max-height: 55vh;
    object-fit: contain;
  }

  .page-header {
    padding-top: 7rem;
  }

  .subpage-hero-card,
  .subpage-section-card,
  .policy-card,
  .subpage-card {
    padding: 1.35rem;
    border-radius: 20px;
  }
}

@media (hover: none) {
  .gallery-caption {
    opacity: 1;
    transform: none;
  }

  .theme-card:hover,
  .feature-card:hover,
  .identity-card:hover,
  .gallery-item:hover {
    transform: none;
  }

  .theme-preview-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

[dir="rtl"] .section-heading {
  padding-inline: 1.4rem 0;
}

[dir="rtl"] .section-heading::before {
  inset-inline: auto 0;
}

[dir="rtl"] .theme-search-box input {
  padding-inline: 2.4rem 1rem;
}

[dir="rtl"] .theme-search-icon {
  inset-inline: auto 0.9rem;
}

[dir="rtl"] .sim-input-wrapper input {
  padding-inline: 1.25rem 3rem;
}

[dir="rtl"] .sim-clear-btn {
  inset-inline: auto 1rem;
}

[dir="rtl"] .comparison-table,
[dir="rtl"] .faq-question,
[dir="rtl"] .language-item {
  text-align: right;
}

[dir="rtl"] .breadcrumb-btn svg {
  transform: rotate(180deg);
}

[dir="rtl"] .lightbox-close {
  right: auto;
  left: 1.2rem;
}

/* Static surfaces render more cheaply than a stack of blurred translucent cards. */
.stat-card,
.simulator-wrapper,
.feature-card,
.identity-card,
.theme-card,
.faq-item,
.preview-card,
.footer-shell,
.subpage-hero-card,
.subpage-card,
.subpage-section-card,
.policy-card,
.store-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.phone-card,
.floating-badge,
.bg-orb {
  animation: none;
}

.pulse-dot {
  animation: none;
  box-shadow: 0 0 0 4px rgba(104, 222, 201, 0.14);
}

.feature-card,
.identity-card,
.theme-card,
.gallery-item,
.stat-card {
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.bg-orb {
  filter: blur(90px);
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  html,
  * {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
