:root {
  --bg: #0b1220;
  --bg-deep: #070d18;
  --panel: rgba(17, 24, 39, 0.78);
  --panel-strong: #111827;
  --border: rgba(148, 163, 184, 0.16);
  --border-bright: rgba(6, 182, 212, 0.34);
  --text: #e8f0ff;
  --muted: #94a3b8;
  --blue: #2563eb;
  --blue-light: #3b82f6;
  --cyan: #06b6d4;
  --cyan-light: #67e8f9;
  --danger: #fb7185;
  --radius: 18px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 17% -5%, rgba(37, 99, 235, 0.26), transparent 29rem),
    radial-gradient(circle at 87% 15%, rgba(6, 182, 212, 0.16), transparent 25rem),
    var(--bg);
  font-family: "Inter", Arial, sans-serif;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

.background-grid {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.header {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(103, 232, 249, 0.32);
  border-radius: 10px;
  color: var(--cyan-light);
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
  box-shadow: 0 0 28px rgba(6, 182, 212, 0.22);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88rem;
}

.brand-dot {
  color: var(--cyan);
}

.nav {
  display: flex;
  align-items: center;
  gap: 27px;
  color: var(--muted);
  font-size: 0.88rem;
}

.nav a,
.footer a {
  transition: color 160ms ease;
}

.nav a:hover,
.footer a:hover {
  color: var(--cyan-light);
}

.header-link {
  border: 1px solid rgba(96, 165, 250, 0.48);
  border-radius: 10px;
  padding: 10px 14px;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.13);
  font-size: 0.84rem;
  font-weight: 600;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.header-link:hover {
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.15);
  transform: translateY(-1px);
}

.hero,
.tools-section,
.info-section,
.faq-section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  padding: 125px 0 90px;
  text-align: center;
}

.hero-badge,
.api-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 999px;
  padding: 8px 12px;
  color: #a5f3fc;
  background: rgba(6, 182, 212, 0.075);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
  animation: pulse 2s infinite;
}

.hero h1 {
  max-width: 900px;
  margin: 25px auto 0;
  color: #f8fbff;
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  font-weight: 800;
  letter-spacing: -0.072em;
  line-height: 0.99;
}

