:root {
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --font-logo: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --color-text: #2a2a2a;
  --color-muted: #6b6560;
  --color-accent: #447c97;
  --color-accent-light: #5d9ab5;
  --color-border: #e4ddd4;
  --color-dark: #1e2422;
  --font-display: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
  --page-gutter: clamp(2rem, 5vw, 4rem);
  --nav-height: 84px;
  --radius: 4px;
  --shadow: 0 4px 24px rgba(30, 36, 34, 0.08);
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
}

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

body.modal-open {
  overflow: hidden;
}

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

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-light);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { margin: 0 0 1em; }

.lead {
  font-size: 1.125rem;
  color: var(--color-muted);
  max-width: 42rem;
}

.container {
  width: min(100% - (var(--page-gutter) * 2), var(--max-width));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: 1rem;
}

.site-logo {
  font-family: var(--font-logo);
  font-size: 2rem;
  font-weight: 500;
  color: var(--color-dark);
  text-decoration: none;
  letter-spacing: 0;
}

.site-logo:hover {
  color: var(--color-accent);
}

@media (min-width: 768px) {
  .site-logo {
    font-size: 2.25rem;
  }
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-dark);
  transition: var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  display: none;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.site-nav.is-open {
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 1rem 0;
}

.site-nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-accent);
  background: #f5f5f5;
}

@media (min-width: 768px) {
  .nav-toggle { display: none; }

  .site-nav {
    display: block;
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .site-nav ul {
    display: flex;
    gap: 0.25rem;
    padding: 0;
  }

  .site-nav a {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    text-transform: none;
    letter-spacing: 0.02em;
  }

  .site-nav a:hover,
  .site-nav a[aria-current="page"] {
    color: var(--color-accent);
    background: transparent;
  }
}

.paypal-cart-nav {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.paypal-cart-nav paypal-cart-button {
  display: block;
  min-width: 44px;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(70vh - 155px);
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(30, 36, 34, 0.65) 0%, rgba(30, 36, 34, 0.15) 60%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 3rem 0 4rem;
  color: #fff;
}

.hero-content h1 {
  margin-bottom: 0.75rem;
}

.hero-content .lead {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 500;
}

.hero--short {
  min-height: calc(40vh - 130px);
  align-items: flex-end;
}

.hero--short .hero-content {
  padding: 0 0 1.25rem;
}

.hero--shop {
  background-image: image-set(
    url("../images/headerbar6.webp") type("image/webp"),
    url("../images/headerbar6.jpg") type("image/jpeg")
  );
}

.hero--home {
  background-image: image-set(
    url("../images/headerbarhome.webp") type("image/webp"),
    url("../images/headerbarhome.jpg") type("image/jpeg")
  );
}

.hero--portfolio {
  background-image: image-set(
    url("../images/headerbar2.webp") type("image/webp"),
    url("../images/headerbar2.jpg") type("image/jpeg")
  );
}

.hero--events {
  background-image: image-set(
    url("../images/headerbar3.webp") type("image/webp"),
    url("../images/headerbar3.jpg") type("image/jpeg")
  );
}

.hero--about {
  background-image: image-set(
    url("../images/headerbar4.webp") type("image/webp"),
    url("../images/headerbar4.jpg") type("image/jpeg")
  );
}

.hero--contact {
  background-image: image-set(
    url("../images/headerbar5.webp") type("image/webp"),
    url("../images/headerbar5.jpg") type("image/jpeg")
  );
}

@media (max-width: 767px) {
  .hero--shop {
    background-image: image-set(
      url("../images/headerbar6sm.webp") type("image/webp"),
      url("../images/headerbar6sm.jpg") type("image/jpeg")
    );
  }
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.section-header p {
  color: var(--color-muted);
  max-width: 36rem;
  margin-inline: auto;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
}

.card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-border);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.card-title {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0;
  text-align: center;
  color: var(--color-text);
}

/* Portfolio year grid */
.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.year-card {
  display: block;
  text-decoration: none;
  color: var(--color-text);
  border-radius: var(--radius);
  overflow: hidden;
}

.year-card-image {
  aspect-ratio: 1;
  overflow: hidden;
}

.year-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.year-card-label {
  padding: 1rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

/* Gallery */
.gallery-header {
  padding: 2rem 0 1rem;
  text-align: center;
}

.gallery-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--color-muted);
  text-decoration: none;
}

.gallery-back:hover {
  color: var(--color-accent);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  padding-bottom: 4rem;
}

.gallery-item {
  cursor: pointer;
  border: none;
  padding: 0;
  background: none;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.18);
  transition: background var(--transition);
}

.lightbox-close:hover {
  background: #fff;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.lightbox-nav:hover {
  background: #fff;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-image-wrap {
  max-width: 90vw;
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  touch-action: pan-y;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 1rem 2rem;
  max-width: 600px;
  font-size: 0.95rem;
}

.lightbox-counter {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

@media (max-width: 720px) {
  .lightbox {
    padding: calc(env(safe-area-inset-top) + 4.25rem) 0.75rem calc(env(safe-area-inset-bottom) + 2rem);
    justify-content: center;
  }

  .lightbox-close {
    top: max(0.75rem, env(safe-area-inset-top));
    right: max(0.75rem, env(safe-area-inset-right));
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.94);
  }

  .lightbox-nav {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
  }

  .lightbox-prev {
    left: max(0.5rem, env(safe-area-inset-left));
  }

  .lightbox-next {
    right: max(0.5rem, env(safe-area-inset-right));
  }

  .lightbox-image-wrap,
  .lightbox-image-wrap img {
    max-width: calc(100vw - 1.5rem);
    max-height: 64dvh;
  }

  .lightbox-caption {
    padding: 0.875rem 1rem 0;
    max-height: 5.5rem;
    overflow: auto;
  }
}

