/* =========================================================
   Made by Gunther — design system
   ========================================================= */

:root {
  /* colour system */
  --color-offwhite: #FAF8F5;
  --color-warm-grey: #8C8680;
  --color-warm-grey-light: #E9E5E0;
  --color-ink: #2B2926;
  --color-teal: #2E7D74;
  --color-orange: #C4571F;

  /* surfaces */
  --color-surface: var(--color-offwhite);
  --color-surface-alt: var(--color-warm-grey-light);
  --color-border: #DCD6CE;

  /* typography */
  --font-heading: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  /* layout */
  --container-max: 72rem;
  --container-narrow: 40rem;
  --radius: 2px;

  color-scheme: light;
}

/* =========================================================
   Reset
   ========================================================= */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-orange);
}

button {
  font-family: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  color: var(--color-ink);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: 0.01em;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-style: italic;
  font-weight: 500;
  color: var(--color-warm-grey);
}

p {
  margin: 0 0 var(--space-2);
  max-width: 68ch;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* focus visibility — teal ring everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-ink);
  color: var(--color-offwhite);
  padding: var(--space-1) var(--space-2);
  z-index: 200;
}

.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
}

/* =========================================================
   Header / Nav
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--color-border);
}

.site-nav {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-1) var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.site-nav__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--color-ink);
  text-decoration: none;
}

.site-nav__brand img {
  height: 1.35rem;
  width: auto;
  display: block;
  transition: opacity 0.2s ease;
}

.site-nav__brand:hover img {
  opacity: 0.62;
}

.site-nav__links {
  display: flex;
  gap: var(--space-3);
}

.site-nav__links a {
  color: var(--color-ink);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: var(--space-1) 0;
  border-bottom: 2px solid transparent;
}

.site-nav__links a:hover,
.site-nav__links a:focus-visible {
  color: var(--color-teal);
  border-bottom-color: var(--color-teal);
}

/* Hamburger button — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
  position: relative;
  z-index: 120;
  width: 2.75rem;
  height: 2.75rem;
  margin: -0.5rem -0.5rem -0.5rem 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-ink);
}

.nav-toggle__box {
  display: block;
  position: relative;
  width: 1.5rem;
  height: 1rem;
  margin: 0 auto;
}

.nav-toggle__bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}

.nav-toggle__bar:nth-child(1) { top: 0; }
.nav-toggle__bar:nth-child(2) { top: calc(50% - 1px); }
.nav-toggle__bar:nth-child(3) { top: calc(100% - 2px); }

/* Toggle → X when the menu is open */
.nav-open .nav-toggle__bar:nth-child(1) {
  top: calc(50% - 1px);
  transform: rotate(45deg);
}
.nav-open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}
.nav-open .nav-toggle__bar:nth-child(3) {
  top: calc(50% - 1px);
  transform: rotate(-45deg);
}

@media (max-width: 48rem) {
  .nav-toggle {
    display: block;
  }

  /* Flyout panel — slides in from the right, vanishes on link tap */
  .site-nav__links {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 110;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-4);
    width: min(78vw, 320px);
    height: 100dvh;
    padding: var(--space-5) var(--space-4);
    background: rgba(250, 248, 245, 0.98);
    backdrop-filter: saturate(140%) blur(10px);
    box-shadow: -18px 0 50px rgba(43, 41, 38, 0.18);
    transform: translateX(105%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.3s ease, visibility 0s linear 0.42s;
  }

  .nav-open .site-nav__links {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.3s ease;
  }

  .site-nav__links a {
    font-size: 1.35rem;
    font-family: var(--font-heading);
    text-transform: none;
    letter-spacing: 0.01em;
  }

  /* Dim backdrop behind the panel */
  .nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 105;
    background: rgba(43, 41, 38, 0.38);
    animation: nav-fade 0.3s ease both;
  }
}

@keyframes nav-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Lock background scroll while the flyout is open */
body.nav-lock {
  overflow: hidden;
}

@media (max-width: 30rem) {
  .site-nav__brand img {
    height: 1.15rem;
  }
  .site-nav {
    padding: var(--space-1) var(--space-1);
  }
}

/* =========================================================
   Hero
   ========================================================= */

#hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-offwhite);
  text-align: center;
}

#hero-canvas-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#hero-canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#hero-fallback {
  position: relative;
  z-index: 1;
}

#hero-fallback:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

#hero-fallback img {
  width: min(60vw, 320px);
  height: auto;
}

.hero-tagline {
  position: absolute;
  z-index: 1;
  top: 74%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: max-content;
  max-width: 90vw;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--color-offwhite);
  letter-spacing: 0.02em;
  text-align: center;
  text-shadow: 0 1px 12px rgba(43, 41, 38, 0.55), 0 0 2px rgba(43, 41, 38, 0.4);
}

