/* =========================================================
   Waendom.com — Stylesheet
   Paper:  creamy off-white           Ink: soft near-black
   Type:   Space Mono (headings, menu, album labels)
           Work Sans (body copy)
   ========================================================= */

:root {
  --cream: #f8f4ea;
  --cream-dim: #efe7d3;
  --ink: #24221d;
  --ink-soft: #79746a;
  --line: #e2d8bf;

  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular",
               "Menlo", "Consolas", monospace;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, sans-serif;

  --max-w: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* drop shadow, nudged by the scroll position (set in JS) */
  --sx: -6px;
  --sy: 10px;
  --sblur: 26px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.menu-open,
body.lightbox-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}

a {
  color: inherit;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

/* every heading, menu item and album label is mono and lowercase */
h1, h2, h3,
.wordmark-bar,
.overlay-nav a,
.menu-overlay .eyebrow,
.category-card .label,
.more-btn,
.cta-link,
.copyright,
.empty-note {
  font-family: var(--font-mono);
  font-weight: 400;
  text-transform: lowercase;
  margin: 0;
}

/* ---------- wordmark bar (top left) ----------
   Full width at rest; once the page is scrolled it collapses into a round
   button showing just a back arrow. Always links to the start page. */

.wordmark-bar {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 300;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--cream);
  box-shadow: 0 1px 4px rgba(36, 34, 29, 0.14);
  color: var(--ink);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  overflow: hidden;
  transition: padding 0.35s var(--ease), width 0.35s var(--ease),
              box-shadow 0.25s var(--ease);
}

.wordmark-bar:hover {
  box-shadow: 0 2px 10px rgba(36, 34, 29, 0.2);
}

.wordmark-text {
  max-width: 12em;
  opacity: 1;
  white-space: nowrap;
  transition: max-width 0.35s var(--ease), opacity 0.2s var(--ease);
}

.wordmark-arrow {
  width: 0;
  height: 18px;
  opacity: 0;
  flex: none;
  transition: width 0.35s var(--ease), opacity 0.25s var(--ease) 0.1s;
}

body.is-scrolled .wordmark-bar[data-up] {
  padding: 0;
  width: 48px;
}

body.is-scrolled .wordmark-bar[data-up] .wordmark-text {
  max-width: 0;
  opacity: 0;
  transition: max-width 0.35s var(--ease), opacity 0.15s var(--ease);
}

body.is-scrolled .wordmark-bar[data-up] .wordmark-arrow {
  width: 18px;
  opacity: 1;
}

body.menu-open .wordmark-bar {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}

/* ---------- menu toggle (top right) ---------- */

.menu-toggle {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 300;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--cream);
  box-shadow: 0 1px 4px rgba(36, 34, 29, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}

body.menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
body.menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}
body.menu-open .menu-toggle span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ---------- overlay menu ---------- */

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  opacity: 0;
  transform: translateY(-2%);
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.4s var(--ease);
}

body.menu-open .menu-overlay {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.menu-overlay .eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
}

.overlay-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.overlay-nav a {
  font-size: clamp(1.3rem, 4.4vw, 1.9rem);
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
  position: relative;
}

.overlay-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -5px;
  height: 1px;
  background: var(--ink);
  transition: right 0.3s var(--ease);
}

.overlay-nav a:hover::after,
.overlay-nav a[aria-current="page"]::after {
  right: 0;
}

/* ---------- hero banner ----------
   2/5 of the viewport, no type. The figures glide apart, shrink and fade;
   because their origin sits at the bottom centre the shrink cancels the
   drift at the edges, so neither man is ever clipped. */

.hero {
  position: relative;
  height: 40vh;
  min-height: 260px;
  max-height: 460px;
  overflow: hidden;
  background: var(--cream);
}

.hero-media {
  position: absolute;
  inset: 0;
  will-change: opacity;
}

.figure-left,
.figure-right {
  position: absolute;
  bottom: 0;
  width: auto;
  height: auto;
  max-height: 68%;
  object-fit: contain;
  transform-origin: 50% 100%;
  will-change: transform;
}

.figure-left {
  left: 4%;
  max-width: 34%;
}

.figure-right {
  right: 4%;
  max-width: 30%;
}

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

.intro {
  padding: 52px 0 34px;
  text-align: center;
}

.intro h2 {
  font-size: clamp(1.3rem, 3.4vw, 1.7rem);
  letter-spacing: 0.02em;
}

