/* Lampri Studio — main stylesheet */
:root {
  --ground: #F2EFE8;
  --ground-2: #E9E5DC;
  --ink: #23211E;
  --muted: #77716A;
  --line: #D9D3C7;
  --white: #FFFFFF;
  --sans: 'Hanken Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.22, .61, .21, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

/* Page fade transition */
html.js body { opacity: 0; transition: opacity .7s var(--ease); }
html.js body.is-ready { opacity: 1; }
html.js body.is-leaving { opacity: 0; transition-duration: .45s; }

/* ---------- Header ---------- */
.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  color: var(--white);
  padding-top: env(safe-area-inset-top, 0px);
}
.site-header.on-light { color: var(--ink); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 64px;
}
.nav { display: flex; gap: 22px; }
.nav a, .brand {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500;
}
.nav a { opacity: .85; transition: opacity .3s; position: relative; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.nav a[aria-current="page"]::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor;
}
.brand { letter-spacing: .08em; white-space: nowrap; }
.brand { display: block; line-height: 0; }
.brand img { height: 12px; width: auto; }
.hero-logo img { width: clamp(220px, 24vw, 360px); height: auto; }
.hero-logo .reveal-line { animation-name: logoIn; }
@keyframes logoIn { from { opacity: 0; transform: scale(.96); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.menu-toggle { display: none; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; }

/* ---------- Full-screen hero ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 520px;
  overflow: hidden; color: var(--white); background: #2a2622;
}
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.8s var(--ease); }
.hero-slide.is-active { opacity: 1; z-index: 1; }
.hero-slide img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.08); transition: transform 9s linear;
}
.hero-slide.is-active img { transform: scale(1); }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.28) 0%, rgba(0,0,0,.05) 30%, rgba(0,0,0,.05) 60%, rgba(0,0,0,.32) 100%);
}
.hero-title {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; text-align: center; white-space: nowrap;
  font-size: clamp(15px, 1.6vw, 20px); font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
}
.hero-title span { margin-left: .9em; font-weight: 400; }
.hero-title .reveal-line { display: inline-block; animation: heroIn 1.6s .35s var(--ease) both; }
.hero-bottom {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 34px;
  display: grid; justify-items: center; gap: 16px; text-align: center;
  padding-inline: var(--gutter);
  animation: fadeIn 1.4s .9s both;
}
.hero-sub { font-size: 12.5px; line-height: 1.45; margin: 0; }
.hero-link {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.6); padding-bottom: 2px;
  transition: border-color .3s;
}
.hero-link:hover { border-color: #fff; }
.dots { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.dots button { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.55); transition: transform .4s var(--ease), background .4s; }
.dots button.is-active { background: #fff; transform: scale(1.6); }
.hero-caption { transition: opacity .6s; }
.hero-caption.is-out { opacity: 0; }

/* Single-image hero (inner pages) */
.hero--page .hero-slide { opacity: 1; }
.hero--page .hero-slide img { animation: slowZoom 2.4s var(--ease) both; transform: none; transition: none; }
.hero--page .hero-title { font-size: clamp(22px, 2.6vw, 34px); font-weight: 400; letter-spacing: .01em; text-transform: none; }
.hero-label { font-size: 12.5px; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(80px, 11vw, 150px); }
.label { font-size: 12px; color: var(--ink); margin: 0 0 18px; }
.small { font-size: 12px; line-height: 1.6; }
.muted { color: var(--muted); }

/* ---------- Selected works (scattered grid) ---------- */
.works {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2.6vw, 32px);
  row-gap: clamp(70px, 9vw, 120px);
  align-items: start;
}
.work { display: block; }
.work-media { overflow: hidden; background: var(--ground-2); }
.work-media img { width: 100%; transition: transform 1.4s var(--ease), opacity .6s; }
.work:hover .work-media img { transform: scale(1.035); }
.work-meta { padding-top: 12px; font-size: 12.5px; line-height: 1.45; }
.work-meta h3 { margin: 0; font-size: 12.5px; font-weight: 500; }
.work-meta .type { display: block; }
.work-meta .tag { display: block; margin-top: 8px; color: var(--muted); max-width: 30ch; }
.work-meta .more {
  display: inline-block; margin-top: 10px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  opacity: 0; transform: translateY(4px); transition: opacity .4s, transform .4s var(--ease);
}
.work:hover .more, .work:focus-visible .more { opacity: 1; transform: none; }

/* placement pattern — repeats every 6 items */
.work:nth-of-type(6n+1) { grid-column: 1 / span 5; }
.work:nth-of-type(6n+2) { grid-column: 8 / span 4; margin-top: clamp(30px, 5vw, 70px); }
.work:nth-of-type(6n+3) { grid-column: 2 / span 4; }
.work:nth-of-type(6n+4) { grid-column: 7 / span 6; margin-top: clamp(60px, 10vw, 150px); }
.work:nth-of-type(6n+5) { grid-column: 1 / span 6; }
.work:nth-of-type(6n+6) { grid-column: 9 / span 4; margin-top: clamp(40px, 7vw, 100px); }

.studio-note {
  grid-column: 3 / span 8;
  padding-block: clamp(20px, 4vw, 50px);
}
.studio-note p { font-size: clamp(16px, 1.5vw, 19px); line-height: 1.5; margin: 0 0 22px; text-wrap: pretty; }
.text-link {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500;
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}

.all-work { margin: clamp(60px, 8vw, 110px) 0 0; text-align: center; }

/* ---------- Work page (all projects) ---------- */
.hero--short { height: 62vh; height: 62svh; min-height: 380px; }
.section--tight { padding-top: clamp(50px, 6vw, 80px); }
/* scattered grid — placement repeats every 9 projects */
.tiles {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2.6vw, 32px); row-gap: clamp(60px, 8vw, 110px);
  align-items: start;
}
.tile { display: block; }
.tile-media { position: relative; aspect-ratio: 4 / 5; max-width: 100%; overflow: hidden; background: var(--ground-2); }
.tile-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity .9s var(--ease), transform 1.6s var(--ease);
}
.tile-b { opacity: 0; transform: scale(1.06); }
.tile:hover .tile-a, .tile:focus-visible .tile-a { opacity: 0; transform: scale(1.04); }
.tile:hover .tile-b, .tile:focus-visible .tile-b { opacity: 1; transform: scale(1); }
.tile-meta {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: baseline;
  padding-top: 12px; font-size: 12.5px; line-height: 1.45;
}
.tile-no { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.tile-name { display: block; font-weight: 500; }
.tile-text .type { display: block; }
.tile-text .tag { display: block; margin-top: 8px; color: var(--muted); max-width: 30ch; }

.tile:nth-of-type(9n+1) { grid-column: 1 / span 4; }
.tile:nth-of-type(9n+2) { grid-column: 6 / span 3; margin-top: clamp(60px, 9vw, 130px); }
.tile:nth-of-type(9n+2) .tile-media { aspect-ratio: 3 / 4; }
.tile:nth-of-type(9n+3) { grid-column: 10 / span 3; margin-top: clamp(20px, 3vw, 40px); }
.tile:nth-of-type(9n+3) .tile-media { aspect-ratio: 1 / 1; }
.tile:nth-of-type(9n+4) { grid-column: 2 / span 5; }
.tile:nth-of-type(9n+4) .tile-media { aspect-ratio: 5 / 4; }
.tile:nth-of-type(9n+5) { grid-column: 8 / span 4; margin-top: clamp(80px, 12vw, 170px); }
.tile:nth-of-type(9n+6) { grid-column: 1 / span 3; margin-top: clamp(30px, 4vw, 60px); }
.tile:nth-of-type(9n+6) .tile-media { aspect-ratio: 3 / 4; }
.tile:nth-of-type(9n+7) { grid-column: 5 / span 4; }
.tile:nth-of-type(9n+7) .tile-media { aspect-ratio: 1 / 1; }
.tile:nth-of-type(9n+8) { grid-column: 10 / span 3; margin-top: clamp(70px, 11vw, 150px); }
.tile:nth-of-type(9n+9) { grid-column: 3 / span 6; }
.tile:nth-of-type(9n+9) .tile-media { aspect-ratio: 5 / 4; }

/* ---------- Two-column text (profile / project intro) ---------- */
.split {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2.6vw, 32px); row-gap: 40px;
}
.split-left { grid-column: 1 / span 3; font-size: 12px; line-height: 1.65; }
.split-right { grid-column: 6 / span 6; font-size: 15px; line-height: 1.6; }
.split-right p { margin: 0 0 18px; max-width: 62ch; }
.split-left p { margin: 0 0 14px; }

