:root {
  color-scheme: light;
  --paper: #f5f2ed;
  --surface: #fffefa;
  --ink: #292f2d;
  --muted: #5c6460;
  --line: #dcded7;
  --line-strong: #c7cbc3;
  --accent: #1f6257;
  --accent-dark: #184d44;
  --mint: #e6f1ec;
  --soft: #eef0ea;
  --danger: #a04742;
  --danger-soft: #f7e9e6;
  --success: #2e6856;
  --shadow: 0 18px 48px rgba(37, 48, 43, 0.07);
  --radius: 14px;
  --radius-small: 10px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select,
.upload-zone,
.download-button,
.text-button {
  min-height: 44px;
}

button,
select,
.upload-zone,
a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  transform: translateY(-150%);
}

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

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #0b4038;
}

.site-header {
  width: min(1120px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  background: var(--ink);
  transform-origin: bottom;
}

.brand-mark::before {
  top: 6px;
  height: 17px;
  transform: translateX(-50%) rotate(-40deg);
}

.brand-mark::after {
  top: 6px;
  height: 17px;
  transform: translateX(-50%) rotate(40deg);
}

.brand-mark span {
  top: 5px;
  height: 19px;
  transform: translateX(-50%);
}

.header-note {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.privacy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--mint);
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  max-width: 780px;
  padding: clamp(66px, 9vw, 116px) 0 clamp(42px, 6vw, 72px);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 500;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(42px, 7.2vw, 82px);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero-copy {
  max-width: 610px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.65;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(270px, 0.88fr);
  align-items: stretch;
  gap: 18px;
}

.converter-card,
.trust-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.converter-card {
  padding: clamp(24px, 4vw, 42px);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.converter-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.converter-fields legend {
  margin: 0 0 30px;
  padding: 0;
  font-family: var(--serif);
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.15;
}

.field + .field {
  margin-top: 28px;
}

.field label,
.label-row label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.label-row {
  margin-bottom: 9px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.field-meta,
.field-help,
.file-meta {
  color: var(--muted);
  font-size: 12px;
}

.field-help,
.file-meta {
  margin: 9px 0 0;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  pointer-events: none;
  transform: translateY(-68%) rotate(45deg);
}

select {
  width: 100%;
  min-width: 0;
  padding: 13px 48px 13px 15px;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

select:hover,
select:focus-visible {
  border-color: var(--accent);
}

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

.upload-zone {
  width: 100%;
  min-width: 0;
  min-height: 154px;
  padding: 25px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--soft);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.upload-zone:hover,
.upload-zone.is-dragging,
.upload-zone.has-files,
.upload-zone:has(+ .file-input:focus-visible) {
  border-color: var(--accent);
  background: var(--mint);
}

.upload-zone.is-dragging {
  transform: translateY(-2px);
}

.upload-zone.is-disabled {
  cursor: wait;
  opacity: 0.64;
}

.upload-icon {
  position: relative;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.upload-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 11px;
  height: 11px;
  border-top: 1.5px solid var(--accent);
  border-left: 1.5px solid var(--accent);
  transform: translateX(-50%) rotate(45deg);
}

.upload-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 1.5px;
  height: 23px;
  background: var(--accent);
  transform: translateX(-50%);
}

.upload-icon span {
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 12px;
  height: 1.5px;
  background: var(--accent);
}

.upload-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.upload-copy strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
}

.upload-copy span {
  color: var(--muted);
  font-size: 12px;
}

.browse-label {
  min-height: 44px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.form-actions {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.primary-button,
.download-button {
  border: 0;
  border-radius: var(--radius-small);
  background: var(--accent);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.primary-button {
  min-width: 196px;
  padding: 13px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(31, 98, 87, 0.16);
}

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

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.button-arrow {
  position: relative;
  width: 18px;
  height: 10px;
}

.button-arrow::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  width: 17px;
  height: 1px;
  background: currentColor;
}

.button-arrow::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 0;
  width: 6px;
  height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.status-panel {
  margin-top: 24px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--soft);
}

.status-panel[data-state="error"] {
  border-color: #dfbbb6;
  background: var(--danger-soft);
}

.status-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.status-indicator.is-working {
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 800ms linear infinite;
}

.status-indicator.is-success {
  position: relative;
  background: var(--accent);
}

.status-indicator.is-success::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 6px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(42deg);
}

.status-indicator.is-error {
  position: relative;
  background: var(--danger);
}

.status-indicator.is-error::before,
.status-indicator.is-error::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 5px;
  width: 2px;
  height: 12px;
  background: #fff;
}

.status-indicator.is-error::before {
  transform: rotate(45deg);
}

.status-indicator.is-error::after {
  transform: rotate(-45deg);
}

.status-copy {
  min-width: 0;
}

#status,
#status-detail {
  margin: 0;
}

#status {
  font-size: 13px;
  font-weight: 750;
}

#status-detail {
  color: var(--muted);
  font-size: 12px;
}

.download-button {
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  white-space: nowrap;
}

.trust-panel {
  padding: clamp(24px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  background: #e9eee7;
}

.trust-panel h2,
.formats h2 {
  margin: 0;
  font-size: clamp(27px, 3.2vw, 39px);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.trust-panel > p:not(.eyebrow) {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.trust-list {
  margin: 28px 0;
  padding: 0;
  display: grid;
  gap: 13px;
  list-style: none;
}

.trust-list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 650;
}

.trust-list li span {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1px solid #9db6aa;
  border-radius: 50%;
}

.trust-list li span::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 4px;
  height: 7px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(42deg);
}

.format-note {
  margin-top: auto;
  padding-top: 20px;
  display: grid;
  gap: 3px;
  border-top: 1px solid rgba(41, 47, 45, 0.12);
}

.format-note span:first-child {
  font-family: var(--serif);
  font-size: 17px;
}

.format-note span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.formats {
  margin: clamp(76px, 10vw, 124px) 0;
  padding-top: 34px;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 42px;
  border-top: 1px solid var(--line);
}

.format-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.format-groups p {
  min-width: 0;
  margin: 0;
  padding: 17px 0;
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}

.format-groups strong {
  font-size: 12px;
}

.format-groups span {
  color: var(--muted);
  font-size: 11px;
}

.site-footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 34px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.site-footer p {
  margin: 0;
}

.site-footer p:first-child {
  color: var(--ink);
  font-weight: 850;
  letter-spacing: 0.14em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.72fr);
  }

  .upload-zone {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .browse-label {
    grid-column: 2;
    width: max-content;
  }

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

@media (max-width: 720px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 28px, 1120px);
  }

  .site-header {
    min-height: 68px;
  }

  .hero {
    padding: 54px 0 38px;
  }

  h1 {
    font-size: clamp(39px, 13vw, 62px);
  }

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

  .trust-panel {
    min-height: 340px;
  }

  .formats {
    margin: 76px 0;
  }

  .format-groups {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .header-note {
    max-width: 120px;
    text-align: right;
    line-height: 1.3;
  }

  .converter-card {
    padding: 22px 18px;
  }

  .converter-fields legend {
    margin-bottom: 24px;
  }

  .upload-zone {
    min-height: 210px;
    padding: 24px 18px;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .browse-label {
    grid-column: 1;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .status-panel {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .download-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
