/* Perry's GIFs — warm editorial, no gradients */
:root {
  --bg: #f5f1eb;
  --bg2: #ebe6de;
  --surface: #ffffff;
  --ink: #1a1814;
  --ink-muted: #5c564d;
  --ink-faint: #8c857a;
  --accent: #c45c3e;
  --accent-hover: #a84d32;
  --border: #e0dad2;
  --radius: 6px;
  --radius-lg: 12px;
  --font-head: "Syne", sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --max: 1200px;
  --shadow: 0 2px 8px rgba(26, 24, 20, 0.06);
  --shadow-hover: 0 8px 24px rgba(26, 24, 20, 0.1);
}

html[data-theme="dark"] {
  --bg: #1a1814;
  --bg2: #252219;
  --surface: #2d2922;
  --ink: #f5f1eb;
  --ink-muted: #b8b0a4;
  --ink-faint: #7a7368;
  --accent: #e07d5a;
  --accent-hover: #f09272;
  --border: #3d3830;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  line-height: 1.5;
}

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

.wrap {
  width: min(var(--max), 100% - 40px);
  margin: 0 auto;
}

/* Header — minimal strip */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.top__nav {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

/* Nav: text links + small buttons */
.pill {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s;
}
.pill--ghost {
  background: transparent;
  border-color: transparent;
}
.pill:hover {
  text-decoration: none;
  background: var(--border);
  border-color: var(--border);
}

/* Hero — big type, no blobs */
.hero {
  padding: 48px 0 40px;
}
.hero__title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}
.hero__subtitle {
  margin: 12px 0 0;
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 42ch;
}
.ctaRow {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn--main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.btn--main:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.btn__icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--bg2);
}
.btn__iconImg, .btn__iconSvg {
  width: 16px;
  height: 16px;
  display: block;
}
.btn__iconImg--giphy { height: 14px; width: auto; }
.btn__label { font-weight: 600; }

/* Controls row */
.controls {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
}
.input:focus {
  border-color: var(--accent);
}
.input--area {
  resize: vertical;
  min-height: 100px;
}

.btn {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
  text-decoration: none;
  background: var(--bg2);
  border-color: var(--accent);
}
.btn--ghost {
  background: transparent;
}
.btn--ghost:hover {
  background: var(--bg2);
}

.footer__sep { opacity: 0.6; margin: 0 6px; }

/* Panel = gallery container */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}
.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.panel__title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}
.panel__meta {
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-weight: 500;
}

/* Gallery */
.gallery {
  column-gap: 16px;
}
.gallery--masonry {
  columns: 4 240px;
}
.gallery--grid {
  columns: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  break-inside: avoid;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.gallery--grid .card { margin: 0; }
.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.card__media {
  width: 100%;
  display: block;
  background: var(--bg2);
  vertical-align: middle;
}
.card__body {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card__title {
  font-size: 0.85rem;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-faint);
  background: var(--bg2);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}

.error {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 12px 0;
}

.suggestModal__form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer {
  padding: 32px 0 48px;
  color: var(--ink-faint);
  font-size: 0.9rem;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.muted { color: var(--ink-muted); }
.mono { font-family: ui-monospace, monospace; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] {
  display: none !important;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.modal__card {
  position: relative;
  width: min(900px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
}
.modal__card--small {
  width: min(520px, 100%);
}
.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}
.iconBtn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}
.iconBtn:hover {
  background: var(--border);
  border-color: var(--accent);
}
.modal__media {
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal__media img {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  display: block;
}
.modal__body {
  padding: 16px 20px 20px;
}
.modal__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}
.modal__actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.modal__actions .btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.modal__actions .btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  max-width: min(320px, calc(100% - 40px));
}

@media (max-width: 640px) {
  .top__nav { gap: 4px; }
  .pill { padding: 6px 10px; font-size: 0.8rem; }
  .hero { padding: 32px 0 28px; }
  .ctaRow { flex-direction: column; }
}
