/* Layout: one calm column, the painting is the point. The page background takes the color of the work on show.
   Color: --vs-h and --vs-s come from the painting (PHP and tint.js), --vs-l and the text colors come from the light or dark theme.
   Type: one family, weight 300 for large lines, 400 and 500 for everything else. */
:root {
  --vs-font: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --vs-h: 38;
  --vs-s: 8%;
  --vs-l: 80%;
  --vs-bg: hsl(var(--vs-h) var(--vs-s) var(--vs-l));
  --vs-fg: hsl(var(--vs-h) 32% 10%);
  --vs-fg-2: hsl(var(--vs-h) 32% 10% / 0.68);
  --vs-line: hsl(var(--vs-h) 32% 10% / 0.26);
  --vs-err: hsl(8 66% 30%);
  --vs-gutter: clamp(16px, 4vw, 48px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --vs-l: 16%;
    --vs-fg: hsl(var(--vs-h) 25% 93%);
    --vs-fg-2: hsl(var(--vs-h) 25% 93% / 0.66);
    --vs-line: hsl(var(--vs-h) 25% 93% / 0.26);
    --vs-err: hsl(8 88% 76%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
:root { background: var(--vs-bg) !important; transition: background-color 1s ease; min-height: 100%; }
body {
  background: var(--vs-bg) !important;
  color: var(--vs-fg);
  font-family: var(--vs-font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; min-height: 100dvh;
  overflow-x: clip;
  transition: background-color 1s ease, color 1s ease;
}
/* The page always fills the window: short pages keep the footer at the bottom and the
   background color runs all the way down, even on very large screens. */
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.wp-site-blocks > * { margin-block: 0; }
.wp-site-blocks > .vs-main { flex: 1 0 auto; }
.vs-main { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
:focus-visible { outline: 2px solid var(--vs-fg); outline-offset: 3px; }
h1, h2, p, figure, dl, dd { margin: 0; }
img { display: block; }
a { color: inherit; }

.label { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--vs-fg-2); }
.num { font-variant-numeric: tabular-nums; }
.empty { color: var(--vs-fg-2); padding-block: 2rem; }

/* Header */
.top {
  position: relative; z-index: 60;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 0.6rem 2rem; padding-block: 1.4rem;
}
.brand { font-weight: 500; color: inherit; text-decoration: none; letter-spacing: 0.01em; }
.top nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.7rem; }
.top nav a {
  color: var(--vs-fg-2); text-decoration: none; padding-block: 0.15rem;
  border-bottom: 1px solid transparent; transition: color 0.3s, border-color 0.3s;
}
.top nav a:hover { color: var(--vs-fg); }
.top nav a[aria-current="page"] { color: var(--vs-fg); border-bottom-color: var(--vs-fg); }

/* Menu button (phones only, and only when JavaScript is available) */
.menu-toggle { display: none; position: relative; z-index: 2; margin-right: -0.6rem; padding: 0.6rem; color: inherit; }
.menu-toggle .bars { display: block; position: relative; width: 24px; height: 9px; }
.menu-toggle .bars::before, .menu-toggle .bars::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px; background: currentColor;
  transition: transform 0.3s ease;
}
.menu-toggle .bars::before { top: 0; }
.menu-toggle .bars::after { bottom: 0; }
.top.open .menu-toggle .bars::before { transform: translateY(4px) rotate(45deg); }
.top.open .menu-toggle .bars::after { transform: translateY(-4px) rotate(-45deg); }
html.menu-open { overflow: hidden; }

.vs-main { animation: rise 0.6s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }

/* Start */
.start {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: var(--vs-gutter); align-items: end; padding-block: 2vh 4vh;
}
.name {
  font-weight: 300; font-size: clamp(2.6rem, 7.5vw, 6.2rem); line-height: 0.98;
  letter-spacing: -0.025em; text-wrap: balance;
}
.start .intro { margin-top: 1.4rem; color: var(--vs-fg-2); max-width: 34ch; }
.start .now { margin-top: 2.4rem; display: grid; gap: 0.1rem; transition: opacity 0.45s ease; }
.start .now.swap { opacity: 0; }
.start .now-title { font-weight: 400; font-size: 0.9rem; color: var(--vs-fg-2); }
.start .now-meta { font-size: 0.78rem; color: var(--vs-fg-2); opacity: 0.8; }
.stage { position: relative; display: block; width: 100%; height: clamp(340px, 68vh, 720px); }
.stage img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: center bottom;
  opacity: 0; transition: opacity 1.2s ease;
}
.stage img.on { opacity: 1; }

/* Works: one painting at a time. Each work gets the whole screen, flies in from the side, and its details sit next to it. */
:root { --vs-top: 4.6rem; }
:root:has(.works) {
  --vs-l: 66%;
  --vs-bg: hsl(var(--vs-h) min(100%, calc(var(--vs-s) * 1.35)) var(--vs-l));
  scroll-snap-type: y proximity; scroll-padding-top: var(--vs-top);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):has(.works) { --vs-l: 24%; }
}
:root:has(.works) .top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; align-items: center;
  min-height: var(--vs-top); padding-block: 0; padding-inline: var(--vs-gutter);
  background: var(--vs-bg); transition: background-color 1s ease;
}
.works { display: block; padding-top: var(--vs-top); padding-bottom: 8vh; }
.tile {
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: clamp(1.5rem, 4vw, 4rem);
  min-height: calc(100vh - var(--vs-top)); min-height: calc(100svh - var(--vs-top));
  margin-top: 14vh; position: relative; text-decoration: none;
  scroll-snap-align: center; scroll-snap-stop: normal;
}
.tile:first-child { margin-top: 0; }
.tile.from-right { flex-direction: row-reverse; }
.tile figure { margin: 0; display: flex; justify-content: center; min-width: 0; flex: 0 1 auto; }
.tile img {
  width: auto; height: auto; max-width: 100%;
  max-height: calc(100vh - var(--vs-top) - 8rem); max-height: calc(100svh - var(--vs-top) - 8rem);
  object-fit: contain;
}
.tile .cap { flex: 0 0 min(14rem, 22vw); display: flex; flex-direction: column; gap: 0.35rem; align-self: flex-end; color: var(--vs-fg-2); font-size: 0.8rem; }
.tile .cap b { font-weight: 400; font-size: 0.95rem; color: var(--vs-fg); }
.tile.from-right .cap { text-align: right; align-items: flex-end; }