.hero h1 span {
  background: linear-gradient(100deg, #60a5fa 16%, #67e8f9 86%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.hero-text {
  max-width: 690px;
  margin: 28px auto 0;
  color: #a9b9d1;
  font-size: clamp(1rem, 2vw, 1.17rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  margin-top: 34px;
  justify-content: center;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 17px;
  font-size: 0.9rem;
  font-weight: 700;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

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

.button-primary {
  color: #fff;
  background: linear-gradient(120deg, #2563eb, #0891b2);
  box-shadow: 0 10px 32px rgba(37, 99, 235, 0.25);
}

.button-primary:hover {
  box-shadow: 0 14px 38px rgba(6, 182, 212, 0.28);
}

.button-secondary {
  border-color: rgba(148, 163, 184, 0.25);
  color: #d6e1f3;
  background: rgba(15, 23, 42, 0.5);
}

.button-secondary:hover {
  border-color: rgba(103, 232, 249, 0.5);
  background: rgba(30, 41, 59, 0.72);
}

.hero-stats {
  display: grid;
  max-width: 690px;
  margin: 73px auto 0;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.43);
  backdrop-filter: blur(12px);
}

.hero-stats div {
  display: flex;
  min-height: 105px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.hero-stats div + div {
  border-left: 1px solid var(--border);
}

.hero-stats strong {
  color: #eff6ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.3rem;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.73rem;
}

.tools-section {
  padding: 95px 0 85px;
}

.section-heading {
  display: flex;
  margin-bottom: 28px;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.11em;
}

.section-heading h2,
.info-section h2,
.faq-section h2 {
  margin: 10px 0 10px;
  color: #f8fbff;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.055em;
}

.section-heading > div:first-child > p:last-child {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.api-state {
  flex: 0 0 auto;
  white-space: nowrap;
}

.tools-grid {
  display: grid;
  margin-bottom: 25px;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tool-card {
  display: flex;
  min-height: 102px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 16px;
  color: inherit;
  text-align: left;
  background: rgba(15, 23, 42, 0.56);
  transition:
    transform 170ms ease,
    border-color 170ms ease,
    background 170ms ease,
    box-shadow 170ms ease;
}

.tool-card:hover {
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(30, 41, 59, 0.72);
  transform: translateY(-2px);
}

.tool-card.active {
  border-color: var(--border-bright);
  background:
    linear-gradient(130deg, rgba(37, 99, 235, 0.18), rgba(6, 182, 212, 0.08)),
    rgba(15, 23, 42, 0.76);
  box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.08);
}

.tool-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 11px;
  color: var(--cyan-light);
  background: rgba(37, 99, 235, 0.13);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  font-weight: 600;
}

.tool-card strong,
.tool-card small {
  display: block;
}

.tool-card strong {
  color: #e7effe;
  font-size: 0.9rem;
}

.tool-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.workspace {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(20px, 4vw, 34px);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.065), transparent 42%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.workspace-top {
  display: flex;
  margin-bottom: 25px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.workspace-top h3 {
  margin: 9px 0 6px;
  color: #f4f8ff;
  font-size: 1.4rem;
  letter-spacing: -0.035em;
}

.workspace-top p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 0.89rem;
  line-height: 1.55;
}

.workspace-label {
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 7px;
  padding: 6px 8px;
  color: #64748b;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.field-label {
  display: block;
  margin: 21px 0 8px;
  color: #c9d6ea;
  font-size: 0.78rem;
  font-weight: 700;
}

.tool-select,
.text-input {
  width: 100%;
  outline: none;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 11px;
  color: #e5efff;
  background: rgba(2, 6, 23, 0.58);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.tool-select {
  height: 43px;
  padding: 0 12px;
}

.text-input {
  min-height: 150px;
  resize: vertical;
  padding: 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.58;
}

.tool-select:focus,
.text-input:focus {
  border-color: rgba(6, 182, 212, 0.75);
  background: rgba(2, 6, 23, 0.8);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
}

.workspace-actions {
  display: flex;
  margin-top: 14px;
  gap: 10px;
}

.result-area {
  margin-top: 25px;
  overflow: hidden;
  border: 1px solid rgba(6, 182, 212, 0.16);
  border-radius: 13px;
  background: rgba(2, 6, 23, 0.58);
}

.result-header {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
  padding: 0 13px;
  color: #94a3b8;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.copy-button {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 5px 8px;
  color: #a5f3fc;
  background: transparent;
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  transition: background 160ms ease;
}

.copy-button:hover {
  background: rgba(6, 182, 212, 0.12);
}

#toolResult {
  min-height: 120px;
  max-height: 380px;
  margin: 0;
  overflow: auto;
  padding: 16px;
  color: #cbdcf5;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.79rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.info-section,
.faq-section {
  padding: 90px 0;
}

.info-section {
  border-top: 1px solid var(--border);
}

.info-section h2 {
  max-width: 650px;
}

.info-grid {
  display: grid;
  margin-top: 32px;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.info-grid article {
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 22px;
  background: rgba(15, 23, 42, 0.45);
}

.info-grid h3 {
  margin: 0;
  color: #e6f0ff;
  font-size: 1rem;
}

.info-grid p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.faq-section {
  border-top: 1px solid var(--border);
}

.faq-section details {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.faq-section summary {
  color: #ddeafe;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}

.faq-section summary::marker {
  color: var(--cyan);
}

.faq-section details p {
  max-width: 800px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.89rem;
  line-height: 1.65;
}

.footer {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--border);
  padding: 27px 0 35px;
  color: #64748b;
  font-size: 0.76rem;
}

.footer p {
  margin: 0;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(0.82);
  }
}

@media (max-width: 760px) {
  .header {
    width: min(100% - 28px, 1180px);
    min-height: 67px;
  }

  .nav {
    display: none;
  }

  .header-link {
    padding: 8px 10px;
    font-size: 0.76rem;
  }

  .hero,
  .tools-section,
  .info-section,
  .faq-section,
  .footer {
    width: min(100% - 28px, 1180px);
  }

  .hero {
    padding: 80px 0 62px;
    text-align: left;
  }

  .hero h1 {
    margin-left: 0;
  }

  .hero-text {
    margin-left: 0;
  }

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

  .hero-stats {
    margin-top: 48px;
  }

  .hero-stats div {
    min-height: 91px;
    padding: 10px;
    text-align: center;
  }

  .hero-stats strong {
    font-size: 1rem;
  }

  .hero-stats span {
    font-size: 0.64rem;
  }

  .section-heading,
  .workspace-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .api-state {
    white-space: normal;
  }

  .tools-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 79px;
  }

  .workspace-label {
    display: none;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .hero-actions,
  .workspace-actions {
    flex-direction: column;
  }

  .hero-actions .button,
  .workspace-actions .button {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stats div + div {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .hero-stats div {
    min-height: 73px;
    align-items: flex-start;
    padding-left: 17px;
    text-align: left;
  }
}
