/* Artwork page: a separate look from the homepage, after Van Gogh's
   "Snow-Covered Field with a Harrow" (1890): pale butter sky, celadon fields, teal ink. */

:root {
  --paper: #f4f1e4;
  --paper-deep: #ebe6d2;
  --ink: #1f3b3a;
  --ink-soft: #4c6b67;
  --teal: #2f6e66;
  --celadon: #8fc0b4;
  --butter: #ece3a2;
  --mat: #faf8ef;
  --line: #d6cfb8;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  color: var(--ink);
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.6;
  background-color: var(--paper);
  /* Faint canvas weave */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.38  0 0 0 0 0.30  0 0 0 0.07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

a { color: var(--teal); text-decoration-color: rgba(47, 110, 102, 0.35); text-underline-offset: 3px; }
a:hover { color: var(--ink); text-decoration-color: var(--butter); }

/* ---------- Hero painting ---------- */
.hero {
  position: relative;
  height: 74vh;
  min-height: 420px;
  max-height: 820px;
  overflow: hidden;
  background: #e4e7c8;
}

.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero__nav {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top, 0px));
  left: 18px;
  font-family: "Cormorant Garamond", Garamond, serif;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero__nav a {
  display: inline-block;
  padding: 0.35em 0.9em;
  color: var(--ink);
  text-decoration: none;
  background: rgba(250, 248, 239, 0.88);
  border: 1px solid var(--line);
}

.hero__nav a:hover { background: var(--mat); }

.hero__title {
  position: absolute;
  left: clamp(18px, 6vw, 80px);
  bottom: clamp(24px, 7vh, 72px);
  max-width: min(560px, calc(100% - 36px));
  padding: 1.1em 1.6em 1.2em;
  background: rgba(250, 248, 239, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(31, 59, 58, 0.12);
}

.hero__title h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Garamond, serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0.01em;
}

.hero__title p {
  margin: 0.5em 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

/* ---------- Content ---------- */
.canvas-paper {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 80px) clamp(16px, 4vw, 40px) 40px;
}

.intro {
  max-width: 640px;
  margin: 0 auto clamp(40px, 6vw, 72px);
  text-align: center;
}

.intro p { margin: 0 0 1em; }

.intro::after {
  content: "";
  display: block;
  width: 120px;
  height: 14px;
  margin: 1.6em auto 0;
  /* A single painted stroke */
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14'><path d='M3 9 C 25 3, 45 12, 62 7 S 100 3, 117 8' fill='none' stroke='%238fc0b4' stroke-width='4' stroke-linecap='round'/><path d='M10 10 C 35 6, 60 11, 85 7' fill='none' stroke='%23ece3a2' stroke-width='2.5' stroke-linecap='round'/></svg>") center / contain no-repeat;
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 72px) clamp(28px, 4vw, 56px);
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
}

@media (max-width: 640px) { .gallery { grid-template-columns: minmax(0, 1fr); } }

.work {
  margin: 0;
}

.frame {
  display: block;
  width: 100%;
  padding: clamp(12px, 1.6vw, 20px);
  background: var(--mat);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 10px 28px rgba(31, 59, 58, 0.14);
  cursor: zoom-in;
  font: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.work--placeholder .frame { cursor: default; }

button.frame:hover {
  transform: translateY(-3px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 16px 34px rgba(31, 59, 58, 0.18);
}

.frame img,
.frame canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  outline: 1px solid rgba(31, 59, 58, 0.18);
}

.work figcaption {
  margin-top: 0.8em;
  text-align: center;
  line-height: 1.4;
}

.work__title { font-style: italic; }
.work__year { color: var(--ink-soft); }

.work__medium,
.work__note {
  display: block;
  color: var(--ink-soft);
  font-size: 0.85em;
  letter-spacing: 0.03em;
}

.work--placeholder figcaption { opacity: 0.7; }

/* ---------- Footer ---------- */
.art-footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px calc(56px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

.art-footer p { margin: 0.4em 0; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(22, 40, 39, 0.92);
  cursor: zoom-out;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  border: 10px solid var(--mat);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  cursor: default;
}

.lightbox__caption {
  margin: 1em 0 0;
  color: var(--paper);
  font-style: italic;
}

.lightbox__close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 16px;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--paper);
  background: none;
  border: 0;
  cursor: pointer;
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  .hero { height: 62vh; min-height: 360px; }
}

.intro .motto {
  font-family: "Cormorant Garamond", Garamond, serif;
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.35;
  color: var(--ink);
}

/* An odd last work sits centred on its own row */
@media (min-width: 641px) {
  .gallery .work:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - clamp(28px, 4vw, 56px)) / 2);
  }
}
