/* ---------------------------------------------------------------------
   Reid's Movie of the Week -- "rep-cinema marquee" visual identity
   --------------------------------------------------------------------- */

:root {
  --black: #151210;      /* backstage black */
  --yellow: #f2c14e;     /* bulb yellow */
  --grey: #3a332c;       /* bulb-off grey */
  --cream: #f4edde;      /* ticket cream */
  --maroon: #7a1f1f;     /* marquee maroon */

  --cream-ink: #211c17;
  --black-ink: #ece5d6;

  --font-display: "Anton", sans-serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--black);
  color: var(--black-ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.stage {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

h1,
h2 {
  margin: 0;
}

a {
  color: var(--yellow);
}

button {
  font-family: inherit;
}

/* -------------------- bulb-dot border treatment --------------------
   Reserved for the marquee header and the current-pick frame only. */

.bulb-frame {
  position: relative;
  border-image-source: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='5' fill='%23f2c14e'/%3E%3C/svg%3E");
  border-image-slice: 12 fill;
  border-image-width: 20px;
  border-image-repeat: round;
  border-style: solid;
  border-width: 20px;
  background: var(--black);
  padding: 22px 26px;
}

/* -------------------- marquee header -------------------- */

.marquee-header {
  text-align: center;
  margin-bottom: 34px;
}

.marquee-header h1 {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2.2vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--yellow);
  text-transform: uppercase;
}

.marquee-header .spark {
  color: var(--maroon);
  filter: drop-shadow(0 0 6px rgba(242, 193, 78, 0.5));
}

/* -------------------- site nav (shared across all pages) -------------------- */

.site-nav {
  display: flex;
  justify-content: center;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 34px;
}

.site-nav a {
  color: var(--black-ink);
  opacity: 0.6;
  text-decoration: none;
}

.site-nav a:hover {
  opacity: 1;
}

.site-nav a.active {
  color: var(--yellow);
  opacity: 1;
  text-decoration: underline dotted;
}

/* -------------------- page heading (watchlist / history) -------------------- */

.page-heading {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--yellow);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1;
  margin: 0 0 8px;
}

.page-subheading {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--grey);
  margin: 0 0 32px;
}

/* -------------------- current pick -------------------- */

.current-pick-section {
  margin-bottom: 46px;
}

.current-frame {
  overflow: hidden;
}

.frame-chaser {
  position: absolute;
  inset: 0;
  width: 12px;
  height: 12px;
  margin: -6px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 10px 3px rgba(242, 193, 78, 0.85);
  offset-path: border-box;
  offset-distance: 0%;
  opacity: 0;
  pointer-events: none;
}

.current-frame.animating .frame-chaser {
  animation: chase-run 1.5s linear;
}

@keyframes chase-run {
  0% {
    offset-distance: 0%;
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

.current-content {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}

.poster-wrap {
  width: 220px;
}

.poster-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  background: var(--grey);
  border: 1px solid var(--grey);
}

.poster-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 3px;
  border: 1px dashed var(--grey);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--grey);
  text-align: center;
  padding: 10px;
}

.current-body {
  min-width: 0;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
  margin: 0 0 6px;
}

.title-marquee {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--yellow);
  font-size: clamp(2.1rem, 6.5vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin: 0 0 12px;
  word-break: break-word;
}

.title-marquee .letter {
  display: inline-block;
  transform: translateY(-65%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.28s linear;
}

.title-marquee .letter.set {
  transform: translateY(0);
  opacity: 1;
}

.meta {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--black-ink);
  opacity: 0.8;
  margin: 0 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
}

.meta .sep {
  margin: 0 8px;
  opacity: 0.5;
}

.genre-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}

.genre-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--grey);
  color: var(--black-ink);
  border-radius: 20px;
  padding: 3px 10px;
}

.synopsis {
  max-width: 640px;
  margin: 0 0 18px;
}

.cast-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--yellow);
  margin: 0 0 8px;
}

.cast-list {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--black-ink);
  opacity: 0.85;
  margin: 0 0 20px;
  line-height: 1.7;
}

.cast-list .cast-member {
  white-space: nowrap;
}

.cast-list .cast-sep {
  opacity: 0.4;
  margin: 0 6px;
}

.current-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.empty-pick {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--grey);
  max-width: 480px;
}

/* -------------------- buttons -------------------- */

.btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 2px;
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--yellow);
  color: var(--black);
  border-color: var(--yellow);
}

.btn-secondary {
  background: var(--maroon);
  color: var(--black-ink);
  border-color: var(--maroon);
}

.link-btn {
  background: none;
  border: none;
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  text-decoration: underline dotted;
}

/* -------------------- section headings -------------------- */

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--black-ink);
  font-size: 1.5rem;
}

/* -------------------- import panel -------------------- */

.import-section {
  margin-bottom: 46px;
}

.import-panel {
  background: rgba(58, 51, 44, 0.35);
  border: 1px dashed var(--grey);
  padding: 16px;
  border-radius: 3px;
}

.import-panel .hint {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 0;
}

.import-panel input[type="file"] {
  display: block;
  width: 100%;
  background: var(--cream);
  color: var(--cream-ink);
  border: 1px solid var(--grey);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 10px;
}

.import-panel input[type="file"]::file-selector-button {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--black);
  color: var(--yellow);
  border: 1px solid var(--grey);
  border-radius: 2px;
  padding: 6px 12px;
  margin-right: 10px;
  cursor: pointer;
}

.import-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.import-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--yellow);
}

.empty-note {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--grey);
}

/* -------------------- watchlist page (poster grid) -------------------- */

.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 24px 18px;
  margin-bottom: 46px;
}

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

.watchlist-card .poster-img,
.watchlist-card .poster-placeholder {
  width: 100%;
}

.watchlist-card-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--black-ink);
  font-size: 0.95rem;
  line-height: 1.05;
  margin: 8px 0 2px;
}

.watchlist-card-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--grey);
}

.watchlist-card-meta a {
  color: var(--maroon);
  text-decoration: none;
}

/* -------------------- archive (plain monospace ledger) -------------------- */

.archive-section {
  margin-bottom: 46px;
}

.archive-list {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-top: 1px solid var(--grey);
}

.ledger-row {
  display: grid;
  grid-template-columns: 100px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--grey);
}

.ledger-date {
  color: var(--grey);
}

.ledger-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-link,
.ledger-comments {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--maroon);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* -------------------- comments -------------------- */

.comments-section {
  border-top: 1px solid var(--grey);
  padding-top: 24px;
  margin-bottom: 46px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.comment {
  border-left: 2px solid var(--maroon);
  padding-left: 12px;
}

.comment-author {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--maroon);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comment-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--grey);
  margin-left: 8px;
}

.comment-body {
  margin: 4px 0 0;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
}

.comment-form input,
.comment-form textarea {
  background: var(--cream);
  color: var(--cream-ink);
  border: 1px solid var(--grey);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 10px 12px;
  resize: vertical;
}

/* -------------------- footer -------------------- */

.site-footer {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--grey);
}

/* -------------------- toast -------------------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cream);
  color: var(--cream-ink);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 10px 18px;
  border-radius: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}

.toast.error {
  background: var(--maroon);
  color: var(--black-ink);
}

.toast.hidden {
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* -------------------- responsive -------------------- */

@media (max-width: 640px) {
  .bulb-frame {
    border-width: 14px;
    padding: 16px 16px;
  }

  .current-content {
    grid-template-columns: 1fr;
  }

  .poster-wrap {
    width: 160px;
    margin: 0 auto;
  }

  .ledger-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ledger-date {
    order: -1;
  }
}
