/* ==========================================================
   DUFRAMES — styles
   Light, editorial look. Colors and fonts live in :root.
   ========================================================== */
:root {
  --bg: #f1efea;            /* warm paper white */
  --bg-2: #e6e3dc;
  --ink: #121212;
  --muted: #7a766e;
  --line: rgba(18, 18, 18, 0.14);
  --accent: #e8401c;        /* signal red-orange: hovers & highlights */
  --display: "Archivo", "Arial Narrow", sans-serif;
  --body: "Archivo", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(16px, 2.4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--ink); color: var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Big condensed headline type */
.display {
  font-family: var(--display); font-stretch: 62.5%; font-weight: 800;
  text-transform: uppercase; letter-spacing: -0.005em; line-height: 0.86;
}
.label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.muted { color: var(--muted); }
.ul-link { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.4s var(--ease), color 0.3s; }
.ul-link:hover, .ul-link.is-active { background-size: 100% 1px; }

/* Page-to-page fade (modern browsers) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut 0.3s var(--ease) both; }
::view-transition-new(root) { animation: vtIn 0.5s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; } }

/* ---------- Corner navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
  padding: var(--pad); pointer-events: none;
  color: #fff; mix-blend-mode: difference;   /* stays readable over photos and paper */
}
.nav a { pointer-events: auto; }
.nav__col { display: flex; flex-direction: column; gap: 2px; }
.nav__col--right { align-items: flex-end; text-align: right; }
.nav__logo { font-size: clamp(22px, 2.6vw, 34px); line-height: 0.8; }

/* ---------- Custom cursor: a plus sign that grows into a label ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  color: #fff; mix-blend-mode: difference; opacity: 0; transition: opacity 0.3s;
}
.cursor.is-visible { opacity: 1; }
.cursor__plus { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; transition: transform 0.4s var(--ease), opacity 0.2s; }
.cursor__plus::before, .cursor__plus::after { content: ""; position: absolute; background: currentColor; }
.cursor__plus::before { left: 8px; top: 0; width: 2px; height: 18px; }
.cursor__plus::after { top: 8px; left: 0; height: 2px; width: 18px; }
.cursor__label {
  position: absolute; left: 14px; top: 10px; white-space: nowrap;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  opacity: 0; transform: translateX(-6px); transition: opacity 0.25s, transform 0.4s var(--ease);
}
.cursor.has-label .cursor__label { opacity: 1; transform: none; }
.cursor.has-label .cursor__plus { transform: rotate(45deg) scale(0.8); }
.cursor.is-grabbing .cursor__plus { transform: scale(0.6); }
@media (hover: hover) and (pointer: fine) { body.has-cursor, body.has-cursor * { cursor: none !important; } }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ==========================================================
   HOME — draggable photo canvas
   ========================================================== */
