:root {
  --ink: #17151c;
  --paper: #f2efe8;
  --paper-deep: #e5dfd3;
  --accent: #bf1922;
  --acid: #f4d35e;
  --muted: #726d78;
  --line: rgba(23, 21, 28, 0.2);
  --display: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 21, 28, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 32px;
  font-family: var(--sans);
}

button,
input,
textarea {
  font: inherit;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  width: 48px;
  height: 48px;
  overflow: visible;
  fill: var(--ink);
  transform: rotate(-3deg);
}

.brand-snout {
  fill: var(--paper);
}

.brand-counter {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: square;
  stroke-width: 5px;
}

.brand-name span {
  color: var(--accent);
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.95rem;
  font-style: italic;
}

main {
  overflow: hidden;
}

.intro,
.admin-intro,
.composer,
.comparison-feed {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.intro {
  position: relative;
  padding: clamp(74px, 11vw, 150px) 0 clamp(66px, 9vw, 118px);
}

.admin-intro {
  padding: clamp(70px, 9vw, 118px) 0 clamp(52px, 7vw, 82px);
}

.admin-intro h1 {
  font-size: clamp(3.2rem, 7vw, 6rem);
}

.admin-intro > p:last-child {
  max-width: 600px;
  margin: 28px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.intro::after {
  position: absolute;
  z-index: -1;
  top: 28%;
  right: -5%;
  width: clamp(180px, 29vw, 380px);
  aspect-ratio: 1;
  border: 1px solid rgba(191, 25, 34, 0.45);
  border-radius: 50%;
  box-shadow: 28px 20px 0 var(--acid), -20px -12px 0 var(--accent);
  content: "";
  opacity: 0.78;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: break-word;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.4rem, 8vw, 7.2rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.88;
}

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

.intro-copy {
  max-width: 570px;
  margin: 38px 0 0;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.7;
}

.composer {
  position: relative;
  padding: clamp(34px, 5vw, 62px);
  color: white;
  background: var(--ink);
  box-shadow: 12px 12px 0 var(--accent);
}

.composer::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 88px;
  height: 8px;
  background: var(--acid);
  content: "";
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 40px;
}

.section-heading .eyebrow {
  color: var(--acid);
}

.section-heading h2,
.feed-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.section-heading > p {
  max-width: 280px;
  margin: 0 0 4px;
  color: #aaa4b0;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: right;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 54px);
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-number {
  color: var(--acid);
  font-family: var(--display);
  font-size: 0.88rem;
  font-style: italic;
}

.field input,
.field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #5c5663;
  border-radius: 0;
  outline: 0;
  color: white;
  background: transparent;
  transition: border-color 160ms ease, background 160ms ease;
}

.field input {
  min-height: 54px;
  padding: 0 2px;
}

.field textarea {
  min-height: 88px;
  padding: 13px 2px;
  line-height: 1.55;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #77717d;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--acid);
}

.field input[aria-invalid="true"] {
  border-color: #ff8f8f;
}

.field-hint,
.field-error {
  min-height: 20px;
  margin-top: 7px;
  font-size: 0.72rem;
}

.field-hint {
  color: #8f8995;
}

.field-error {
  display: none;
  color: #ff9f9f;
}

.field:has(.field-error:not(:empty)) .field-hint {
  display: none;
}

.field-error:not(:empty) {
  display: block;
}

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

.optional {
  color: #87818c;
  font-size: 0.62rem;
  font-weight: 600;
}

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

.primary-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  gap: 30px;
  align-items: center;
  justify-content: space-between;
  min-width: 260px;
  padding: 16px 18px;
  color: var(--ink);
  background: var(--acid);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  background: white;
  transform: translateY(-2px);
}

.primary-button span {
  font-size: 1.25rem;
}

.text-button {
  padding: 12px 2px;
  border-bottom: 1px solid #77717d;
  color: #b7b1bc;
  background: transparent;
  font-size: 0.78rem;
}

.text-button:hover {
  color: white;
  border-color: white;
}

.primary-button:focus-visible,
.text-button:focus-visible,
.brand:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.composer .primary-button:focus-visible,
.composer .text-button:focus-visible {
  outline-color: var(--acid);
}

.form-status {
  margin: 0 0 0 auto;
  color: #c6c0ca;
  font-size: 0.75rem;
}

.form-status[data-state="error"] {
  color: #ff9f9f;
}

.comparison-feed {
  padding: clamp(100px, 14vw, 170px) 0 clamp(90px, 12vw, 150px);
}

.feed-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: clamp(42px, 6vw, 74px);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.feed-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.feed-actions p {
  margin: 0;
  color: var(--muted);
}

.feed-actions strong {
  color: var(--accent);
  font-family: var(--display);
  font-size: 1.3rem;
  font-style: italic;
}

.feed-actions a {
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: var(--ink);
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.feed-actions a:hover {
  color: var(--accent);
}

.feed-actions a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.feed-empty {
  display: flex;
  min-height: 280px;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 5vw, 52px);
  border: 1px dashed rgba(23, 21, 28, 0.35);
  background: rgba(255, 255, 255, 0.25);
}

.feed-empty h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
}

.feed-empty p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.empty-stamp {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 3px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--display);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 700;
  transform: rotate(-9deg);
}

