/* Phren Lhantom — single-page portfolio */

:root {
  --bg: #030303;
  --text: #d8d5cf;
  --bright: #ece9e3;
  --muted: #5e5d5b;
  --field-border: rgba(216, 213, 207, .14);
  --field-border-focus: rgba(216, 213, 207, .45);
  --field-fill: rgba(255, 255, 255, .025);
  --button-bg: rgba(236, 233, 227, .9);

  /* One romantic script for every word on the site (name, titles, text, menu, form, footer) */
  --script: 'Imperial Script', cursive;
  --prose-font: var(--script);
  --body-font: var(--script);

  /* About, Contact intro and the menu share one size and brightness
     (large enough to read comfortably in a script font, faded like a whisper) */
  --text-size: clamp(32px, 3vw, 38px);
  /* Everything in the contact form matches the Contact paragraph size */
  --form-size: var(--prose-size);
  --text-color: rgba(216, 213, 207, .62);

  /* About and Contact text: larger, and lit like candlelight along each line.
     The fade repeats once per line, so the middle of every letter is bright
     and the long upper and lower flourishes fade away. */
  --prose-size: clamp(35px, 3.3vw, 44px);
  /* Soft, faded ink */
  --prose-color: rgba(226, 223, 217, .68);
  --prose-line: 1.6em;
  /* The same lighting as a mask, for the shimmering name */
  --letter-fade: linear-gradient(to bottom,
    rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .35) 30%, #000 47%,
    #000 66%, rgba(0, 0, 0, .35) 82%, rgba(0, 0, 0, .35) 100%);


  --pagepad: clamp(24px, 7vw, 96px);
  --focus-ring: 1px solid rgba(236, 233, 227, .7);
}

/* ---------- Base ---------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  /* This script sets words close together; open them up a little */
  word-spacing: .12em;
  /* No fake italics or bold on the script font */
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity .6s ease;
}
a:hover { opacity: .5; }

input, textarea, button, select { font: inherit; color: inherit; }

input::placeholder, textarea::placeholder { color: var(--text); opacity: .4; }

/* Ghost cursor; form fields keep the normal text cursor */
html, body, a, button, label, figure, figure * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' viewBox='0 0 28 32'%3E%3Cpath d='M5 15a9 9 0 0 1 18 0v13l-3-2.3-3 2.3-3-2.3-3 2.3-3-2.3-3 2.3z' fill='%23ecebe7' fill-opacity='.88' stroke='%230a0a0b' stroke-width='1.3' stroke-linejoin='round'/%3E%3Ccircle cx='11' cy='14' r='1.5' fill='%230a0a0b'/%3E%3Ccircle cx='17' cy='14' r='1.5' fill='%230a0a0b'/%3E%3C/svg%3E") 10 4, auto !important;
}
input, textarea { cursor: text; }
/* No ghost over an enlarged painting */
.lightbox, .lightbox * { cursor: default !important; }
.lightbox__close { cursor: pointer !important; }

/* Keyboard focus */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 4px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--bright);
  color: var(--bg);
  font-style: italic;
}
.skip-link:focus { top: 16px; }
.skip-link:hover { opacity: 1; }

/* ---------- Layout ---------- */

.site {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.content {
  position: relative;
  z-index: 1;
}

/* ---------- Atmosphere ---------- */

.fog {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  animation: breathe 14s ease-in-out infinite;
}

.fog__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.fog__blob--a {
  width: 70vw;
  height: 60vh;
  left: -15vw;
  top: -10vh;
  background: rgba(190, 192, 200, .035);
  animation: drift1 40s ease-in-out infinite;
}
.fog__blob--b {
  width: 60vw;
  height: 55vh;
  right: -20vw;
  bottom: -5vh;
  background: rgba(170, 172, 182, .03);
  animation: drift2 52s ease-in-out infinite;
}
.fog__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0, 0, 0, .7) 100%);
}

.halo {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(225, 225, 235, .10) 0%, rgba(225, 225, 235, .05) 30%, rgba(225, 225, 235, 0) 65%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate(-9999px, -9999px);
  transition: opacity 1.2s ease;
}
.halo:not(.is-enabled) { display: none; }

/* Soft light where a finger touches empty space */
.tap-light {
  position: fixed;
  z-index: 2;
  width: 160px;
  height: 160px;
  margin: -80px 0 0 -80px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(236, 233, 227, .22) 0%, rgba(225, 225, 235, .08) 35%, rgba(225, 225, 235, 0) 68%);
  mix-blend-mode: screen;
  animation: tap-light 1.6s ease-out forwards;
}

