* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Alignment variables */
:root {
  --page-max-width: 1300px;
  --page-pad-x: 56px;
  --header-right-adjust: 32px;
  /* Title typography */
  --site-title-size: 2.06rem;
  /* 1.2x previous 1.72rem */
  /* refined size */
  --site-title-spacing: 0.045em;
  /* minimal slim tracking */
  --site-title-weight: 500;
  /* medium weight for clean look */
  /* Nav typography */
  --nav-link-size: 0.94rem;
  --nav-link-spacing: 0.04em;
  --nav-gap: 60px;
  /* Layout spacers */
  --header-spacer-height: 86px;
  --header-pad-top: 26px;
  --header-pad-bottom: 8px;
  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-title: 'Plus Jakarta Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-display-slim: 'Plus Jakarta Sans', var(--font-sans);
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: #333;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* Prevent iOS Safari bounce */
  position: relative;
  overflow-x: hidden;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: var(--header-pad-top) 0 var(--header-pad-bottom);
  background: #fff;
  z-index: 300;
  border: 0;
  box-sizing: border-box;
}

.site-header-inner {
  width: 100%;
  max-width: var(--page-max-width);
  padding-left: var(--page-pad-x);
  padding-right: var(--page-pad-x);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  box-sizing: border-box;
}

/* Hamburger button */
.nav-toggle {
  position: relative;
  align-self: flex-end;
  margin-left: auto;
  width: 30px;
  /* slim */
  height: var(--site-title-size);
  background: transparent;
  border: 0;
  padding: 0;
  display: none;
  cursor: pointer;
  z-index: 500;
}

/* Thin 1px bars center-aligned within hamburger button */
.nav-toggle span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: #111;
  border-radius: 0;
  transition: .32s ease;
}

/* Center the 3 lines with 8px gaps between them */
.nav-toggle span:nth-child(1) {
  top: calc(50% - 8px);
}

.nav-toggle span:nth-child(2) {
  top: calc(50% - 0.5px);
}

.nav-toggle span:nth-child(3) {
  top: calc(50% + 7px);
}

/* Open (X) state: move all bars to center and rotate */
.nav-toggle.open span:nth-child(1) {
  top: calc(50% - 0.5px);
  transform: rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  top: calc(50% - 0.5px);
  transform: rotate(-45deg);
}

.site-title {
  margin: 0;
  font: var(--site-title-weight) var(--site-title-size)/1.04 var(--font-title);
  letter-spacing: var(--site-title-spacing);
  text-transform: uppercase;
  color: #111;
  -webkit-font-smoothing: antialiased;
}

.site-title-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}

.site-title-link:hover {
  opacity: .75;
}

.site-nav {
  display: flex;
  gap: var(--nav-gap);
  flex-wrap: nowrap;
}

.nav-link {
  position: relative;
  font: 500 var(--nav-link-size)/1.12 'Raleway', 'Plus Jakarta Sans', var(--font-sans);
  letter-spacing: 0.03em;
  text-decoration: none;
  color: #555;
  padding: 4px 0 8px;
  transition: color .25s ease;
  text-transform: uppercase;
}

.nav-link:hover,
.nav-link.active {
  color: #111;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: #222;
  transition: width .35s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #222;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.site-header.is-scrolled {
  box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
}

/* Final title font: IM Fell English SC */
.site-title {
  font-family: 'IM Fell English SC', serif;
  font-weight: 400;
  font-size: var(--site-title-size);
  line-height: 1.07;
  letter-spacing: 0.045em;
  margin: 0;
}

/* (navigation font variants & comparison panel removed after final selection) */

/* (font comparison panel styles removed) */

@media (max-width:900px) {
  .site-header {
    padding: 28px 0 20px;
  }

  .site-header-inner {
    padding-left: 40px;
    padding-right: 40px;
  }

  .site-nav {
    gap: 44px;
  }
}