body.page-home { overflow: hidden; height: 100svh; overscroll-behavior: none; }
.canvas { position: fixed; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.canvas__item { position: absolute; left: 0; top: 0; will-change: transform; z-index: 2; }
.canvas__item.is-front { z-index: 8; }
.canvas__item a { display: block; }
.canvas__item img {
  width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none;
  transform: scale(0.6); opacity: 0;
  transition: transform 1.1s var(--ease), opacity 0.8s, filter 0.4s;
}
.canvas__item.is-in img { transform: scale(1); opacity: 1; }
.canvas__item:hover img { transform: scale(1.05); }
.canvas.is-dragging .canvas__item:hover img { transform: scale(1); }

.home-title {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center;
  pointer-events: none; text-align: center; padding: 0 var(--pad);
}
.home-title .display { margin: 0; font-size: clamp(54px, 11vw, 210px); }
.home-title .display .line { display: block; overflow: hidden; }
.home-title .display .line span { display: inline-block; transform: translateY(105%); transition: transform 1.2s var(--ease); }
.home-title.is-in .display .line span { transform: none; }
.home-title .display .line:nth-child(2) span { transition-delay: 0.08s; }

.home-foot {
  position: fixed; left: var(--pad); right: var(--pad); bottom: var(--pad); z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 20px;
  color: #fff; mix-blend-mode: difference; pointer-events: none;
}
.home-foot a { pointer-events: auto; }
.home-foot p { margin: 0; max-width: 340px; }
.home-foot__right { justify-self: end; text-align: right; display: flex; flex-direction: column; gap: 2px; }
.home-foot__hint { display: flex; align-items: center; gap: 10px; }
.home-foot__hint i { display: block; width: 26px; height: 1px; background: currentColor; animation: hint 2.4s var(--ease) infinite; }
@keyframes hint { 0%, 100% { transform: scaleX(0.3); } 50% { transform: scaleX(1); } }
@media (max-width: 640px) {
  .home-foot { grid-template-columns: 1fr 1fr; }
  .home-foot__intro { display: none; }
}

/* ==========================================================
   WORK — list view (hover preview) & grid view
   ========================================================== */
.wlist {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 120px var(--pad) 110px; text-align: center;
}
.wlist__item { font-size: clamp(42px, 8.4vw, 132px); transition: opacity 0.35s, color 0.3s; display: inline-flex; align-items: flex-start; }
.wlist__item sup { font-family: var(--body); font-stretch: 100%; font-size: 13px; font-weight: 500; letter-spacing: 0.04em; margin: 0.5em 0 0 0.5em; }
.wlist:hover .wlist__item { opacity: 0.16; }
.wlist .wlist__item:hover, .wlist .wlist__item:focus-visible { opacity: 1; color: var(--accent); }
.wlist__item { opacity: 0; transform: translateY(30px); }
.wlist.is-in .wlist__item { opacity: 1; transform: none; transition: opacity 0.8s var(--ease), transform 0.9s var(--ease), color 0.3s; }
.wlist.is-in:hover .wlist__item { opacity: 0.16; transition: opacity 0.35s, color 0.3s; }
.wlist.is-in .wlist__item:hover { opacity: 1; }

.preview {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none;
  width: clamp(200px, 22vw, 340px); aspect-ratio: 4 / 5; overflow: hidden;
  opacity: 0; transition: opacity 0.3s;
}
.preview.is-on { opacity: 1; }
.preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (hover: none) { .preview { display: none; } }

.viewtoggle {
  position: fixed; bottom: var(--pad); left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; gap: 16px; color: #fff; mix-blend-mode: difference;
}

.wgrid { padding: 110px var(--pad) 120px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; margin-bottom: 40px; }
.filter { color: var(--muted); transition: color 0.3s; }
.filter:hover, .filter.is-active { color: var(--ink); }
.filter sup { font-size: 9px; margin-left: 2px; }

.gallery { display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: clamp(120px, 14vw, 240px); grid-auto-flow: dense; gap: clamp(8px, 1vw, 14px); }
@media (max-width: 1100px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px)  { .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 44vw; } }
.tile { margin: 0; position: relative; overflow: hidden; background: var(--bg-2); cursor: zoom-in; opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.tile.is-in { opacity: 1; transform: none; }
.tile.is-hidden { display: none; }
.tile--tall { grid-row: span 2; }
.tile--wide { grid-column: span 2; }
.tile--big { grid-column: span 2; grid-row: span 2; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.tile:hover img { transform: scale(1.05); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ==========================================================
   PROJECT (one category) page
   ========================================================== */
.proj-head { padding: clamp(96px, 12vw, 150px) var(--pad) 0; }
.proj-meta { display: flex; justify-content: space-between; margin-bottom: 14px; }
.proj-title { margin: 0; white-space: nowrap; font-size: 20vw; /* fitted to the screen width by script */ }
.proj-title .ch { display: inline-block; transform: translateY(100%); opacity: 0; transition: transform 1s var(--ease), opacity 0.6s; }
.proj-title.is-in .ch { transform: none; opacity: 1; }
.proj-title-wrap { overflow: hidden; }
.proj-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 26px; padding-bottom: 6vh; border-bottom: 1px solid var(--line); }
.proj-intro p { margin: 0; max-width: 460px; }

.proj-grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(12px, 2vw, 28px); row-gap: clamp(40px, 9vw, 140px); padding: 10vh var(--pad); align-items: start; }
.proj-img { position: relative; cursor: zoom-in; margin: 0; }
.proj-img .wipe { overflow: hidden; clip-path: inset(100% 0 0 0); transition: clip-path 1.3s var(--ease); }
.proj-img.is-in .wipe { clip-path: inset(0 0 0 0); }
.proj-img img { width: 100%; height: auto; transform: scale(1.15); transition: transform 1.6s var(--ease); }
.proj-img.is-in img { transform: scale(1); }
.proj-img figcaption { margin-top: 10px; color: var(--muted); }
.proj-img.is-tall img { aspect-ratio: 4 / 5; object-fit: cover; }
.proj-img.is-wide img { aspect-ratio: 3 / 2; object-fit: cover; }
.proj-img.is-natural img { aspect-ratio: auto; } /* framed photos: never crop */
@media (max-width: 760px) {
  .proj-grid { row-gap: 28px; }
  .proj-grid .proj-img { grid-column: 1 / -1 !important; margin-top: 0 !important; }
  .proj-grid .proj-img.is-pair { grid-column: span 6 !important; }
  .proj-intro { grid-template-columns: 1fr; }
}

.proj-next { border-top: 1px solid var(--line); padding: 12vh var(--pad) 14vh; text-align: center; }
.proj-next a { display: inline-block; font-size: clamp(48px, 12vw, 200px); transition: color 0.3s; }
.proj-next a:hover { color: var(--accent); }

/* ==========================================================
   ABOUT
   ========================================================== */
.statement { padding: clamp(120px, 16vw, 200px) var(--pad) 12vh; text-align: center; max-width: 1400px; margin: 0 auto; }
.statement p { margin: 0 0 0.5em; font-size: clamp(30px, 4.6vw, 74px); }
.statement a { color: var(--accent); }
.statement .ul-link { background-size: 100% 0.06em; }
.statement .ul-link:hover { background-size: 0 0.06em; }
.stagger > * { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.stagger.is-in > * { opacity: 1; transform: none; }
.stagger.is-in > *:nth-child(2) { transition-delay: 0.12s; }
.stagger.is-in > *:nth-child(3) { transition-delay: 0.24s; }
.stagger.is-in > *:nth-child(4) { transition-delay: 0.36s; }

.about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(30px, 6vw, 100px); padding: 6vh var(--pad) 12vh; border-top: 1px solid var(--line); align-items: start; }
.about-grid__img { overflow: hidden; aspect-ratio: 4 / 5; position: sticky; top: 90px; }
.about-grid__img img { width: 100%; height: 100%; object-fit: cover; }
.about-bio { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; }
.about-bio p { margin: 0 0 1em; max-width: 680px; }
.stats { display: flex; gap: clamp(24px, 5vw, 70px); margin-top: 40px; }
.stat__num { font-size: clamp(56px, 7vw, 110px); }
.stat__label { margin-top: 6px; }
.page-about .about-grid:first-child { padding-top: clamp(100px, 12vw, 150px); border-top: 0; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } .about-grid__img { position: static; max-width: 420px; } }

