/* =====================================================================
   THEME — change colors and the background here
   ===================================================================== */
:root {
  /* Page background. For a tiling image later, set --page-bg-image to
     url("../assets/bg/tile.png") and adjust --page-bg-size.          */
  --page-bg: #c9e3f8;
  --page-bg-image: none;
  --page-bg-size: auto;

  --banner-bg: #333132;
  --nav-bg: #4a4a4a;
  --name-shadow: #8b5a3c;

  --window-bar: #333132;
  --window-body: #ffffff;
  --panel-bg: #f4f8fd;

  --card: #353334;
  --card-open: #474546;

  --pill: #dedede;
  --pill-text: #444;
  --accent: #cfe6f9;
  --accent-dark: #1f4a75;

  --text: #1f1f1f;
  --text-soft: #4a4a4a;

  --font-display: "Silkscreen", "Courier New", monospace;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --nav-h: 84px;
  --radius-lg: 12px;
  --radius-md: 10px;
}

/* ---- Base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--page-bg) var(--page-bg-image) repeat;
  background-size: var(--page-bg-size);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: #fff; padding: .5rem 1rem; border-radius: 6px;
}
.skip-link:focus { top: 1rem; }

/* ---- Banner (scrolls away; returns at the top) ------------------- */
.banner {
  background: var(--banner-bg);
  text-align: center;
  padding: 1.1rem 1rem 1.4rem;
}
.banner-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 6.6vw, 6rem);
  line-height: 1.05;
  color: #fff;
  text-decoration: none;
  letter-spacing: .02em;
  text-shadow:
    -3px 0 #141414, 3px 0 #141414, 0 -3px #141414, 0 3px #141414,
    5px 7px var(--name-shadow);
}

/* ---- Nav (sticks to the top) ------------------------------------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: var(--nav-bg);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 1rem;
}
.nav-links {
  grid-column: 2;
  display: flex; align-items: center; gap: .6rem;
  font-size: clamp(1.4rem, 2.4vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 0 #1a1a1a;
}
.nav-links a {
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 5px solid transparent;
}
.nav-links a[aria-current="page"] { border-bottom-color: var(--accent); }
.nav-links a:hover { border-bottom-color: rgba(207, 230, 249, .5); }
.nav-sep { font-weight: 800; }

.nav-socials { grid-column: 3; justify-self: end; display: flex; gap: .7rem; }
.social {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: #e9e9e9; color: #333;
  transition: background .15s;
}
.social:hover { background: #fff; }
.social svg {
  width: 28px; height: 28px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.social svg.brand { fill: currentColor; stroke: none; }
.social img { width: 30px; height: 30px; object-fit: contain; }

/* ---- Page + mac-style window ------------------------------------- */
main { padding: clamp(1rem, 3vw, 3.2rem) clamp(.75rem, 3vw, 2rem) 4rem; }

