/*
 * L'Oeil Cosmique — replica of the Squarespace layout.
 * Sizes are fluid like Squarespace's: most values are measured on the live
 * site at 1024px and 1440px wide and expressed as calc(a·vw + b px).
 */

:root {
  --bg: #000;
  --fg: #fff;
  --accent: rgb(248, 223, 219);      /* "Contact me" link */
  --field: rgb(93, 13, 4);           /* contact form fields */
  --pad: 3vw;                        /* page side padding */
  --header-h: calc(8.27vw + 16px);
  --logo-h: calc(1.548vw + 10.48px);
  --heading-font: "pragmatica-extended", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fs-base: calc(0.12vw + 13px);
  --fs-h3: calc(1.92vw + 13px);
  --fs-h4: calc(0.75vw + 10.2px);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body-font);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1 0 auto; padding-top: var(--header-h); }

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

a { color: inherit; }

h3, h4 {
  font-family: var(--heading-font);
  font-weight: 700;
  /* Archivo at 112% width matches pragmatica-extended's widths to ±2px */
  font-stretch: 112%;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0;
}

h3 { font-size: var(--fs-h3); line-height: 1.123; margin-bottom: 26px; }
h4 { font-size: var(--fs-h4); line-height: 1.18; }

h3 a, h4 a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.12em;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 1000;
  background: var(--fg);
  color: var(--bg);
  padding: 8px 14px;
}
.skip-link:focus { left: 8px; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
}

.header-inner {
  height: 100%;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
}

.site-title { display: block; flex: none; }
.site-title img { height: var(--logo-h); width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.12em;
  margin-left: calc(4.33vw - 18.3px);
  line-height: 1.6;
}

.nav-link {
  text-decoration: none;
  padding-bottom: 0.1em;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0 1px;
  background-position: 0 calc(100% - 0.1em);
  transition: background-size 0.2s ease;
}
.nav-link:hover,
.nav-link.active { background-size: 100% 1px; }

.nav-folder { position: relative; }

.nav-folder-content {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 0.5em;
  display: flex;
  flex-direction: column;
  min-width: 10em;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s;
  background: var(--bg);
}
.nav-folder:hover .nav-folder-content,
.nav-folder:focus-within .nav-folder-content { opacity: 1; visibility: visible; }

.nav-folder-content a {
  text-decoration: none;
  line-height: 1.3;
  width: fit-content;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0 1px;
  background-position: 0 100%;
}
.nav-folder-content a:hover,
.nav-folder-content a.active { background-size: 100% 1px; }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.icon-link { display: inline-flex; color: var(--fg); }
.icon-link svg { width: 20px; height: 20px; fill: currentColor; transform: scale(1.6); }
.icon-link:hover { opacity: 0.8; }

.lang-switch {
  text-decoration: none;
  font-size: 0.93em;
  letter-spacing: 0.04em;
}
.lang-switch:hover { text-decoration: underline; text-underline-offset: 0.2em; }

.burger { display: none; }

/* ---------------------------------------------------------------- mobile menu */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 82px 6vw 40px;
}

.mobile-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  font-size: 40px;
  line-height: 1.7;
}
.mobile-panel.active { display: flex; }