.comparison-list {
  display: grid;
  gap: 0;
}

.comparison-item {
  scroll-margin-top: 24px;
}

.comparison-item:not(:last-child) {
  padding-bottom: clamp(86px, 12vw, 150px);
  border-bottom: 1px solid var(--line);
}

.comparison-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.comparison-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.comparison-controls time {
  color: var(--muted);
  font-size: 0.7rem;
}

.comparison-controls a,
.comparison-controls button {
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
}

.comparison-controls a:hover,
.comparison-controls button:hover {
  color: var(--accent);
}

.comparison-controls a:focus-visible,
.comparison-controls button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.comparison-meta h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.comparison-number {
  margin-left: 5px;
  color: var(--accent);
  font-family: var(--display);
  font-size: 1.35rem;
  font-style: italic;
}

.clip-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 44px);
}

.clip-card {
  min-width: 0;
}

.clip-card-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.clip-index {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-style: italic;
}

.clip-card-header h4 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 400;
}

.copy-clip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.copy-clip svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.copy-clip:hover,
.copy-clip:focus-visible {
  color: var(--accent);
}

.copy-clip:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--paper-deep);
  box-shadow: 7px 7px 0 var(--ink);
}

.clip-card-counter .player-shell {
  box-shadow: 7px 7px 0 var(--accent);
}

.player-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.unavailable-player {
  display: grid;
  width: 100%;
  height: 100%;
  place-content: center;
  padding: 30px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 1.1rem;
  line-height: 1.6;
  text-align: center;
}

.unavailable-player a {
  color: var(--accent);
}

.clip-attribution {
  min-height: 18px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.context-note {
  position: relative;
  max-width: 800px;
  margin: clamp(58px, 8vw, 90px) auto 0;
  padding: clamp(28px, 4vw, 46px);
  border-top: 3px solid var(--accent);
  background: white;
  box-shadow: 0 18px 50px rgba(42, 30, 54, 0.1);
}

.context-note::before {
  position: absolute;
  top: -13px;
  left: 34px;
  width: 24px;
  height: 24px;
  background: var(--accent);
  content: "";
  transform: rotate(45deg);
}

.context-label {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.context-output {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.6;
  white-space: pre-wrap;
}

.page-status {
  min-height: 20px;
  margin: -42px 0 22px;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: right;
}

.admin-records {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(100px, 12vw, 150px) 0;
}

.admin-list {
  display: grid;
  gap: 28px;
}

.admin-empty {
  padding: 40px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.admin-comparison {
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.admin-comparison > header,
.admin-clip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.admin-comparison h3,
.admin-comparison h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
}

.admin-comparison h3 {
  font-size: 1.7rem;
}

.admin-permalink,
.admin-clip-source {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 0.72rem;
}

.admin-context {
  margin: 24px 0;
  padding: 18px 0;
  border-block: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--display);
  line-height: 1.6;
}

.admin-clips {
  display: grid;
  gap: 18px;
}

.admin-clip {
  padding: 18px;
  background: var(--paper-deep);
}

.admin-clip-role {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.availability-badge {
  display: inline-block;
  margin-left: 12px;
  padding: 4px 7px;
  color: white;
  background: var(--ink);
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
}

.archive-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.archive-file {
  max-width: 220px;
  font-size: 0.7rem;
}

.small-button,
.danger-button {
  padding: 9px 11px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
}

.small-button:hover {
  color: white;
  background: var(--ink);
}

.danger-button {
  border-color: var(--accent);
  color: var(--accent);
}

.danger-button:hover {
  color: white;
  background: var(--accent);
}

footer a {
  color: inherit;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

footer p {
  margin: 0;
}

@media (max-width: 760px) {
  .site-header {
    min-height: 68px;
  }

  .tagline {
    display: none;
  }

  .intro,
  .admin-intro,
  .composer,
  .comparison-feed {
    width: min(100% - 28px, 1180px);
  }

  .intro::after {
    top: 25%;
    right: -25%;
    opacity: 0.35;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 5.2rem);
  }

  .composer {
    padding: 32px 22px;
    box-shadow: 7px 7px 0 var(--accent);
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    margin-bottom: 32px;
  }

  .section-heading > p {
    text-align: left;
  }

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

  .form-grid {
    gap: 22px;
  }

  .form-actions {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .primary-button {
    width: 100%;
  }

  .form-status {
    width: 100%;
    margin: 0;
  }

  .clip-grid {
    gap: 42px;
  }

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

  .feed-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
  }

  .feed-empty {
    min-height: 250px;
    align-items: flex-start;
    flex-direction: column;
    padding: 34px 28px;
  }

  .comparison-meta {
    align-items: flex-start;
  }

  .comparison-controls {
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
  }

  .admin-records {
    width: min(100% - 28px, 1180px);
  }

  .admin-comparison > header,
  .admin-clip,
  .archive-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .archive-actions,
  .archive-file {
    width: 100%;
    max-width: none;
  }

  .player-shell {
    box-shadow: 5px 5px 0 var(--ink);
  }

  .clip-card-counter .player-shell {
    box-shadow: 5px 5px 0 var(--accent);
  }

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

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
