/* ─── Fonts ─────────────────────────────────────────────────────────────────
   Drop font files into /assets/fonts/. Filenames below are conventional;
   adjust if your copies differ.
   - Redaction:  redaction-regular.woff2, redaction-italic.woff2
   - Necto Mono: necto-mono-regular.woff2
   - Helvetica is a system font — no @font-face needed.
────────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Redaction20";
  src: url("/assets/fonts/redaction-20-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Redaction20";
  src: url("/assets/fonts/redaction-20-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Redaction35";
  src: url("/assets/fonts/redaction-35-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Redaction35";
  src: url("/assets/fonts/redaction-35-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Necto Mono";
  src: url("/assets/fonts/necto-mono-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ─── Variables ──────────────────────────────────────────────────────────── */

:root {
  --font-sans:    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif20: "Redaction20", Georgia, "Times New Roman", serif;
  --font-serif35: "Redaction35", Georgia, "Times New Roman", serif;
  --font-mono:    "Necto Mono", "Courier New", Courier, monospace;

  --text:      #393939;
  --muted:     #393939;
  --bg:        #ffffff;

  --max-width: 700px;
  --gutter:    24px;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  font-style: italic;
}

img { max-width: 100%; height: auto; display: block; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */

.site-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Homepage uses a wider wrapper; prose stays narrow */
body.home .site-wrapper {
  max-width: 1000px;
}

body.home main > h1,
body.home main > h2,
body.home main > h3,
body.home main > p,
body.home main > blockquote,
.credits,
body.home main > .references {
  max-width: 660px;
}

/* ─── Navigation ─────────────────────────────────────────────────────────── */

nav {
  padding: 36px 0 28px;
  font-family: var(--font-sans);
  font-size: 0.933rem;
}

nav a {
  margin-right: 20px;
  text-transform: lowercase;
}

nav a.active {
  font-weight: 700;
}

/* ─── Headings ───────────────────────────────────────────────────────────── */

h1 {
  font-family: var(--font-serif20);
  font-size: clamp(3.5rem, 10vw, 4rem);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 16px;
}

/* Page section labels — small Necto Mono */
h2 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.02em;
  color: var(--text);
  margin: 48px 0 8px;
}

/* Section headers — Redaction35 italic */
h2.section-label {
  font-family: var(--font-serif35);
  font-size: 2rem;
  font-style: italic;
  letter-spacing: 0;
  margin: 48px 0 16px;
}

h3 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 400;
  margin: 28px 0 8px;
}

/* ─── Body text ──────────────────────────────────────────────────────────── */

p {
  font-family: var(--font-sans);
  font-size: 0.933rem;
  line-height: 1.75;
  margin: 0 0 14px;
}

strong { font-weight: 600; }

em { font-style: italic; }

blockquote {
  font-size: 0.933rem;
  margin: 24px 0;
  padding-left: 20px;
  color: var(--muted);
}

/* ─── Page content wrapper ───────────────────────────────────────────────── */

main {
  padding: 40px 0 80px;
}

/* ─── Page subtitle (below h1 on project pages) ──────────────────────────── */

.page-subtitle {
  font-family: var(--font-sans);
  font-size: 0.867rem;
  color: var(--muted);
  margin: -8px 0 32px;
  line-height: 1.6;
}

/* ─── Metadata block (Role / Tools / Duration etc.) ─────────────────────── */

.meta-block {
  display: grid;
  grid-template-rows: auto auto;
  grid-auto-flow: column;
  gap: 4px 32px;
  margin-bottom: 40px;
}

.meta-block dt {
  font-family: var(--font-mono);
  font-size: 0.733rem;
  color: var(--muted);
  white-space: nowrap;
}

.meta-block dd {
  font-family: var(--font-sans);
  font-size: 0.933rem;
  color: var(--text);
  margin: 0;
}

/* ─── Credits / date line ────────────────────────────────────────────────── */

.credits {
  font-family: var(--font-mono);
  font-size: 0.733rem;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 32px;
}

.credits p { font-family: inherit; font-size: inherit; color: inherit; }

/* ─── Card title ─────────────────────────────────────────────────────────── */

.card-title {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
  margin: 10px 0 4px;
  color: var(--text);
}

.card-tags {
  font-family: var(--font-mono);
  font-size: 0.667rem;
  color: var(--muted);
}

/* ─── List-style grid ────────────────────────────────────────────────────── */

.list-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px;
  margin-top: 4px;
}

