:root {
  --bg: #ffffff;
  --bg-tint: #f2f2f2;
  --fg: #0d0d0d;
  --fg-muted: #888076;
  --border: rgba(13, 13, 13, 0.12);
  --font: "IBM Plex Mono", "Courier New", monospace;
  --nav-h: 48px;
}

html[data-theme="night"] {
  --bg: #080808;
  --bg-tint: #101010;
  --fg: #ffffff;
  --fg-muted: #706a62;
  --border: rgba(245, 243, 239, 0.11);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

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

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

button {
  appearance: none;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 14px;
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

button:hover {
  color: var(--fg);
  background: var(--bg-tint);
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
.rendered-output:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}

.nav-logo {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  line-height: 1;
  white-space: nowrap;
}

.nav-logo a {
  color: inherit;
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  gap: 28px;
  flex-shrink: 0;
}

.nav-link,
.nav-meta,
.theme-toggle {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--fg-muted);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.nav-link:hover,
.theme-toggle:hover {
  color: var(--fg);
  background: transparent;
}

.theme-toggle {
  border: 0;
  padding: 0;
  white-space: nowrap;
}

.nav-meta {
  white-space: nowrap;
}

.page {
  position: relative;
  z-index: 2;
  width: min(100%, 972px);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 60px) 24px 72px;
}

.content-box {
  max-width: 860px;
  margin: 0 auto 32px;
  padding: 48px 56px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.hero-box {
  min-height: 0;
}

.hero-eyebrow {
  margin: 0 0 20px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--fg-muted);
}

.hero-box h1 {
  margin: 0;
  font-size: clamp(34px, 5.5vw, 66px);
  line-height: 1.08;
  letter-spacing: 0.16em;
  font-weight: 600;
}

.hero-descriptor {
  max-width: 68ch;
  margin: 24px 0 0;
  font-size: 12px;
  line-height: 1.9;
  text-transform: lowercase;
}

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sec-head span:last-child {
  opacity: 0.5;
}

.tool-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.cta-button {
  color: var(--fg);
}

.cta-button:hover {
  background: var(--fg);
  color: var(--bg);
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.converter-panel {
  border: 1px solid var(--border);
  min-width: 0;
}

.panel-head {
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-title span:last-child {
  color: var(--fg-muted);
}

textarea,
.rendered-output {
  width: 100%;
  min-height: 560px;
  padding: 18px;
  border: 0;
  background: var(--bg);
  color: var(--fg);
  border-radius: 0;
}

textarea {
  resize: vertical;
  line-height: 1.7;
}

textarea::placeholder {
  color: var(--fg-muted);
}

.rendered-output {
  overflow: auto;
}

.rendered-output > :first-child {
  margin-top: 0;
}

.rendered-output > :last-child {
  margin-bottom: 0;
}

.rendered-output h1,
.rendered-output h2,
.rendered-output h3,
.rendered-output h4,
.rendered-output h5,
.rendered-output h6 {
  font-weight: 500;
  line-height: 1.3;
  margin-top: 1.9em;
  margin-bottom: 0.7em;
}

.rendered-output p,
.rendered-output ul,
.rendered-output ol,
.rendered-output blockquote,
.rendered-output pre,
.rendered-output table {
  margin: 0 0 1.15rem;
}

.rendered-output blockquote {
  margin-left: 0;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  color: var(--fg-muted);
}

.rendered-output pre,
.rendered-output code {
  font-family: inherit;
}

.rendered-output pre {
  overflow: auto;
  padding: 12px;
  background: var(--bg-tint);
}

.rendered-output a {
  color: var(--fg-muted);
  transition: color 0.12s ease;
}

.rendered-output a:hover {
  color: var(--fg);
}

.rendered-output table {
  width: 100%;
  border-collapse: collapse;
}

.rendered-output th,
.rendered-output td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}

.rendered-output th {
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 400;
  text-transform: uppercase;
}

.ripple-canvas,
#ripple-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.ambient-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-particle {
  position: absolute;
  top: 0;
  left: 0;
  user-select: none;
  line-height: 1;
  color: var(--fg-muted);
  will-change: transform;
}

.fade-in {
  opacity: 0;
  transform: translateY(8px);
  animation: fade-in 0.35s ease forwards;
}

.hero-box.fade-in {
  animation-delay: 0.04s;
}

#converter.fade-in {
  animation-delay: 0.1s;
}

.tool-controls.fade-in {
  animation-delay: 0.17s;
}

.converter-panel:nth-child(1) {
  animation-delay: 0.24s;
}

.converter-panel:nth-child(2) {
  animation-delay: 0.31s;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 800px) {
  .content-box {
    padding: 32px 24px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  textarea,
  .rendered-output {
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 72px;
  }

  .topbar {
    padding: 0 24px;
    gap: 12px;
  }

  .nav-actions {
    gap: 16px;
    min-width: 0;
  }

  .nav-meta {
    display: none;
  }

  .page {
    width: 100%;
    padding-top: calc(var(--nav-h) + 24px);
  }
}
