/* klaxson.net
   Four fixed layouts, measured from the 2020 Sparkle site:
   960px page (>= 960), 768px (768-959), 480px (480-767), 320px (< 480). */

@font-face {
  font-family: "Droid Sans Mono";
  src: url("../fonts/DroidSansMono.woff2") format("woff2"),
       url("../fonts/DroidSansMono.woff") format("woff");
  font-weight: 400;
  font-display: block;
}

/* ---------- 960 layout (default) ---------- */
:root {
  --ink: #000;
  --grey: #404040;
  --rule: #cccccc;
  --mono: "Droid Sans Mono", ui-monospace, Menlo, Consolas, monospace;

  --page: 960px;  --pad: 10px;
  --header-h: 135px;
  --name: 30px;   --name-ls: 2.4px;  --name-lh: 1.334;  --name-top: 13px;
  --nav: 20px;    --nav-lh: 1.301;   --nav-slot: 110px; --nav-gap: 0px;  --nav-top: 5px;
  --small: 14px;  --small-lh: 1.358; --year-slot: 72px; --bar-top: 16px;
  --body: 12px;   --body-lh: 1.334;
  --label: 18px;  --label-lh: 1.334;
  --text: 14px;   --text-lh: 19px;   /* bio + contact */
  --credit: 9px;
  --foot: 9px;    --foot-link: 9px;  --foot-h: 42px;
  --credits-top: 51px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: #fff; color: var(--ink);
  font-family: var(--mono); font-size: var(--body); line-height: var(--body-lh);
  overflow-y: scroll;
}
p, h1, h2, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px dotted var(--ink); outline-offset: 2px; }
img { display: block; max-width: 100%; height: auto; border: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--pad); position: relative; }
main { flex: 1 0 auto; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: #fff; }
.site-header .wrap { min-height: var(--header-h); padding-top: var(--name-top); }
.page-work .site-header .wrap { padding-bottom: 8px; }
.site-name { font-size: var(--name); letter-spacing: var(--name-ls); line-height: var(--name-lh); }
.site-name a { display: inline-block; }
.site-nav { display: flex; gap: var(--nav-gap); margin-top: var(--nav-top); font-size: var(--nav); line-height: var(--nav-lh); }
.site-nav a { width: var(--nav-slot); }
.site-nav a:hover { color: #808080; }

/* ---------- work: filter row + year bar ---------- */
.filters, .years { display: flex; flex-wrap: wrap; font-size: var(--small); line-height: var(--small-lh); color: var(--grey); }
.filters { margin-top: var(--bar-top); gap: 0 2em; }
.filters button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.filters button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.years { margin-top: 4px; }
.years li { width: var(--year-slot); }
.years a:hover, .filters button:hover, .years a.is-current { color: var(--ink); }

/* ---------- work: credits ---------- */
.credits { padding-top: calc(var(--credits-top) - 8px); }
.year-block {
  display: grid; grid-template-columns: 80px 782px;
  margin-bottom: 64px;
  scroll-margin-top: var(--header-offset, 180px);
}
.year-label { font-size: var(--label); line-height: var(--label-lh); font-weight: 400; }
.entries { column-count: 2; column-gap: 22px; }
.credit, .canceled { break-inside: avoid; padding-bottom: calc(var(--body) * var(--body-lh)); }
.canceled p:first-child { margin-bottom: calc(var(--body) * var(--body-lh)); }
.credit a { text-decoration: underline; }
.status { padding: 40px 0; color: var(--grey); }

.end-mark { font-size: var(--text); line-height: var(--text-lh); text-align: center; padding: 80px 0 60px; }

/* ---------- work: hero media per category ---------- */
.category-media { margin-top: calc(var(--credits-top) - 8px); }
.category-media[hidden] { display: none; }
.media-frame {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border: 0; padding: 0; margin: 0; border-radius: 14px; overflow: hidden;
  background: #000; cursor: pointer;
}
.media-frame img, .media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
video.media-frame { height: auto; cursor: auto; }
.media-image { border-radius: 14px; }
.play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.6);
}
.play::after {
  content: ""; position: absolute; left: 25px; top: 20px;
  border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff;
}
.media-facade:hover .play, .media-facade:focus-visible .play { background: #808080; }
.media-caption { margin-top: 6px; color: var(--grey); }

/* ---------- home ---------- */
.hero { margin-top: 17px; }
.hero-wide { border-radius: 14px; }
.hero-narrow { display: none; }

/* ---------- bio ---------- */
.bio { margin-top: 60px; font-size: var(--text); line-height: var(--text-lh); }
.bio::after { content: ""; display: block; clear: both; }
.bio figure { float: left; width: 299px; margin: 0 19px 0 3px; }
.bio-text { margin-left: 321px; }
.bio-text p + p { margin-top: var(--text-lh); }
.photo-credit { font-size: var(--credit); line-height: 1.334; color: var(--grey); margin-top: 5px; }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: 453px 448px; margin-top: 78px; font-size: var(--text); line-height: var(--text-lh); }
.contact-text p + p { margin-top: var(--text-lh); }
.contact-text a { text-decoration: underline; }
.contact figure { margin-top: 0; }

