:root {
  color-scheme: light;
  --bg: #f3f1eb;
  --surface: #fbfaf7;
  --surface-strong: #ffffff;
  --ink: #171916;
  --muted: #6e736c;
  --line: #d9dbd3;
  --line-strong: #b9beb3;
  --accent: #d9f35b;
  --accent-strong: #b8d638;
  --accent-ink: #1b210d;
  --warning: #fff1c7;
  --warning-ink: #604b13;
  --danger: #b52e2e;
  --shadow: 0 1.5rem 4rem rgb(34 39 27 / 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 80% 0%, rgb(217 243 91 / 0.23), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
pre:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 3px;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  font-size: 0.9em;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.6rem;
  background: var(--ink);
  color: var(--surface-strong);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
.site-footer {
  width: min(100% - 3rem, 68rem);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5.5rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 0.7rem;
  background: var(--accent);
}

.brand-mark svg {
  width: 1.35rem;
  height: 1.35rem;
}

.header-note,
.site-footer {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

main {
  padding-block: 4.5rem 5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  gap: 4rem;
  align-items: end;
  margin-bottom: 4rem;
}

.eyebrow,
.step {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.4rem;
}

.eyebrow-dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 0.3rem rgb(184 214 56 / 0.2);
}

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

h1 {
  max-width: 12ch;
  margin-bottom: 1.35rem;
  font-size: clamp(2.75rem, 7vw, 5.6rem);
  font-weight: 780;
  letter-spacing: -0.075em;
  line-height: 0.96;
}

h1 em {
  color: #7d9d13;
  font-style: normal;
}

.hero-lede {
  max-width: 38rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.privacy-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.54);
}

.privacy-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border-radius: 0.7rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.2rem;
  font-weight: 800;
}

.privacy-card h2 {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.privacy-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.converter-form {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
  gap: 1rem;
}

.panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.panel-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}

.step {
  flex: 0 0 auto;
  min-width: 2rem;
  padding-top: 0.3rem;
  color: #879b3e;
}

.panel h2,
.result-panel h2 {
  margin-bottom: 0.35rem;
  font-size: 1.2rem;
  letter-spacing: -0.04em;
}

.panel-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.dropzone {
  display: flex;
  min-height: 15rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 0.48);
  color: var(--muted);
  text-align: center;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging,
.dropzone.has-file {
  border-color: var(--accent-strong);
  background: rgb(217 243 91 / 0.13);
}

.dropzone.is-dragging {
  transform: scale(1.01);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.upload-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 1rem;
  background: var(--accent);
  color: var(--accent-ink);
}

.upload-icon svg {
  width: 1.65rem;
  height: 1.65rem;
}

.dropzone-title {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.dropzone-subtitle {
  margin-top: 0.3rem;
  font-size: 0.86rem;
}

.browse-link {
  color: #69840c;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.dropzone-hint {
  margin-top: 1.15rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.selected-file {
  max-width: 100%;
  margin-top: 0.85rem;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field {
  margin-bottom: 1.5rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.field label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.7rem;
  background: var(--surface-strong);
  color: var(--ink);
}

.field input:focus {
  border-color: var(--accent-strong);
}

.field-hint,
.action-hint,
.result-note {
  color: var(--muted);
  font-size: 0.76rem;
}

.field-hint {
  margin: 0.45rem 0 0;
}

.field-grid .field-hint {
  min-height: 2.3em;
}

.check-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding-block: 0.25rem;
  cursor: pointer;
}

.check-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.check-mark {
  display: grid;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.05rem;
  place-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 0.38rem;
  background: var(--surface-strong);
}

.check-mark::after {
  width: 0.55rem;
  height: 0.3rem;
  border-bottom: 2px solid var(--accent-ink);
  border-left: 2px solid var(--accent-ink);
  content: "";
  opacity: 0;
  transform: rotate(-45deg) translateY(-0.05rem);
}

.check-row input:checked + .check-mark {
  border-color: var(--accent-strong);
  background: var(--accent);
}

.check-row input:checked + .check-mark::after {
  opacity: 1;
}

.check-row input:focus-visible + .check-mark {
  outline: 3px solid var(--accent-strong);
  outline-offset: 3px;
}

.check-row strong,
.check-row small {
  display: block;
}

.check-row strong {
  font-size: 0.86rem;
}

.check-row small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.form-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  font-size: 0.84rem;
  font-weight: 750;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface-strong);
}

.button-primary:hover {
  background: #30362d;
}

.button-secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--surface-strong);
}

.button-arrow {
  font-size: 1.1rem;
  line-height: 1;
}

.action-hint {
  margin: 0;
}

.status {
  min-height: 1.5rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: pre-line;
}

.status.is-error {
  color: var(--danger);
  font-weight: 650;
}

.result-panel {
  margin-top: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.result-heading .step {
  margin-bottom: 0.35rem;
}

.result-badge {
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 750;
}

.warnings-panel {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid #e1c66b;
  border-radius: 0.75rem;
  background: var(--warning);
  color: var(--warning-ink);
}

.warnings-panel h3 {
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
}

.warnings-panel ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.78rem;
}

.warnings-panel li + li {
  margin-top: 0.25rem;
}

.code-frame {
  overflow: hidden;
  border: 1px solid #32372e;
  border-radius: 0.85rem;
  background: #20231e;
  color: #e9eedf;
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #3b4235;
  color: #aeb8a5;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
}

.toolbar-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
}

.text-button {
  padding: 0.25rem;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
}

.code-frame pre {
  max-height: 34rem;
  margin: 0;
  overflow: auto;
  padding: 1.25rem;
  font-size: 0.8rem;
  line-height: 1.65;
  tab-size: 2;
}

.result-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.result-note {
  margin: 1rem 0 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  padding-block: 1.5rem 2rem;
  border-top: 1px solid var(--line);
}

[hidden] {
  display: none !important;
}

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

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #171a15;
    --surface: #20241d;
    --surface-strong: #292e26;
    --ink: #f1f4e8;
    --muted: #adb5a3;
    --line: #3a4235;
    --line-strong: #5c6954;
    --accent: #d9f35b;
    --accent-strong: #d9f35b;
    --accent-ink: #1b210d;
    --warning: #403617;
    --warning-ink: #f6dda0;
    --danger: #ff9696;
    --shadow: 0 1.5rem 4rem rgb(0 0 0 / 0.16);
  }

  body {
    background:
      radial-gradient(circle at 80% 0%, rgb(217 243 91 / 0.1), transparent 30rem),
      var(--bg);
  }

  h1 em {
    color: var(--accent);
  }

  .privacy-card,
  .dropzone {
    background: rgb(41 46 38 / 0.55);
  }

  .button-primary:hover {
    background: #30382d;
  }
}

@media (max-width: 46rem) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 2rem, 40rem);
  }

  .site-header {
    min-height: 4.5rem;
  }

  .header-note {
    display: none;
  }

  main {
    padding-block: 3rem 3.5rem;
  }

  .hero,
  .converter-form {
    grid-template-columns: 1fr;
  }

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

  .hero {
    gap: 2rem;
    margin-bottom: 2.5rem;
  }

  h1 {
    font-size: clamp(2.7rem, 14vw, 4.5rem);
  }

  .form-actions,
  .result-actions,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