.hero-scroll-cue {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: var(--color-offwhite);
  font-size: 1.5rem;
  text-decoration: none;
  text-shadow: 0 1px 10px rgba(43, 41, 38, 0.5);
  animation: hero-bounce 2.2s ease-in-out infinite;
}

@keyframes hero-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* =========================================================
   Sections
   ========================================================= */

.section {
  padding: var(--space-6) var(--space-2);
}

.section--muted {
  background: var(--color-surface-alt);
}

.section__inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.section__inner--narrow {
  max-width: var(--container-narrow);
}

.section h2 {
  margin-bottom: var(--space-4);
}

.section h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin-top: var(--space-1);
  background: var(--color-teal);
}

/* =========================================================
   Artwork grid (masonry via columns)
   ========================================================= */

.artwork-grid {
  column-count: 1;
  column-gap: var(--space-2);
}

@media (min-width: 40rem) {
  .artwork-grid {
    column-count: 2;
  }
}

@media (min-width: 64rem) {
  .artwork-grid {
    column-count: 3;
  }
}

.artwork-item {
  display: block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: var(--space-2);
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  line-height: 0;
}

.artwork-item img {
  width: 100%;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.artwork-item:hover img,
.artwork-item:focus-visible img {
  opacity: 0.88;
  transform: translateY(-2px);
}

/* =========================================================
   Exhibitions strip
   ========================================================= */

.exhibitions-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-3);
  max-width: 48rem;
}

.exhibitions-strip__item picture {
  overflow: hidden;
  border-radius: var(--radius);
}

.exhibitions-strip__item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.exhibitions-strip__item p {
  margin-top: var(--space-1);
  font-size: 0.85rem;
  color: var(--color-warm-grey);
  text-align: center;
}

.exhibitions-strip__item p span {
  display: block;
  font-size: 0.75rem;
}

/* =========================================================
   Bio
   ========================================================= */

.section__inner--split {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 48rem) {
  .section__inner--split {
    grid-template-columns: 3fr 2fr;
    align-items: start;
  }
  .section__inner--split .bio-portrait {
    order: 2;
  }
}

.bio-lede {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--color-teal);
}

.bio-portrait {
  margin: 0;
}

.bio-portrait img {
  width: 100%;
  border-radius: var(--radius);
}

/* =========================================================
   Studio
   ========================================================= */

.studio-intro {
  color: var(--color-warm-grey);
  margin-bottom: var(--space-4);
}

.studio-grid {
  display: grid;
  gap: var(--space-2);
}

@media (min-width: 48rem) {
  .studio-grid {
    grid-template-columns: 3fr 2fr;
    align-items: center;
  }
}

.studio-grid__item {
  margin: 0;
}

.studio-grid__item img {
  width: 100%;
  border-radius: var(--radius);
}

/* =========================================================
   Contact form
   ========================================================= */

.contact-intro {
  color: var(--color-warm-grey);
  margin-bottom: var(--space-4);
}

.form-field {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-3);
}

.form-field label {
  font-size: 0.9rem;
  margin-bottom: var(--space-1);
  color: var(--color-ink);
}

.form-field input,
.form-field textarea {
  font: inherit;
  padding: 0.65em 0.8em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-ink);
}

.form-field input:invalid[aria-invalid="true"],
.form-field textarea:invalid[aria-invalid="true"] {
  border-color: var(--color-orange);
}

.form-error {
  display: block;
  min-height: 1.2em;
  margin-top: var(--space-1);
  font-size: 0.82rem;
  color: var(--color-orange);
}

.btn-cta {
  display: inline-block;
  padding: 0.8em 2em;
  background: var(--color-orange);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-cta:hover {
  background: #a84a19;
}

.btn-cta:disabled {
  background: var(--color-warm-grey);
  cursor: not-allowed;
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  padding: var(--space-3) var(--space-2) var(--space-4);
  text-align: center;
  color: var(--color-warm-grey);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
}

.site-footer p {
  margin: 0.2em auto;
  max-width: none;
}

/* =========================================================
   Lightbox
   ========================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43, 41, 38, 0.97);
  padding: var(--space-2);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__stage {
  max-width: min(92vw, 62rem);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.lightbox__stage img {
  max-height: 78vh;
  width: auto;
  max-width: 100%;
  border-radius: var(--radius);
}

.lightbox__caption {
  color: var(--color-offwhite);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.1rem;
  text-align: center;
  max-width: none;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: none;
  border: none;
  color: var(--color-offwhite);
  cursor: pointer;
  line-height: 1;
}

.lightbox__close {
  top: var(--space-2);
  right: var(--space-2);
  font-size: 2rem;
  padding: var(--space-1);
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  padding: var(--space-1) var(--space-2);
}

.lightbox__prev {
  left: 0;
}

.lightbox__next {
  right: 0;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover,
.lightbox__close:focus-visible,
.lightbox__prev:focus-visible,
.lightbox__next:focus-visible {
  color: var(--color-orange);
}