.window {
  max-width: 1440px;
  margin: 0 auto;
  background: var(--window-body);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(31, 74, 117, .18);
}
.window-bar {
  background: var(--window-bar);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .75rem 1rem;
  padding: .7rem 1.1rem;
}
.bar-left { display: flex; align-items: center; gap: 1.4rem; min-width: 0; }
.lights { display: flex; gap: 14px; flex: none; }
.lights span { width: 22px; height: 22px; border-radius: 50%; background: #ee6a5f; }
.lights span:nth-child(2) { background: #f5bd4f; }
.lights span:nth-child(3) { background: #61c454; }
.window-title { margin: 0; font-size: 2rem; font-weight: 700; }

.window-tools {
  justify-self: end;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: .5rem;
}
.search {
  font: inherit; font-size: .95rem;
  width: 100%;
  max-width: 14rem;
  min-width: 0;
  padding: .3rem .9rem;
  border: 0; border-radius: 999px;
  background: #e6e6e6; color: var(--text);
}
.search::placeholder { color: #777; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Pills (filters + tags) */
.pill {
  display: inline-block;
  font: inherit; font-size: 1.05rem; font-weight: 700;
  text-transform: uppercase;
  line-height: 1.6;
  min-width: 5rem;
  text-align: center;
  padding: 0 .9rem;
  border: 0; border-radius: 999px;
  background: var(--pill); color: var(--pill-text);
  text-decoration: none;
}
.pill-label { background: #c9c9c9; color: #555; text-transform: none; min-width: 0; }
.pill-label:hover { background: #d8d8d8; }
.pill-label[aria-expanded="true"] { background: #e6e6e6; color: #333; }
.filter-count {
  display: inline-block; margin-left: .35rem; padding: 0 .45rem;
  border-radius: 999px; background: var(--accent-dark); color: #fff; font-size: .85em;
}
.filters[hidden] { display: none; }
button.pill { cursor: pointer; }
.filter[aria-pressed="true"] { background: var(--accent); color: var(--accent-dark); }
.filter:hover { background: #ececec; }
.filter[aria-pressed="true"]:hover { background: #dcedfb; }
.filter-clear { min-width: 0; background: transparent; color: #ddd; font-size: 1.3rem; }

.window-body { padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 3.7rem) 2.5rem; }

/* ---- Card grid --------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 2.4rem;
  align-items: start;
}
.card { margin: 0; }
.card-thumb {
  all: unset;
  box-sizing: border-box;
  display: grid; place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  background: var(--card);
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: filter .15s;
}
.card-thumb:hover { filter: brightness(1.15); }
.card-thumb:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 3px; }
.card-thumb { position: relative; isolation: isolate; }
/* Whole image always shows; any leftover space is filled by a
   blurred, zoomed copy of the same image behind it.               */
.card-thumb .thumb-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}
.card-thumb .thumb-bg {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.25);
  filter: blur(22px) brightness(.75) saturate(1.1);
}
.thumb-title { font-weight: 700; font-size: 1.05rem; }

.card-summary {
  margin: .5rem 0 0;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}
.card.is-open .card-thumb { background: var(--card-open); }
.card.is-open .card-summary { display: none; }
.card.is-open::after {
  content: "";
  display: block;
  height: 12px;
  margin-top: 14px;
  border-radius: 3px;
  background: var(--accent-dark);
}

.empty { text-align: center; color: var(--text-soft); font-size: 1.1rem; }

/* ---- Expanded view + full page header ---------------------------- */
.detail {
  grid-column: 1 / -1;
  background: var(--panel-bg);
  padding: 1.5rem clamp(1rem, 2.5vw, 2.4rem) 2.5rem;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.detail-head {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .75rem 1.25rem;
  margin-bottom: 1.6rem;
}
.detail-title { margin: 0; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.1; font-weight: 800; }
.tag-list { display: flex; flex-wrap: wrap; gap: .9rem; }
.detail-actions { margin-left: auto; display: flex; align-items: center; gap: 1rem; align-self: flex-start; }
.full-link {
  font-weight: 700; font-size: 1.6rem;
  text-decoration: none;
  border-bottom: 3px solid currentColor;
}
.full-link:hover { color: var(--accent-dark); }
.detail-close {
  all: unset; cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.6rem; color: var(--text-soft);
}
.detail-close:hover { background: #e3ebf3; }
.detail-close:focus-visible { outline: 3px solid var(--accent-dark); }

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2rem 3.5rem;
  align-items: center;
}
.media { border-radius: var(--radius-lg); overflow: hidden; }
/* Videos, web pages and the placeholder: fixed 16:9 dark frame */
.media--video, .media--placeholder { aspect-ratio: 16 / 9; background: var(--card); }
.media--video iframe, .media--video video { width: 100%; height: 100%; border: 0; background: #000; }
/* Images keep their own shape */
.media--image img { width: 100%; height: auto; }
/* Pasted embed code keeps the size it sets for itself */
.media--embed { overflow: visible; border-radius: 0; }
.media--embed iframe { display: block; width: 100%; max-width: 100%; border: 0; }
.media-placeholder {
  height: 100%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 1.4rem;
}
.detail-text { font-size: 1.25rem; }
.role { margin: 0 0 .5rem; color: var(--text-soft); }
.lede { font-size: 1.5rem; font-weight: 600; margin: 0 0 1rem; }
.btn-play {
  display: block;
  width: fit-content;
  min-width: 12rem;
  margin: 1.4rem auto 0;
  padding: .45rem 2rem;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-dark);
  font-weight: 800; font-size: 1.5rem;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  letter-spacing: .04em;
  transition: background .15s;
}
.btn-play:hover { background: #b9daf6; }

/* Long-form writing (descriptions, full pages, about) */
.prose { max-width: 70ch; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.8rem; margin: 2.2rem 0 .6rem; }
.prose h3 { font-size: 1.35rem; margin: 1.6rem 0 .4rem; }
.prose p, .prose li { font-size: 1.15rem; }
.prose img, .prose video, .prose iframe { border-radius: var(--radius-md); margin: 1.2rem 0; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.detail-text .prose p { font-size: 1.25rem; }

/* ---- Full project page + about ----------------------------------- */
.page-body { padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 3.7rem) 3rem; }
.back-link {
  display: inline-block; margin-bottom: 1rem;
  font-weight: 700; text-decoration: none; color: var(--accent-dark);
}
.back-link:hover { text-decoration: underline; }
.page-body > .prose { margin-top: 2.5rem; }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 2rem 3rem;
  align-items: start;
}
.portrait {
  aspect-ratio: 1; border-radius: var(--radius-lg);
  background: var(--card); color: #fff;
  display: grid; place-items: center; font-weight: 700;
  overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.contact-list { list-style: none; padding: 0; display: grid; gap: .6rem; }
.contact-list a { font-weight: 700; color: var(--accent-dark); }

/* ---- Smaller screens --------------------------------------------- */
@media (max-width: 1150px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .window-bar { grid-template-columns: 1fr auto; }
  .bar-left { order: 2; grid-column: 1 / -1; }
  .window-title { grid-row: 1; justify-self: start; }
  .window-tools { grid-row: 1; }
  .search { max-width: none; }
}
@media (max-width: 900px) {
  :root { --nav-h: 64px; }
  .window-title { font-size: 1.5rem; }
  .window-tools { grid-column: 1 / -1; grid-row: auto; justify-self: stretch; justify-content: flex-start; }
  .detail-body, .about-grid { grid-template-columns: 1fr; }
  .card-summary { font-size: 1.15rem; }
  .full-link { font-size: 1.25rem; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .navbar { grid-template-columns: 1fr auto; }
  .nav-links { grid-column: 1; }
  .nav-socials { grid-column: 2; gap: .4rem; }
  .social { width: 40px; height: 40px; }
  .social svg { width: 22px; height: 22px; }
  .lights span { width: 14px; height: 14px; }
  .lights { gap: 8px; }
  .pill { font-size: .9rem; min-width: 4rem; }
}

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

/* ---- Pulled-in fields on full pages (data-field) ------------------ */
.prose .field-image { width: 100%; height: auto; border-radius: var(--radius-lg); margin: 1rem 0; }
.prose .media { margin: 1rem 0; }
.prose .media iframe, .prose .media video { margin: 0; border-radius: 0; }
.prose .media--video iframe { aspect-ratio: auto; }
.prose .btn-play { margin: 1rem 0; }
.prose .tag-list { margin: .5rem 0 1rem; }
.prose .media img { margin: 0; border-radius: 0; }

/* ---- Photo gallery on full pages ---------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}
.gallery a { display: block; cursor: zoom-in; }
.prose .gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin: 0;
  border-radius: var(--radius-md);
  transition: filter .15s;
}
.gallery a:hover img { filter: brightness(1.1); }

/* ---- Lightbox (enlarged gallery photo) ---------------------------- */
html:has(.lightbox[open]) { overflow: hidden; }
.lightbox {
  width: 100vw; height: 100dvh;
  max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: transparent;
  color: #fff;
}
.lightbox[open] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  animation: lb-fade .15s ease-out;
}
.lightbox::backdrop { background: rgba(14, 14, 16, .9); }
.lightbox figure {
  margin: 0; height: 100%;
  display: grid; place-items: center; align-content: center; gap: .75rem;
  padding: 4rem 0 2rem;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100dvh - 9rem);
  object-fit: contain;
  border-radius: 8px;
  cursor: default;
}
.lightbox figcaption { font-size: 1.05rem; text-align: center; color: #ddd; max-width: 60ch; }
.lb-btn {
  all: unset; cursor: pointer;
  width: 3.2rem; height: 3.2rem; margin: 0 .75rem;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 2.6rem; line-height: 1; color: #fff;
}
.lb-btn:hover { background: rgba(255, 255, 255, .14); }
.lb-btn:focus-visible { outline: 3px solid var(--accent); }
.lb-close { position: absolute; top: .75rem; right: 0; font-size: 2.2rem; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { visibility: hidden; }
@keyframes lb-fade { from { opacity: 0; } }
@media (max-width: 560px) { .lb-btn { margin: 0 .2rem; width: 2.6rem; height: 2.6rem; } }