.list-card {
  display: block;
  text-decoration: none;
  border: 1px dashed transparent;
  transition: border-color;
  padding: 8px;
  margin: -8px;
}

.list-card:hover {
  border-color: var(--text);
  text-decoration: none;
  font-style: normal;
}

/* ─── Icon animations ────────────────────────────────────────────────────── */

@keyframes cl-eye-shift {
  0%, 75%, 100% { transform: translateX(0); }
  25%, 50%      { transform: translateX(-6px); }
}
@keyframes docs-up-down {
  0%, 75%, 100% { transform: translateY(0); }
  25%, 50%      { transform: translateY(-10px); }
}
@keyframes overfit-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes polly-show-1 {
  0%, 32%   { opacity: 1; }
  33%, 100% { opacity: 0; }
}
@keyframes polly-show-2 {
  0%, 32%   { opacity: 0; }
  33%, 65%  { opacity: 1; }
  66%, 100% { opacity: 0; }
}
@keyframes polly-show-3 {
  0%, 65%   { opacity: 0; }
  66%, 100% { opacity: 1; }
}

/* off by default */
.polly-left-1, .polly-left-2, .polly-down { opacity: 0; }

/* run on hover */
.list-card:hover .cl-eye        { animation: cl-eye-shift 1.6s linear infinite; }
.list-card:hover .docs-boxes    { animation: docs-up-down 1.2s linear infinite; }
.list-card:hover .overfit-blink { animation: overfit-blink 1.2s linear infinite; }
.list-card:hover .polly-left-1  { animation: polly-show-1 1.8s linear infinite; }
.list-card:hover .polly-left-2  { animation: polly-show-2 1.8s linear infinite; }
.list-card:hover .polly-down    { animation: polly-show-3 1.8s linear infinite; }

.list-card:hover .card-title {
  font-style: italic;
}

.list-card.hidden {
  display: none;
}

.list-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.list-card img,
.list-card svg {
  width: 38px;
  height: 38px;
  object-fit: cover;
  flex-shrink: 0;
}

.list-card .card-title {
  font-size: 0.933rem;
  font-weight: 400;
  line-height: 1.35;
  margin: 0;
  align-self: center;
}

.list-card .card-tags {
  font-size: 0.667rem;
  margin-top: 5px;
}

@media (max-width: 900px) {
  .list-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .list-grid { grid-template-columns: 1fr; }
}

/* ─── Images inside project pages ───────────────────────────────────────── */

.page-image {
  width: 100%;
  height: auto;
  margin: 28px 0;
}

figure {
  margin: 28px 0;
}

figure .page-image {
  margin: 0;
}

figcaption {
  font-family: var(--font-mono);
  font-size: 0.667rem;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ─── Image grid (visual media pages) ───────────────────────────────────── */

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 28px 0;
}

.image-grid img { width: 100%; height: auto; }

/* ─── Video embed ────────────────────────────────────────────────────────── */

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 28px 0;
}

.video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ─── Essay page styles ──────────────────────────────────────────────────── */

/* Footnote superscripts inline */
sup {
  font-size: 0.65rem;
  vertical-align: super;
  line-height: 0;
}

/* References / footnotes section */
.references {
  margin-top: 56px;
  padding-top: 0;
}

.references h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

.references ol,
.references ul {
  padding-left: 20px;
  font-size: 0.867rem;
  line-height: 1.75;
}

.references li {
  margin-bottom: 10px;
}

/* ─── Under construction ─────────────────────────────────────────────────── */

.under-construction {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding: 40px 0;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

footer {
  padding: 32px 0 48px;
  font-family: var(--font-sans);
  font-size: 0.933rem;
  color: var(--text);
}

footer a { margin-right: 4px; }

/* ─── Lightbox ───────────────────────────────────────────────────────────── */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  cursor: zoom-out;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

#lightbox.open {
  display: flex;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

#lightbox-caption {
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  margin-top: 16px;
  text-align: center;
}

figure img,
.page-image,
.image-grid img {
  cursor: zoom-in;
}

/* ─── Mobile ─────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  :root { --gutter: 20px; }

  nav { font-size: 0.85rem; }
  nav a { margin-right: 12px; }

  .image-grid { grid-template-columns: 1fr; }

  h2 { font-size: 1.2rem; }
}

/* ─── Utilities ──────────────────────────────────────────────────────────── */

.blue-link {
  color: #0059D1;
}

.call-out {
  font-family: var(--font-serif35);
  font-size: 2rem;
  line-height: 1.5;
  letter-spacing: 0;
  margin: 48px 0 16px;
}
