:root {
  --bg: #f6f4ef;
  --bg-soft: #efede8;
  --bg-muted: #e6e4df;
  --off-white: #f6f4ef;
  --charcoal: #2a2a2a;
  --charcoal-soft: #4a4a4a;
  --text: #2a2a2a;
  --text-soft: rgba(42, 42, 42, 0.72);
  --text-muted: rgba(42, 42, 42, 0.52);
  --text-on-photo: #ffffff;
  --border: rgba(42, 42, 42, 0.1);
  --border-strong: rgba(42, 42, 42, 0.22);
  --shadow: 0 20px 60px rgba(42, 42, 42, 0.12);
  --accent: #2a2a2a;
  --gallery-gap: 1.5cm;
  --liri-content-max: 1400px;
  --liri-gap: 66px;
  --liri-side: 8.35%;
  --header-h: 72px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: Outfit, system-ui, -apple-system, Segoe UI, sans-serif;
  --weight-regular: 500;
  --weight-medium: 600;
  --lightbox-overlay: rgba(246, 244, 239, 0.5);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.is-hidden { display: none !important; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.skip-link:focus { left: 12px; z-index: 9999; }

/* ── Header (Liri-style minimal top bar) ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
  padding: 0 clamp(20px, 4vw, 48px);
  background: rgba(246, 244, 239, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.site-brand {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}

.site-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text-soft);
  transition: color 0.2s ease, transform 0.2s ease;
}

.site-social-link svg {
  width: 18px;
  height: 18px;
}

.site-social-link:hover,
.site-social-link:focus-visible {
  color: var(--text);
  transform: translateY(-1px);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
}

.site-nav-link,
.hero-subtitle,
.category-back,
.footer-top {
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.theme-card-title,
.category-title,
.photo-caption,
.lightbox-counter {
  font-family: var(--font-display);
  font-weight: 600;
}

.site-nav-link,
.hero-subtitle,
.category-back,
.footer-top {
  font-size: 15px;
  color: var(--text-soft);
}

.site-nav-link {
  transition: color 0.2s ease;
}

.site-nav-link:hover,
.site-nav-link:focus-visible {
  color: var(--text);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--border);
  background: transparent;
  padding: 10px 12px;
  cursor: pointer;
}

.nav-toggle-lines {
  display: inline-block;
  width: 18px;
  height: 12px;
  border-top: 2px solid rgba(42, 42, 42, 0.65);
  border-bottom: 2px solid rgba(42, 42, 42, 0.65);
  position: relative;
}

.nav-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  border-top: 2px solid rgba(42, 42, 42, 0.65);
}

.nav-panel {
  display: none;
}

/* ── Hero: darker off-white panel + lighter page below ── */

.hero {
  background-color: var(--bg);
}

.hero-panel {
  width: 100%;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: clamp(240px, 36vh, 360px);
  padding: clamp(48px, 8vw, 96px) 24px clamp(40px, 6vw, 64px);
  text-align: center;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
}

.hero-subtitle {
  margin: 20px 0 0;
  line-height: 1.6;
}

/* ── Work: theme cards (Commercial · Living) ── */

.section-work {
  padding: clamp(32px, 5vw, 64px) clamp(20px, 4vw, 48px) clamp(64px, 8vw, 120px);
  background: var(--bg);
}

.section-work.is-category-open {
  padding: 0 0 clamp(64px, 8vw, 120px);
}

.theme-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 28px);
  max-width: 1400px;
  margin: 0 auto;
}

.theme-extra {
  max-width: 1400px;
  margin: clamp(28px, 4vw, 48px) auto 0;
}

.theme-extra .theme-card-wide img {
  aspect-ratio: 16 / 7;
}

.theme-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  overflow: visible;
}

.theme-card-media {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-muted);
}

.theme-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(246, 244, 239, 0);
  transition: background 0.4s ease;
  pointer-events: none;
  z-index: 2;
}

.theme-card:hover .theme-card-media::after {
  background: rgba(246, 244, 239, 0.7);
}

.theme-card img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  opacity: 0.9;
  transition: opacity 0.35s ease;
}

.theme-card:hover img {
  transform: none;
  opacity: 1;
}

.theme-card-caption-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 28px);
  background: transparent;
  pointer-events: none;
  opacity: 1;
}

.theme-card-title {
  display: inline-block;
  box-sizing: border-box;
  max-width: 100%;
  padding: 0.4em 0.7em;
  font-size: clamp(18px, 3.6vw, 42px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  color: #1a1a1a;
  text-shadow: none;
  -webkit-text-stroke: 0;
  text-align: center;
  background: rgba(246, 244, 239, 0.88);
  box-shadow: 0 8px 28px rgba(246, 244, 239, 0.65);
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: none;
}

.theme-card:hover .theme-card-title {
  color: #1a1a1a;
  background: rgba(246, 244, 239, 0.92);
}

.gallery-empty {
  text-align: center;
  font-weight: var(--weight-regular);
  color: var(--text-muted);
  padding: 48px 0;
}

/* ── Work: inside a theme — Liri layout (measured from reference site) ── */

.work-category {
  width: 100%;
  margin: 0 auto;
}

.category-toolbar {
  padding: clamp(20px, 3vw, 32px) var(--liri-side) 0;
}

.category-back {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.category-back:hover {
  color: var(--text);
}

.category-title {
  margin: 0;
  padding: clamp(28px, 4vw, 48px) var(--liri-side) clamp(20px, 3vw, 32px);
  text-align: center;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.category-gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3.88vw, var(--liri-gap));
  width: min(var(--liri-content-max), calc(100vw - var(--liri-side) * 2));
  margin: 0 auto;
}

.gallery-row {
  display: flex;
  gap: clamp(20px, 3.88vw, var(--liri-gap));
  width: 100%;
  align-items: stretch;
}

.photo-tile {
  position: relative;
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: var(--bg-muted);
  cursor: zoom-in;
  overflow: hidden;
}

.photo-tile img,
.photo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.photo-tile img.is-loaded,
.photo-image.is-loaded {
  opacity: 1;
}

.photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(12px, 1.8vw, 18px) clamp(14px, 2vw, 22px);
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.58) 100%);
  font-size: clamp(15px, 1.5vw, 16px);
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  pointer-events: none;
}