/* ---------- plain text pages ---------- */
.page-title { font-size: 30px; font-weight: 400; margin: 40px 0 30px; }
.prose { max-width: 640px; font-size: var(--text); line-height: var(--text-lh); }
.prose p + p { margin-top: var(--text-lh); }
.prose a { text-decoration: underline; }

/* ---------- footer ---------- */
.site-footer { position: sticky; bottom: 0; z-index: 30; margin-top: 30px; }
.site-footer .wrap { padding: 9px 0 0; background: #fff; }
.footer-bar {
  display: flex; justify-content: space-between; align-items: flex-start;
  min-height: var(--foot-h); padding: 10px var(--pad) 0;
  border-top: 1px solid var(--rule); color: var(--grey);
  font-size: var(--foot); line-height: 1.779;
}
.footer-bar a { text-decoration: underline; font-size: var(--foot-link); }

/* ---------- 768 layout ---------- */
@media (max-width: 959px) {
  :root {
    --page: 768px; --header-h: 120px;
    --name: 24px; --name-ls: 2.23px; --name-top: 12px;
    --nav: 17px; --nav-lh: 1.354; --nav-slot: 85px; --nav-top: 12px;
    --small: 12px; --small-lh: 1.334; --year-slot: 56px; --bar-top: 22px;
    --label: 16px; --label-lh: 1.313;
    --credit: 7px; --foot: 10px; --foot-link: 7px; --foot-h: 32px;
    --credits-top: 60px;
  }
  .year-block { display: block; margin-left: -2px; }
  .year-label { margin-bottom: 2px; }
  .entries { column-gap: 19px; max-width: 751px; }

  .hero-wide { display: none; }
  .hero-narrow { display: block; width: 490px; margin: 53px 0 0 auto; }

  .bio { margin-top: 27px; }
  .bio figure { width: 241px; margin: 4px 12px 8px -3px; }
  .bio-text { margin-left: 0; }

  .contact { grid-template-columns: 350px 358px; margin-top: 50px; }
  .contact figure { margin-top: 0; }
  .contact-text { width: 366px; }
  .contact .agency { line-height: 26px; }
  .contact .agency a { font-size: 11px; }

  .site-footer .wrap { padding-top: 6px; }
  .footer-bar { align-items: center; padding-top: 0; }
}

/* ---------- 480 layout ---------- */
@media (max-width: 767px) {
  :root {
    --page: 480px; --pad: 6px; --header-h: 72px;
    --name: 16px; --name-lh: 1.313; --name-top: 3px;
    --nav: 12px; --nav-lh: 1.334; --nav-slot: 53px; --nav-top: 4px;
    --small: 10px; --small-lh: 1.401; --year-slot: 36px; --bar-top: 16px;
    --body: 10px; --body-lh: 1.401;
    --label: 14px; --label-lh: 1.358;
    --credit: 6px; --foot: 6px; --foot-link: 6px; --foot-h: 20px;
    --credits-top: 26px;
  }
  .year-block { margin-left: -1px; margin-bottom: 48px; }
  .entries { column-gap: 15px; max-width: 465px; }
  .filters { gap: 0 1.5em; }

  .hero-narrow { width: 187px; margin: 20px 0 0 216px; }

  .bio { margin-top: 38px; }
  .bio figure { width: 172px; margin: 0 12px 8px 0; }

  .contact { grid-template-columns: 306px 162px; margin-top: 38px; }
  .contact-text { width: auto; max-width: 270px; }
  .contact figure { margin-top: 0; }
  .contact .agency a { font-size: inherit; }

  .end-mark { padding: 60px 0 40px; }
}

/* ---------- 320 layout ---------- */
@media (max-width: 479px) {
  :root {
    --page: 320px; --pad: 4px; --header-h: 132px;
    --name: 30px; --name-lh: 1.334; --name-top: 13px;
    --nav: 20px; --nav-lh: 1.301; --nav-slot: auto; --nav-gap: 51px; --nav-top: 7px;
    --small: 10px; --year-slot: 30px; --bar-top: 7px;
    --label: 18px; --label-lh: 1.334;
    --credit: 10px; --foot: 8px; --foot-link: 8px; --foot-h: 21px;
    --credits-top: 43px;
  }
  .year-block { margin-left: -1px; }
  .entries { column-count: 1; }
  .filters { gap: 0 1.2em; }

  .hero-narrow { position: static; width: 306px; margin: 162px 0 0 4px; }

  .bio { margin-top: 36px; }
  .bio figure { float: none; width: 311px; margin: 0 0 6px -1px; }

  .contact { grid-template-columns: minmax(0, 1fr); margin-top: 36px; }
  .contact-text { max-width: none; }
  .contact figure { margin-top: 40px; width: 314px; }
  .contact a { letter-spacing: 1.01px; }
  .media-frame, .media-image { border-radius: 8px; }
  .play { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  .play::after { left: 19px; top: 15px; border-width: 9px 0 9px 15px; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
