:root {
  --ink: #111217;
  --muted: #5b6472;
  --paper: #fffdf8;
  --wash: #f6efe7;
  --line: #e6d7ca;
  --orange: #f04418;
  --orange-dark: #bf3213;
  --green: #167a4b;
  --blue: #1469c8;
  --purple: #5a37cf;
  --shadow: 0 24px 70px rgba(17, 18, 23, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(255, 253, 248, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 900;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #fff;
}

.build-version {
  align-self: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.nav {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-weight: 800;
}

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

.intro {
  padding: 54px 0 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--orange);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 850px;
  margin-bottom: 18px;
  font-size: clamp(46px, 6vw, 92px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.05;
}

.lede,
.drop-copy > p {
  max-width: 720px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.35;
}

.drop-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(460px, 1.1fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: start;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(240, 68, 24, 0.08), transparent 38%),
    linear-gradient(315deg, rgba(20, 105, 200, 0.08), transparent 42%),
    var(--wash);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.button.primary {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

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

.button.ghost {
  color: var(--orange-dark);
}

.poster-link {
  display: block;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.poster-link img {
  display: block;
  width: 100%;
  height: auto;
}

.caption-card {
  max-width: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.caption-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 950;
}

.caption-head button {
  border: 0;
  background: transparent;
  color: var(--orange-dark);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.caption-card p {
  margin: 0;
  padding: 16px;
  color: #2b3038;
  font-size: 18px;
  line-height: 1.45;
}

.pixelfed-shell {
  margin-top: 34px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pixelfed-profile {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 4px solid #fff;
  border-radius: 50%;
  background:
    linear-gradient(135deg, var(--orange), var(--blue) 58%, var(--green));
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 36px;
  font-weight: 950;
}

.profile-main h2 {
  margin-bottom: 6px;
}

.profile-main p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.profile-title-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.profile-bio {
  max-width: 760px;
  padding-top: 14px;
  font-size: 18px;
}

.profile-stats {
  display: flex;
  gap: 28px;
  margin: 24px 0 0;
}

.profile-stats div {
  min-width: 92px;
}

.profile-stats dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-stats dd {
  margin: 3px 0 0;
  font-size: 28px;
  font-weight: 950;
}

.feed-toolbar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 22px 0;
}

.feed-tab {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.feed-tab.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

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

.post-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.post-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--wash);
}

.post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.post-card:hover .post-media img {
  transform: scale(1.03);
}

.post-badge,
.post-overlay {
  position: absolute;
  left: 12px;
  border-radius: 999px;
  background: rgba(17, 18, 23, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.post-badge {
  top: 12px;
  padding: 6px 9px;
}

.post-overlay {
  right: 12px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  text-transform: none;
}

.post-body {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.post-body h3 {
  margin-bottom: 7px;
  font-size: 20px;
}

.post-body p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.4;
}

.post-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.post-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  flex: 1;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.post-action-button span {
  color: var(--orange-dark);
}

.post-action-button:disabled {
  cursor: default;
  opacity: 0.62;
}

.comment-panel {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.comment-panel[hidden] {
  display: none;
}

.comment-form {
  display: grid;
  gap: 8px;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  font: inherit;
}

.comment-form textarea {
  resize: vertical;
}

.comment-list {
  display: grid;
  gap: 8px;
}

.comment-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
}

.comment-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.comment-item p,
.comment-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.grid-section,
.queue {
  padding: 74px 0 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-grid article,
.queue li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
}

.feature-grid span {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--orange);
  font-weight: 950;
}

.feature-grid p,
.queue span {
  color: var(--muted);
  line-height: 1.45;
}

.queue ul {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.queue li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.queue strong {
  font-size: 20px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1440px, calc(100% - 36px));
  margin: 80px auto 0;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer span:first-child {
  color: var(--ink);
  font-weight: 950;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  transition: 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.studio-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 72px);
  margin: 0;
}

.studio-input-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #fffdf8;
}

.studio-input-panel h1 {
  margin-bottom: 22px;
  font-size: clamp(35px, 4vw, 58px);
  line-height: 1;
}

.single-studio-form {
  display: grid;
  gap: 18px;
  min-width: 0;
  margin-top: 0;
}

.single-studio-form > * {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.upload-box {
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: var(--wash);
  font-size: 20px;
  font-weight: 950;
}

.upload-box input {
  font: inherit;
  font-weight: 700;
}

.direction-line {
  display: grid;
  gap: 8px;
  justify-self: stretch;
  min-width: 0;
  overflow: hidden;
  font-weight: 950;
}

.direction-line textarea {
  display: block;
  width: 100%;
  inline-size: 100%;
  max-width: 100%;
  min-width: 0;
  min-inline-size: 0;
  min-height: 92px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.studio-preview {
  display: grid;
  place-items: center;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.studio-preview img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.studio-output-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  min-width: 0;
  min-height: calc(100vh - 72px);
  padding: 24px;
  background: var(--wash);
}

.studio-output-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.studio-output-head h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 64px);
}

.generated-preview {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 950;
}

.generated-preview img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 250px);
  object-fit: contain;
}

.output-loading {
  display: grid;
  place-items: center;
  gap: 9px;
  text-align: center;
}

.output-loading span {
  width: 36px;
  height: 36px;
  border: 4px solid rgba(240, 68, 24, 0.2);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.output-loading small {
  color: var(--muted);
}

.studio-result {
  max-width: none;
  margin-top: 0;
}

.studio-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
  margin: -14px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
}

.studio-status[data-state="working"] {
  color: var(--orange-dark);
}

.studio-status[data-state="working"]::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(240, 68, 24, 0.25);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.studio-status[data-state="done"] {
  color: var(--green);
}

.studio-status[data-state="needs-work"] {
  color: var(--orange-dark);
}

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

.admin-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 28px 0 16px;
}

.admin-login input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.approval-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.approval-item {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.approval-image {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--wash);
}

.approval-image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.approval-copy h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.approval-copy p {
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 980px) {
  .drop-layout,
  .feature-grid,
  .pixelfed-profile,
  .post-grid,
  .studio-workspace {
    grid-template-columns: 1fr;
  }

  .intro-copy,
  .drop-copy,
  .drop-layout,
  .caption-card {
    min-width: 0;
    max-width: 100%;
  }

  .studio-input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .studio-output-panel {
    min-height: 70vh;
  }

  .profile-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .queue li,
  footer {
    display: block;
  }
}

@media (max-width: 680px) {
  main,
  footer {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
    overflow: hidden;
  }

  section,
  article,
  img,
  p,
  h1,
  h2,
  h3 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

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

  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    font-size: 15px;
  }

  h1 {
    font-size: 35px;
    line-height: 1.02;
  }

  h2 {
    font-size: 34px;
    line-height: 1.04;
  }

  .lede,
  .drop-copy > p {
    font-size: 19px;
  }

  .drop-layout {
    padding: 18px;
    overflow: hidden;
  }

  .studio-input-panel,
  .studio-output-panel {
    padding: 18px;
  }

  .pixelfed-shell {
    padding: 18px;
  }

  .pixelfed-profile {
    gap: 18px;
  }

  .profile-avatar {
    width: 96px;
    height: 96px;
    font-size: 27px;
  }

  .profile-stats {
    justify-content: space-between;
    gap: 10px;
  }

  .profile-stats div {
    min-width: 0;
  }

  .feed-toolbar {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