@media (prefers-reduced-motion: no-preference) {
  .works-fx .tile figure {
    opacity: 0.1; transform: translate3d(-22vw, 0, 0);
    transition: opacity 1s ease, transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .works-fx .tile.from-right figure { transform: translate3d(22vw, 0, 0); }
  .works-fx .tile .cap {
    opacity: 0; transform: translate3d(2.5rem, 0, 0);
    transition: opacity 0.9s ease 0.35s, transform 1.3s cubic-bezier(0.16, 1, 0.3, 1) 0.35s;
  }
  .works-fx .tile.from-right .cap { transform: translate3d(-2.5rem, 0, 0); }
  .works-fx .tile.is-active figure,
  .works-fx .tile.is-active .cap { opacity: 1; transform: none; }
}

/* Single painting */
.work { display: grid; gap: 1.4rem; justify-items: start; padding-block: 0.5rem 3rem; }
.link { color: var(--vs-fg-2); text-decoration: none; transition: color 0.3s; }
.link:hover { color: var(--vs-fg); }
.plate { display: grid; gap: 1.1rem; justify-items: start; max-width: 100%; }
.plate img {
  max-width: 100%; max-height: 78vh; width: auto; height: auto;
  box-shadow: 0 1px 0 hsl(0 0% 0% / 0.08), 0 22px 44px -26px hsl(0 0% 0% / 0.5);
}
.plate figcaption { display: grid; gap: 0.15rem; animation: fade 1.4s ease 0.9s both; }
.plate h1 { font-weight: 300; font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.15; letter-spacing: -0.01em; }
.plate .meta { font-size: 0.8rem; color: var(--vs-fg-2); }

/* About page (the content is edited in the block editor) */
.lead {
  font-weight: 300; font-size: clamp(1.7rem, 3.6vw, 2.9rem); line-height: 1.15;
  letter-spacing: -0.015em; text-wrap: balance; max-width: 26ch;
}
.body { max-width: 62ch; }
.wp-block-columns { gap: calc(var(--vs-gutter) * 1.5); }
.wp-block-image img { max-width: 100%; height: auto; }

/* Legal pages */
.legal { max-width: 68ch; padding-block: 1rem 2rem; }
.legal h1 { font-weight: 300; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 1.2rem; }
.legal h2 { font-weight: 500; font-size: 1rem; margin-top: 2.2rem; margin-bottom: 0.5rem; }
.legal p + p { margin-top: 0.8rem; }

/* Contact form: three lines and a send link, same quiet style as the rest */
.contact { max-width: 30rem; padding-block: 2rem 3rem; }
.contact form { display: grid; gap: 1.8rem; }
.field { display: grid; gap: 0.2rem; }
.field label { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--vs-fg-2); }
.field input, .field textarea {
  font: inherit; font-size: 1rem; color: var(--vs-fg); background: transparent; width: 100%;
  border: 0; border-bottom: 1px solid var(--vs-line); border-radius: 0; padding: 0.55rem 0;
  transition: border-color 0.3s;
}
.field textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
.field input:hover, .field textarea:hover { border-bottom-color: var(--vs-fg-2); }
.field input:focus, .field textarea:focus { border-bottom-color: var(--vs-fg); }
.field.invalid input, .field.invalid textarea { border-bottom-color: var(--vs-err); }
.err { font-size: 0.86rem; color: var(--vs-err); }
.send {
  justify-self: start; color: var(--vs-fg); padding: 0.15rem 0; border-bottom: 1px solid var(--vs-fg);
  transition: opacity 0.3s;
}
.send:hover { opacity: 0.6; }
.send[disabled] { opacity: 0.4; cursor: default; }
.notice { margin-bottom: 1.6rem; outline: none; }
.notice.bad { color: var(--vs-err); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 1rem 2rem; padding-block: 3rem 1.6rem; font-size: 0.8rem; color: var(--vs-fg-2);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1.5rem; }
.foot a { color: inherit; text-decoration: none; padding-block: 0.1rem; border-bottom: 1px solid transparent; transition: color 0.3s, border-color 0.3s; }
.foot a:hover, .foot a[aria-current="page"] { color: var(--vs-fg); border-bottom-color: var(--vs-fg); }

