/* todayspussy.com
   The site is one full-bleed picture, an archive, and a small admin. It does
   not need a framework; v1 pulled Bootstrap 5.0.0-beta2 from a CDN to draw a
   navbar and a dropdown. */

:root {
  color-scheme: dark;

  --bg: #0c0c0d;
  --surface: #16171a;
  --surface-2: #1e2024;
  --ink: #f2f2f3;
  --ink-2: #b9bcc2;
  --muted: #82868f;
  --rule: #2a2d33;
  --accent: #e8b4bc;
  --accent-ink: #1a1113;

  --pad: clamp(16px, 4vw, 32px);
  --head-h: 56px;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  z-index: 10;
}
.skip:focus { left: 0; }

/* ---------- chrome ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 5;
  height: var(--head-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-weight: 640;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.site-head nav {
  display: flex;
  gap: 18px;
  font-size: 0.9rem;
}

.site-head nav a {
  color: var(--ink-2);
  text-decoration: none;
}
.site-head nav a:hover { color: var(--ink); }

main { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.site-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--pad);
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.78rem;
}

.version { font-family: var(--mono); }

/* ---------- the picture ---------- */

.stage {
  position: relative;
  flex: 1;
  min-height: calc(100svh - var(--head-h) - 48px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #000;
}

.stage-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The image is the page. Nothing else should be visible through it. */
  z-index: 0;
}

/* A gradient rather than a panel background, so the picture stays uncovered
   while the text on top of it stays readable at any brightness. */
.stage-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 96px var(--pad) var(--pad);
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.45) 45%,
    rgba(0, 0, 0, 0) 100%);
}

.stage-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.stage-meta h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.stage-meta time,
.badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.badge {
  align-self: flex-start;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 2px 7px;
  font-weight: 600;
}

.stage-description {
  margin: 6px 0 0;
  max-width: 52ch;
  color: var(--ink-2);
}

/* ---------- links menu ---------- */

.links { position: relative; flex-shrink: 0; }

.links summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 2px;
  user-select: none;
}

.links summary::-webkit-details-marker { display: none; }

.links summary::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.15s ease;
}

.links[open] summary::after { transform: rotate(180deg); }

.links ul {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 260px;
  max-width: min(90vw, 380px);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.links li + li { border-top: 1px solid var(--rule); }

.links ul a {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 12px;
  text-decoration: none;
  border-radius: 2px;
}

.links ul a:hover { background: var(--surface-2); }

.link-label {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-host {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}

/* ---------- ordinary pages ---------- */

.page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 64px) var(--pad);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.page.centered { flex: 1; justify-content: center; align-items: center; }

.page-head { display: flex; flex-direction: column; gap: 4px; }

.page-head h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.025em;
}

.page-head p { margin: 0; color: var(--muted); }

.notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.notice h1 { margin: 0; font-size: 1.9rem; letter-spacing: -0.025em; }
.notice p { margin: 0; color: var(--ink-2); }

.code {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.button {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 2px;
}

.empty-note { color: var(--muted); }

/* ---------- archive ---------- */

.archive {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}

.archive-row { border-bottom: 1px solid var(--rule); }

.archive-row > a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 4px;
  text-decoration: none;
}

.archive-row > a:hover { background: var(--surface); }

.archive-thumb {
  width: 140px;
  height: 84px;
  object-fit: cover;
  background: var(--surface-2);
  border-radius: 2px;
  flex-shrink: 0;
}

.archive-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.archive-name {
  font-weight: 550;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-text time {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.archive-more { padding: 20px 0; text-align: center; }

.archive-more a {
  display: inline-block;
  padding: 9px 20px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-2);
  font-size: 0.88rem;
  text-decoration: none;
}

.archive-more a:hover { background: var(--surface); color: var(--ink); }

/* htmx sets this class on the indicator target during a request. */
.archive-more.htmx-request a { opacity: 0.5; pointer-events: none; }

@media (max-width: 640px) {
  .archive-thumb { width: 100px; height: 62px; }
  .stage-panel { flex-direction: column; align-items: stretch; }
  .links summary { justify-content: center; }
  .links ul { left: 0; right: 0; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- admin ---------- */

.page.wide { max-width: 1000px; }

.page-head.row {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.page-head .actions { display: flex; align-items: center; gap: 10px; }

.warn { color: var(--accent); }

.button.subtle {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--rule);
}
.button.subtle:hover { background: var(--surface); color: var(--ink); }

.notice-bar {
  margin: 0;
  padding: 10px 14px;
  background: var(--surface);
  border-left: 2px solid var(--accent);
  color: var(--ink-2);
  font-size: 0.92rem;
}

.alert {
  margin: 0;
  padding: 10px 14px;
  background: #3a1a1a;
  border-left: 2px solid #e88;
  color: #ffd8d8;
  font-size: 0.92rem;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.9rem;
}

.admin-table th {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

.admin-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.is-queued { opacity: 0.72; }
.admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table td.nowrap { white-space: nowrap; }
.admin-table td.thumb-cell { width: 84px; }

.admin-thumb {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 2px;
  background: var(--surface-2);
  display: block;
}

.admin-table td .sub {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  max-width: 44ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table td.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
}

.tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 2px;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-button.danger { color: #e89b93; }

/* ---------- forms ---------- */

.form { gap: 18px; align-items: stretch; text-align: left; }

.form-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.form h1 { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; }
.form .back { color: var(--muted); font-size: 0.88rem; }

.form label { display: flex; flex-direction: column; gap: 5px; }

.form label > span {
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--ink-2);
}

.form label em { font-style: normal; color: var(--muted); font-weight: 400; }

.form small { color: var(--muted); font-size: 0.78rem; }

.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="url"],
.form input[type="date"],
.form textarea {
  width: 100%;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
}

.form input[type="file"] { color: var(--ink-2); font-size: 0.88rem; }
.form textarea { resize: vertical; }

.form button[type="submit"] {
  align-self: flex-start;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 2px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.form-actions { display: flex; align-items: center; gap: 12px; }
.form-actions .button { margin-top: 0; }

.links-field {
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.links-field legend {
  padding: 0 6px;
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--ink-2);
}

#link-rows { display: flex; flex-direction: column; gap: 8px; }

.link-row {
  display: grid;
  grid-template-columns: 1fr 200px auto;
  gap: 8px;
  align-items: center;
}

.links-field .button { align-self: flex-start; margin-top: 0; }

.current-image {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.current-image img { border-radius: 2px; object-fit: cover; }
.current-image .sub { color: var(--muted); font-size: 0.84rem; }

@media (max-width: 640px) {
  .link-row { grid-template-columns: 1fr; }
  .page-head.row { flex-direction: column; }
}