.services { padding: 0 var(--pad) 12vh; }
.services__head { display: flex; justify-content: space-between; align-items: end; padding: 3vh 0 2vh; border-top: 1px solid var(--ink); }
.service { display: grid; grid-template-columns: 70px 1.2fr 1fr 1fr; gap: 20px; align-items: baseline; padding: 26px 0; border-top: 1px solid var(--line); transition: background 0.3s, padding 0.5s var(--ease); }
.service:hover { padding-left: 14px; }
.service h3 { margin: 0; font-size: clamp(30px, 4vw, 60px); transition: color 0.3s; }
.service:hover h3 { color: var(--accent); }
.service p { margin: 0; color: var(--muted); }
.service ul { margin: 0; padding: 0; list-style: none; }
@media (max-width: 860px) { .service { grid-template-columns: 40px 1fr; } .service p, .service ul { grid-column: 2; } }

/* ==========================================================
   CONTACT
   ========================================================== */
.contact-hero { padding: clamp(120px, 16vw, 200px) var(--pad) 8vh; text-align: center; }
.contact-hero h1 { margin: 0 0 30px; font-size: clamp(56px, 12vw, 220px); }
.contact-hero__email { font-size: clamp(22px, 3vw, 44px); }
.contact-hero__email:hover { color: var(--accent); }
.contact-hero__socials { display: flex; justify-content: center; gap: 22px; margin-top: 22px; }