@keyframes drift1 {
  0%, 100% { transform: translate(-10%, -5%) scale(1); }
  50%      { transform: translate(8%, 6%) scale(1.15); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(6%, 4%) scale(1.1); }
  50%      { transform: translate(-8%, -6%) scale(.95); }
}
@keyframes breathe {
  0%, 100% { opacity: .85; }
  50%      { opacity: 1; }
}
@keyframes haunt {
  0%, 100% { opacity: .5; transform: translateY(0); filter: blur(.8px); }
  50%      { opacity: .95; transform: translateY(-8px); filter: blur(0); }
}
@keyframes tap-light {
  0%   { opacity: 0; transform: scale(.4); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.15); }
}
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ---------- Scroll reveal (only when JS is running) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(10px);
  transition: opacity 1.8s ease, transform 1.8s ease, filter 1.8s ease;
}
.js .reveal--hero { transition-duration: 2.2s; }
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* ---------- Nav ---------- */

.nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 28px var(--pagepad);
  font-family: var(--prose-font);
  font-size: var(--text-size);
  color: var(--text-color);
}

.nav__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
}
.nav__links a {
  display: inline-flex;
  align-items: center;
}
/* The page you're on */
.nav__links a[aria-current="page"] {
  color: rgba(236, 233, 227, .85);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  text-decoration-color: rgba(236, 233, 227, .35);
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(48px, 10vw, 140px) var(--pagepad) clamp(40px, 7vw, 96px);
  text-align: center;
}

.hero__name {
  margin: 0;
  font-family: var(--prose-font);
  font-weight: 400;
  font-size: clamp(42px, 12vw, 140px);
  line-height: 1.6;
  word-spacing: .12em;
  background: linear-gradient(100deg,
    rgba(220, 217, 211, .25) 0%,
    rgba(240, 238, 234, .95) 25%,
    rgba(220, 217, 211, .25) 50%,
    rgba(240, 238, 234, .95) 75%,
    rgba(220, 217, 211, .25) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  will-change: transform, opacity;
  animation: haunt 7s ease-in-out infinite, shimmer 14s linear infinite;
  /* Bright through the middle of the letters, the tall loops and tails fade */
  -webkit-mask-image: var(--letter-fade);
  mask-image: var(--letter-fade);
}

/* ---------- Section titles ---------- */

.script-title {
  margin: 0 0 12px;
  font-family: var(--script);
  font-weight: 400;
  /* Smaller than the name on phones, so the name stays the focus */
  font-size: clamp(30px, 8.2vw, 60px);
  line-height: 1.1;
  text-align: center;
  background: linear-gradient(100deg, rgba(236, 233, 227, .35), rgba(236, 233, 227, .8) 45%, rgba(236, 233, 227, .35));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: blur(.3px);
}
.script-title--tight { margin-bottom: 8px; }

/* ---------- About ---------- */

.about {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 64px) var(--pagepad) clamp(64px, 10vw, 140px);
  text-align: center;
}
.about p:not(.cta) {
  margin: 0;
  font-family: var(--prose-font);
  font-size: var(--prose-size);
  line-height: var(--prose-line);
  word-spacing: .12em;
  /* Bright middle of each line, faded loops above and below:
     the fade repeats once per line as a mask */
  color: var(--prose-color);
  -webkit-mask: var(--letter-fade) 0 0 / 100% var(--prose-line) repeat-y;
  mask: var(--letter-fade) 0 0 / 100% var(--prose-line) repeat-y;
  text-wrap: pretty;
}

.about p + p:not(.cta) { margin-top: 1em; }
/* A line that must not wrap; it shrinks a touch on the narrowest phones instead */
.one-line {
  white-space: nowrap;
  font-size: min(1em, 7.4vw);
}
.about .cta { margin-top: clamp(32px, 6vw, 56px); }

/* ---------- Gallery ---------- */

.gallery {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px, 7vw, 96px);
}

.gallery__grid {
  columns: 2 300px;
  column-gap: clamp(24px, 5vw, 72px);
}

.gallery__noscript { text-align: center; opacity: .7; }

/* Gallery page */
.gallery--page { padding-bottom: clamp(48px, 8vw, 112px); }
.page-title { padding-top: clamp(24px, 6vw, 72px); }
.gallery--page .page-title { margin-bottom: clamp(28px, 5vw, 56px); }

/* Home page: one featured painting, then a way into the gallery */
.gallery--featured { padding-bottom: clamp(64px, 10vw, 140px); }
.gallery__grid--featured {
  columns: 1;
  max-width: 460px;
  margin: 0 auto;
}

