:root {
  --bg: #111111;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.55);
  --line: rgba(255, 255, 255, 0.18);
  --pink: #f2a3c4;
  --green: #a9d98f;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "Inconsolata", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(16px, 4.5vw, 86px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}
html { overflow-x: clip; }
img { 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(--pink); color: #111; }

@media (hover: hover) and (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
}

/* ---------- ambient layers ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
.spotlight {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 30%), rgba(169, 217, 143, 0.07), transparent 60%),
              radial-gradient(380px circle at calc(var(--mx, 50%) + 120px) calc(var(--my, 30%) + 80px), rgba(242, 163, 196, 0.05), transparent 60%);
  transition: opacity 0.6s;
}

/* ---------- cursor ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none;
  width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: #fff; mix-blend-mode: difference;
  display: grid; place-items: center;
  transition: width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), background 0.3s, opacity 0.3s;
  opacity: 0;
}
body.has-cursor .cursor { opacity: 1; }
.cursor.is-hover { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
.cursor.is-label {
  width: 116px; height: 116px; margin: -58px 0 0 -58px;
  mix-blend-mode: normal; background: #fff; color: #111;
}
.cursor.is-down { transform: scale(0.8); }
.cursor-label {
  font-size: 15px; font-weight: 500; white-space: nowrap; opacity: 0; transform: scale(0.6);
  transition: opacity 0.25s, transform 0.35s var(--ease);
}
.cursor.is-label .cursor-label { opacity: 1; transform: none; }
/* small pill that sits beside the pointer instead of covering what's under it */
.cursor.is-tag {
  width: auto; height: auto; margin: 16px 0 0 16px; padding: 5px 10px; border-radius: 100px;
  mix-blend-mode: normal; background: #fff; color: #111;
}
.cursor.is-tag .cursor-label { opacity: 1; transform: none; font-size: 13px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(14px, 2.76vw, 53px) clamp(16px, 3.07vw, 59px) 0;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.logo {
  width: clamp(32px, 2.4vw, 46px); opacity: 0; transform: rotate(-90deg) scale(0.6);
  transition: opacity 0.4s, transform 0.6s var(--ease);
}
.logo img { width: 100%; filter: invert(1); }
.scrolled .logo { opacity: 1; transform: none; }
.logo:hover img { animation: spin 1.2s var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }

.links { display: flex; gap: clamp(8px, 1.25vw, 24px); }
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #fff; background: rgba(17, 17, 17, 0.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: clamp(8px, 0.83vw, 16px) clamp(14px, 1.67vw, 32px);
  font-size: clamp(14px, 1.67vw, 32px); font-weight: 500; line-height: 1.1;
  transition: color 0.4s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; background: #fff;
  transform: translateY(101%); transition: transform 0.45s var(--ease); border-radius: 0;
}
.btn span { position: relative; display: inline-block; transition: transform 0.45s var(--ease); }
.btn:hover, .btn:focus-visible { color: #111; }
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* ---------- hero ---------- */
.hero {
  /* landscape composition: 1920 × 820 design px, scaled to fit width and height */
  --dw: 1920; --dh: 820;
  --u: min(100vw / var(--dw), (100svh - 180px) / var(--dh));
  position: relative; overflow: clip; height: 100svh; min-height: 520px;
}
.stage {
  /* centred with margins, not a transform: a transform would isolate the
     flowers' screen blend and bring back their black squares */
  position: absolute; left: 50%; top: calc(50% + 20px);
  width: calc(var(--dw) * var(--u)); height: calc(var(--dh) * var(--u));
  margin: calc(var(--dh) * var(--u) / -2) 0 0 calc(var(--dw) * var(--u) / -2);
}
.stage > * { --px: calc(var(--x) * var(--u)); --py: calc(var(--y) * var(--u)); }

.deco {
  position: absolute; left: var(--px); top: var(--py); width: calc(var(--w) * var(--u)); height: auto;
  mix-blend-mode: screen; user-select: none; -webkit-user-drag: none; touch-action: none;
  --tx: 0px; --ty: 0px; --spin: 0deg;
  transform: translate3d(var(--tx), var(--ty), 0) rotate(calc(var(--r) + var(--spin))) scale(var(--s, 1));
  cursor: grab; will-change: transform;
  animation: pop-in 1.1s var(--ease) both;
}
.deco.is-dragging { cursor: grabbing; --s: 1.08; z-index: 5; }
.deco--pink  { --x: 428;  --y: 138; --w: 113; --r: -83.5deg; animation-delay: 0.35s; }
.deco--green { --x: 332;  --y: 334; --w: 330; --r: -23.9deg; animation-delay: 0.2s; }
.deco--round { --x: 1367; --y: 54;  --w: 159; --r: 0deg;     animation-delay: 0.5s; }
@keyframes pop-in { from { opacity: 0; scale: 0.4; } to { opacity: 1; scale: 1; } }

.intro {
  --y: 192;
  position: absolute; left: 50%; top: var(--py); transform: translateX(-50%);
  width: calc(var(--iw, 820) * var(--u)); text-align: center; display: flex; flex-direction: column; align-items: center; gap: calc(4 * var(--u));
  pointer-events: none;
}
.title {
  margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: calc(var(--fs, 160) * var(--u)); line-height: 1; letter-spacing: -0.01em; white-space: nowrap;
  pointer-events: auto;
}
.title .ch {
  display: inline-block; transform-origin: 50% 80%;
  transform: translateY(var(--cy, 0)) rotate(var(--cr, 0)) scale(var(--cs, 1));
  animation: rise 1s var(--ease) both; animation-delay: calc(var(--i) * 45ms + 0.1s);
  transition: color 0.3s;
}
.title .ch.sp { width: 0.25em; }
.title .ch.lit { color: var(--pink); }
@keyframes rise { from { opacity: 0; translate: 0 0.5em; filter: blur(8px); } to { opacity: 1; translate: 0 0; filter: none; } }
.lead {
  margin: 0; width: calc(var(--lw, 682) * var(--u)); font-size: calc(var(--lf, 36) * var(--u)); line-height: 0.98; letter-spacing: -0.02em;
  animation: fade-up 1s var(--ease) 0.6s both;
}
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.avatar {
  --x: 1348; --y: 352; --w: 188;
  position: absolute; left: var(--px); top: var(--py); width: calc(var(--w) * var(--u)); aspect-ratio: 188 / 207;
  --tx: 0px; --ty: 0px;
  transform: translate3d(var(--tx), var(--ty), 0);
  animation: pop-in 1.1s var(--ease) 0.45s both;
  -webkit-tap-highlight-color: transparent;
}
.avatar img {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-mask: url("./assets/avatar-mask.svg") center / 100% 100% no-repeat;
          mask: url("./assets/avatar-mask.svg") center / 100% 100% no-repeat;
  transition: transform 0.6s var(--ease), filter 0.4s;
}
.avatar:hover img { transform: rotate(-8deg) scale(1.06); }
.avatar.is-pop img { animation: squish 0.5s var(--ease); }
@keyframes squish {
  0% { transform: scale(1); } 30% { transform: scale(0.86, 0.92) rotate(6deg); }
  60% { transform: scale(1.08) rotate(-4deg); } 100% { transform: scale(1); }
}
.avatar:focus-visible { outline: none; }
.avatar:focus-visible img { filter: drop-shadow(0 0 0 2px var(--green)) drop-shadow(0 0 12px var(--green)); }

.counter {
  --x: 1461; --y: 481;
  position: absolute; left: var(--px); top: var(--py);
  display: inline-flex; align-items: center; gap: calc(var(--cf, 32) * var(--u) * 0.3);
  padding: calc(var(--cf, 32) * var(--u) * 0.5) calc(var(--cf, 32) * var(--u));
  border-radius: 100px; background: #fff; color: #000;
  font-size: calc(var(--cf, 32) * var(--u)); font-weight: 500; line-height: 1;
  --tx: 0px; --ty: 0px;
  transform: translate3d(var(--tx), var(--ty), 0);
  animation: pop-in 1.1s var(--ease) 0.6s both;
  transition: box-shadow 0.4s;
}
.counter:hover { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.15); }
.counter img { width: 1.25em; height: auto; transition: transform 0.8s var(--ease); }
.counter.is-pop img { transform: rotate(180deg) scale(1.15); }
.counter-num { display: inline-block; height: 1em; overflow: hidden; min-width: 0.5em; text-align: center; font-variant-numeric: tabular-nums; }
.counter-num span { display: block; }
.counter-num span.out { animation: num-out 0.35s var(--ease) forwards; }
.counter-num span.in { animation: num-in 0.35s var(--ease) forwards; }
@keyframes num-out { to { transform: translateY(-110%); } }
@keyframes num-in { from { transform: translateY(110%); } to { transform: none; } }
.counter-num { position: relative; }
.counter-num span.out { position: absolute; inset: 0; }

.hint {
  --x: 1567; --y: 373;
  position: absolute; left: var(--px); top: var(--py); margin: 0;
  font-family: var(--serif); font-style: italic; font-size: max(15px, calc(var(--hf, 28) * var(--u))); color: var(--muted);
  transform: rotate(-8deg); transition: opacity 0.5s; animation: wiggle 2.4s ease-in-out infinite;
  pointer-events: none;
}
.hint.gone { opacity: 0; }
@keyframes wiggle { 0%, 100% { translate: 0 0; } 50% { translate: -6px -2px; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: clamp(20px, 3vw, 56px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: clamp(12px, 0.9vw, 16px); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  transition: color 0.3s;
}
.scroll-cue:hover { color: #fff; }
.scroll-cue i { width: 1px; height: 48px; background: linear-gradient(#fff, transparent); transform-origin: top; animation: drip 2s var(--ease) infinite; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- burst particles ---------- */
.burst-layer { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.petal {
  position: absolute; left: 0; top: 0; width: var(--size); height: var(--size);
  background: var(--c);
  -webkit-mask: url("./assets/flower-icon.svg") center / contain no-repeat;
          mask: url("./assets/flower-icon.svg") center / contain no-repeat;
  will-change: transform, opacity;
}
.plus {
  position: absolute; left: 0; top: 0; font-family: var(--serif); font-style: italic; font-size: 22px; color: #fff;
  pointer-events: none; animation: plus 0.9s var(--ease) forwards;
}
@keyframes plus { from { opacity: 1; transform: translate(-50%, 0) scale(0.6); } to { opacity: 0; transform: translate(-50%, -70px) scale(1.2); } }
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 96; transform: translate(-50%, calc(100% + 48px));
  padding: 14px 24px; border-radius: 100px; background: #fff; color: #111; font-weight: 500; font-size: 16px;
  transition: transform 0.6s var(--ease); white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- work ---------- */
.work { position: relative; z-index: 1; padding: clamp(80px, 8vw, 160px) var(--pad) clamp(60px, 6vw, 120px); max-width: 1920px; margin: 0 auto; }
.work-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  max-width: 1735px; margin: 0 auto clamp(48px, 6vw, 120px); padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.work-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 5vw, 96px); line-height: 0.95; }
.work-title em { color: var(--pink); }
.work-title sup { font-family: var(--mono); font-size: 0.22em; vertical-align: top; color: var(--muted); letter-spacing: 0.04em; }
.view-toggle { position: relative; display: inline-flex; border: 1px solid #fff; border-radius: 100px; padding: 4px; }
.view-toggle button {
  position: relative; z-index: 1; padding: 10px 20px; border-radius: 100px; font-size: clamp(14px, 1vw, 18px); font-weight: 500;
  transition: color 0.35s;
}
.view-toggle button.is-active { color: #111; }
.view-toggle::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: var(--pl, 4px); width: var(--pw, 50%);
  background: #fff; border-radius: 100px; transition: left 0.45s var(--ease), width 0.45s var(--ease);
}

.projects { list-style: none; margin: 0 auto; padding: 0; max-width: 1735px; }

/* showcase view */
.projects[data-view="rows"] { display: flex; flex-direction: column; gap: clamp(80px, 10.4vw, 200px); }
.projects[data-view="rows"] .project {
  display: grid; align-items: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(0, 600px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 120px);
}
.p-num {
  align-self: center; justify-self: center;
  font-family: var(--serif); font-style: italic; font-size: clamp(64px, 8.33vw, 160px); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.6);
  transition: color 0.6s var(--ease), -webkit-text-stroke-color 0.6s, transform 0.8s var(--ease);
}
.project.is-active .p-num, .project:hover .p-num { color: #fff; -webkit-text-stroke-color: #fff; }
.project:hover .p-num { transform: rotate(-6deg); }

.p-media {
  position: relative; display: block; aspect-ratio: 1; border-radius: clamp(12px, 1.2vw, 24px); overflow: hidden;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
  isolation: isolate;
}
.p-media:hover { box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8); }
.p-img { position: absolute; inset: 0; background: var(--pbg, #222); overflow: hidden; }
.p-img img {
  width: 100%; height: 100%; object-fit: cover; scale: 1.12;
  transform: translate3d(var(--ix, 0px), var(--iy, 0px), 0);
  transition: scale 0.9s var(--ease), transform 0.6s var(--ease);
}
.p-img--contain img { object-fit: contain; }
/* Veglifefood cover: case hero look (herbs + logo + lime strap) */
.veg-cover {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6%; padding: 0 12%; pointer-events: none;
  transform: translate3d(calc(var(--ix, 0px) * -0.4), calc(var(--iy, 0px) * -0.4), 0);
  transition: transform 0.6s var(--ease), scale 0.9s var(--ease);
}
@font-face { font-family: Manrope; src: url("./projects/veglifefood/assets/manrope-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }
.p-media .p-img .veg-cover .veg-logo { width: 100%; height: auto; scale: 1; transform: none; object-fit: contain; }
.veg-strap {
  padding: 0.35em 0.6em; background: #caff00; color: #1a3054; white-space: nowrap;
  font-family: Manrope, Arial, sans-serif; font-weight: 700; font-size: clamp(11px, 1.15vw, 20px); letter-spacing: -0.02em;
}
@supports (font-size: 1cqi) {
  .p-img--veg { container-type: inline-size; }
  .veg-strap { font-size: max(11px, 3.4cqi); }
}
.p-media:hover .veg-cover { scale: 1.04; }
.p-media:hover .p-img img { scale: 1.2; }
.p-img--agentiqa img { scale: 0.84; }
.p-media:hover .p-img--agentiqa img { scale: 0.92; }
.p-glare {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; mix-blend-mode: soft-light;
  background: radial-gradient(400px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.7), transparent 55%);
  transition: opacity 0.4s;
}
.p-media:hover .p-glare { opacity: 1; }
.p-media:focus-visible { outline: 2px solid var(--green); outline-offset: 6px; }

.p-info { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; max-width: 420px; }
.p-title { margin: 0 0 14px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(32px, 2.5vw, 48px); line-height: 1; }
.p-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; }
.p-tags li { padding: 5px 12px; border: 1px solid var(--line); border-radius: 100px; font-size: clamp(13px, 0.83vw, 16px); color: var(--muted); }
.p-desc { margin: 0; font-size: clamp(17px, 1.25vw, 24px); line-height: 1.05; letter-spacing: -0.02em; }
.p-meta { margin: 0; display: grid; gap: 10px; font-size: clamp(14px, 0.94vw, 18px); }
.p-meta div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.p-meta dt { color: var(--muted); }
.p-meta dd { margin: 0; }
.p-link { display: inline-flex; gap: 8px; align-items: center; margin-top: 8px; font-weight: 500; width: fit-content; }
.p-link i { font-style: normal; transition: transform 0.4s var(--ease); }
.p-link:hover i { transform: translateX(6px); }
.p-link { background: linear-gradient(#fff, #fff) left bottom / 0 1px no-repeat; transition: background-size 0.4s var(--ease); }
.p-link:hover { background-size: 100% 1px; }

/* reveal */
[data-reveal] .p-media {
  opacity: 0; translate: 0 80px; scale: 0.94; will-change: transform, opacity;
  transition: opacity 0.9s var(--ease), translate 1.1s var(--ease), scale 1.1s var(--ease), transform 0.6s var(--ease), box-shadow 0.6s;
}
[data-reveal] .p-num, [data-reveal] .p-info > * { opacity: 0; translate: 0 30px; transition: opacity 0.9s var(--ease), translate 0.9s var(--ease), color 0.6s, transform 0.8s var(--ease); }
[data-reveal] .p-info > *:last-child { transition-delay: 0.15s; }
[data-reveal].in .p-media { opacity: 1; translate: 0 0; scale: 1; }
[data-reveal].in .p-num, [data-reveal].in .p-info > * { opacity: 1; translate: 0 0; }

/* index view */
.projects[data-view="index"] { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.projects[data-view="index"] .project {
  position: relative; display: grid; align-items: center;
  grid-template-columns: 120px minmax(0, 1.2fr) minmax(0, 1fr) 80px;
  gap: 24px; padding: clamp(18px, 1.8vw, 32px) 0; border-bottom: 1px solid var(--line);
}
.projects[data-view="index"] .p-num { font-size: clamp(36px, 3vw, 56px); justify-self: start; color: #fff; -webkit-text-stroke: 0; }
.projects[data-view="index"] .p-media {
  position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; opacity: 0; translate: none; scale: none; z-index: 2; box-shadow: none; transform: none;
}
.projects[data-view="index"] .p-media .p-img, .projects[data-view="index"] .p-glare { display: none; }
.projects[data-view="index"] .p-info { display: contents; }
.projects[data-view="index"] .p-top { display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.projects[data-view="index"] .p-title { margin: 0; font-size: clamp(30px, 3.3vw, 64px); transition: transform 0.5s var(--ease), color 0.4s; }
.projects[data-view="index"] .p-tags { margin: 0; }
.projects[data-view="index"] .p-desc { display: none; }
.projects[data-view="index"] .p-meta { display: block; text-align: right; }
.projects[data-view="index"] .p-meta div { display: none; }
.projects[data-view="index"] .p-meta div:nth-child(2) { display: block; border: 0; padding: 0; color: var(--muted); }
.projects[data-view="index"] .p-meta div:nth-child(2) dt { display: none; }
.projects[data-view="index"] .p-link { display: none; }
.projects[data-view="index"] .project::after {
  content: "→"; justify-self: end; font-size: clamp(22px, 2vw, 36px); transition: transform 0.5s var(--ease);
}
.projects[data-view="index"] .project::before {
  content: ""; position: absolute; inset: 0; background: #fff; transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.5s var(--ease); z-index: -1;
}
.projects[data-view="index"] .project:hover::before { transform: scaleY(1); }
.projects[data-view="index"] .project:hover { color: #111; }
.projects[data-view="index"] .project:hover .p-tags li { color: #111; border-color: rgba(0,0,0,.2); }
.projects[data-view="index"] .project:hover .p-meta div:nth-child(2) { color: #111; }
.projects[data-view="index"] .project:hover .p-num { color: #111; transform: none; }
.projects[data-view="index"] .project:hover .p-title { transform: translateX(16px); }
.projects[data-view="index"] .project:hover::after { transform: translateX(-12px) rotate(-45deg); }
.projects[data-view="index"] .project { z-index: 0; }
.projects[data-view="index"] [data-reveal] .p-num,
.projects[data-view="index"] [data-reveal] .p-info > * { opacity: 1; translate: none; }

.preview {
  position: fixed; left: 0; top: 0; z-index: 60; width: clamp(220px, 20vw, 380px); aspect-ratio: 4 / 3;
  border-radius: 16px; overflow: hidden; pointer-events: none; opacity: 0; scale: 0.6;
  transition: opacity 0.35s, scale 0.5s var(--ease); background: #ddd;
}
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview.show { opacity: 1; scale: 1; }

/* ---------- outro ---------- */
.outro { position: relative; z-index: 1; padding: clamp(60px, 8vw, 160px) 0 0; border-top: 1px solid var(--line); }
.marquee { overflow: hidden; white-space: nowrap; }
.marquee-track { display: inline-flex; animation: marquee 28s linear infinite; }
.marquee span { font-family: var(--serif); font-size: clamp(64px, 11vw, 220px); line-height: 1.05; padding-right: 0.3em; }
.marquee em { color: var(--green); }
.outro:hover .marquee-track { animation-duration: 60s; }
@keyframes marquee { to { transform: translateX(-50%); } }
.outro-row {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: clamp(40px, 4vw, 80px) var(--pad);
}
.outro-mail {
  display: inline-block; font-size: clamp(24px, 3vw, 56px); font-weight: 500;
  background: linear-gradient(#fff, #fff) left bottom / 100% 2px no-repeat; padding-bottom: 6px;
  transition: background-size 0.5s var(--ease);
}
.outro-mail:hover { background-size: 0 2px; background-position: right bottom; }
.outro-flowers { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: clamp(16px, 1.2vw, 22px); color: var(--muted); }
.outro-flowers b { color: #fff; font-weight: 500; }
.outro-flowers img { width: 22px; filter: invert(1); }
.foot {
  display: flex; justify-content: space-between; gap: 16px; padding: 24px var(--pad) 32px;
  border-top: 1px solid var(--line); font-size: 14px; color: var(--muted);
}
.foot a:hover { color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .projects[data-view="rows"] .project { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto auto; row-gap: 20px; }
  .projects[data-view="rows"] .p-num { grid-column: 1 / -1; justify-self: start; }
  .p-info { max-width: none; }
}

/* portrait composition (phones, tablets held upright, narrow windows): 400 × 640 design px */
@media (max-aspect-ratio: 1/1), (max-width: 700px) {
  .hero { --dw: 400; --dh: 640; --u: min(100vw / var(--dw), (100svh - 110px) / var(--dh)); min-height: 0; }
  .deco--pink  { --x: 24;  --y: 40;  --w: 60; }
  .deco--round { --x: 296; --y: 28;  --w: 72; }
  .deco--green { --x: 8;   --y: 372; --w: 176; }
  .intro { --y: 124; --iw: 380; --fs: 66; --lw: 344; --lf: 18.4; gap: calc(12 * var(--u)); }
  .lead { line-height: 1.05; }
  .avatar { --x: 208; --y: 388; --w: 120; }
  .counter { --x: 264; --y: 524; --cf: 19; }
  .hint { --x: 200; --y: 576; --hf: 18; }
  .scroll-cue { display: none; }
}

@media (max-width: 900px) {

  .projects[data-view="rows"] .project { grid-template-columns: 1fr; }
  .p-num { -webkit-text-stroke-width: 1px; }
  .projects[data-view="rows"] [data-reveal] .p-num { color: #fff; }
  .projects[data-view="index"] .project { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .projects[data-view="index"] .p-meta { display: none; }
  .projects[data-view="index"] .p-tags { display: none; }
  .projects[data-view="index"] .p-num { font-size: 32px; }
  .preview { display: none; }
}

@media (max-width: 560px) {
  .links { gap: 6px; }
  .btn { padding: 8px 10px; font-size: 13px; }
  .logo { width: 28px; }
  .view-toggle button { padding: 8px 14px; }
  .work-head { align-items: flex-start; flex-direction: column; }
  .outro-row { flex-direction: column; align-items: flex-start; }
}

/* fade out when opening a case */
main, .topbar { transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); }
body.leaving main, body.leaving .topbar { opacity: 0; transform: translateY(-24px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .grain { display: none; }
}