@media (max-width:640px) {
  .site-header {
    padding: 20px 0 16px;
  }

  /* Center-align hamburger with title on mobile */
  .site-header-inner {
    padding-left: 26px;
    padding-right: 26px;
    flex-direction: row;
    align-items: center;
  }

  .site-title {
    font-size: clamp(1.34rem, 6.0vw, 1.78rem);
    line-height: 1;
    letter-spacing: 0.075em;
    margin: 0;
  }

  /* Hamburger matches title height and centers perfectly */
  .nav-toggle {
    height: clamp(1.34rem, 6.0vw, 1.78rem);
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 18px 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid #eee;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease, transform .4s cubic-bezier(.4, .6, .25, 1);
  }

  .site-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-link {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    padding: 8px 0 6px;
  }

  .header-spacer {
    height: 86px;
  }
}

@media (max-width:420px) {
  .site-nav {
    gap: 8px;
  }

  .nav-link {
    font-size: 0.64rem;
    letter-spacing: 0.16em;
  }

  .header-spacer {
    height: 134px;
  }
}

/* Spacer element matches header height; adjust --header-spacer-height if needed */
.header-spacer {
  height: var(--header-spacer-height);
}

/* Gallery */
.gallery-container {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad-x) 4rem;
  box-sizing: border-box;
}

/* Justified row layout across all viewports */
.gallery-grid {
  display: block;
  margin-top: 1rem;
}

.gallery-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 24px;
  height: auto;
}

.gallery-item {
  margin-right: 24px;
  cursor: pointer;
  transition: opacity .3s ease;
  display: block;
  overflow: hidden;
  animation: fadeIn .4s ease forwards;
}

.gallery-item:last-child {
  margin-right: 0;
}

.gallery-item:hover {
  opacity: .8;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  /* Prevent layout reflow */
  min-height: 150px;
  background-color: #f5f5f5;
}

/* Responsive spacing tweaks for smaller widths */
@media (max-width:900px) {
  .gallery-row {
    margin-bottom: 20px;
  }

  .gallery-item {
    margin-right: 20px;
  }
}

@media (max-width:640px) {
  .gallery-row {
    margin-bottom: 16px;
  }

  .gallery-item {
    margin-right: 16px;
  }
}

@media (max-width:480px) {
  .gallery-row {
    margin-bottom: 14px;
  }

  .gallery-item {
    margin-right: 14px;
  }
}

.gallery-item.hidden {
  display: none;
}

/* Lightbox - Modern White Design */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(15px);
}

.lightbox-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: var(--header-pad-top) 0 var(--header-pad-bottom);
  z-index: 1002;
  display: flex;
  justify-content: center;
}

.lightbox-header-inner {
  width: 100%;
  max-width: var(--page-max-width);
  padding-left: var(--page-pad-x);
  padding-right: var(--page-pad-x);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  box-sizing: border-box;
}

.lightbox-title {
  font-family: 'IM Fell English SC', serif;
  font-weight: 400;
  font-size: var(--site-title-size);
  line-height: 1.07;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: #111;
  margin: 0;
  text-decoration: none;
  cursor: pointer;
}

.lightbox-title:hover {
  color: #111;
  text-decoration: none;
}

.lightbox-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 85vw;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  margin-top: 40px; /* Account for header */
  z-index: 1000; /* Ensure image is visible but below navigation */
}

.close {
  color: #999;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.3s ease;
  background: none;
  border: none;
  padding: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  display: block;
  align-self: flex-end;
}

.close:hover {
  color: #666;
}

.nav-buttons {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  pointer-events: none;
  z-index: 1001;
}

.prev,
.next {
  flex: 1;
  background: transparent;
  border: none;
  pointer-events: auto;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: transparent;
  position: relative;
}

/* Custom cursor - gray arrow buttons */
.prev {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" rx="16" fill="%23999" opacity="0.8"/><path d="M18 10 L12 16 L18 22" stroke="white" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>'), auto;
}

