/* ============================================
   BASE TOKENS
   ============================================ */
:root {
  --bg: #ffffff;
  --text: #1c1c1a;
  --muted: #6a6a64;
  --border: #e3e3df;

  --space: 1.6rem;
  --max-text: 68ch;
  --max-wide: 1200px;

  /* Type scale. Five sizes, each with one job:
     xs   captions, footer, section heads on work pages
     sm   navigation, thumbnail overlays
     base body text, CV entries, work descriptions, section headings
     lg   page labels (About, CV, Contact)
     xl   work titles */
  --text-xs: 0.85rem;      /* 13.6px */
  --text-sm: 0.95rem;      /* 15.2px */
  --text-base: 1.0625rem;  /* 17px   */
  --text-lg: 1.66rem;      /* 26.6px */
  --text-xl: 2rem;         /* 32px   */
}

* {
  box-sizing: border-box;
}

/* Never let an image push the page wider than the screen */
img {
  max-width: 100%;
  height: auto;
}

/* Keyboard-only link that jumps past the header straight to the page content */
/* Present to screen readers and search engines, not shown on screen */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: var(--bg);
  color: var(--text);
  padding: 0.6rem 1rem;
}
.skip-link:focus {
  left: var(--space);
  top: var(--space);
  outline: 2px solid var(--text);
}

#content:focus {
  outline: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Lora", Georgia, serif;
  font-size: var(--text-base);
  line-height: 1.65;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 {
  font-size: var(--text-xl);
  line-height: 1.2;
  margin: 2rem 0 0.5rem;
  font-weight: 600;
}

/* About, CV and Contact: the h1 is a page label, not a title, so it
   does not get the size a work title gets. */
h1.page-title {
  font-size: var(--text-lg);
}

/* Section headings share one language with .section-head below:
   a hairline rule, generous space above, no jump in size. */
h2 {
  font-size: var(--text-base);
  line-height: 1.3;
  font-weight: 600;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin: 2.6rem 0 0.75rem;
}
p {
  margin: 0.9rem 0;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover,
a:focus {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

blockquote {
  font-style: italic;
  color: var(--muted);
  margin: 1.6rem 0;
  line-height: 1.65;
  padding-left: 0;
}
blockquote cite {
  display: block;
  font-style: normal;
  color: var(--muted);
  margin-top: 0.5rem;
  font-size: var(--text-xs);
}

/* ============================================
   LAYOUT WIDTHS
   ============================================ */
.text-content {
  max-width: var(--max-text);
  margin: 0 auto;
  padding: var(--space);
}

.work,
.works-index {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: var(--space);
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: var(--bg);
}
.site-header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: var(--space);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand {
  font-weight: 600;
}
.primary-nav {
  display: flex;
  gap: 2rem;
  margin-left: 1.5rem;
  font-size: var(--text-sm);
}
@media (max-width: 600px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem var(--space);
  }
  .primary-nav {
    margin-left: 0;
  }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  margin-top: calc(var(--space) * 3);
}
.site-footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: var(--space);
  color: var(--muted);
  font-size: var(--text-xs);
}

/* ============================================
   SECTION HEADS
   ============================================ */
.section-head {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  color: var(--muted);
  margin-top: 2.6rem;
  margin-bottom: 0.75rem;
  font-size: var(--text-xs);
}

/* ============================================
   WORKS INDEX — GRID
   ============================================ */
.works-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 900px) {
  .works-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1200px) {
  .works-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  display: block;
  overflow: hidden;
}
.card a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.card figure {
  margin: 0;
  padding-top: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--border);
}
.card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.18s ease;
}
.card .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 0.6rem 0.75rem;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
  color: #fff;
  font-size: var(--text-sm);
  line-height: 1.3;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.card:hover .overlay,
.card:focus-within .overlay {
  opacity: 1;
}
.card .meta {
  display: none;
}
@media (hover: none) {
  .card .overlay { display: none; }
  .card .meta {
    display: block;
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
  }
}

