:root {
  color-scheme: light;
  --ink: #07132b;
  --muted: #53627c;
  --line: #d7e3f5;
  --panel: #ffffff;
  --canvas: #f6fbff;
  --blue: #1768e8;
  --blue-strong: #0b55cf;
  --teal: #11aa9b;
  --green: #18b86f;
  --purple: #7057f5;
  --orange: #f8a51b;
  --shadow: 0 22px 60px rgba(23, 83, 156, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf5ff;
  --muted: #a9b8d0;
  --line: #263b5c;
  --panel: #101b2f;
  --canvas: #071120;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 14%, rgba(23, 104, 232, 0.12), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(17, 170, 155, 0.1), transparent 26%),
    linear-gradient(180deg, #f9fcff 0%, var(--canvas) 42%, #ffffff 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 14%, rgba(23, 104, 232, 0.18), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(17, 170, 155, 0.15), transparent 26%),
    linear-gradient(180deg, #071120 0%, #0a1424 42%, #08101d 100%);
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 0 max(24px, calc((100vw - 1480px) / 2));
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(23, 83, 156, 0.06);
}

:root[data-theme="dark"] .site-header,
:root[data-theme="dark"] .converter-shell,
:root[data-theme="dark"] .category-card,
:root[data-theme="dark"] .converter-card,
:root[data-theme="dark"] .search-box,
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .toast {
  background: rgba(16, 27, 47, 0.94);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.32rem;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 22px rgba(23, 104, 232, 0.28);
  font-size: 0.88rem;
  font-weight: 900;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  display: grid;
  min-height: 72px;
  place-items: center;
  border-bottom: 3px solid transparent;
  color: #26354f;
  padding: 0 12px;
  font-weight: 800;
}

:root[data-theme="dark"] .nav-link,
:root[data-theme="dark"] .mode-button,
:root[data-theme="dark"] .hero-lead,
:root[data-theme="dark"] .field span {
  color: #d7e6ff;
}

.nav-link.active,
.nav-link:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}

.mode-button,
.login-button,
.primary-action,
.secondary-action,
.swap-button {
  display: inline-grid;
  min-height: 44px;
  place-items: center;
  border-radius: 8px;
  font-weight: 850;
}

.mode-button {
  width: 44px;
  border: 0;
  background: transparent;
  color: #2d3c58;
  font-size: 1.2rem;
}

.login-button,
.primary-action {
  border: 0;
  background: var(--blue);
  color: #fff;
  padding: 0 18px;
  box-shadow: 0 12px 24px rgba(23, 104, 232, 0.2);
}

.primary-action:hover,
.login-button:hover {
  background: var(--blue-strong);
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
}

main {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 270px;
  padding: 42px 180px 28px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 930px;
  margin-bottom: 12px;
  font-size: 3.35rem;
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 820px;
  margin-bottom: 0;
  color: #3f4d65;
  font-size: 1.08rem;
  line-height: 1.65;
}

.float-card {
  position: absolute;
  display: grid;
  width: 86px;
  height: 76px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--blue);
  box-shadow: var(--shadow);
  font-weight: 950;
}

.float-left {
  left: 70px;
  top: 68px;
  transform: rotate(-8deg);
}

.float-right {
  right: 70px;
  top: 78px;
  color: var(--teal);
  transform: rotate(7deg);
}

.converter-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.code-shell {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

:root[data-theme="dark"] .code-shell,
:root[data-theme="dark"] .code-panel,
:root[data-theme="dark"] .code-field textarea {
  background: rgba(16, 27, 47, 0.94);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 22px;
}

.section-note {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.search-box {
  display: flex;
  align-items: center;
  width: min(430px, 100%);
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0 14px;
}

.search-box span {
  color: var(--blue);
  font-size: 1.2rem;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
}

.converter-layout {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
}

.code-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
}

.code-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 12px 32px rgba(23, 83, 156, 0.07);
}

.code-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.code-field {
  display: grid;
  gap: 8px;
}

.code-field span {
  color: #2e3b53;
  font-size: 0.9rem;
  font-weight: 850;
}

:root[data-theme="dark"] .code-field span {
  color: #d7e6ff;
}

.code-field textarea {
  width: 100%;
  min-height: 278px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #07111f;
  color: #d8ecff;
  padding: 16px;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.94rem;
  line-height: 1.55;
  outline: 0;
  resize: vertical;
}

.compact-title {
  margin-bottom: 16px;
}

.code-result {
  min-height: 356px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #07111f;
  color: #d8ecff;
  padding: 16px;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.94rem;
  line-height: 1.55;
}

.code-examples {
  border-top: 1px solid var(--line);
  padding: 0 22px 22px;
}

.category-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.category-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 14px;
  text-align: left;
  box-shadow: 0 12px 30px rgba(23, 83, 156, 0.06);
}