@media (max-width: 760px) {
  .js .menu-toggle { display: block; }
  .top { flex-wrap: nowrap; align-items: center; }
  .brand { position: relative; z-index: 2; }
  .js .top nav {
    position: fixed; inset: 0; z-index: 1; flex-direction: column; justify-content: center; flex-wrap: nowrap;
    gap: 0.5rem; padding: 6rem var(--vs-gutter) 3rem; background: var(--vs-bg);
    opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s linear 0.35s;
  }
  .js .top.open nav { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
  .js .top nav a {
    align-self: flex-start; color: var(--vs-fg); font-size: clamp(2rem, 10vw, 3rem);
    font-weight: 300; letter-spacing: -0.02em; line-height: 1.15;
  }

  /* Start: the painting comes first, edge to edge and as large as the screen allows */
  .start { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; padding-block: 0 2rem; }
  .stage {
    order: -1; display: grid; height: auto;
    width: auto; margin-inline: calc(var(--vs-gutter) * -1);
  }
  .stage img {
    position: static; grid-area: 1 / 1; width: 100%; height: auto; max-height: 78svh;
    object-fit: contain; object-position: center; align-self: center;
  }
  .name { font-size: clamp(2.4rem, 13vw, 3.4rem); }
  .start .now { margin-top: 1.4rem; }

  /* Works: the painting uses the full width, details below it */
  :root { --vs-top: 4.2rem; }
  .tile, .tile.from-right { flex-direction: column; justify-content: center; gap: 1rem; min-height: calc(100svh - var(--vs-top)); margin-top: 10vh; }
  .tile:first-child { margin-top: 0; }
  .tile figure { margin-inline: calc(var(--vs-gutter) * -1); max-width: none; align-self: stretch; }
  .tile img { max-height: calc(100svh - var(--vs-top) - 9rem); }
  .tile .cap, .tile.from-right .cap { flex: none; align-self: flex-start; text-align: left; align-items: flex-start; }
  :root:has(.works) { scroll-snap-type: y mandatory; }
  .works-fx .tile figure, .works-fx .tile.from-right figure { transform: translate3d(0, 2.5rem, 0); }
  .works-fx .tile .cap, .works-fx .tile.from-right .cap { transform: translate3d(0, 0.8rem, 0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
