/* Pandactions gallery — warm paper, white cards, bamboo-green accent.
   Editorial serif (Fraunces) for the voice, Instrument Sans for the body. */

:root {
  --paper: #f6f5f1;
  --card: #ffffff;
  --ink: #1c1b18;
  --muted: #8b877d;
  --line: #e8e5dd;
  --accent: #177e54;
  --accent-soft: #e3f0e9;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(28, 27, 24, 0.05), 0 6px 24px rgba(28, 27, 24, 0.06);
  --shadow-hover: 0 2px 4px rgba(28, 27, 24, 0.06), 0 14px 40px rgba(28, 27, 24, 0.12);
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: "Instrument Sans", -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}

.logo {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.logo-dot { color: var(--accent); }

.open-canvas {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.open-canvas:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

main {
  padding: 0 clamp(20px, 4vw, 48px) 64px;
  max-width: 1560px;
  margin: 0 auto;
}

/* ---------- feed head ---------- */

.feed-head {
  padding: 20px 0 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.feed-title {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.01em;
}

.feed-title em {
  font-style: italic;
  color: var(--accent);
}

.pills { display: flex; gap: 8px; }

.pill {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s;
}

.pill:hover { color: var(--ink); background: var(--card); }

.pill.active {
  color: #fff;
  background: var(--ink);
}

/* ---------- masonry cards ---------- */

.masonry { columns: 5 250px; column-gap: 18px; }

.card {
  break-inside: avoid;
  margin-bottom: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i) * 45ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card-media {
  display: block;
  position: relative;
  background: var(--paper);
}

.card-media img,
.card-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.kind-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: color-mix(in srgb, #fff 85%, transparent);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 4px 10px;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 12px 12px;
}

.author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-width: 0;
}

.author-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author:hover .author-name { color: var(--accent); }

.card-title {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* letter avatar, tinted per letter via data attribute */
.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.avatar::after { content: attr(data-letter); }

.avatar-lg { width: 56px; height: 56px; font-size: 24px; }

/* ---------- empty state ---------- */

.empty {
  text-align: center;
  padding: 90px 0 60px;
  color: var(--muted);
  font-size: 15px;
}

.empty-mark {
  font-size: 34px;
  margin-bottom: 12px;
  color: var(--accent);
}

.empty-sub { margin-top: 6px; font-size: 13.5px; }
.empty a { color: var(--accent); }

/* ---------- work page ---------- */

.crumb {
  display: inline-block;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  margin: 6px 0 18px;
}

.crumb:hover { color: var(--ink); }

.work { max-width: 980px; margin: 0 auto; }

.work-frame {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.work-frame img,
.work-frame video { width: 100%; display: block; }

.work-info { padding: 22px 6px; }

.work-info h1 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 26px;
  margin-bottom: 10px;
}

.work-author { font-size: 14px; }
.dot-sep { color: var(--muted); }
.work-date { color: var(--muted); font-weight: 400; }

.desc {
  margin-top: 14px;
  font-size: 15.5px;
  line-height: 1.65;
  color: #4a4740;
  max-width: 64ch;
}

/* ---------- profile ---------- */

.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 0 30px;
}

.profile-head h1 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 28px;
}

.profile-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------- legal ---------- */

.legal {
  max-width: 700px;
  margin: 12px auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 48px);
  line-height: 1.7;
  font-size: 15px;
}

.legal h1 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 28px;
  margin-bottom: 4px;
}

.legal h2 { font-size: 17px; margin: 26px 0 8px; }
.legal p, .legal ul { color: #4a4740; margin-bottom: 10px; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--accent); }
.legal-updated { color: var(--muted); font-size: 13px; }

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

.site-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 40px 24px;
  color: var(--muted);
  font-size: 13.5px;
}

.site-footer a { color: var(--accent); text-decoration: none; }

.footer-nav { display: flex; gap: 20px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--ink); }

@media (max-width: 640px) {
  .feed-head { flex-direction: column; align-items: flex-start; }
  .masonry { columns: 2 150px; column-gap: 12px; }
  .card { margin-bottom: 12px; }
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 72px 64px;
}

.lightbox[hidden] { display: none; }

.lb-stage {
  max-width: min(1200px, 100%);
  max-height: calc(100vh - 150px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-stage img,
.lb-stage video {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: lb-in 0.18s ease-out;
}

@keyframes lb-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: none; }
}

.lb-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  color: #f2f1ec;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  padding: 8px 18px;
  max-width: min(90vw, 720px);
}

.lb-caption a { color: #f2f1ec; text-decoration: none; }
.lb-author { font-weight: 600; }
.lb-author:hover, .lb-page:hover { color: #9fd9bd; }

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

.lb-page { flex-shrink: 0; font-size: 13px; opacity: 0.85; }

.lb-close,
.lb-nav {
  position: absolute;
  border: 0;
  cursor: pointer;
  color: #f2f1ec;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.lb-close:hover,
.lb-nav:hover { background: rgba(255, 255, 255, 0.25); }

.lb-close {
  top: 20px;
  right: 22px;
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 30px;
  line-height: 1;
  padding-bottom: 4px;
}

.lb-prev { left: 18px; }
.lb-next { right: 18px; }

@media (max-width: 640px) {
  .lightbox { padding: 20px 8px 70px; }
  .lb-nav { width: 40px; height: 40px; }
}

/* ---------- making-of (signed-in only) ---------- */

.making-of {
  margin-top: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.making-of h2 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 12px;
}

.mo-row { display: flex; gap: 8px; flex-wrap: wrap; }

.mo-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 12px;
}

.mo-label {
  margin: 16px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.mo-prompt {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #4a4740;
  background: var(--paper);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.mo-refs { display: flex; gap: 10px; flex-wrap: wrap; }

.mo-refs img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.mo-teaser p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.mo-teaser a { color: var(--accent); }

.header-right { display: flex; align-items: center; gap: 12px; }

.header-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.header-link:hover { color: var(--ink); }

.open-canvas.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.open-canvas.accent:hover { box-shadow: 0 6px 18px rgba(23, 126, 84, 0.35); }

.viewer-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.viewer-chip:hover span:last-child { color: var(--accent); }