.contact-body { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 100px); padding: 6vh var(--pad) 14vh; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .contact-body { grid-template-columns: 1fr; } }
.contact-body h2 { margin: 0 0 24px; font-size: clamp(36px, 5vw, 72px); }
.contact-note { font-size: clamp(18px, 1.6vw, 24px); line-height: 1.5; max-width: 32ch; margin: 0; }

.form { display: flex; flex-direction: column; gap: 26px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 520px) { .form__row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 17px; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 0 10px; outline: none; resize: vertical;
  transition: border-color 0.3s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-bottom-color: var(--ink); }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-bottom-color: var(--accent); }
.hp { position: absolute; left: -9999px; }
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 10px;
  padding: 18px 28px; background: var(--ink); color: var(--bg);
  text-transform: uppercase; font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  transition: background 0.3s;
}
.btn:hover { background: var(--accent); }
.form__status { margin: 0; min-height: 1.5em; }
.form__status.is-ok { color: #1f7a45; }
.form__status.is-err { color: var(--accent); }

.faq__item { border-top: 1px solid var(--line); }
.faq__item:last-child { border-bottom: 1px solid var(--line); }
.faq__item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; padding: 20px 0; font-size: 17px; font-weight: 500; transition: color 0.3s; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--accent); }
.faq__icon { position: relative; flex: 0 0 14px; height: 14px; margin-top: 5px; }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: currentColor; transition: transform 0.4s var(--ease); }
.faq__icon::after { transform: rotate(90deg); }
.faq__item[open] .faq__icon::after { transform: rotate(0deg); }
.faq__a { color: var(--muted); padding: 0 0 22px; animation: faqIn 0.5s var(--ease); }
.faq__a p { margin: 0; max-width: 560px; }
@keyframes faqIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Footer (inner pages) ---------- */
.foot { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; padding: var(--pad); border-top: 1px solid var(--line); }
.foot__mid { display: flex; gap: 18px; }
.foot__right { justify-self: end; }
@media (max-width: 640px) { .foot { grid-template-columns: 1fr 1fr; } .foot__mid { grid-column: 1 / -1; order: -1; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 500; background: rgba(241, 239, 234, 0.97);
  display: grid; place-items: center; opacity: 0; transition: opacity 0.35s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox__stage { width: min(90vw, 1500px); height: min(82vh, 1000px); display: grid; place-items: center; }
.lightbox__stage img, .lightbox__stage video { max-width: 100%; max-height: 100%; object-fit: contain; animation: lbIn 0.5s var(--ease); }
.lightbox__stage iframe { width: 100%; aspect-ratio: 16 / 9; max-height: 100%; border: 0; }
@keyframes lbIn { from { opacity: 0; transform: scale(0.97); } }
.lightbox__close, .lightbox__nav { position: absolute; padding: 10px; }
.lightbox__close { top: var(--pad); right: var(--pad); }
.lightbox__nav--prev { left: var(--pad); top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: var(--pad); top: 50%; transform: translateY(-50%); }
.lightbox__caption { position: absolute; bottom: var(--pad); left: 0; right: 0; text-align: center; }
@media (max-width: 640px) { .lightbox__nav { top: auto; bottom: 46px; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .tile, .stagger > *, .wlist__item, .canvas__item img, .proj-title .ch, .home-title .display .line span { opacity: 1 !important; transform: none !important; }
  .proj-img .wipe { clip-path: none !important; }
  html { scroll-behavior: auto; }
}

/* fixes */
.nav__col > a { width: fit-content; }
.nav__col--right > a { align-self: flex-end; }
.proj-title { display: inline-block; }
.wlist__item { font-size: clamp(38px, min(8vw, 9.4vh), 132px); }
[hidden] { display: none !important; }
.home-foot__hint { white-space: nowrap; }
