/* Lymbow site: shared look (header, loader, menu, the one-photo viewer and its grid). Every page links this. */

@property --a { syntax: "<angle>"; inherits: true; initial-value: 0deg; }
:root {
  --bg: #fbfbfa; --ink: #121214; --muted: #8a8a8c; --night: #0c0c0d;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Red Hat Text", system-ui, sans-serif;
  --pad: clamp(22px, 3.4vw, 56px);
  --head: clamp(88px, 11vh, 120px);
  --ease: cubic-bezier(.65, 0, .15, 1);
  --ox: calc(100% - 60px); --oy: 60px; --lox: 1300px; --loy: 17px;   /* where the menu grows from: set to the button by script */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
body.page-scroll { overflow: auto; height: auto; min-height: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1.5px solid currentColor; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- loader: the colour-chase wheel, then the page breathes in ---- */
.loader { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; transition: opacity .9s ease .1s, visibility .9s .1s; }
.loader img { width: 64px; height: 64px; transition: transform .9s var(--ease), opacity .6s ease; }
html.is-loaded .loader { opacity: 0; visibility: hidden; }
html.is-loaded .loader img { transform: scale(.6); opacity: 0; }
html.no-loader .loader { display: none; }

/* ---- header: the logo left, the menu button right; it stays above the menu ---- */
.top { position: fixed; inset: 0 0 auto; height: var(--head); padding: 0 var(--pad); display: flex; align-items: center; justify-content: space-between; z-index: 50; pointer-events: none; }
.top > * { pointer-events: auto; }
.logo { position: relative; display: block; height: 34px; width: 38px; }
.logo .lg { position: absolute; left: 0; top: 0; width: 220px; height: 34px; pointer-events: none; }
.logo .lc-logo { position: absolute; left: 0; top: 0; height: 34px; width: auto; transition: opacity .5s ease .1s; }
.logo .logo-dark { position: absolute; left: 0; top: 50%; height: 30px; width: auto; transform: translateY(-50%); opacity: 0; transition: opacity .5s ease; }
.logo-dark--w1 { display: none; }
html[data-dark="w1"] .logo-dark--w5 { display: none; }
html[data-dark="w1"] .logo-dark--w1 { display: block; }
body.is-menu .logo .lc-logo { opacity: 0; transition-delay: 0s; }
body.is-menu .logo .logo-dark { opacity: 1; transition-delay: .35s; }

/* ---- the menu button: five looks, each turns into a close mark ---- */
.burger { position: relative; width: 48px; height: 48px; margin-right: -10px; display: grid; place-items: center; color: var(--ink); transition: color .4s ease; }
body.is-menu .burger { color: #f4f4f2; }
.burger i { position: absolute; left: 50%; top: 50%; display: block; background: currentColor; transition: transform .5s var(--ease), opacity .3s ease, width .5s var(--ease); }
.burger .bt { display: none; font-family: var(--serif); font-style: italic; font-size: 22px; }
/* lines: two even lines */
html[data-burger="lines"] .burger i { width: 28px; height: 1.5px; margin-left: -14px; }
html[data-burger="lines"] .burger .b1 { transform: translateY(-5px); }
html[data-burger="lines"] .burger .b2 { transform: translateY(5px); }
html[data-burger="lines"] .burger .b3 { opacity: 0; }
/* offset: a long line over a short one, both on the right */
html[data-burger="offset"] .burger i { height: 1.5px; right: 10px; left: auto; }
html[data-burger="offset"] .burger .b1 { width: 28px; transform: translateY(-5px); }
html[data-burger="offset"] .burger .b2 { width: 16px; transform: translateY(5px); }
html[data-burger="offset"] .burger .b3 { opacity: 0; }
/* dots: three small dots */
html[data-burger="dots"] .burger i { width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; }
html[data-burger="dots"] .burger .b1 { transform: translateX(-9px); }
html[data-burger="dots"] .burger .b3 { transform: translateX(9px); }
/* word: the word itself */
html[data-burger="word"] .burger { width: auto; padding: 0 10px; }
html[data-burger="word"] .burger i { display: none; }
html[data-burger="word"] .burger .bt { display: block; }
/* eye: a ring with a pupil, like the mark's eye */
html[data-burger="eye"] .burger .b1 { width: 22px; height: 22px; margin: -11px 0 0 -11px; background: none; border: 1.5px solid currentColor; border-radius: 50%; }
html[data-burger="eye"] .burger .b2 { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; transform: translate(3px, -3px); }
html[data-burger="eye"] .burger .b3 { opacity: 0; }
/* open: every look becomes a thin cross (word becomes "Close") */
body.is-menu .burger i { width: 26px !important; height: 1.5px !important; margin: 0 0 0 -13px !important; left: 50% !important; right: auto !important; border: 0 !important; border-radius: 0 !important; background: currentColor !important; opacity: 1; }
body.is-menu .burger .b1 { transform: rotate(45deg); }
body.is-menu .burger .b2 { transform: rotate(-45deg); }
body.is-menu .burger .b3 { opacity: 0; }

/* ---- the photograph: centred, with room around it ---- */
main { position: fixed; inset: var(--head) var(--pad) 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: calc(var(--head) * .55); }
.slide { position: relative; margin: 0; height: min(64vh, 760px); max-width: min(78vw, 1100px); display: flex; justify-content: center; }
.slide img { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; opacity: 1; transition: opacity .8s ease; user-select: none; -webkit-user-drag: none; }
.slide img.is-fading { opacity: 0; transition-duration: .45s; }
.hit { position: absolute; top: 0; bottom: 0; width: 50%; }
.hit--prev { left: 0; cursor: w-resize; }
.hit--next { right: 0; cursor: e-resize; }
.count { margin-top: 28px; display: flex; align-items: center; gap: 22px; font-size: 13px; letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.grid-btn { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); transition: color .3s ease; }
.grid-btn:hover { color: var(--ink); }
.grid-btn svg { width: 14px; height: 14px; fill: currentColor; }

/* ---- all photographs ---- */
.grid { position: fixed; inset: var(--head) 0 0; overflow-y: auto; padding: 8px var(--pad) 120px; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility .5s; }
body.is-grid .grid { opacity: 1; visibility: visible; }
body.is-grid main .slide { opacity: 0; pointer-events: none; }
body.is-grid .count { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); margin: 0; background: var(--bg); padding: 4px 6px 4px 18px; border-radius: 99px; box-shadow: 0 0 0 1px rgb(18 18 20 / .08); z-index: 5; }
.grid ol { list-style: none; margin: 0 auto; padding: 0; max-width: 1280px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 28px; }
.grid button { display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.grid button:hover img { transform: scale(1.025); }

/* ---- the menu: night ground, white words ---- */
.menu { position: fixed; inset: 0; z-index: 40; color: #f4f4f2; visibility: hidden; display: flex; flex-direction: column; justify-content: center; padding: var(--head) var(--pad) var(--pad); }
.menu nav { padding-left: clamp(0px, 8vw, 160px); }
.menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(4px, 1.2vh, 14px); }
.menu li { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .7s var(--ease); }
.menu nav a { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(38px, 5vw, 68px); line-height: 1.12; letter-spacing: -0.005em; color: rgb(244 244 242 / .92); background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .4s var(--ease), color .3s ease; }
.menu nav a:hover, .menu nav a[aria-current="page"] { background-size: 100% 1px; color: #fff; }
.menu nav a .ext { font-family: var(--sans); font-style: normal; font-size: .3em; vertical-align: .9em; margin-left: .4em; opacity: .6; }
body.is-menu .menu { visibility: visible; }
body.is-menu .menu li { opacity: 1; transform: none; transition-delay: calc(.38s + var(--i) * .06s); }

/* 1. iris: the night opens from the button like a lens aperture */
html[data-menu="iris"] .menu { background: var(--night); clip-path: circle(0 at var(--ox) var(--oy)); transition: clip-path .85s var(--ease), visibility 0s .85s; }
html[data-menu="iris"] body.is-menu .menu { clip-path: circle(150vmax at var(--ox) var(--oy)); transition: clip-path .9s var(--ease), visibility 0s; }

/* 2. shutter: two blades meet in the middle, like a camera shutter */
html[data-menu="shutter"] .menu { transition: visibility 0s .8s; }
html[data-menu="shutter"] .menu::before, html[data-menu="shutter"] .menu::after { content: ""; position: absolute; left: 0; right: 0; height: 50.5%; background: var(--night); transition: transform .7s var(--ease); z-index: -1; }
html[data-menu="shutter"] .menu::before { top: 0; transform: translateY(-101%); }
html[data-menu="shutter"] .menu::after { bottom: 0; transform: translateY(101%); transition-delay: .05s; }
html[data-menu="shutter"] body.is-menu .menu { transition: visibility 0s; }
html[data-menu="shutter"] body.is-menu .menu::before, html[data-menu="shutter"] body.is-menu .menu::after { transform: none; }

/* 3. wheel: the logo's colour wheel sweeps round from the button and leaves the night behind it.
      --a animates on body, so the menu's ground and both logo layers follow one sweep: the dark
      wordmark appears exactly where the night has reached, the light mark stays where it has not. */
html[data-menu="wheel"] body { --a: 0deg; transition: --a .95s var(--ease); }
html[data-menu="wheel"] body.is-menu { --a: 396deg; transition: --a 1.05s var(--ease); }
html[data-menu="wheel"] .menu { background: conic-gradient(from 85deg at var(--ox) var(--oy), var(--night) 0 calc(var(--a) - 36deg), #001A94 calc(var(--a) - 36deg), #662277 calc(var(--a) - 31deg), #EC008C calc(var(--a) - 26deg), #E81123 calc(var(--a) - 21deg), #FF8C00 calc(var(--a) - 16deg), #FFF100 calc(var(--a) - 11deg), #009E49 calc(var(--a) - 6deg), #00BCF2 calc(var(--a) - 1deg), transparent var(--a)); transition: visibility 0s .95s; }
html[data-menu="wheel"] body.is-menu .menu { transition: visibility 0s; }
html[data-menu="wheel"] .logo .lc-logo, html[data-menu="wheel"] .logo .logo-dark { opacity: 1; transition: none; }
html[data-menu="wheel"] .lg-light { -webkit-mask-image: conic-gradient(from 85deg at var(--lox) var(--loy), transparent 0 calc(var(--a) - 36deg), #000 calc(var(--a) - 36deg)); mask-image: conic-gradient(from 85deg at var(--lox) var(--loy), transparent 0 calc(var(--a) - 36deg), #000 calc(var(--a) - 36deg)); }
html[data-menu="wheel"] .lg-dark { -webkit-mask-image: conic-gradient(from 85deg at var(--lox) var(--loy), #000 0 calc(var(--a) - 36deg), transparent calc(var(--a) - 36deg)); mask-image: conic-gradient(from 85deg at var(--lox) var(--loy), #000 0 calc(var(--a) - 36deg), transparent calc(var(--a) - 36deg)); }

/* 4. slide: the night slides in from the right, the words follow */
html[data-menu="slide"] .menu { background: var(--night); transform: translateX(100%); transition: transform .8s var(--ease), visibility 0s .8s; }
html[data-menu="slide"] body.is-menu .menu { transform: none; transition: transform .85s var(--ease), visibility 0s; }

/* ---- phone ---- */
@media (max-width: 760px) {
  :root { --pad: 20px; --head: 76px; }
  .logo .lc-logo { height: 28px; }
  .logo .logo-dark { height: 24px; }
  main { inset: var(--head) 0 0; padding: 0 0 72px; }
  .slide { height: auto; max-width: 100%; width: calc(100vw - 2 * var(--pad)); }
  .slide img { width: 100%; height: auto; max-height: 66svh; }
  .grid ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .menu nav { padding-left: 4px; }
  }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01s !important; transition-delay: 0s !important; }
}

/* ---- project view (Selected work): the title over the photograph, a way back beside the counter ---- */
.viewer__title { margin: 0 0 18px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(22px, 1.8vw, 28px); letter-spacing: -0.005em; text-align: center; }
.count .back { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .3s ease; }
.count .back:hover { color: var(--ink); }

/* ---- project index (Selected work): covers with their titles ---- */
.projects { padding: calc(var(--head) + 8px) var(--pad) 96px; max-width: 1280px; margin: 0 auto; }
.projects h1 { margin: 0 0 clamp(28px, 5vh, 56px); font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(36px, 4vw, 56px); letter-spacing: -0.01em; }
.projects ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: clamp(28px, 4vw, 56px) clamp(20px, 3vw, 40px); }
.projects a { display: block; }
.projects .cover { aspect-ratio: 4 / 5; overflow: hidden; background: #efefed; }
.projects .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.projects a:hover .cover img { transform: scale(1.025); }
.projects .name { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 14px; }
.projects .name span:first-child { font-family: var(--serif); font-style: italic; font-size: 22px; }
.projects .name span:last-child { font-size: 12px; letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.projects .empty { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted); }
@media (max-width: 760px) { .projects ol { grid-template-columns: 1fr; } }

/* ---- a quiet page (until its content arrives) ---- */
.quiet { min-height: 100svh; display: grid; align-content: center; padding: var(--head) var(--pad); max-width: 1280px; margin: 0 auto; }
.quiet h1 { margin: 0 0 12px; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(40px, 5vw, 68px); letter-spacing: -0.01em; }
.quiet p { margin: 0; font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted); }

[hidden] { display: none !important; }