.gallery-top:hover {
  background: var(--bg);
}

.gallery-top {
  position: fixed;
  right: clamp(20px, 3vw, 32px);
  bottom: clamp(20px, 3vw, 32px);
  z-index: 90;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border-strong);
  background: rgba(246, 244, 239, 0.94);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.2s ease;
  box-shadow: var(--shadow);
}

.gallery-top.is-hidden {
  display: none;
}

/* ── About & Contact ── */

.section-about,
.section-contact {
  padding: clamp(64px, 8vw, 120px) clamp(20px, 4vw, 48px);
  border-top: 1px solid var(--border);
}

.section-about {
  background: var(--bg-soft);
}

.section-contact {
  background: var(--bg-muted);
}

.content-block {
  max-width: 640px;
  margin: 0 auto;
}

.block-title {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.block-lead {
  margin: 0 0 16px;
  font-size: clamp(17px, 2.1vw, 20px);
  font-weight: var(--weight-regular);
  line-height: 1.7;
  color: var(--text-soft);
}

.block-text {
  margin: 0;
  font-weight: var(--weight-regular);
  color: var(--text-muted);
  line-height: 1.8;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 32px 0;
}

.contact-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  font-size: 16px;
  font-weight: var(--weight-regular);
  letter-spacing: 0.02em;
  color: var(--text-soft);
  transition: color 0.2s ease;
}

.contact-label {
  min-width: 6.5em;
  font-size: 13px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-value {
  color: inherit;
}

.contact-line:hover {
  color: var(--charcoal-soft);
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border: 1px solid var(--border-strong);
  background: transparent;
  font-size: 14px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.contact-button:hover {
  background: rgba(42, 42, 42, 0.06);
  border-color: var(--charcoal);
}

/* ── Footer ── */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 24px 56px;
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
}

.footer-top {
  transition: color 0.2s ease;
}

.footer-top:hover {
  color: var(--text);
}

.footer-copy {
  margin: 0;
  font-size: 14px;
  font-weight: var(--weight-regular);
  color: var(--text-muted);
}

/* ── Lightbox (keep size user liked) ── */

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 48px 72px;
  background: var(--lightbox-overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  box-sizing: border-box;
}

.lightbox.is-open { display: flex; }

.lightbox-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 144px);
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
}

.lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 144px);
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  object-fit: contain;
  image-rendering: auto;
}

.lightbox-counter {
  margin: 14px 0 0;
  font-size: 18px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: var(--text);
  text-align: center;
}

.lightbox-zone {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 22%;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 1;
}

.lightbox-zone-prev { left: 0; }
.lightbox-zone-next { right: 0; }

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  background: rgba(246, 244, 239, 0.82);
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  backdrop-filter: blur(6px);
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  background: rgba(246, 244, 239, 0.96);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  background: rgba(246, 244, 239, 0.82);
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  z-index: 4;
  backdrop-filter: blur(6px);
}

.lightbox-close:hover {
  background: rgba(246, 244, 239, 0.96);
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .lightbox { padding: 48px 16px; }
  .lightbox-stage {
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 80px);
  }
  .lightbox-image {
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 96px);
  }
  .lightbox-nav {
    min-width: 52px;
    min-height: 52px;
    font-size: 26px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-zone { width: 28%; }
}

@media (max-width: 768px) {
  .site-header {
    flex-wrap: wrap;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .site-nav { display: none; }

  .nav-toggle { display: inline-flex; }

  .nav-panel {
    display: none;
    position: absolute;
    right: 20px;
    top: calc(var(--header-h) - 8px);
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border);
    background: rgba(246, 244, 239, 0.98);
    backdrop-filter: blur(12px);
    min-width: 200px;
  }

  .nav-panel.is-open { display: flex; }

  .nav-panel .site-nav-link {
    padding: 12px 14px;
  }

  .theme-index {
    grid-template-columns: 1fr;
  }

  .theme-card-caption-overlay {
    padding: 12px 14px;
  }

  .theme-card-title {
    font-size: clamp(21px, 5.8vw, 30px);
    letter-spacing: 0.05em;
    padding: 0.38em 0.55em;
    max-width: 100%;
  }

  .theme-extra .theme-card-wide .theme-card-title {
    font-size: clamp(20px, 5.4vw, 28px);
  }

  .category-gallery {
    width: calc(100vw - clamp(32px, 10vw, 80px));
  }

  .gallery-row {
    flex-direction: column;
  }

  .photo-tile {
    width: 100% !important;
    height: auto !important;
  }

  .photo-tile img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .photo-caption {
    font-size: 16px;
    padding: 14px 16px;
  }
}

@media (max-width: 640px) {
  .hero-title {
    letter-spacing: 0.08em;
  }

  .site-brand {
    font-size: 13px;
    letter-spacing: 0.06em;
  }

  .theme-card-title {
    font-size: 21px;
    letter-spacing: 0.04em;
    padding: 0.35em 0.5em;
  }

  .theme-extra .theme-card-wide .theme-card-title {
    font-size: 20px;
  }
}