.next {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" rx="16" fill="%23999" opacity="0.8"/><path d="M14 10 L20 16 L14 22" stroke="white" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>'), auto;
}

/* Subtle hover indication */
.prev:hover {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.05), transparent);
}

.next:hover {
  background: linear-gradient(to left, rgba(0, 0, 0, 0.05), transparent);
}

/* Remove the large arrow overlays since cursor shows direction */
.prev:hover::before,
.next:hover::after {
  display: none;
}

/* Mobile lightbox optimizations */
@media (max-width: 768px) {
  .lightbox {
    /* Ensure lightbox takes full screen */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
  }
  
  .lightbox-header {
    padding: 20px 0 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    z-index: 1002;
  }
  
  .lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: calc(100vh - 160px); /* Account for header and safe areas */
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    margin-top: 0; /* Remove margin, use positioning instead */
    z-index: 1000;
    /* Ensure image is always visible */
    min-width: 200px;
    min-height: 200px;
  }

  .lightbox-header-inner {
    padding-left: 40px;
    padding-right: 40px;
  }

  .lightbox-title {
    font-size: clamp(1.34rem, 6.0vw, 1.78rem);
    line-height: 1;
    letter-spacing: 0.075em;
  }

  .lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: calc(100vh - 160px); /* Account for header and safe areas */
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    margin-top: 0; /* Remove margin, use positioning instead */
    z-index: 1000;
    /* Ensure image is always visible */
    min-width: 200px;
    min-height: 200px;
  }

  .close {
    font-size: 22px;
  }

  .nav-buttons {
    /* Positioned to not cover the center image area */
    position: absolute;
    top: 120px; /* Below header */
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    pointer-events: none;
  }

  .prev, .next {
    /* Side touch areas that don't cover the image */
    flex: none;
    width: 80px;
    min-height: 60px;
    /* Keep pointer cursor on mobile since custom cursors may not work well */
    cursor: pointer !important;
    pointer-events: auto;
  }

  .prev {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
  }

  .next {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
  }

  /* More visible hover feedback on mobile */
  .prev:active {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent);
  }

  .next:active {
    background: linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);
  }
}

/* Mobile scrolling optimization */
@media (max-width: 768px) {
  html {
    /* Prevent mobile zoom from causing scroll issues */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }

  body {
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
    /* Prevent scroll bounce */
    overscroll-behavior-y: contain;
  }

  .gallery-container {
    padding: 0 40px 3rem;
  }

  .gallery-item {
    /* Reduce mobile animations for better performance */
    animation: none;
    transition: opacity 0.2s ease;
  }

  .gallery-item img {
    /* Mobile hardware acceleration */
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
    will-change: auto;
  }
}

@media (max-width:440px) {
  .gallery-container {
    padding: 0 24px 3rem;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}



/* Footer */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e9e9e9;
  display: flex;
  justify-content: center;
  padding: 12px 0 10px;
  z-index: 220;
  font-family: 'Raleway', var(--font-sans);
}

.site-footer-inner {
  width: 100%;
  max-width: var(--page-max-width);
  padding-left: var(--page-pad-x);
  padding-right: var(--page-pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.footer-icons {
  display: flex;
  align-items: center;
}

.footer-icons a {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  border: 1px solid #d6d6d6;
  border-radius: 50%;
  color: #444;
  text-decoration: none;
  font-size: 16px;
  transition: all .28s ease;
}

.footer-icons a:last-child {
  margin-right: 0;
}

.footer-icons a:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}

.site-footer small {
  font: 400 .6rem/1.1 'Raleway', var(--font-sans);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #666;
  white-space: nowrap;
}

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

@media (max-width:900px) {
  .site-footer-inner {
    padding-left: 40px;
    padding-right: 40px;
  }
}

@media (max-width:640px) {
  .site-footer-inner {
    padding-left: 28px;
    padding-right: 28px;
  }

  .footer-icons a {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .site-footer small {
    font-size: .55rem;
    letter-spacing: .18em;
  }
}