:root {
  color-scheme: dark light;
  --bg: #071017;
  --bg-soft: #0c1822;
  --bg-panel: #101d27;
  --header-bg: #081c34;
  --ink: #edf6ff;
  --muted: #a9b8c7;
  --line: #203343;
  --blue: #2095ff;
  --cyan: #56d7ff;
  --green: #32d17a;
  --yellow: #f3c64e;
  --red: #ef5c68;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7fbff;
  --bg-soft: #eef5fb;
  --bg-panel: #ffffff;
  --header-bg: #081c34;
  --ink: #0a1722;
  --muted: #536477;
  --line: #d6e2ee;
  --blue: #0877df;
  --cyan: #0b8ee9;
  --green: #168f52;
  --yellow: #b78300;
  --red: #c93545;
  --shadow: 0 20px 60px rgba(22, 46, 70, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-width: 320px;
  transition: background 160ms ease, color 160ms ease;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(86, 215, 255, 0.15);
}

.nav {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--header-bg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand img {
  width: 148px;
  height: auto;
}

.brand span {
  font-weight: 800;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  color: #b9c9da;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 6px;
}

.nav-links a:hover,
.nav-links a.active {
  color: #f3f9ff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-cta {
  color: #061017 !important;
  background: var(--cyan) !important;
}

.menu-button {
  display: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel);
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 800;
}

.theme-toggle {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #f3f9ff;
  font-weight: 900;
  cursor: pointer;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 74px);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(rgba(7, 16, 23, 0.62), rgba(7, 16, 23, 0.88)),
    url("/assets/tunaio-logo-wide.png");
  background-repeat: no-repeat;
  background-position: right 9vw top 90px;
  background-size: min(560px, 54vw) auto;
}

[data-theme="light"] .hero {
  background-image:
    linear-gradient(rgba(247, 251, 255, 0.86), rgba(247, 251, 255, 0.96)),
    url("/assets/tunaio-logo-wide.png");
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 16, 23, 0.98) 0%, rgba(7, 16, 23, 0.84) 48%, rgba(7, 16, 23, 0.45) 100%),
    repeating-linear-gradient(0deg, transparent 0 72px, rgba(86, 215, 255, 0.07) 73px, transparent 74px),
    repeating-linear-gradient(90deg, transparent 0 160px, rgba(86, 215, 255, 0.06) 161px, transparent 162px);
  pointer-events: none;
}

[data-theme="light"] .hero::before {
  background:
    linear-gradient(90deg, rgba(247, 251, 255, 1) 0%, rgba(247, 251, 255, 0.86) 52%, rgba(247, 251, 255, 0.65) 100%),
    repeating-linear-gradient(0deg, transparent 0 72px, rgba(8, 119, 223, 0.08) 73px, transparent 74px),
    repeating-linear-gradient(90deg, transparent 0 160px, rgba(8, 119, 223, 0.07) 161px, transparent 162px);
}

.hero-inner,
.section-inner {
  position: relative;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero-copy {
  width: min(760px, 100%);
  padding: 100px 0 80px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 24px var(--green);
}

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

h1 {
  margin: 20px 0 18px;
  font-size: clamp(38px, 5.4vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-lead {
  color: var(--muted);
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.35;
  max-width: 700px;
}

.hero-actions,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: var(--bg-panel);
  color: var(--ink);
  font-weight: 900;
}

.button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.06);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  width: min(980px, 100%);
  margin-top: 62px;
  border: 1px solid var(--line);
  background: var(--line);
}

.hero-stat {
  padding: 20px;
  background: var(--bg-panel);
}

.hero-stat strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  margin-bottom: 5px;
}

.hero-stat span {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.section {
  padding: 88px 0;
}

.section.alt {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-title {
  max-width: 780px;
  margin-bottom: 34px;
}

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

.section-title h2 {
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
  margin-bottom: 16px;
}

.section-title p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 24px;
  min-height: 100%;
}

.tile h3 {
  font-size: 21px;
  margin-bottom: 12px;
}

.tile p,
.tile li {
  color: var(--muted);
  line-height: 1.55;
}

.tile ul {
  margin: 0;
  padding-left: 20px;
}

.icon {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(86, 215, 255, 0.11);
  color: var(--cyan);
  margin-bottom: 18px;
  font-weight: 900;
  font-size: 20px;
}

.feature-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
}

.feature-strip {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.feature-item {
  min-height: 146px;
  padding: 24px 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--blue);
  text-align: center;
  border-right: 1px solid var(--line);
}

.feature-item:first-child {
  border-left: 1px solid var(--line);
}

