:root {
  --color-bg: #0b0e11;
  --color-surface: #14181c;
  --color-border: #262c32;
  --color-border-strong: #343b42;
  --color-text: #e7e9ea;
  --color-text-secondary: #a1a8ae;
  --color-text-muted: #6b7378;
  --color-accent: #1d9bf0;
  --color-accent-soft: rgb(29 155 240 / 0.1);
  --color-danger: #f4212e;
  --color-warning: #f5b400;
  --color-ok: #00ba7c;
  --color-post-bg: #000;
  --color-post-border: #2f3336;
  --color-post-muted: #71767b;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 15px;
  --text-md: 17px;
  --text-xl: 28px;

  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --border: 1px solid var(--color-border);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);

  --carousel-gap: 4px;
  --carousel-radius: 14.4px;
  --carousel-peek-factor: 1.67;
  --carousel-nav-size: 32px;
  --post-width: 600px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

.app {
  max-width: var(--post-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-16);
}

.app > * {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-12);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.mark {
  width: 24px;
  height: 24px;
}

.topbar-link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 150ms ease-out;
}

.topbar-link:hover {
  color: var(--color-text);
}

.hero {
  margin-bottom: var(--space-8);
}

h1 {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}

.hero p {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  max-width: 52ch;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  padding: 10px var(--space-6);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  border: none;
  cursor: pointer;
  transition-property: background-color, color, scale;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.button:active,
.dropzone:active .button {
  scale: 0.96;
}

.button:focus-visible,
.topbar-link:focus-visible,
.footer a:focus-visible,
.download-card a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-full);
}

.button-primary {
  background: var(--color-text);
  color: var(--color-bg);
}

.button-primary:hover {
  background: #fff;
}

.dropzone {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-6);
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition-property: border-color, background-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.dropzone:hover {
  border-color: var(--color-border-strong);
}

.dropzone:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.dropzone.is-over {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.dropzone-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.report {
  animation: rise 200ms ease-out both;
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius-md);
  display: grid;
  gap: var(--space-2);
}

.report-dims {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.report ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-1);
}

.report li {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.report li::before {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--note-color);
  translate: 0 -1px;
}

.report .is-error {
  --note-color: var(--color-danger);
}

.report .is-warning {
  --note-color: var(--color-warning);
}

.report .is-ok {
  --note-color: var(--color-ok);
}

.result {
  margin-top: var(--space-12);
  display: grid;
  gap: var(--space-12);
}

.section {
  display: grid;
  gap: var(--space-3);
  animation: rise 300ms ease-out both;
}

.section:nth-child(2) {
  animation-delay: 100ms;
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 8px;
  }
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.post {
  background: var(--color-post-bg);
  border: 1px solid var(--color-post-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-md);
}

.post-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-accent), #7856ff);
  flex-shrink: 0;
}

.identity {
  display: grid;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}

.identity-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.name {
  font-weight: 700;
}

.handle {
  color: var(--color-post-muted);
}

.verified {
  width: 18px;
  height: 18px;
  fill: var(--color-accent);
}

.more {
  color: var(--color-post-muted);
  letter-spacing: 1px;
}

.post-text {
  margin: var(--space-3) 0;
  font-size: var(--text-md);
}

[contenteditable]:focus {
  outline: 1px dashed var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.carousel-wrap {
  position: relative;
}

/* Mirrors x.com: the first image takes roughly 60% of the width so the next one peeks in. */
.carousel {
  display: flex;
  gap: var(--carousel-gap);
  aspect-ratio: calc(var(--carousel-peek-factor) * var(--slice-aspect, 0.6));
  padding-block: 2px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel-item {
  height: 100%;
  aspect-ratio: var(--slice-aspect, 0.6);
  flex-shrink: 0;
  scroll-snap-align: center;
  border: 1px solid var(--color-post-border);
  border-radius: var(--carousel-radius);
  overflow: hidden;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: var(--carousel-nav-size);
  height: var(--carousel-nav-size);
  border-radius: var(--radius-full);
  border: none;
  background: rgb(0 0 0 / 0.4);
  color: #fff;
  opacity: 0.7;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition-property: opacity, scale;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.carousel-nav:hover {
  opacity: 1;
}

.carousel-nav:active {
  scale: 0.96;
}

.carousel-nav svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carousel-prev {
  left: var(--space-1);
}

.carousel-next {
  right: var(--space-1);
}

.meta {
  margin-top: var(--space-3);
  color: var(--color-post-muted);
}

.meta strong {
  color: var(--color-text);
}

.actions {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-post-border);
  color: var(--color-post-muted);
  font-size: var(--text-sm);
}

.actions span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.actions svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.downloads {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.download-card {
  display: grid;
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.download-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top;
  display: block;
  outline: 1px solid rgb(255 255 255 / 0.1);
  outline-offset: -1px;
}

.download-card-body {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
}

.download-card-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--text-sm);
  font-weight: 600;
}

.download-card-title small {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-muted);
}

.download-card a {
  justify-self: start;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}

.download-card a:hover {
  text-decoration: underline;
}

.download-actions {
  margin-top: var(--space-2);
}

.footer {
  margin-top: var(--space-16);
  padding-top: var(--space-6);
  border-top: var(--border);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 150ms ease-out;
}

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

@media (max-width: 520px) {
  h1 {
    font-size: 22px;
  }

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

@media (prefers-reduced-motion: reduce) {
  .report,
  .section {
    animation: none;
  }

  .button,
  .carousel-nav {
    transition-property: background-color, color, opacity;
  }
}
