@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg-canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-canvas);
}

.app-body {
  position: relative;
  overflow-x: hidden;
}

::selection {
  background: rgba(0, 212, 255, 0.28);
  color: var(--text);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast), opacity var(--transition-fast);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--text);
  font-family: var(--font-display);
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  font-size: 3rem;
  line-height: 1;
}

h2 {
  font-size: 1.75rem;
  line-height: 1.12;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.2;
}

p,
li,
label,
input,
select,
button,
textarea,
span,
strong,
code {
  overflow-wrap: anywhere;
  line-height: 1.6;
}

p,
li {
  font-size: 0.95rem;
}

p,
li {
  color: var(--text-soft);
}

ul,
ol {
  padding-left: 1.15rem;
}

label {
  display: block;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(8, 12, 18, 0.72);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: rgba(255, 255, 255, 0.9);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) calc(50% - 2px),
    calc(100% - 0.85rem) calc(50% - 2px);
  background-repeat: no-repeat;
  background-size: 0.38rem 0.38rem;
  padding-right: 2.6rem;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
  background-color: rgba(11, 17, 31, 0.62);
}

:root[data-theme="light"] input:hover,
:root[data-theme="light"] select:hover,
:root[data-theme="light"] textarea:hover {
  background-color: rgba(255, 255, 255, 0.98);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

table,
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-card);
}

thead th {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line-subtle);
  background: rgba(148, 163, 184, 0.05);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
}

tbody td {
  padding: 0.72rem 0.85rem;
  border-top: 1px solid var(--line-subtle);
  color: var(--text-soft);
  vertical-align: top;
}

tbody tr:hover {
  background: rgba(148, 163, 184, 0.05);
}

code,
pre {
  font-family: var(--font-mono);
}

pre {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--code-bg);
  color: var(--text);
  overflow: auto;
}

.text-muted {
  color: var(--text-muted) !important;
}

.eyebrow,
.eyebrow-label,
.surface-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before,
.eyebrow-label::before,
.surface-label::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 18px currentColor;
  opacity: 0.9;
}

.eyebrow {
  color: var(--primary);
}

.eyebrow-label {
  color: var(--text-muted);
}

.surface-label {
  width: fit-content;
  padding: 0.52rem 0.85rem;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.68rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast);
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

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

.button:hover::before {
  opacity: 1;
}

.button:active {
  transform: translateY(0);
}

.button--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #031320;
  box-shadow: 0 16px 34px rgba(0, 212, 255, 0.22);
}

.button--primary:hover {
  color: #031320;
  box-shadow: 0 18px 40px rgba(0, 212, 255, 0.28);
}

.button--secondary {
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--border);
  color: var(--text);
}

.button--secondary:hover {
  background: rgba(148, 163, 184, 0.12);
  border-color: var(--border-strong);
}

.button--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-soft);
}

.button--ghost:hover {
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--border-strong);
  color: var(--text);
}

.button--danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.94), rgba(185, 28, 28, 0.94));
  color: #fff5f5;
  box-shadow: 0 16px 34px rgba(239, 68, 68, 0.2);
}

.button--danger:hover {
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(239, 68, 68, 0.26);
}

.button--small {
  min-height: 2.25rem;
  padding: 0.52rem 0.75rem;
  font-size: 0.84rem;
}

.button--block {
  width: 100%;
}

@media (max-width: 760px) {
  h1 {
    font-size: 1.95rem;
  }

  h2 {
    font-size: 1.45rem;
  }
}

.inline-form {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