.feature-item svg {
  width: 48px;
  height: 48px;
}

.feature-item span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
  line-height: 1.22;
}

.flow-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.flow-head {
  display: grid;
  grid-template-columns: 120px repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.flow-head div {
  padding: 12px 14px;
  color: #c6d6e5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  border-right: 1px solid var(--line);
}

.flow-row {
  display: grid;
  grid-template-columns: 120px repeat(4, 1fr);
  min-height: 58px;
  border-bottom: 1px solid rgba(32, 51, 67, 0.7);
}

.flow-row div {
  position: relative;
  padding: 16px 14px;
  border-right: 1px solid rgba(32, 51, 67, 0.7);
  color: #8ea0b1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: nowrap;
}

.arrow {
  position: absolute;
  top: 24px;
  left: 12px;
  width: calc(200% - 24px);
  height: 2px;
  background: var(--cyan);
}

.arrow.green {
  background: var(--green);
}

.arrow.red {
  background: var(--red);
}

.arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -5px;
  border-left: 10px solid currentColor;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  color: inherit;
}

.arrow-label {
  position: relative;
  z-index: 1;
  display: inline-block;
  background: var(--bg);
  color: var(--ink);
  padding: 0 8px;
  margin-left: 34px;
  font-weight: 900;
}

.split {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 44px;
  align-items: center;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 14px;
}

.step {
  position: relative;
  padding: 20px 20px 20px 68px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
  font-weight: 900;
}

.step h3 {
  margin-bottom: 6px;
}

.step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.plan {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel);
}

.plan.featured {
  border-color: rgba(86, 215, 255, 0.55);
  box-shadow: var(--shadow);
}

.plan h3 {
  font-size: 28px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(50, 209, 122, 0.12);
  color: #a3f1c6;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.code {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 18px;
  color: #dbe8f5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.api-docs {
  display: grid;
  gap: 14px;
}

.endpoint {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-panel) 88%, transparent);
}

.method-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 6px;
  color: #061017;
  background: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.method-pill.get {
  background: #86efac;
}

.method-pill.post {
  background: #56d7ff;
}

.method-pill.delete {
  background: #ff8f9a;
}

.endpoint h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.endpoint p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.page-hero {
  padding: 96px 0 62px;
  background:
    linear-gradient(90deg, rgba(7, 16, 23, 1), rgba(7, 16, 23, 0.82)),
    url("/assets/tunaio-logo-wide.png") right 9vw center / min(430px, 45vw) auto no-repeat;
  border-bottom: 1px solid var(--line);
}

[data-theme="light"] .page-hero {
  background:
    linear-gradient(90deg, rgba(247, 251, 255, 1), rgba(247, 251, 255, 0.82)),
    url("/assets/tunaio-logo-wide.png") right 9vw center / min(430px, 45vw) auto no-repeat;
}

.page-hero h1 {
  font-size: clamp(44px, 6vw, 76px);
  max-width: 900px;
}

.page-hero p {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
  max-width: 760px;
}

.contact-form {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg-panel);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  color: var(--ink);
  font-weight: 850;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  padding: 12px 13px;
  font: inherit;
}

.form-field textarea {
  min-height: 156px;
  resize: vertical;
}

.form-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  background: var(--bg-panel);
  margin-bottom: 20px;
}

.form-status.ok {
  border-color: rgba(50, 209, 122, 0.55);
  color: var(--green);
}

.form-status.err {
  border-color: rgba(239, 92, 104, 0.55);
  color: var(--red);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 42px 0;
}

.footer-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

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

@media (max-width: 900px) {
  .nav {
    height: auto;
    padding: 14px 0;
    flex-wrap: wrap;
  }

  .menu-button {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px;
  }

  .theme-toggle {
    width: 100%;
    justify-content: center;
  }

  .hero {
    min-height: auto;
    background-size: 360px auto;
    background-position: right -90px top 40px;
  }

  .hero-copy {
    padding-top: 78px;
  }

  .hero-stats,
  .feature-strip,
  .grid.three,
  .grid.two,
  .code-grid,
  .plans,
  .split,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .feature-item,
  .feature-item:first-child {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .flow-preview {
    overflow-x: auto;
  }

  .flow-head,
  .flow-row {
    width: 820px;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .nav,
  .hero-inner,
  .section-inner,
  .footer-inner {
    width: min(100% - 28px, 1180px);
  }

  .brand img {
    width: 126px;
  }

  h1 {
    font-size: 48px;
  }

  .section {
    padding: 64px 0;
  }

  .hero-stat,
  .tile,
  .plan {
    padding: 20px;
  }
}
