:root {
  color-scheme: light dark;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-sunken: #f0f2f7;
  --raised: #ffffff;
  --text: #171a23;
  --muted: #646b7d;
  --border: #e2e5ee;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --success: #15803d;
  --success-soft: #ecfdf3;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.04), 0 8px 24px -6px rgb(16 24 40 / 0.08);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1016;
    --surface: #171a23;
    --surface-sunken: #11131a;
    --raised: #2a2e3b;
    --text: #eceef4;
    --muted: #9399ab;
    --border: #2a2e3b;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: #1e2140;
    --success: #4ade80;
    --success-soft: #11291c;
    --danger: #f87171;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -6px rgb(0 0 0 / 0.4);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem;
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  display: grid;
  gap: 1.25rem;
  align-content: start;
}

svg {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

header {
  padding: 1.5rem 0 2.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.logo svg {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.3rem;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 8px;
  stroke-width: 2.4;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 4rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

footer nav {
  display: flex;
  gap: 1.25rem;
}

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

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

.card {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1rem;
}

.narrow {
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
}

.center {
  text-align: center;
  justify-items: center;
}

.hero {
  text-align: center;
  padding-bottom: 0.75rem;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 2.75rem);
  text-wrap: balance;
  letter-spacing: -0.035em;
}

.hero p {
  margin-top: 0.75rem;
  text-wrap: balance;
  color: var(--muted);
  font-size: 1.125rem;
}

.drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 3rem 1rem;
  background: var(--surface-sunken);
  border: 2px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop svg {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  padding: 0.7rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}

.drop strong {
  font-size: 1.05rem;
}

.drop u {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.drop span {
  color: var(--muted);
  font-size: 0.875rem;
}

.drop:hover,
.drop:focus-within,
.dragging .drop {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.busy {
  pointer-events: none;
}

.busy .drop {
  opacity: 0.5;
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  float: left;
  font-weight: 600;
  font-size: 0.9rem;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: block;
  padding: 0.3rem 0.8rem;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.segmented input:checked + span {
  background: var(--raised);
  color: var(--text);
  box-shadow: 0 1px 3px rgb(16 24 40 / 0.12);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--accent);
}

#status:empty {
  display: none;
}

#status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
}

.busy #status::before {
  content: "";
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.error,
#status.error {
  color: var(--danger);
}

.features,
.faq {
  margin-top: 2rem;
}

.features h2,
.faq h2 {
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

.features ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.features h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.features p,
.faq p {
  color: var(--muted);
  font-size: 0.9rem;
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.2;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  padding-bottom: 1rem;
}

.fine-print {
  color: var(--muted);
  font-size: 0.8rem;
}

.notice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  background: var(--success-soft);
  color: var(--success);
  border-radius: 12px;
  font-weight: 500;
}

.viewer {
  display: grid;
  place-items: center;
  padding: 1rem;
  background-color: var(--surface);
  background-image: conic-gradient(var(--surface-sunken) 25%, transparent 0 50%, var(--surface-sunken) 0 75%, transparent 0);
  background-size: 20px 20px;
}

.viewer img {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  border-radius: 6px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.badge,
.report,
.narrow h1 {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.badge {
  padding: 0.2rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
}

.badge svg {
  width: 1rem;
  height: 1rem;
  color: var(--muted);
}

.report {
  margin-left: auto;
  color: var(--muted);
  text-decoration: none;
}

.report:hover {
  color: var(--danger);
}

.report svg {
  width: 1rem;
  height: 1rem;
}

.embed {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.embed span {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

@media (max-width: 32rem) {
  .embed {
    grid-template-columns: 1fr auto;
  }

  .embed span {
    grid-column: 1 / -1;
  }
}

input:not([type="file"], [type="radio"]) {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.embed input {
  font: 0.8rem/1.5 ui-monospace, "SF Mono", Menlo, monospace;
}

button,
.button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

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

.button.secondary,
.embed button {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.button.secondary:hover,
.embed button:hover {
  background: var(--surface-sunken);
}

.embed input,
.embed button {
  height: 2.5rem;
}

.embed button {
  min-width: 5.5rem;
  padding-block: 0;
}

.embed button.copied {
  color: var(--success);
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: var(--danger);
  filter: brightness(0.92);
}

.narrow h1 {
  font-size: 1.5rem;
}

.narrow h1 svg {
  color: var(--danger);
}

.narrow p {
  color: var(--muted);
}

.captcha {
  display: grid;
  place-items: center;
  padding: 0.75rem;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.captcha svg {
  width: 220px;
  height: 70px;
  stroke-width: 3;
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
}

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

.prose {
  max-width: 40rem;
}

.prose h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.prose h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.15rem;
}

.prose p,
.prose ul {
  margin: 0 0 1rem;
  color: var(--muted);
}

.prose li + li {
  margin-top: 0.35rem;
}