.intro p {
  margin: 18px auto 0;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

/* ---------- home highlights ---------- */

.highlights {
  padding: 0 0 96px;
}

.highlights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.more-row {
  text-align: center;
  margin-top: 52px;
}

.more-btn {
  display: inline-block;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  padding: 15px 38px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: none;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.more-btn:hover {
  background: var(--ink);
  color: var(--cream);
}

/* ---------- art pieces ----------
   No frame, no caption — just the work, with a soft shadow whose angle
   shifts a little as the page is scrolled. */

.art-piece {
  position: relative;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.art-piece.in-view {
  opacity: 1;
  transform: translateY(0);
}

.art-piece img {
  width: 100%;
  height: auto;
  /* width/height attributes in the HTML reserve the right space up front,
     so nothing jumps around while the images arrive */
  box-shadow: var(--sx) var(--sy) var(--sblur) rgba(36, 34, 29, 0.17);
  transition: box-shadow 0.2s linear, transform 0.6s var(--ease);
}

.art-piece:hover img {
  transform: scale(1.02);
}

/* the home row crops to a common 4:5; galleries never crop */
.highlights-grid .art-piece {
  aspect-ratio: 4 / 5;
}

.highlights-grid .art-piece img {
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

/* ---------- gallery grid ---------- */

.gallery-rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0 0 32px;
}

.gallery {
  columns: 1;
  column-gap: 26px;
  padding-bottom: 100px;
}

.gallery .art-piece {
  break-inside: avoid;
  margin-bottom: 26px;
}

.gallery .art-piece,
.highlights-grid .art-piece {
  cursor: zoom-in;
}

/* a closing note under an album */
.album-outro {
  padding: 0 0 100px;
  margin-top: -60px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.album-outro a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

.album-outro a:hover {
  color: var(--ink-soft);
  border-color: var(--ink-soft);
}

/* ---------- gallery landing ---------- */

.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 32px 0 96px;
}

.category-card {
  position: relative;
  display: block;
  text-decoration: none;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--cream-dim);
  box-shadow: var(--sx) var(--sy) var(--sblur) rgba(36, 34, 29, 0.17);
  transition: box-shadow 0.2s linear;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.category-card:hover img {
  transform: scale(1.04);
}

/* a scrim so the off-white label stays readable on any artwork */
.category-card::after {
  content: "";
  position: absolute;
  inset: 40% 0 0 0;
  background: linear-gradient(to top, rgba(20, 18, 15, 0.62), transparent);
  pointer-events: none;
}

.category-card .label {
  position: absolute;
  left: 22px;
  bottom: 20px;
  z-index: 2;
  color: var(--cream);
}

.category-card .label .name {
  display: block;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}

.category-card .label .sub {
  display: block;
  margin-top: 5px;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  opacity: 0.82;
}

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

.page-head {
  padding: 118px 0 34px;
}

.page-head h1 {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  letter-spacing: 0.02em;
}

.page-head p {
  margin-top: 14px;
  color: var(--ink-soft);
  max-width: 48ch;
}

.empty-note {
  padding: 8px 0 120px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ---------- about + contact ---------- */

/* The text runs the page and wraps around a square portrait that sits
   slightly askew — one flowing column instead of two rigid blocks. */
.about {
  display: block;
  max-width: 660px;
  padding-bottom: 110px;
}

.about::after {
  content: "";
  display: block;
  clear: both;
}

.about-portrait {
  margin: 0 0 22px;
  width: 190px;
  aspect-ratio: 1 / 1;
}

.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: var(--sx) var(--sy) var(--sblur) rgba(36, 34, 29, 0.17);
  transform: rotate(-1.6deg);
  transition: box-shadow 0.2s linear, transform 0.4s var(--ease);
}

.about-portrait img:hover {
  transform: rotate(0deg);
}

.about-text p:first-child {
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink);
}

.about-text p {
  max-width: none;
}

.contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-bottom: 110px;
}

.about-text p,
.contact-text p {
  margin-bottom: 16px;
  color: var(--ink-soft);
  max-width: 52ch;
}

.contact {
  max-width: 620px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-mono);
  text-transform: lowercase;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.contact-btn:hover {
  background: var(--ink);
  color: var(--cream);
}

.contact-btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
  transition: gap 0.2s var(--ease);
}

.cta-link:hover {
  gap: 18px;
}

/* ---------- back to top ---------- */

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 280;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 1px 4px rgba(36, 34, 29, 0.16);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
              box-shadow 0.2s var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.to-top:hover {
  box-shadow: 0 2px 10px rgba(36, 34, 29, 0.22);
}

.to-top svg {
  width: 18px;
  height: 18px;
}

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 66px 20px 56px;
  background: rgba(248, 244, 234, 0.97);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: min(1600px, 100%);
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 6px 40px rgba(36, 34, 29, 0.2);
  transform: scale(0.97);
  transition: transform 0.3s var(--ease);
}

.lightbox.is-open img {
  transform: scale(1);
}

/* a quiet pulse while the full-resolution file is still on its way */
.lightbox.is-loading .lightbox-counter::after {
  content: " ·";
  animation: lb-pulse 1s ease-in-out infinite;
}

@keyframes lb-pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.lightbox button {
  position: absolute;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 1px 4px rgba(36, 34, 29, 0.14);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s var(--ease);
}

.lightbox button:hover {
  box-shadow: 0 2px 10px rgba(36, 34, 29, 0.22);
}

.lightbox button svg {
  width: 18px;
  height: 18px;
}

.lightbox-close { top: 22px; right: 22px; }
.lightbox-prev  { left: 22px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 22px; top: 50%; transform: translateY(-50%); }

.lightbox-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  background: var(--cream);
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.copyright {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* ---------- responsive ---------- */

@media (max-width: 639px) {
  .wordmark-bar {
    top: 16px;
    left: 16px;
    height: 44px;
    padding: 0 18px;
    font-size: 0.82rem;
  }
  body.is-scrolled .wordmark-bar[data-up] {
    width: 44px;
  }
  .menu-toggle {
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
  .figure-left {
    left: 2%;
    max-width: 40%;
    max-height: 58%;
  }
  .figure-right {
    right: 2%;
    max-width: 34%;
    max-height: 62%;
  }
  .lightbox {
    padding: 60px 12px 66px;
  }
  .lightbox-prev  { left: 14px;  top: auto; bottom: 18px; transform: none; }
  .lightbox-next  { right: 14px; top: auto; bottom: 18px; transform: none; }
  .lightbox-counter { bottom: 32px; }
  .to-top { right: 16px; bottom: 16px; }
}

@media (min-width: 640px) {
  .highlights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery {
    columns: 2 240px;
  }
}

@media (min-width: 900px) {
  .wrap {
    padding: 0 40px;
  }
  .highlights-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .about-portrait {
    float: right;
    width: 240px;
    margin: 4px 0 26px 40px;
    shape-outside: inset(0 round 2px);
  }
  .gallery {
    columns: 3 240px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .art-piece {
    opacity: 1 !important;
    transform: none !important;
  }
}