/* One or more buttons to other pages, stacked and centered */
.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0;
  text-align: center;
}
/* At the end of the Gallery and Contact pages */
.cta--end { margin-top: clamp(40px, 8vw, 96px); }
/* Stacked buttons share one width so they line up */
.cta__link { min-width: 11em; justify-content: center; }
.cta__link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 40px;
  border: 1px solid var(--field-border-focus);
  border-radius: 999px;
  font-size: 19px;
  font-style: italic;
  color: var(--bright);
  box-shadow: 0 0 40px rgba(236, 233, 227, .06);
  transition: background .8s ease, box-shadow .8s ease;
}
.cta__link:hover {
  opacity: 1;
  background: rgba(236, 233, 227, .06);
  box-shadow: 0 0 60px rgba(236, 233, 227, .16);
}

.piece {
  position: relative;
  margin: 0 0 clamp(28px, 5vw, 72px);
  break-inside: avoid;
  border-radius: 18px;
  overflow: hidden;
  /* Keeps rounded corners clipping the scaled image in Safari */
  isolation: isolate;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 60px -10px rgba(200, 200, 210, .03);
  transition: box-shadow 1s ease;
}
.js .piece.reveal {
  transition: opacity 1.6s ease, transform 1.6s ease, filter 1.6s ease, box-shadow 1s ease;
}
.piece:focus-visible { outline-offset: 6px; border-radius: 18px; }

.piece__art {
  position: relative;
  transition: transform 1.4s ease;
}

.piece__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #1c1c1f, #121214);
  font-family: var(--body-font);
  font-size: 14px;
  color: var(--muted);
}

/* The image sits over the placeholder until it loads, then takes its natural ratio */
.piece__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.piece.has-image .piece__placeholder { display: none; }
.piece.has-image .piece__img {
  position: static;
  display: block;
  height: auto;
  opacity: 1;
}

/* Copyright mark, bottom-right of every painting */
.watermark {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  font-family: var(--script);
  font-size: 19px;
  line-height: 1;
  color: rgba(236, 233, 227, .55);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
/* The caption covers the bottom of the tile, so the mark moves out of its way */
.piece:focus-visible .watermark { opacity: 0; }
@media (hover: hover) {
  .piece:hover .watermark { opacity: 0; }
}
.watermark { transition: opacity .9s ease; }

/* Stops long-press "Save image" on phones */
.piece__img,
.lightbox__img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

.piece__caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  padding: 28px;
  background: linear-gradient(to top, rgba(8, 8, 9, .88), rgba(8, 8, 9, 0) 55%);
  opacity: 0;
  transition: opacity .9s ease;
}
.piece__title {
  font-size: 24px;
  font-style: italic;
  color: var(--bright);
}
.piece__meta {
  font-size: 16px;
  opacity: .75;
}

/* Details: hover (mouse) or keyboard focus; a tap enlarges instead */
.piece:focus-visible .piece__caption { opacity: 1; }
.piece:focus-visible .piece__art { transform: scale(1.03); }
.piece:focus-visible {
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 60px -10px rgba(200, 200, 210, .12);
}

@media (hover: hover) {
  .piece:hover .piece__caption { opacity: 1; }
  .piece:hover .piece__art { transform: scale(1.03); }
  .piece:hover {
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 60px -10px rgba(200, 200, 210, .12);
  }
}

/* ---------- Lightbox (enlarged painting) ---------- */

.lightbox-open { overflow: hidden; }
/* No halo or tap light over an enlarged painting */
.lightbox-open .halo,
.lightbox-open .tap-light { display: none !important; }

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}
.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lightbox-in .5s ease;
}
.lightbox::backdrop {
  background: rgba(2, 2, 2, .95);
}
.lightbox:focus-visible { outline: none; }

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 64px 16px 32px;
  max-width: 100%;
  max-height: 100%;
}

.lightbox__art { position: relative; }
.lightbox__art .watermark { font-size: clamp(19px, 3vw, 29px); right: 18px; bottom: 14px; }

.lightbox__img {
  display: block;
  max-width: min(100%, 1400px);
  max-height: calc(100dvh - 180px);
  object-fit: contain;
  border-radius: 8px;
}
.lightbox__placeholder {
  width: min(88vw, calc((100dvh - 180px) * .75), 900px);
  border-radius: 8px;
}

.lightbox__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.lightbox__title {
  font-size: 24px;
  font-style: italic;
  color: var(--bright);
}
.lightbox__meta {
  font-size: 16px;
  opacity: .75;
}
.lightbox__availability {
  margin-top: 4px;
  font-size: 16px;
  font-style: italic;
  color: var(--bright);
}