/* Content pages */
.content-block {
  max-width: 42rem;
  margin-inline: auto;
}

.content-block.wide {
  max-width: 56rem;
}

.page-body-align {
  margin-left: max(var(--page-gutter), calc((100% - var(--max-width)) / 2));
  margin-right: auto;
}

.prose h3 {
  margin-top: 2rem;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.75rem;
}

.prose li a {
  font-weight: 500;
}

.award-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.award-logos img {
  max-height: 60px;
  width: auto;
  opacity: 0.85;
}

/* Contact */
.contact-grid {
  display: grid;
  gap: 3rem;
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.contact-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: var(--color-surface);
  margin-bottom: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.contact-form button {
  padding: 0.85rem 2rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition);
}

.contact-form button:hover {
  background: var(--color-accent-light);
}

.contact-info a {
  font-size: 1.125rem;
  font-weight: 500;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: border-color var(--transition), transform var(--transition);
}

.social-links a:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.social-links img {
  width: 22px;
  height: 22px;
}

/* Shop */
.shop-intro {
  max-width: 42rem;
  margin-bottom: 2rem;
  color: var(--color-muted);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  padding-bottom: 4rem;
}

.shop-product-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.shop-product-image-button {
  width: 100%;
  display: block;
  border: 0;
  padding: 0;
  background: #f5f3f0;
  cursor: pointer;
}

.shop-product-image-button:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: -3px;
}

.shop-product-image-button img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.shop-product-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem;
}

.shop-product-content h3 {
  margin: 0;
  font-size: 1.08rem;
}

.shop-product-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.shop-product-meta strong {
  color: var(--color-text);
  font-weight: 600;
  text-align: right;
}

.shop-details-button {
  width: 100%;
  min-height: 44px;
  margin-top: auto;
  border: 0;
  border-radius: var(--radius);
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.shop-details-button:hover {
  background: var(--color-accent-light);
}

.shop-details-button--disabled,
.shop-details-button:disabled {
  cursor: not-allowed;
  background: var(--color-accent);
  color: #fff;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2.25rem);
  background: rgba(30, 36, 34, 0);
  opacity: 0;
  pointer-events: none;
  transition: background 180ms ease, opacity 180ms ease;
}

.product-modal.open {
  background: rgba(30, 36, 34, 0.58);
  opacity: 1;
  pointer-events: auto;
}

.product-modal-panel {
  position: relative;
  width: min(900px, 100%);
  max-height: min(760px, calc(100vh - 2rem));
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1fr);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: 0 18px 56px rgba(30, 36, 34, 0.22);
  transform: translateY(14px) scale(0.98);
  transition: transform 180ms ease;
}

.product-modal.open .product-modal-panel {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  z-index: 1;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-dark);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

.product-modal-media {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: clamp(1rem, 2vw, 1.5rem);
  background: #f5f3f0;
}

.product-modal-media img {
  width: 100%;
  max-height: calc(100vh - 7rem);
  object-fit: contain;
  border-radius: var(--radius);
}

.product-modal-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.product-modal-content span {
  color: var(--color-accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-modal-content h2 {
  margin: 0.5rem 3rem 0.75rem 0;
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  letter-spacing: 0;
}

.product-modal-content strong {
  font-size: 1.2rem;
}

.product-modal-content p {
  margin: 1.25rem 0 1.75rem;
  color: var(--color-muted);
}

.modal-actions {
  margin-top: auto;
}

.modal-paypal-action {
  min-height: 128px;
}

.product-modal.paypal-product-modal .product-modal-panel {
  width: min(430px, 100%);
  grid-template-columns: 1fr;
  overflow: auto;
}

.product-modal.paypal-product-modal .product-modal-media {
  display: none;
}

.product-modal.paypal-product-modal .product-modal-content {
  overflow: visible;
  padding: clamp(1.25rem, 4vw, 1.75rem);
}

.product-modal.paypal-product-modal .product-modal-content h2 {
  font-size: clamp(1.7rem, 5vw, 2.35rem);
}

.product-modal.paypal-product-modal .modal-paypal-action {
  min-height: 360px;
}

@media (max-width: 720px) {
  .shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .shop-product-content {
    padding: 0.875rem;
  }

  .shop-product-meta {
    display: block;
  }

  .shop-product-meta strong {
    display: block;
    margin-top: 0.25rem;
    text-align: left;
  }

  .product-modal {
    align-items: stretch;
    padding: 0;
  }

  .product-modal-panel {
    width: 100%;
    max-height: 100vh;
    grid-template-columns: 1fr;
    overflow-y: auto;
    border-radius: 0;
  }

  .product-modal-media img {
    max-height: 45vh;
  }
}

/* CV download */
.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-accent);
  color: #fff !important;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 2rem;
  transition: background var(--transition);
}

.cv-download:hover {
  background: var(--color-accent-light);
  color: #fff;
}

/* Footer */
.site-footer {
  background: var(--color-dark);
  color: rgba(255, 255, 255, 0.75);
  padding: 2.5rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: background var(--transition);
}

.footer-social a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.footer-social img {
  width: 20px;
  height: 20px;
  filter: invert(1);
}

.footer-copy {
  font-size: 0.875rem;
  margin: 0;
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.honeypot {
  position: absolute;
  left: -9999px;
}