.mobile-link {
  font: inherit;
  color: var(--fg);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.mobile-link.active { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.mobile-link .chev { display: inline-flex; margin-left: 0.3em; }
.mobile-link .chev svg { width: 0.6em; height: 0.6em; }
.mobile-back { opacity: 0.55; margin-bottom: 0.15em; }
.mobile-back .chev { margin: 0 0.35em 0 0; }

.mobile-actions {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

body.menu-open { overflow: hidden; }
body.menu-open .mobile-menu { display: flex; }

/* ---------------------------------------------------------------- galleries */

.gallery { position: relative; }

.g-item { margin: 0; }
.g-item a { display: block; cursor: zoom-in; }
.g-item img { width: 100%; height: 100%; object-fit: cover; }

/* Masonry: 3 columns, 10px between photos and at the edges, full bleed
   (JS places items into the shortest column; CSS columns are the no-JS
   fallback). */
.gallery-masonry {
  padding: 0 10px;
  columns: 3;
  column-gap: 10px;
}
.gallery-masonry .g-item { break-inside: avoid; margin-bottom: 10px; }
.gallery-masonry.is-laid-out { columns: auto; display: flex; gap: 10px; align-items: flex-start; }
.gallery-masonry .m-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.gallery-masonry.is-laid-out .g-item { margin: 0; }

/* Strips: justified rows, 10px gutter, full bleed. */
.gallery-strips { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery-strips .g-item { flex: 0 0 auto; }
.gallery-strips .g-item img { height: 100%; }

/* Scroll-in fade (Squarespace "site-default" animation) */
.js .gallery[data-animate] .g-item { opacity: 0; transform: translateY(16px); transition: opacity 0.9s ease, transform 0.9s ease; }
.js .gallery[data-animate] .g-item.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .gallery[data-animate] .g-item { opacity: 1; transform: none; transition: none; }
}

/* ---------------------------------------------------------------- lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.lightbox.open { opacity: 1; visibility: visible; }
body.lightbox-open { overflow: hidden; }

.lb-image {
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
}

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  padding: 12px;
  color: var(--fg);
  cursor: pointer;
}
.lightbox button svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.4; }
.lb-close { top: 10px; right: 10px; }
.lb-close svg { width: 22px; height: 22px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-prev svg, .lb-next svg { width: 44px; height: 18px; }
.lightbox button:hover { opacity: 0.7; }

/* ---------------------------------------------------------------- home intro */

.intro { padding: 11.9vw var(--pad) 0; }
.intro-text { width: 46.5vw; }

/* ---------------------------------------------------------------- about */

.about {
  padding: 3.3vw var(--pad) 31vw;
  display: flex;
  align-items: flex-start;
}
.about-text { width: 46.5vw; }
.about-body p { margin: 0; }
.about-image { margin-left: 5vw; width: 38.6vw; }
.about-image img { width: 100%; aspect-ratio: 395 / 563; object-fit: cover; }

.button {
  display: inline-block;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: normal;
  color: var(--fg);
  background: transparent;
  border: 2px solid var(--fg);
  border-radius: 0;
  padding: 1.3em 2.17em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.button:hover { background: var(--fg); color: var(--bg); }
.button:disabled { opacity: 0.6; cursor: default; }

.about-button { margin-top: 2.6em; padding: 1.23em 3.65em; }

/* ---------------------------------------------------------------- contact */

.contact {
  padding: 6.6vw var(--pad) 3.5vw;
  display: flex;
  align-items: flex-start;
}
.contact-intro { width: 30.7vw; }
.contact-icons { display: flex; gap: 14px; margin-top: 24px; }
.contact-icons .icon-link svg { width: 24px; height: 24px; transform: scale(1.7); }

.contact-form { margin-left: 8.9vw; width: 34.6vw; }
.contact-form fieldset { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.field { display: block; margin-bottom: 20px; }
.field-title { display: block; margin-bottom: 0.45em; line-height: normal; }
.name-row { display: flex; gap: 8px; margin-top: 6px; }
.field-sub { flex: 1 1 0; min-width: 0; display: block; }
.field-label { display: block; font-size: 0.8em; margin-bottom: 0.45em; line-height: normal; }
.req { font-size: 0.79em; opacity: 0.7; margin-left: 0.3em; }
.field-title .req, .field-label .req { font-size: 0.79em; }
.field-label .req { font-size: 1em; }

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  display: block;
  width: 100%;
  font: inherit;
  color: var(--fg);
  background: var(--field);
  border: 1px solid transparent;
  border-radius: 25.55px;
  padding: 10px 20px;
  line-height: 1.6;
  appearance: none;
}
.contact-form textarea { height: 100px; resize: vertical; }
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: rgba(255, 255, 255, 0.5); }
.contact-form .button { margin-top: 0; }
.hp { position: absolute; left: -9999px; }
.form-status { min-height: 1.6em; margin: 14px 0 0; }
.form-status.error { color: var(--accent); }

/* ---------------------------------------------------------------- share */

.share {
  padding: 3.3vw var(--pad) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.share h3 { margin-bottom: 0.6em; }
.share img { width: 46.5vw; }

/* ---------------------------------------------------------------- 404 */

.not-found { padding: 10vw var(--pad); text-align: center; }
.not-found h4 { margin-bottom: 1em; }
.not-found p { margin: 0 0 2em; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  position: relative;
  padding: 19.6vw var(--pad) 3.6vw;
  text-align: center;
}
.page-gallery .site-footer { padding-top: 17.1vw; }
.page-share .site-footer { padding-top: 19.6vw; }
.copyright { margin: 0; }
.footer-icons {
  position: absolute;
  right: var(--pad);
  bottom: 3.6vw;
  height: 1.6em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-icons .icon-link svg { width: 16px; height: 16px; }

/* ================================================================ mobile */

@media (max-width: 767px) {
  :root {
    --pad: 6.13vw;
    --header-h: 82px;
    --logo-h: 18.34px;
    --fs-base: 13.97px;
    --fs-h3: 28.59px;
    --fs-h4: 18px;
  }

  .site-nav,
  .header-actions { display: none; }

  .burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    width: 36px;
    height: 36px;
    margin: 0 27px 0 0;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    position: relative;
    z-index: 110;
  }
  .burger-line {
    display: block;
    width: 35px;
    height: 1px;
    background: var(--fg);
    transition: transform 0.25s ease;
  }
  body.menu-open .burger-line:first-child { transform: translateY(5.5px) rotate(45deg) scaleX(0.75); }
  body.menu-open .burger-line:last-child { transform: translateY(-5.5px) rotate(-45deg) scaleX(0.75); }

  .site-title { position: relative; z-index: 110; }

  /* masonry → 2 columns, tight gutter */
  .gallery-masonry { padding: 0 4px; columns: 2; column-gap: 3px; }
  .gallery-masonry .g-item { margin-bottom: 4px; }
  .gallery-masonry.is-laid-out { gap: 3px; }
  .gallery-masonry .m-col { gap: 4px; }

  /* strips → one photo per row */
  .gallery-strips .g-item { width: 100% !important; height: auto !important; }
  .gallery-strips .g-item img { height: auto; }

  .lb-image { max-width: 100vw; max-height: calc(100vh - 120px); }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }

  .intro { padding: 16vw var(--pad) 0; }
  .intro-text { width: auto; }

  .about { flex-direction: column; padding: 7.2vw var(--pad) 12vw; }
  .about-text { display: contents; }
  .about h3 { order: 1; }
  .about-body { order: 2; }
  .about-image { order: 3; margin: 3vw auto 0; width: 65.3vw; }
  .about-image img { aspect-ratio: 245 / 304; }
  .about-button { order: 4; margin: 12vw auto 0; width: 65.3vw; text-align: center; }

  .contact { flex-direction: column; padding: 7.2vw var(--pad) 12vw; }
  .contact-intro, .contact-form { width: 100%; margin: 0; }
  .contact-intro { margin-bottom: 9vw; }

  .share img { width: 100%; }

  .site-footer { padding: 16vw var(--pad) 8vw; }
  .page-gallery .site-footer, .page-share .site-footer { padding-top: 16vw; }
  .copyright { text-align: left; }
  .footer-icons { position: static; justify-content: flex-start; margin-top: 12px; }
}
