:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: 214 48% 97%;
  --foreground: 218 38% 13%;
  --card: 0 0% 100%;
  --card-foreground: 218 38% 13%;
  --popover: 0 0% 100%;
  --popover-foreground: 218 38% 13%;
  --primary: 211 92% 46%;
  --primary-foreground: 0 0% 100%;
  --secondary: 211 42% 92%;
  --secondary-foreground: 218 38% 13%;
  --muted: 212 32% 90%;
  --muted-foreground: 216 17% 38%;
  --accent: 174 76% 38%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 100%;
  --success: 145 62% 34%;
  --success-foreground: 0 0% 100%;
  --warning: 36 94% 47%;
  --warning-foreground: 218 38% 13%;
  --info: 202 89% 44%;
  --info-foreground: 0 0% 100%;
  --border: 214 28% 84%;
  --input: 214 28% 84%;
  --ring: 211 92% 46%;
  --radius: 1.125rem;
  --shadow-sm: 0 1px 2px hsl(218 38% 13% / 0.05);
  --shadow-md: 0 8px 22px hsl(218 38% 13% / 0.09);
  --shadow-lg: 0 18px 48px hsl(218 38% 13% / 0.14);
  --shadow-elegant: 0 20px 70px hsl(var(--primary) / 0.22);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dark {
  --background: 222 44% 7%;
  --foreground: 214 32% 94%;
  --card: 222 36% 11%;
  --card-foreground: 214 32% 94%;
  --popover: 222 36% 12%;
  --popover-foreground: 214 32% 94%;
  --primary: 205 94% 64%;
  --primary-foreground: 222 44% 7%;
  --secondary: 220 28% 18%;
  --secondary-foreground: 214 32% 94%;
  --muted: 220 28% 18%;
  --muted-foreground: 215 20% 74%;
  --accent: 173 78% 48%;
  --accent-foreground: 222 44% 7%;
  --destructive: 0 78% 62%;
  --destructive-foreground: 222 44% 7%;
  --success: 145 63% 49%;
  --success-foreground: 222 44% 7%;
  --warning: 42 95% 56%;
  --warning-foreground: 222 44% 7%;
  --info: 199 89% 58%;
  --info-foreground: 222 44% 7%;
  --border: 220 25% 23%;
  --input: 220 25% 23%;
  --ring: 205 94% 64%;
}

* { box-sizing: border-box; }
html { font-family: var(--font-sans); background: hsl(var(--background)); color: hsl(var(--foreground)); color-scheme: light; }
html.dark { color-scheme: dark; }
body { margin: 0; min-height: 100vh; background: hsl(var(--background)); color: hsl(var(--foreground)); transition: background-color var(--transition-smooth), color var(--transition-smooth); }
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
input, textarea, select { font-size: max(16px, 1rem); }

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, hsl(var(--primary) / 0.15), transparent 28rem),
    radial-gradient(circle at 88% 10%, hsl(var(--accent) / 0.14), transparent 26rem),
    linear-gradient(180deg, hsl(var(--background)), hsl(var(--secondary) / 0.54));
  transition: background var(--transition-smooth);
}

.safe-header { padding-top: env(safe-area-inset-top); }
.app-main { padding-bottom: calc(5.75rem + env(safe-area-inset-bottom)); animation: page-enter 360ms var(--transition-smooth); }
.bottom-nav { padding-bottom: env(safe-area-inset-bottom); }

@media (min-width: 768px) {
  .app-main { padding-bottom: 0; }
}

.signature-grid {
  background-image:
    linear-gradient(hsl(var(--border) / 0.58) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.58) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.arc-phone {
  border-radius: 2.25rem;
  background:
    linear-gradient(145deg, hsl(var(--card)), hsl(var(--secondary) / 0.72));
  box-shadow: var(--shadow-lg), inset 0 0 0 1px hsl(var(--border));
}

.arc-pane {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card) / 0.88);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.solid-tab {
  position: relative;
  overflow: hidden;
}
.solid-tab::after {
  content: "";
  position: absolute;
  inset-inline: 18%;
  bottom: 0.25rem;
  height: 3px;
  border-radius: 999px;
  background: hsl(var(--primary));
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity var(--transition), transform var(--transition);
}
.solid-tab[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.scanline {
  position: relative;
  overflow: hidden;
}
.scanline::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, hsl(var(--primary) / 0.16), transparent);
  transform: translateX(-100%);
  animation: scan 3.6s var(--transition-smooth) infinite;
}
@keyframes scan { to { transform: translateX(100%); } }
@keyframes page-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: hsl(var(--background)); }
::-webkit-scrollbar-thumb { background: hsl(var(--muted-foreground) / 0.35); border-radius: 999px; }

/* Custom 16 column display for Hexadecimal Grid */
.grid-cols-16 {
  grid-template-columns: repeat(16, minmax(0, 1fr));
}