/* ============================================
   WORK PAGE — GRID LAYOUT
   ============================================ */
.work-meta {
  margin-bottom: 2rem;
  max-width: var(--max-text);
}
.work-description {
  font-style: italic;
  color: var(--muted);
  margin-top: 0.4rem;
}

.work-columns {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: calc(var(--space) * 2);
  align-items: start;
}

.work-text {
  position: sticky;
  top: var(--space);
}

.work-media {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space);
  align-items: flex-start;
}

.work-media-item {
  margin: 0;
}
.work-media--full {
  width: 100%;
}
.work-media--half {
  width: calc(50% - calc(var(--space) / 2));
}

.work-media-item img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 0 0 1px var(--border);
}

figcaption,
.media-caption {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 0.4rem;
  font-style: italic;
}

/* Video */
.video-wrapper {
  position: relative;
  padding-top: 56.25%;
  width: 100%;
}
.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.work-related {
  margin-top: 2rem;
}
.work-related ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}
.work-related li {
  margin: 0.3rem 0;
}
.work-exhibited ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}
.work-exhibited li {
  margin: 0.3rem 0;
}
/* Mobile */
@media (max-width: 720px) {
  .work-columns {
    grid-template-columns: 1fr;
  }
  .work-text {
    position: static;
  }

  .work-media--half {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .works-grid {
    grid-template-columns: 1fr;
  }
}
/* ============================================
   CV PAGE
   ============================================ */
.cv-download {
  margin: 1.5rem 0 2rem;
}
.cv-download a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cv {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  column-gap: 1rem;
  margin: 0.5rem 0 2.5rem;
}
.cv dt {
  grid-column: 1;
  color: var(--muted);
}
.cv dd {
  grid-column: 2;
  margin: 0 0 0.35rem;
}
.cv dt,
.cv dt + dd {
  padding-top: 0.9rem;
}
.cv dt:first-child,
.cv dt:first-child + dd {
  padding-top: 0;
}

@media (max-width: 600px) {
  .cv {
    grid-template-columns: 1fr;
  }
  .cv dt {
    grid-column: 1;
  }
  .cv dd {
    grid-column: 1;
  }
  .cv dt + dd {
    padding-top: 0.2rem;
  }
}

/* ============================================
   CONTACT PAGE
   ============================================ */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.contact-list a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.contact-location {
  color: var(--muted);
  margin-top: 2rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 800px) {
  :root {
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.5rem;     /* 24px */
    --text-xl: 1.75rem;    /* 28px */
  }
  .primary-nav {
    flex-wrap: wrap;
    gap: 1.25rem;
  }
}

/* ============================================
   PRINT (the CV page prints as a standalone PDF)
   ============================================ */
.print-only {
  display: none;
}

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .cv-download,
  .print-hidden {
    display: none;
  }

  .print-only {
    display: block;
    color: #000;
    margin: 0 0 1.6rem;
  }
  .print-head p {
    margin: 0;
  }
  .print-head .print-name {
    font-size: 17pt;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.25rem;
  }

  @page {
    margin: 18mm 16mm;
  }

  body {
    font-size: 10pt;
    line-height: 1.45;
    color: #000;
    background: #fff;
  }

  .text-content {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  h1 {
    font-size: 17pt;
    margin: 0 0 0.3rem;
  }

  h2 {
    font-size: 10.5pt;
    margin: 1.1rem 0 0.3rem;
    break-after: avoid;
    page-break-after: avoid;
  }

  /* Grid does not fragment reliably across printed pages, so flow it */
  .cv {
    display: block;
    margin: 0 0 1rem;
  }
  .cv dt {
    margin: 0.6rem 0 0.1rem;
    padding-top: 0;
    color: #000;
    font-weight: 600;
    break-after: avoid;
    page-break-after: avoid;
  }
  .cv dt:first-child {
    margin-top: 0.2rem;
  }
  .cv dt + dd {
    padding-top: 0;
  }
  .cv dd {
    margin: 0 0 0.1rem;
    padding-top: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}
