:root {
  --bg: #14100c;
  --card: #201913;
  --line: #3b3225;
  --ink: #ece1cd;
  --muted: #a3947c;
  --tan: #c9a175;
  --brown: #d3ab7c;
  --dark: #0e0a06;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
h1, h2, .brand { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-weight: 600; }
a { color: var(--brown); }
img { max-width: 100%; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 28px;
  background: var(--dark); color: var(--ink);
}
.site-header .brand { color: inherit; text-decoration: none; font-size: 1.2rem; letter-spacing: .01em; }
.site-sub { color: var(--tan); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }

/* Hero */
.hero { position: relative; width: 75%; min-height: 46vh; max-height: 640px; margin: 0 auto; display: flex; align-items: flex-end; overflow: hidden; border-radius: var(--radius); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s ease; }
.hero-text {
  position: relative; width: 100%; max-width: 1140px; margin: 0 auto;
  padding: 100px 28px 30px; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(30, 20, 10, .78));
}
.hero-text h1 { margin: 0 0 6px; font-size: clamp(2rem, 5vw, 3.2rem); }
.hero-text p { margin: 0; color: #efe6d6; max-width: 60ch; }

/* Layout */
.timeline-wrap, .project { max-width: 1140px; margin: 0 auto; padding: 34px 28px 70px; }
.section-title { font-size: 1.35rem; margin: 10px 0 18px; }
.section { margin-top: 36px; }

/* Timeline entries (index) */
.timeline { display: grid; gap: 16px; }
.entry {
  display: grid; grid-template-columns: 210px 1fr auto; align-items: center; gap: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 18px 12px 12px; text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.entry:hover { border-color: var(--tan); box-shadow: 0 8px 22px rgba(62, 44, 28, .10); transform: translateY(-1px); }
.entry-thumb { width: 210px; height: 130px; object-fit: cover; border-radius: 10px; }
.entry-body { display: grid; gap: 3px; min-width: 0; }
.entry-date { color: var(--muted); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.entry-title { font-size: 1.15rem; font-family: Georgia, "Iowan Old Style", serif; }
.entry-desc {
  color: var(--muted); font-size: .92rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.entry-meta { color: var(--muted); font-size: .85rem; white-space: nowrap; }

/* Project page */
.crumbs { margin-bottom: 18px; font-size: .9rem; }
.project-head h1 { margin: 4px 0 10px; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.project-desc { color: var(--muted); max-width: 70ch; }
.counts { color: var(--brown); font-weight: 600; font-size: .9rem; letter-spacing: .04em; }

.masonry { columns: 3 280px; column-gap: 14px; }
.masonry figure { margin: 0 0 14px; break-inside: avoid; }
.masonry img { width: 100%; display: block; border-radius: 10px; cursor: zoom-in; }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }

/* Card: single border on figure, video+transcript inside */
.video-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  display: flex;
  flex-direction: column;
}
.video-grid video {
  width: 100%;
  display: block;
  flex-shrink: 0;
  background: #000;
  border-radius: 9px 9px 0 0;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center top;
}
.video-grid .transcript {
  display: block;
  margin: 0; padding: 12px 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.video-grid .transcript summary {
  cursor: pointer; list-style: none; user-select: none;
  font-size: .88rem; line-height: 1.65; color: var(--ink);
}
.video-grid .transcript summary::-webkit-details-marker { display: none; }
.tr-text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
/* Open state: expand in flow, push content below down */
.video-grid .transcript[open] .tr-text {
  display: block; -webkit-line-clamp: unset;
  line-height: 1.7;
}
.transcript-toggle { color: var(--brown); font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.transcript-toggle::before { content: " "; }
.transcript-toggle::after { content: "· show full transcript"; }
.video-grid .transcript[open] .transcript-toggle::after { content: "· shrink"; }
.transcript-short {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-size: .88rem; line-height: 1.7; color: var(--ink);
}

/* Custom always-visible video control bar (replaces native controls) */
.vcontrols {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--dark);
  border-top: 1px solid var(--line);
}
.vbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink); cursor: pointer; flex: 0 0 auto;
}
.vbtn:hover { background: rgba(255, 255, 255, .10); color: var(--tan); }
.vbtn .ico { width: 18px; height: 18px; display: block; }
.vtime { font-size: .78rem; color: var(--muted); white-space: nowrap; min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.vseek { flex: 1 1 auto; min-width: 40px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--tan); }
/* Round the bottom corners of the card's last row (control bar or transcript) */
.video-grid figure > :last-child { border-radius: 0 0 9px 9px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(20, 14, 8, .92); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }
.lightbox button {
  position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0;
  font-size: 2rem; line-height: 1; width: 52px; height: 52px; border-radius: 50%; cursor: pointer;
}
.lightbox button:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #efe6d6; font-size: .9rem; }

/* Footer */
.site-footer { padding: 26px; text-align: center; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .entry { grid-template-columns: 1fr; }
  .entry-thumb { width: 100%; height: 180px; }
  .masonry { columns: 2 160px; }
}
