/* Shared base — Swiss deck: tight grotesk headlines, off-white pages, black covers */
:root {
  --bg: #f5f5f4;
  --black: #070808;
  --ink: #0a0a0a;
  --ink-2: #4d4d4d;
  --ink-3: #8b8b8b;
  --soft: #ebebea;
  --line: #d9d9d7;
  --glass-line: #d9d9d7;
  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max: 1440px;
  --gutter: max(clamp(18px, 4.6vw, 72px), calc((100vw - var(--max)) / 2 + 72px));
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: #fff; }
.sheet { overflow-x: clip; }
.wrap { padding: 0 var(--gutter); }

/* Giant headline: fitted to the column width by JS, tight and overlapping like the deck */
.giant { display: block; width: max-content; max-width: none; font-weight: 800; text-transform: none; letter-spacing: -0.035em; line-height: .8; white-space: nowrap; font-size: clamp(56px, 13vw, 210px); margin-left: -0.04em; }
.giant.case { text-transform: none; }

/* Header */
.g-header { position: sticky; top: 0; z-index: 50; background: rgba(245, 245, 244, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.g-header .bar { height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 0 var(--gutter); font-size: 15px; }
.g-brand { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; line-height: 1.05; }
.g-brand .mark { font-weight: 800; letter-spacing: -0.06em; font-size: 22px; }
.g-brand b { font-weight: 700; text-transform: none; font-size: 13px; letter-spacing: .02em; }
.g-brand small { display: block; font-size: 13px; text-transform: none; letter-spacing: .02em; }
.g-links { display: flex; gap: 32px; }
.g-links a:hover { opacity: .5; }
.g-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; }
.g-header .bar > .btn, .g-header .bar > .tag-r { justify-self: end; }
@media (max-width: 820px) { .g-header .bar { grid-template-columns: 1fr auto; } .g-links { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; font-size: 15px; font-weight: 500; white-space: nowrap; transition: background .2s, color .2s; }
.btn svg { width: 16px; height: 16px; }
.btn-dark, .btn-light { background: var(--ink); color: #fff; border: 1.5px solid var(--ink); }
.btn-dark:hover, .btn-light:hover { background: #333; }
.btn-outline, .btn-glass { border: 1.5px solid currentColor; }
.btn-outline:hover, .btn-glass:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }

/* Deck-style section footer: mark · name · page · Portfolio · year */
.folio-row { display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: end; gap: 16px; padding: 56px 0 28px; font-size: 12px; }
.folio-row .pg { font-size: 22px; font-weight: 400; text-align: center; }
.folio-row :nth-child(2) { text-align: center; }
.folio-row :nth-child(4) { text-align: center; }
.folio-row :last-child { text-align: right; }
.folio-row b { font-weight: 800; letter-spacing: -0.04em; font-size: 14px; }
@media (max-width: 700px) { .folio-row { grid-template-columns: 1fr auto 1fr; } .folio-row :nth-child(2), .folio-row :nth-child(4) { display: none; } }

/* Fade-in */
.fade { opacity: 0; transform: translate3d(0, var(--y, 18px), 0); transition: opacity .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0s), transform .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0s); }
.fade.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .fade { opacity: 1; transform: none; transition: none; } }

/* Back-to-top button (js/totop.js) — difference blend keeps it visible on light and black sections */
.to-top {
  position: fixed; right: clamp(16px, 2.4vw, 32px); bottom: clamp(16px, 2.4vw, 32px); z-index: 60;
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: #000; mix-blend-mode: difference;
  display: grid; place-items: center;
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  transition: opacity .3s, transform .3s cubic-bezier(.2, .7, .2, 1);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px); }
.to-top svg { width: 22px; height: 22px; }
.to-top:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Page loader (js/loader.js): black screen with the cover's water drop until every image is loaded */
html.pj-loading, html.pj-loading body { background: #070808; overflow: hidden; }
html.pj-loading body > *:not(#pj-loader) { visibility: hidden; }
#pj-loader { position: fixed; inset: 0; z-index: 9999; background: #070808; transition: opacity .6s ease, visibility .6s; }
#pj-loader canvas { display: block; width: 100%; height: 100%; }
#pj-loader.out { opacity: 0; visibility: hidden; pointer-events: none; }
#pj-loader.no-gl::after { content: ""; position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%;
  background: radial-gradient(circle at 36% 36%, rgba(255,255,255,.95) 0 3%, transparent 5%), radial-gradient(circle, transparent 62%, rgba(150,170,255,.35) 72%, rgba(190,120,255,.5) 78%, transparent 80%); }

/* Case transition (js/transition.js out of the home, js/loader.js into the case page) */
.pj-tx { position: fixed; inset: 0; z-index: 9998; pointer-events: none; }
.pj-tx .tx-panel { position: absolute; inset: 0; background: var(--tx, #070808); }
.pj-tx .tx-cwrap { display: contents; }
.pj-tx .tx-clone { position: fixed; margin: 0; transform-origin: 50% 50%; overflow: hidden; border-radius: 20px; z-index: 1; }
.tx-name { position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(28px, 6vh, 72px); z-index: 2; color: #f5f5f4; }
.tx-name small { display: block; font-size: clamp(16px, 1.6vw, 22px); font-weight: 300; letter-spacing: .02em; opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .6s cubic-bezier(.22,1,.36,1); }
.tx-name b { display: block; overflow: hidden; font-weight: 800; letter-spacing: -0.045em; line-height: .9; font-size: clamp(64px, 14vw, 230px); white-space: nowrap; padding-bottom: .06em; }
.tx-name b span { display: inline-block; transform: translateY(105%); transition: transform .55s cubic-bezier(.22,1,.36,1) calc(var(--i) * 20ms); }
.pj-tx.go .tx-name small { opacity: .7; transform: none; transition-delay: .3s; }
.pj-tx.go .tx-name b span { transform: none; transition-delay: calc(.22s + var(--i) * 20ms); }
/* arrival: the same screen, already in place, then it wipes up */
#pj-loader.tx { background: var(--tx, #070808); clip-path: inset(0 0 0 0); transition: clip-path .65s cubic-bezier(.76,0,.24,1) .05s, visibility 0s .75s; }
#pj-loader.tx .tx-name small { opacity: .7; transform: none; }
#pj-loader.tx .tx-name b span { transform: none; }
#pj-loader.tx.out { opacity: 1; visibility: hidden; clip-path: inset(0 0 100% 0); }
#pj-loader.tx.out .tx-name b span { transform: translateY(-105%); transition: transform .4s cubic-bezier(.76,0,.24,1) calc(var(--i) * 12ms); }
#pj-loader.tx.out .tx-name small { opacity: 0; transition: opacity .3s; }
html.pj-tx-in.pj-loading, html.pj-tx-in.pj-loading body { background: var(--tx); }
/* Burst reveal: the black fades away but the droplets and shockwave keep flying over the page */
#pj-loader:not(.tx) { transition: background-color .45s ease, opacity .3s ease .45s, visibility 0s .75s; }
#pj-loader.out:not(.tx) { background-color: transparent; opacity: 0; }
@media (prefers-reduced-motion: reduce) { #pj-loader:not(.tx) { transition: opacity .4s ease, visibility .4s; } }