.facts { margin: 0; display: grid; gap: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.columns {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: clamp(16px, 2.6vw, 32px); row-gap: 40px;
  font-size: 12px; line-height: 1.7;
}
.columns h4 { margin: 0 0 12px; font-size: 12px; font-weight: 500; }
.columns ul { list-style: none; margin: 0; padding: 0; }

/* ---------- Project gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.6vw, 32px); row-gap: clamp(16px, 2.6vw, 32px); }
.gallery figure { margin: 0; overflow: hidden; background: var(--ground-2); cursor: zoom-in; }
.gallery img { width: 100%; transition: transform 1.4s var(--ease); }
.gallery figure:hover img { transform: scale(1.02); }
.g-full { grid-column: 1 / -1; }
.g-half { grid-column: span 6; }
.g-solo-l { grid-column: 2 / span 6; }
.g-solo-r { grid-column: 6 / span 6; }
.g-space { grid-column: 1 / -1; height: clamp(20px, 5vw, 70px); }

.credit { margin-top: 40px; font-size: 12px; color: var(--muted); }

.next-project {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 2.6vw, 32px); align-items: end;
  border-top: 1px solid var(--line); padding-top: 28px;
}
.next-project .k { font-size: 12px; color: var(--muted); }
.next-project a.np { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 20px; align-items: end; }
.next-project a.np img { width: 160px; aspect-ratio: 4/5; object-fit: cover; transition: transform 1s var(--ease); }
.next-project a.np:hover img { transform: scale(1.04); }
.next-project .np-name { font-size: 18px; line-height: 1.3; }

/* ---------- Contact ---------- */
.contact-block { display: grid; gap: 34px; font-size: 13px; line-height: 1.6; }
.contact-block h4 { margin: 0 0 4px; font-size: 12px; font-weight: 500; }
.contact-block p { margin: 0; }
.copy-btn { margin-left: 10px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.copy-btn:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ground-2); padding-block: 60px 40px; font-size: 12px; line-height: 1.7; }
.site-footer .columns { margin-bottom: 50px; }
.site-footer p { margin: 0 0 14px; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer .columns { margin-bottom: clamp(40px, 5vw, 64px); }
.footer-mark { overflow: hidden; margin-bottom: clamp(28px, 3.5vw, 48px); line-height: 0; }
.footer-mark img { width: 100%; height: auto; transition: transform 1.6s var(--ease); }
.footer-mark.reveal.is-pending { opacity: 1; transform: none; }
.footer-mark.is-pending img { transform: translateY(102%); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 11.5px; }

/* Back to top */
.to-top {
  position: fixed; right: 22px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink);
  opacity: 0; pointer-events: none; transition: opacity .4s;
}
.to-top.is-visible { opacity: .7; pointer-events: auto; }
.to-top:hover { opacity: 1; }
.to-top svg { width: 26px; height: 14px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(242,239,232,.97);
  display: grid; grid-template-columns: 60px minmax(0, 1fr) 60px; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity .5s var(--ease);
  padding: 50px 0;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img { max-height: calc(100vh - 100px); max-width: 100%; margin: auto; object-fit: contain; transition: opacity .35s; }
.lightbox button { height: 100%; display: grid; place-items: center; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.lightbox .lb-close { position: absolute; top: 18px; right: 24px; height: auto; }
.lightbox .lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 11.5px; color: var(--muted); }
.lightbox svg { width: 14px; height: 26px; }

/* ---------- Reveal on scroll ---------- */
.reveal { transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.reveal.is-pending { opacity: 0; transform: translateY(40px); }

@keyframes heroIn { from { opacity: 0; letter-spacing: .3em; } to { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slowZoom { from { transform: scale(1.1); } to { transform: scale(1); } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .works { row-gap: 64px; }
  .work:nth-of-type(odd) { grid-column: 1 / span 9 !important; margin-top: 0 !important; }
  .work:nth-of-type(even) { grid-column: 4 / span 9 !important; margin-top: 0 !important; }
  .studio-note { grid-column: 1 / -1; }
  .tile:nth-of-type(odd) { grid-column: 1 / span 9 !important; margin-top: 0 !important; }
  .tile:nth-of-type(even) { grid-column: 4 / span 9 !important; margin-top: 0 !important; }
  .split-left, .split-right { grid-column: 1 / -1; }
  .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-half, .g-solo-l, .g-solo-r { grid-column: 1 / -1; }
  .next-project { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .nav {
    position: fixed; inset: 0; z-index: 50; background: var(--ground); color: var(--ink);
    flex-direction: column; justify-content: center; align-items: center; gap: 28px;
    opacity: 0; pointer-events: none; transition: opacity .4s;
  }
  .nav a { font-size: 14px; }
  .nav.is-open { opacity: 1; pointer-events: auto; }
  .menu-toggle { display: block; position: relative; z-index: 60; }
  .menu-toggle[aria-expanded="true"] { color: var(--ink); }
  .site-header .container { flex-direction: row-reverse; }
  .work:nth-of-type(n) { grid-column: 1 / -1 !important; }
  .tile:nth-of-type(n) { grid-column: 1 / -1 !important; }
  .tile-b { display: none; }
  .hero-title { white-space: normal; width: 90%; }
  .next-project a.np { grid-template-columns: 110px minmax(0, 1fr); }
  .next-project a.np img { width: 110px; }
  .lightbox { grid-template-columns: 40px minmax(0, 1fr) 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal.is-pending { opacity: 1; transform: none; }
  html.js body { opacity: 1; }
}
