:root {
  --app-bg: #f8fafc;
  --app-text: #0f172a;
  --app-border: #dbe4ef;
  --app-surface: rgba(255, 255, 255, 0.84);
  --app-surface-strong: #ffffff;
  --app-surface-soft: #f8fafc;
  --app-shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.08);
  --app-shadow-md: 0 14px 40px rgba(15, 23, 42, 0.06);
  --app-radius-xl: 1.75rem;
  --text: #6b6375;
  --text-h: #08060d;
  --bg: #fff;
  --border: #e5e4e7;
  --code-bg: #f4f3ec;
  --accent: #aa3bff;
  --accent-bg: rgba(170, 59, 255, 0.1);
  --accent-border: rgba(170, 59, 255, 0.5);
  --social-bg: rgba(244, 243, 236, 0.5);
  --shadow:
    rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;

  --sans: system-ui, 'Segoe UI', Roboto, sans-serif;
  --heading: system-ui, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, Consolas, monospace;

  font: 18px/145% var(--sans);
  letter-spacing: 0.18px;
  color-scheme: light dark;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  @media (max-width: 1024px) {
    font-size: 16px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #9ca3af;
    --text-h: #f3f4f6;
    --bg: #16171d;
    --border: #2e303a;
    --code-bg: #1f2028;
    --accent: #c084fc;
    --accent-bg: rgba(192, 132, 252, 0.15);
    --accent-border: rgba(192, 132, 252, 0.5);
    --social-bg: rgba(47, 48, 58, 0.5);
    --shadow:
      rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
  }

  #social .button-icon {
    filter: invert(1) brightness(2);
  }
}

:root[data-theme='dark'] {
  --app-bg: #091e42;
  --app-text: #e2e8f0;
  --app-border: rgba(148, 163, 184, 0.22);
  --app-surface: rgba(9, 30, 66, 0.72);
  --app-surface-strong: #0b1329;
  --app-surface-soft: rgba(255, 255, 255, 0.04);
  --app-shadow-lg: 0 28px 90px rgba(0, 0, 0, 0.24);
  --app-shadow-md: 0 14px 40px rgba(0, 0, 0, 0.18);
}

html {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}

body {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  min-height: 100vh;
  background: var(--app-bg);
  color: var(--app-text);
  overflow-x: clip;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 36%),
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.06), transparent 30%),
    linear-gradient(to bottom, rgba(255,255,255,0.02), transparent 18%, rgba(255,255,255,0.02));
  opacity: 0.55;
  z-index: 0;
}

#root {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  border-inline: 1px solid var(--app-border);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: var(--app-bg);
  color: var(--app-text);
  position: relative;
  z-index: 1;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.72);
  outline-offset: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  word-break: break-word;
}

@media (max-width: 1024px) {
  :root {
    font-size: 15.5px;
  }
}

@media (max-width: 768px) {
  #root {
    border-inline: none;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none !important;
  }

  tr {
    margin-bottom: 12px;
    border: 1px solid var(--app-border);
    border-radius: 18px;
    overflow: hidden;
  }

  td,
  th {
    padding: 12px 14px !important;
    text-align: left !important;
    white-space: normal !important;
    border: 0 !important;
  }

  td + td,
  th + th {
    border-top: 1px solid var(--app-border) !important;
  }

  .landing-shell button,
  .landing-shell a,
  .landing-shell input,
  .landing-shell select,
  .landing-shell textarea {
    min-height: 44px;
  }

  .landing-shell h1 {
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.04;
  }

  .landing-shell h2 {
    line-height: 1.1;
  }
}

@media (max-width: 480px) {
  :root {
    font-size: 15px;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 19px;
  }
}

@keyframes app-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ui-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-xl);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-lg);
  backdrop-filter: blur(18px);
}

.ui-card-strong {
  background: var(--app-surface-strong);
  box-shadow: var(--app-shadow-md);
}

.ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.ui-button:hover {
  transform: translateY(-1px);
}

.ui-button-primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.24);
}

.ui-button-primary:hover {
  box-shadow: 0 24px 52px rgba(37, 99, 235, 0.3);
}

.ui-button-secondary {
  border: 1px solid var(--app-border);
  background: color-mix(in srgb, var(--app-surface-strong) 90%, transparent);
  color: var(--app-text);
}

.ui-skeleton {
  background: linear-gradient(90deg, rgba(148,163,184,0.12) 25%, rgba(148,163,184,0.22) 37%, rgba(148,163,184,0.12) 63%);
  background-size: 400% 100%;
  animation: app-shimmer 1.4s ease infinite;
}

.ui-empty-state {
  border: 1px dashed var(--app-border);
  border-radius: 1.5rem;
  background: color-mix(in srgb, var(--app-surface-strong) 92%, transparent);
  padding: 1.25rem;
  color: var(--text);
}

.ui-fade-up {
  animation: uiFadeUp 280ms ease both;
}

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

h1,
h2 {
  font-family: var(--heading);
  font-weight: 500;
  color: var(--text-h);
}

h1 {
  font-size: 56px;
  letter-spacing: -1.68px;
  margin: 32px 0;
  @media (max-width: 1024px) {
    font-size: 36px;
    margin: 20px 0;
  }
}
h2 {
  font-size: 24px;
  line-height: 118%;
  letter-spacing: -0.24px;
  margin: 0 0 8px;
  @media (max-width: 1024px) {
    font-size: 20px;
  }
}
p {
  margin: 0;
}

code,
.counter {
  font-family: var(--mono);
  display: inline-flex;
  border-radius: 4px;
  color: var(--text-h);
}

code {
  font-size: 15px;
  line-height: 135%;
  padding: 4px 8px;
  background: var(--code-bg);
}
