/* react-image-studio docs site — hand-written, no build step. */

:root {
  --bg: #0a0d14;
  --bg-soft: #0f1420;
  --panel: #131a27;
  --panel-2: #17202f;
  --border: #232d40;
  --border-strong: #31405a;
  --text: #e8edf6;
  --muted: #93a3bd;
  --accent: #4c8dff;
  --accent-soft: rgba(76, 141, 255, 0.14);
  --green: #45d7a0;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 560px at 15% -10%, #16253f 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 0%, #1d1830 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ───────────────────────────────────── nav ───────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 58px;
  padding: 0 clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 13, 20, 0.82);
  backdrop-filter: blur(12px);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.nav__brand svg {
  color: var(--accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  overflow-x: auto;
  scrollbar-width: none;
}

.nav__links a {
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.nav__links a:hover {
  color: var(--text);
  background: var(--panel);
}

.nav__pill {
  border: 1px solid var(--border-strong);
  color: var(--text) !important;
}

/* ──────────────────────────────────── layout ─────────────────────────────── */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 72px;
}

.section {
  padding: clamp(40px, 7vw, 76px) 0 0;
}

.section__head {
  max-width: 760px;
  margin-bottom: 22px;
}

.section__head h2,
.two-col h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.01em;
}

.section__head p {
  margin: 0;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 13.5px;
}

.subhead {
  margin: 30px 0 12px;
  font-size: 16px;
  letter-spacing: 0.01em;
}

/* ───────────────────────────────────── hero ──────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding: clamp(40px, 8vw, 92px) 0 0;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.badges img {
  height: 20px;
  display: block;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.hero__lead {
  margin: 0 0 24px;
  color: #c3d0e4;
  font-size: clamp(14.5px, 1.5vw, 16px);
  max-width: 56ch;
}

.hero__lead strong {
  color: var(--text);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--panel-2);
  transform: translateY(-1px);
}

.btn--primary {
  background: linear-gradient(180deg, #5b97ff, #2f6fe0);
  border-color: #4c8dff;
  color: #06121f;
}

.btn--primary:hover {
  background: linear-gradient(180deg, #6fa4ff, #3b7cee);
}

.hero__code,
.usage__item pre,
pre.arch {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(23, 32, 47, 0.9), rgba(15, 20, 32, 0.9));
  overflow: hidden;
}

.hero__code {
  padding: 4px 0 10px;
}

.code__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.code__head + pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
}

.code__head button {
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  padding: 3px 8px;
  cursor: pointer;
}

.code__head button:hover {
  color: var(--text);
  background: var(--panel-2);
}

/* ───────────────────────────────────── demo ──────────────────────────────── */

.demo {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-soft);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

.demo__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.demo__sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  appearance: none;
}

.chip:hover {
  background: var(--panel-2);
}

.chip[data-active='true'] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.chip--file {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.chip--file input {
  display: none;
}

select.chip {
  padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.demo__log {
  flex: 1 1 220px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--muted);
}

.demo__stage {
  height: clamp(420px, 62vh, 680px);
  background: #0c1018;
  position: relative;
}

.demo__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

/* ──────────────────────────────────── cards ─────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(23, 32, 47, 0.7), rgba(17, 23, 34, 0.7));
}

.card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.card--new {
  border-color: rgba(69, 215, 160, 0.42);
  background: linear-gradient(180deg, rgba(69, 215, 160, 0.1), rgba(17, 23, 34, 0.72));
}

.card__flag {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(69, 215, 160, 0.16);
  color: var(--green);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ──────────────────────────────────── usage ─────────────────────────────── */

.usage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.usage__item h3 {
  margin: 0 0 8px;
  font-size: 14.5px;
}

.usage__item pre {
  margin: 0 0 10px;
  padding: 13px 15px;
  overflow-x: auto;
}

.usage__item code {
  color: #cfe0ff;
}

/* ──────────────────────────────────── tables ────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(35, 45, 64, 0.6);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody code {
  color: #bcd3ff;
  font-size: 12px;
}

/* ─────────────────────────────────── two col ─────────────────────────────── */

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(20px, 4vw, 40px);
}

.two-col pre {
  margin: 12px 0;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow-x: auto;
}

pre.arch {
  padding: 16px 18px;
  overflow-x: auto;
  color: #b9c8e2;
}

/* ──────────────────────────────────── footer ────────────────────────────── */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 40px) 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
}

.footer__links {
  display: flex;
  gap: 14px;
}

.footer__links a:hover {
  color: var(--text);
}

/* ───────────────────────────────── responsive ───────────────────────────── */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 36px;
  }

  .nav__links {
    gap: 2px;
    font-size: 12.5px;
  }
}

@media (max-width: 620px) {
  .nav__links a:not(.nav__pill) {
    display: none;
  }

  .demo__stage {
    height: 72vh;
  }
}

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

  * {
    transition-duration: 0.001ms !important;
  }
}
