/* Hérô — same design language as cproth.com:
 * warm near-black, white ink, dot lattice, Cormorant + Inter. */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #151013;
  --panel: #211a1e;
  --text: #f7f1f3;
  --soft: #ded4d8;
  --muted: #a99ba1;
  --rule: #3d2f35;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(920px circle at 88% -6%, rgba(255, 255, 255, 0.07), transparent 64%),
    radial-gradient(880px circle at -10% 104%, rgba(255, 255, 255, 0.05), transparent 62%),
    radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.5px),
    var(--bg);
  background-size: 100% 100%, 100% 100%, 26px 26px, auto;
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Nav ---- */
.topnav {
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 22px 0 0;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.topnav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.topnav a:hover { color: var(--text); }
.topnav a.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ---- Header ---- */
header {
  padding: 40px 0 24px;
  text-align: center;
}
h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(64px, 10vw, 110px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  margin: 0;
}
.subtitle {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 0.02em;
}
.subtitle em {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 19px;
  color: var(--soft);
}
.statement {
  max-width: 640px;
  margin: 26px auto 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
}

/* ---- Müller-Lyer illusion feature ---- */
.ml {
  max-width: 620px;
  margin: 14px auto 0;
  text-align: center;
}
.ml svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.ml .fin line {
  stroke: var(--soft);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.ml .fin {
  transform-box: view-box;
  animation: finPulse 5.5s ease-in-out infinite alternate;
}
.ml .f-l1 { transform-origin: 200px 110px; }
.ml .f-r1 { transform-origin: 560px 110px; animation-direction: alternate-reverse; }
.ml .f-l2 { transform-origin: 200px 250px; animation-direction: alternate-reverse; }
.ml .f-r2 { transform-origin: 560px 250px; }
@keyframes finPulse {
  from { rotate: -2.5deg; }
  to   { rotate: 2.5deg; }
}
.ml .guide {
  stroke: var(--text);
  stroke-width: 1;
  stroke-dasharray: 4 5;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.ml:hover .guide { opacity: 0.55; }
.ml:hover .fin { opacity: 0.25; animation-play-state: paused; }
.ml-caption {
  max-width: 500px;
  margin: 4px auto 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}
.ml-caption em {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 15.5px;
  color: var(--soft);
}

/* ---- Gallery ---- */
.gallery {
  columns: 3;
  column-gap: 22px;
  padding: 40px 0 30px;
}
@media (max-width: 900px) { .gallery { columns: 2; } }
@media (max-width: 560px) { .gallery { columns: 1; } }

.work {
  break-inside: avoid;
  margin: 0 0 22px;
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--rule);
  cursor: pointer;
  padding: 0;
  background: var(--panel);
  width: 100%;
  /* scroll-reveal start state */
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.work.seen {
  opacity: 1;
  transform: none;
  /* gentle continuous drift once revealed (translate/rotate compose
   * independently of the hover-zoom transform on the inner img) */
  animation: floaty var(--fdur, 8s) ease-in-out infinite;
  animation-delay: var(--fdelay, 0s);
}
.work.seen:hover { animation-play-state: paused; }
@keyframes floaty {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  50%      { translate: 0 var(--famp, -7px); rotate: var(--frot, 0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .work.seen { animation: none; }
  .ml .fin { animation: none; }
}
.work img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1), filter 0.6s ease;
}
.work:hover img,
.work:focus-visible img {
  transform: scale(1.045);
  filter: brightness(1.06);
}
.work .caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 40px 16px 12px;
  background: linear-gradient(transparent, rgba(12, 8, 10, 0.82));
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  text-align: left;
  pointer-events: none;
}
.work .caption .num {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 2px;
}
.work .caption .t {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 19px;
}
.work:hover .caption,
.work:focus-visible .caption {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .work .caption { opacity: 1; transform: none; }
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(12, 8, 10, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox img {
  max-width: min(92vw, 1100px);
  max-height: 58vh;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.3s ease;
}
.lightbox.open img { transform: none; }
.lb-caption {
  margin-top: 16px;
  text-align: center;
  max-width: 680px;
  padding: 0 76px;
}
.lb-caption .num {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.lb-caption .t {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 30px;
  margin-top: 2px;
}
.lb-size {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.lb-desc {
  margin-top: 12px;
  color: var(--soft);
  font-size: 14.5px;
  line-height: 1.65;
  max-height: 24vh;
  overflow-y: auto;
  text-align: left;
}
.lb-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(33, 26, 30, 0.7);
  border: 1px solid var(--rule);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.lb-btn:hover { background: var(--panel); border-color: var(--muted); }
.lb-prev { left: 22px; }
.lb-next { right: 22px; }
.lb-close {
  position: fixed;
  top: 20px;
  right: 22px;
  transform: none;
}
@media (max-width: 700px) {
  .lb-btn { width: 44px; height: 44px; font-size: 21px; }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
}

footer {
  padding: 40px 0 48px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  border-top: 1px solid var(--rule);
}

/* ---- In the Wild ---- */
.wild-grid {
  columns: 2;
  column-gap: 24px;
  padding: 30px 0;
}
@media (max-width: 640px) { .wild-grid { columns: 1; } }
.wild-item {
  break-inside: avoid;
  margin: 0 0 24px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--panel);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.wild-item.seen { opacity: 1; transform: none; }
.wild-item img {
  display: block;
  width: 100%;
  height: auto;
}
.wild-item figcaption {
  padding: 13px 16px 15px;
  font-size: 13.5px;
  color: var(--muted);
}
.wild-item figcaption .t {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  color: var(--text);
  margin-right: 8px;
}