.category-card:hover,
.category-card.active {
  border-color: #90b9ff;
  background: #f8fbff;
}

:root[data-theme="dark"] .category-card:hover,
:root[data-theme="dark"] .category-card.active {
  background: #122644;
}

.card-icon,
.panel-icon,
.feature-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), #4da0ff);
  color: #fff;
  font-weight: 950;
}

.card-icon.green,
.feature-icon.green {
  background: var(--green);
}

.card-icon.orange {
  background: var(--orange);
}

.card-icon.teal,
.feature-icon.teal {
  background: var(--teal);
}

.card-icon.purple,
.feature-icon.purple {
  background: var(--purple);
}

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

.category-card small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.converter-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 12px 32px rgba(23, 83, 156, 0.07);
}

.converter-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.converter-title p,
.feature-strip p,
.site-footer p {
  color: var(--muted);
  line-height: 1.55;
}

.converter-title p {
  margin: 5px 0 0;
}

.converter-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) 48px minmax(180px, 1fr) minmax(150px, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: #2e3b53;
  font-size: 0.9rem;
  font-weight: 850;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: 0;
}

.swap-button {
  width: 48px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  font-size: 1.2rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.action-row .primary-action {
  min-width: 180px;
}

.result-box {
  display: block;
  min-height: 140px;
  white-space: pre-wrap;
  border: 1px solid #c8dbf6;
  border-radius: 10px;
  background: linear-gradient(180deg, #f6faff, #edf5ff);
  color: #17233b;
  padding: 18px;
  line-height: 1.55;
}

:root[data-theme="dark"] .result-box {
  background: #0c1729;
  color: #edf5ff;
}

.quick-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.quick-examples button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  padding: 0 12px;
  font-weight: 850;
}

:root[data-theme="dark"] .quick-examples button,
:root[data-theme="dark"] .secondary-action,
:root[data-theme="dark"] .swap-button {
  background: #101b2f;
  color: #edf5ff;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(241, 248, 255, 0.9);
  overflow: hidden;
}

:root[data-theme="dark"] .feature-strip {
  background: #0c1729;
}

.feature-strip article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 104px;
  border-right: 1px solid var(--line);
  padding: 18px 22px;
}

.feature-strip article:last-child {
  border-right: 0;
}

.feature-icon.blue {
  background: var(--blue);
}

.feature-strip strong {
  display: block;
  margin-bottom: 4px;
}

.feature-strip p {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(280px, 1.7fr) repeat(2, minmax(160px, 1fr));
  gap: 28px;
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 28px 0 34px;
}

.site-footer p {
  max-width: 440px;
  margin: 14px 0 0;
}

.site-footer nav {
  display: grid;
  align-content: start;
  gap: 10px;
}

.site-footer nav a {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 40px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 13px 14px;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 800;
}

@media (max-width: 1180px) {
  .site-header,
  main,
  .site-footer {
    width: auto;
    padding-left: 20px;
    padding-right: 20px;
  }

  .converter-layout,
  .code-layout,
  .feature-strip,
  .site-footer {
    grid-template-columns: 1fr 1fr;
  }

  .converter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .code-controls {
    grid-template-columns: 1fr;
  }

  .swap-button {
    width: 100%;
  }

  .hero {
    padding-left: 110px;
    padding-right: 110px;
  }

  h1 {
    font-size: 2.8rem;
  }
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .nav-group {
    overflow-x: auto;
    width: 100%;
  }

  .nav-link {
    min-height: 42px;
  }

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

  main,
  .site-footer {
    width: min(100% - 28px, 1480px);
    padding-left: 0;
    padding-right: 0;
  }

  .hero {
    min-height: auto;
    padding: 34px 0 22px;
  }

  .float-card {
    display: none;
  }

  h1 {
    font-size: 2.28rem;
  }

  h2 {
    font-size: 1.7rem;
  }

  .section-heading,
  .converter-layout,
  .converter-form,
  .code-layout,
  .feature-strip,
  .site-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .feature-strip article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .feature-strip article:last-child {
    border-bottom: 0;
  }
}