.lightbox__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 32px;
  line-height: 1;
  opacity: .8;
  transition: opacity .6s ease;
}
.lightbox__close:hover { opacity: 1; }

@keyframes lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Forms ---------- */

.form-section {
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(40px, 9vw, 128px) var(--pagepad) clamp(64px, 10vw, 140px);
}
.form-section--last { padding-bottom: clamp(80px, 12vw, 160px); }

.form-section__intro {
  margin-bottom: 32px;
  text-align: center;
}
.form-section__intro p,
.detail__text {
  margin: 0;
  font-family: var(--prose-font);
  font-size: var(--prose-size);
  line-height: var(--prose-line);
  word-spacing: .12em;
  /* Bright middle of each line, faded loops above and below:
     the fade repeats once per line as a mask */
  color: var(--prose-color);
  -webkit-mask: var(--letter-fade) 0 0 / 100% var(--prose-line) repeat-y;
  mask: var(--letter-fade) 0 0 / 100% var(--prose-line) repeat-y;
  text-wrap: pretty;
}
.form-section__intro p + p { margin-top: 1em; }
.detail__text { text-align: center; }

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form input,
.form textarea,
.form select {
  width: 100%;
  border: 1px solid var(--field-border);
  border-radius: 999px;
  background: var(--field-fill);
  padding: 14px 22px;
  font-size: var(--form-size);
  outline: none;
  transition: border-color .6s ease, box-shadow .6s ease;
}
.form textarea {
  border-radius: 24px;
  padding: 16px 22px;
  resize: vertical;
}
/* Painting picker: a pill like the other fields, with a thin arrow */
.form select {
  appearance: none;
  padding-right: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23d8d5cf' stroke-width='1.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 22px center;
}
.form select:invalid,
.form select:has(option[value=""]:checked) { color: rgba(216, 213, 207, .4); }
.form option { background: var(--bg); color: var(--text); }

.form input:focus,
.form textarea:focus,
.form select:focus {
  border-color: var(--field-border-focus);
}
/* A soft extra ring so keyboard users can find the field */
.form input:focus-visible,
.form textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(236, 233, 227, .08);
}

.form button {
  align-self: center;
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  padding: 14px 44px;
  background: var(--button-bg);
  color: var(--bg);
  font-size: var(--form-size);
  font-style: italic;
  box-shadow: 0 0 40px rgba(236, 233, 227, .12);
  transition: box-shadow .8s ease, background .8s ease;
}
.form button:hover {
  background: var(--bright);
  box-shadow: 0 0 60px rgba(236, 233, 227, .28);
}
.form button:disabled { opacity: .6; }
.form button:focus-visible { outline-offset: 4px; border-radius: 999px; }

/* Groups of fields (enquiry type, commission details) */
.form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px !important;
}
.detail[hidden] { display: none; }

.form__legend {
  padding: 0;
  margin-bottom: 12px;
  font-size: var(--form-size);
  font-style: italic;
  opacity: .8;
}
.choice { margin-top: 6px !important; }
.choice .form__legend,
.commission .form__legend { width: 100%; text-align: center; }

.choice__options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.choice__pill { position: relative; }
.choice__pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice__pill span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--field-border);
  border-radius: 999px;
  background: var(--field-fill);
  font-size: var(--form-size);
  transition: border-color .6s ease, background .6s ease, color .6s ease;
}
.choice__pill:hover span { border-color: var(--field-border-focus); }
.choice__pill input:checked + span {
  border-color: transparent;
  background: var(--button-bg);
  color: var(--bg);
}
.choice__pill input:focus-visible + span { outline: var(--focus-ring); outline-offset: 3px; }

/* Photo upload */
.upload__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.upload__button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px dashed var(--field-border-focus);
  border-radius: 999px;
  font-size: var(--form-size);
  font-style: italic;
  transition: background .6s ease;
}
.upload__button:hover { background: rgba(236, 233, 227, .06); }
.upload:focus-within .upload__button { outline: var(--focus-ring); outline-offset: 3px; }
.upload__name {
  font-size: var(--form-size);
  opacity: .8;
  overflow-wrap: anywhere;
}
.upload__note {
  margin: 8px 0 0;
  font-size: var(--form-size);
  line-height: var(--prose-line);
  text-align: center;
  color: var(--prose-color);
  -webkit-mask: var(--letter-fade) 0 0 / 100% var(--prose-line) repeat-y;
  mask: var(--letter-fade) 0 0 / 100% var(--prose-line) repeat-y;
}
.upload-off { margin: 0; }

