:root {
  color-scheme: light;
  --bg: oklch(98.5% 0.004 250);
  --surface: oklch(100% 0 0);
  --surface-alt: oklch(96.4% 0.008 250);
  --ink: oklch(19% 0.025 255);
  --muted: oklch(43% 0.03 255);
  --quiet: oklch(58% 0.025 255);
  --line: oklch(88% 0.012 250);
  --line-strong: oklch(78% 0.018 250);
  --accent: oklch(51% 0.17 255);
  --accent-dark: oklch(41% 0.16 255);
  --accent-soft: oklch(94% 0.035 255);
  --success: oklch(48% 0.12 160);
  --warning: oklch(62% 0.14 78);
  --danger: oklch(52% 0.17 25);
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.06);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, oklch(96.8% 0.014 255 / 0.92), transparent 340px);
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

button,
.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

button:focus-visible,
.button:focus-visible,
textarea:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid oklch(75% 0.12 255 / 0.55);
  outline-offset: 2px;
}

.button-primary,
button.primary {
  background: var(--accent);
  color: white;
}

.button-primary:hover,
button.primary:hover {
  background: var(--accent-dark);
}

.button-ghost,
button.ghost {
  border-color: var(--line);
  background: var(--surface);
}

.button-soft,
button.soft {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid oklch(90% 0.014 250 / 0.8);
  background: oklch(99% 0.004 250 / 0.86);
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 780;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  position: relative;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent);
  overflow: hidden;
  color: transparent;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
}

.brand-mark::before {
  width: 17px;
  height: 3px;
  border-radius: 999px;
  background: white;
  box-shadow:
    -3px 7px 0 white,
    3px 14px 0 white;
  transform: translateY(-7px);
}

.brand-mark::after {
  right: 5px;
  bottom: 5px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: oklch(76% 0.14 170);
}

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

.nav-links a {
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 620;
  padding: 8px 10px;
}

.nav-links a:hover {
  background: var(--surface-alt);
  color: var(--ink);
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 44px;
  align-items: center;
  padding: 56px 0 42px;
}

.hero h1,
.tool-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.tool-hero h1 {
  font-size: clamp(2rem, 4vw, 4rem);
}

.hero p,
.tool-hero p {
  max-width: 620px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
  padding: 5px 10px;
}

.mini-tool {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.mini-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  padding: 10px 12px;
}

.window-dots {
  display: flex;
  gap: 6px;
}

.window-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.mini-toolbar strong {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.mini-pane {
  min-height: 260px;
  padding: 16px;
}

.mini-pane + .mini-pane {
  border-left: 1px solid var(--line);
}

.mini-label {
  margin-bottom: 10px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 700;
}

.mini-line {
  display: flex;
  align-items: center;
  min-height: 31px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}

.section {
  padding: 44px 0;
}

.section h2 {
  margin: 0 0 18px;
  font-size: 1.65rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section-intro {
  max-width: 680px;
  margin: -8px 0 26px;
  color: var(--muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.tool-card {
  display: block;
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  color: var(--ink);
  transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.tool-card:hover {
  border-color: var(--accent);
  background: oklch(99% 0.01 255);
  transform: translateY(-2px);
  text-decoration: none;
}

.tool-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.02rem;
}

.tool-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.workflow-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.workflow-item {
  background: var(--surface);
  padding: 18px;
}

.workflow-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.workflow-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tool-hero {
  padding: 40px 0 22px;
}

.breadcrumb {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--quiet);
  font-size: 14px;
}

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

.tool-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tool-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  padding: 12px;
}

.tool-tabs,
.tool-actions,
.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tool-tabs button[aria-pressed="true"],
.mode-button[aria-pressed="true"] {
  background: var(--accent);
  color: white;
}

.tool-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
}

.textarea-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.textarea-panel + .textarea-panel {
  border-left: 1px solid var(--line);
}

.panel-head {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.panel-head strong {
  font-size: 14px;
}

.panel-head span {
  color: var(--quiet);
  font-size: 13px;
}

textarea {
  width: 100%;
  min-height: 340px;
  flex: 1;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  padding: 14px;
}

textarea::placeholder {
  color: oklch(44% 0.025 255);
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  padding: 12px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 620;
}

.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.select-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 620;
}

select {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 5px 9px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.stat {
  background: var(--surface);
  padding: 12px;
}

.stat strong {
  display: block;
  font-family: var(--mono);
  font-size: 1.25rem;
}

.stat span {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 700;
}

.compare-body {
  grid-template-columns: 1fr 1fr;
}

.compare-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.result-box {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.result-box header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  padding: 10px;
}

.result-box header strong {
  font-size: 13px;
}

.result-box pre {
  min-height: 150px;
  max-height: 260px;
  margin: 0;
  overflow: auto;
  padding: 12px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.copy-small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 32px;
  align-items: start;
}

.article {
  display: grid;
  gap: 24px;
}

.article-block {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.article-block h2,
.article-block h3 {
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.article-block p,
.article-block li {
  color: var(--muted);
}

.article-block p {
  max-width: 72ch;
}

.example {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.example pre {
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  font-family: var(--mono);
  font-size: 13px;
}

.side-panel {
  position: sticky;
  top: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

.side-panel h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.side-panel a {
  display: block;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 620;
  padding: 8px;
}

.side-panel a:hover {
  background: var(--surface-alt);
  color: var(--ink);
  text-decoration: none;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
}

.faq p {
  margin-bottom: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 56px;
  padding: 34px 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(150px, 1fr));
  gap: 28px;
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: 12px;
}

.footer-brand p {
  max-width: 38ch;
  margin: 0;
  color: var(--muted);
}

.footer-group h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
}

.footer-group a,
.footer-note {
  display: block;
  color: var(--muted);
  line-height: 1.9;
}

.footer-group a:hover {
  color: var(--accent-dark);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 18px;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .tool-body,
  .compare-body,
  .mini-grid,
  .example {
    grid-template-columns: 1fr;
  }

  .textarea-panel + .textarea-panel,
  .mini-pane + .mini-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .side-panel {
    position: static;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .nav-links {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .nav-links a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 20px, 1180px);
  }

  .hero {
    padding-top: 34px;
  }

  .hero h1,
  .tool-hero h1 {
    font-size: 2.15rem;
  }

  .tool-bar,
  .footer-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .tool-tabs button {
    flex: 0 0 auto;
  }

  .tool-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .tool-actions button {
    width: auto;
    flex: 0 0 auto;
    padding-inline: 8px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