/* Discount questions: centered, with a quiet switch beneath instead of a checkbox */
.toggle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-top: 6px;
  font-size: var(--form-size);
}
/* Faded like the rest of the Contact text, loops softer than the letters */
.toggle__text {
  line-height: var(--prose-line);
  color: var(--prose-color);
  -webkit-mask: var(--letter-fade) 0 0 / 100% var(--prose-line) repeat-y;
  mask: var(--letter-fade) 0 0 / 100% var(--prose-line) repeat-y;
}
/* The discount itself, on its own line and drawn a little bolder */
.toggle__offer {
  display: block;
  font-weight: inherit;
  -webkit-text-stroke: .3px currentColor;
}
.toggle__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle__switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  border: 1px solid var(--field-border-focus);
  border-radius: 999px;
  background: var(--field-fill);
  transition: background .6s ease, border-color .6s ease;
}
.toggle__switch::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(216, 213, 207, .55);
  transition: transform .6s ease, background .6s ease;
}
.toggle__input:checked + .toggle__switch {
  border-color: transparent;
  background: var(--button-bg);
}
.toggle__input:checked + .toggle__switch::after {
  transform: translateX(22px);
  background: var(--bg);
}
.toggle__input:focus-visible + .toggle__switch { outline: var(--focus-ring); outline-offset: 3px; }

.form__status {
  margin: 0;
  min-height: 1em;
  text-align: center;
  font-size: var(--form-size);
  font-style: italic;
}
.form__status:empty { display: none; }

.form-thanks {
  margin: 0;
  text-align: center;
  font-size: var(--form-size);
  font-style: italic;
  color: var(--bright);
}

/* ---------- Footer ---------- */

.footer__icon { display: inline-flex; align-items: center; }
.footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 32px;
  padding: 32px var(--pagepad) 40px;
  font-size: 16px;
  align-items: center;
  opacity: .5;
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  /* Four links and the icon on one line: slightly smaller, centered, tighter */
  .nav {
    justify-content: center;
    padding: 16px 14px;
    font-size: 28px;
  }
  /* Tighter gaps so the Instagram icon stays on the same line as the links */
  .nav__links { gap: 0 12px; }
  .footer { gap: 4px 20px; }
  /* Lighter fog on phones, which struggle with very large blurs */
  .fog__blob { filter: blur(48px); }
  /* 44px tap targets */
  .nav__links a,
  .footer a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .nav__icon { min-width: 44px; justify-content: center; }
}

/* ---------- Wide screens: text and featured painting fill the middle half ---------- */

@media (min-width: 1024px) {
  .about,
  .form-section {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }
  .about p:not(.cta),
  .form-section__intro {
    width: 50vw;
    margin-left: auto;
    margin-right: auto;
  }
  .form {
    max-width: 560px;
    margin: 0 auto;
  }
  .gallery__grid--featured { max-width: 50vw; }
}

/* ---------- Reduced motion ---------- */

/* ---------- Small text in the script font ---------- */

/* The script has a small x-height, so small text is scaled up to read clearly */
.footer,
.cta,
.piece__caption,
.lightbox__caption,
.piece__placeholder { font-size-adjust: .5; }

/* ---------- Ghostly fade: words breathe in and out like the name ---------- */

/* Everything except the menu and the form fields */
.script-title,
.about p:not(.cta),
.form-section__intro p,
.detail__text,
.toggle__text,
.form__legend,
.choice__pill span,
.form button,
.cta__link,
.footer,
.watermark,
.piece__caption,
.lightbox__caption {
  animation: ghost 7s ease-in-out infinite;
}
@keyframes ghost {
  0%, 100% { filter: opacity(.5); }
  50%      { filter: opacity(1); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fog,
  .fog__blob,
  .hero__name { animation: none; }
  .hero__name { opacity: .9; filter: none; }
  .js .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
  .halo,
  .tap-light { display: none !important; }
  .lightbox[open] { animation: none; }
  .script-title,
  .about p:not(.cta),
  .form-section__intro p,
  .detail__text,
  .toggle__text,
  .form__legend,
  .choice__pill span,
  .form button,
  .cta__link,
  .footer,
  .watermark,
  .piece__caption,
  .lightbox__caption { animation: none; }
}

/* ---------- Windows high-contrast mode ---------- */

@media (forced-colors: active) {
  .hero__name,
  .script-title,
  .about p:not(.cta),
  .form-section__intro p,
  .detail__text {
    background: none;
    color: CanvasText;
    filter: none;
    -webkit-mask-image: none;
    mask-image: none;
    -webkit-mask: none;
    mask: none;
  }
}
