/* =========================================================
   Direction: Signature
   Quiet Product foundation (Geist, Apple-like greys, calm spacing)
   + Editorial's subtle dot ground, bento work grid and "messy" closing
   + a black-and-white dithered portrait that comes alive under the cursor.
   One interaction language for every card: lift 4px, inner content
   scales/shifts on a soft ease, small parts spring, arrow fills and turns.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #fafaf9;
  --dot: #e5e4e0;           /* subtle dot grid */
  --surface: #ffffff;       /* cards */
  --well: #f2f2f4;          /* media wells inside cards */
  --ink: #1d1d1f;
  --text: #515154;
  --muted: #86868b;
  --faint: #b4b4b9;
  --line: rgba(0, 0, 0, .07);
  --orange: #ff5900;
  --paper: #f4f2ec;         /* vintage photo paper */

  --font: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --hand: "Caveat", "Bradley Hand", cursive;   /* handwritten notes in About only */

  --max: 1200px;
  --gutter: 32px;
  --hs: 1.2;                /* avatar scale */
  --display: 84px;          /* hero headline */

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-card: cubic-bezier(0.25, 0.46, 0.45, 0.94);   /* card lift */
  --ease-inner: cubic-bezier(0.32, 0.72, 0, 1);        /* images inside cards */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);         /* small parts */
  /* Very soft depth: enough to separate cards from the page, never dark */
  --shadow: 0 1px 2px rgba(0, 0, 0, .03);
  --shadow-lift: 0 1px 2px rgba(0, 0, 0, .03), 0 14px 30px -20px rgba(0, 0, 0, .10);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Crect width='2' height='2' fill='%23e5e4e0'/%3E%3C/svg%3E");
  background-size: 22px 22px;
  background-position: top center;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
b { font-weight: 500; color: var(--ink); }
button { font: inherit; color: inherit; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--orange);
  color: #fff;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .2s ease, transform .3s var(--ease);
}
.btn:hover { background: #e65000; transform: scale(1.03); }
.btn--sm { padding: 9px 14px; }
.btn--md { padding: 12px 22px; }

/* Shared round arrow: → at rest, fills and turns to ↗ on hover */
.arrow-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--well);
  color: var(--ink);
  font-size: 15px;
  transition: background-color .3s var(--ease-card), color .3s var(--ease-card), transform .45s var(--spring);
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 20px var(--gutter);
}
.header__logo img { width: 36px; height: auto; }
.header__nav { display: flex; gap: 20px; font-size: 14px; }
.header__nav a {
  padding: 7px 14px;
  border-radius: 999px;
  transition: background-color .2s ease, color .2s ease;
}
.header__nav a:hover { background: rgba(0, 0, 0, .05); color: var(--ink); }

/* ================= 1. Hero ================= */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 104px 24px 0;
  text-align: center;
}
.hero__role {
  display: inline-grid;
  margin-bottom: 120px;          /* room for the taller portrait above the headline */
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}
.hero__role-word {
  grid-area: 1 / 1;
  transition: opacity .6s var(--ease), filter .6s var(--ease), transform .6s var(--ease);
}
.hero__role-word:not(.is-current) { opacity: 0; filter: blur(6px); transform: translateY(6px); }

.hero__title {
  font-weight: 600;
  font-size: var(--display);
  line-height: 1.04;
  letter-spacing: -0.05em;
  color: var(--ink);
}
.hero__line { display: block; white-space: nowrap; }
.hero__line--muted { color: var(--faint); }

.hero__hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  font-size: 15px;
  color: var(--muted);
}
.js .hero__hint.is-done { animation: hint-out .6s ease forwards; }
@keyframes hint-out { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }
.hero__hint-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--orange);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 89, 0, .45); }
  70%  { box-shadow: 0 0 0 7px rgba(255, 89, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 89, 0, 0); }
}

/* --- Avatar: v1 interaction; capsule bottom sits on the baseline --- */
.hero__avatar-slot {
  position: relative;
  display: inline-block;
  width: calc(112px * var(--hs));
  height: 1em;
  vertical-align: top;
  translate: var(--ax, 0px) var(--ay, 0px);       /* follows the cursor a little (main.js) */
}
.hero__avatar {
  position: absolute;
  top: calc(0.95em - 138px * var(--hs));
  left: calc(50% - 43px * var(--hs));
  width: calc(86px * var(--hs));
  height: calc(138px * var(--hs));
  background: var(--orange);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition: background-color .5s ease;
  -webkit-tap-highlight-color: transparent;
}
.hero__avatar:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.hero__avatar img {
  position: absolute;
  z-index: 1;
  top: calc(0.4px * var(--hs));
  left: calc(-57.02px * var(--hs));
  width: calc(200px * var(--hs));
  max-width: none;
  height: calc(200.24px * var(--hs));
  translate: var(--hx, 0px) var(--hy, 0px);       /* head parallax (main.js) */
  transition: transform 0.25s ease;
}
/* While dithering: no capsule, no colour — just black dots straight on the page */
.js .hero__avatar.is-dithering { background-color: transparent; }
.js .hero__avatar.is-dithering img,
.js .hero__avatar.is-dithering .hero__wave { opacity: 0; }
.hero__dither { display: none; }
.js .hero__dither {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
}
.hero__badge {
  position: absolute;
  top: calc(0.95em - 132px * var(--hs));            /* 6px below the capsule top */
  left: calc(50% + 61.6px * var(--hs));
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-weight: 400;
  line-height: normal;
  letter-spacing: 0;
  text-align: left;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-8px, 8px) scale(0.6);
  transform-origin: 0% 100%;
  transition: opacity 0.15s ease, transform 0.2s ease;
}
.hero__badge-small { font-size: 12px; }
.hero__badge-name { font-size: 16px; }
.hero__wave {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: calc(12px * var(--hs));
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: calc(36px * var(--hs));
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  transform: translate(-50%, calc(56px * var(--hs)));
  transform-origin: 70% 90%;
  transition: transform 0.2s ease;
}
.hero__avatar:not(.is-dithering):hover img,
.hero__avatar:not(.is-dithering):focus-visible img,
.hero__avatar.is-active img {
  transform: translateY(calc(22px * var(--hs)));
  transition: transform 0.4s var(--spring);
}
.hero__avatar:not(.is-dithering):hover ~ .hero__badge,
.hero__avatar:not(.is-dithering):focus-visible ~ .hero__badge,
.hero__avatar.is-active ~ .hero__badge {
  opacity: 1;
  transform: none;
  transition: opacity 0.2s ease, transform 0.45s var(--spring);
}
.hero__avatar:not(.is-dithering):hover .hero__wave,
.hero__avatar:not(.is-dithering):focus-visible .hero__wave,
.hero__avatar.is-active .hero__wave {
  transform: translate(-50%, 0);
  transition: transform 0.4s var(--spring) 0.1s;
  animation: hero-wave 0.9s ease-in-out 0.45s infinite;
}
@keyframes hero-wave {
  0%, 100% { rotate: 0deg; }
  20%      { rotate: 18deg; }
  45%      { rotate: -12deg; }
  70%      { rotate: 14deg; }
}

/* --- "messy": letters swap into hobbies under the cursor --- */
.messy { position: relative; display: inline-block; color: var(--ink); cursor: default; }
.messy__l {
  position: relative;
  display: inline-block;
  transition: color .25s ease, transform .45s var(--spring);
}
.messy__l::after {
  content: attr(data-e);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 0.62em;
  letter-spacing: 0;
  color: var(--ink);              /* emoji must not inherit the letter's transparent colour */
  transform: scale(0) rotate(-20deg);
  transition: transform .45s var(--spring);
}
.messy__l.is-on { color: transparent; transform: translateY(-0.04em); }
.messy__l.is-on::after { transform: scale(1) rotate(0deg); }
.messy__tip {
  position: absolute;
  top: calc(100% + 8px);
  left: var(--tx, 50%);
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -4px) scale(.9);
  transition: opacity .2s ease, transform .3s var(--spring), left .25s var(--ease);
}
.messy__tip.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ================= Shared section head ================= */
.section {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 180px auto 0;
  padding: 0 var(--gutter);
}
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
.section__title {
  font-size: 44px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.045em;
  color: var(--ink);
}
.section__note { font-size: 15px; color: var(--muted); }

/* ================= 3. Selected work — Harin-style cases ================= */
.work { margin-top: 116px; }               /* ~35% tighter after the hero */
.work__head { margin-bottom: 40px; text-align: center; }
.work__title { font-size: 36px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.15; color: var(--ink); }
.work__sub { margin-top: 8px; font-size: 16px; color: var(--muted); }

.cases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.case {
  position: relative;
  display: flex;
  overflow: hidden;
  border-radius: 18px;
  background: #f2f2f4;
  --ly: 0px;
  transform: translateY(var(--ly));
  transition: transform .45s var(--ease-card);
  -webkit-tap-highlight-color: transparent;
}
.case--wide { grid-column: 1 / -1; height: 476px; padding-left: 32px; }
.case--sm { flex-direction: column; justify-content: space-between; height: 340px; padding: 24px; }

.case__text {
  display: flex;
  flex: 0 0 280px;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 0;
}
.case__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 22%;
  background: var(--ink);
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
  transition: transform .5s var(--spring);
}
.case__icon--sm { width: 44px; height: 44px; font-size: 20px; margin-bottom: 14px; }
.case__title { display: block; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.03em; color: var(--ink); }
.case__title--sm { font-size: 17px; letter-spacing: -0.025em; }
.case__sub { display: block; max-width: 250px; margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--text); }
.case__meta { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }

/* "Concept project" tag (style from v1) */
.tag {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}
.tag--sm { align-self: flex-start; margin: 10px 0 0; padding: 5px 10px; font-size: 11px; }
.case__top { display: flex; flex-direction: column; align-items: flex-start; }

/* Three screens rising from the bottom edge (featured) */
.case__shots {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  padding-top: 36px;
}
.case__shot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 190px;
  height: 380px;
  padding: 22px 16px;
  border-radius: 14px 14px 0 0;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .04);
  transition: transform .6s var(--ease-inner);
}
.case__shot--main { width: 220px; height: 440px; transition-delay: .04s; }
.case__shot:last-child { transition-delay: .08s; }
/* Skeleton lines stand in until real screens are added */
.case__shot i { display: block; height: 10px; border-radius: 5px; background: #ececef; }
.case__shot i:nth-child(1) { width: 45%; height: 12px; }
.case__shot i:nth-child(2) { height: 120px; border-radius: 14px; background: #f2f2f4; }
.case__shot i:nth-child(3) { width: 80%; }
.case__shot i:nth-child(4) { width: 60%; }

/* Three tiles fanned at the bottom (small cards) */
.case__fan {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 150px;
  padding-bottom: 4px;
}
.case__fan span {
  width: 108px;
  height: 108px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .04);
  transition: transform .6s var(--ease-inner);
}
.case__fan span:nth-child(1) { transform: translate(6px, 6px) rotate(-8deg); }
.case__fan span:nth-child(2) { width: 96px; height: 96px; transform: translateY(-8px); background: #e9e9ec; }
.case__fan span:nth-child(3) { transform: translate(-6px, 6px) rotate(8deg); }

.case__arrow {
  position: absolute;
  top: 22px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  transition: background-color .3s var(--ease-card), color .3s var(--ease-card), transform .45s var(--spring);
}

/* Cursor-following "View project" label */
.wcard__cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(var(--cx, 50%), var(--cy, 50%), 0) translate(-50%, -50%) scale(.5);
  transition: opacity .25s ease, transform .35s var(--spring);
}

/* ---- Shared hover language (work cases + playground tiles) ---- */
@media (hover: hover) {
  [data-tilt]:hover { --ly: -4px; }
  .case:hover .case__icon { transform: scale(1.06) rotate(-3deg); }
  .case:hover .case__arrow { background: var(--ink); color: #fff; transform: rotate(-45deg); }
  .case:hover .case__shot { transform: translateY(-8px); }
  .case:hover .case__fan span:nth-child(1) { transform: translate(1px, 9px) rotate(-12deg); }
  .case:hover .case__fan span:nth-child(2) { transform: translateY(-14px); }
  .case:hover .case__fan span:nth-child(3) { transform: translate(-1px, 9px) rotate(12deg); }
  .case:hover .wcard__cursor {
    opacity: 1;
    transform: translate3d(var(--cx, 50%), var(--cy, 50%), 0) translate(-50%, -50%) scale(1);
    transition: opacity .25s ease;           /* position follows the pointer via JS easing */
  }
}
.case:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* ================= 4. Playground ================= */
.pgrid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}
.ptile { --mx: 0; --my: 0; --ly: 0px; }
.ptile--span-8 { grid-column: span 8; }
.ptile--span-4 { grid-column: span 4; }
.ptile__stage {
  position: relative;
  height: 340px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translate3d(calc(var(--mx) * 3px), calc(var(--my) * 3px + var(--ly)), 0);
  transition: transform .45s var(--ease-card), box-shadow .45s var(--ease-card);
}
.ptile__stage--well { background: var(--well); }
.ptile--dots .ptile__stage,
.ptile--phone .ptile__stage { height: 440px; }
/* The preview inside: scales and drifts on its own, softer curve */
.ptile__inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform: translate3d(calc(var(--mx) * -6px), calc(var(--my) * -4px), 0) scale(var(--ps, 1));
  transition: transform .6s var(--ease-inner);
}
.ptile__inner canvas { display: block; width: 100%; height: 100%; }
.ptile__inner video { display: block; width: 100%; height: 100%; object-fit: cover; }
.ptile__cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 6px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.ptile__title { transition: transform .45s var(--spring); }
.ptile__tag { font-size: 12px; font-weight: 400; color: var(--muted); transition: color .3s ease; }
@media (hover: hover) {
  .ptile:hover { --ps: 1.035; }
  .ptile:hover .ptile__stage { box-shadow: var(--shadow-lift); }
  .ptile:hover .ptile__title { transform: translateX(4px); }
  .ptile:hover .ptile__tag { color: var(--ink); }
}

/* Pay button (mobile UI micro-interaction) */
.ptile--phone .ptile__stage { background: var(--well); }
.phone {
  width: 204px;
  height: 392px;
  padding: 8px;
  border-radius: 40px;
  background: var(--ink);
  box-shadow: 0 24px 40px -28px rgba(0, 0, 0, .35);
}
.phone__screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding: 24px 16px 28px;
  border-radius: 32px;
  background: #fff;
}
.phone__label { font-size: 12px; color: var(--muted); }
.phone__amount { margin-bottom: 28px; font-size: 30px; font-weight: 600; letter-spacing: -0.04em; color: var(--ink); }
.pay {
  position: relative;
  display: grid;
  place-items: center;
  width: 156px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: default;
  animation: pay-btn 3.6s var(--ease) infinite paused;
}
.pay__text { grid-area: 1 / 1; animation: pay-text 3.6s ease infinite paused; }
.pay__spin {
  grid-area: 1 / 1;
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: pay-spin-fade 3.6s ease infinite paused, spin .7s linear infinite paused;
}
.pay__tick { grid-area: 1 / 1; width: 22px; height: 22px; }
.pay__tick path {
  fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 22; stroke-dashoffset: 22;
  animation: pay-tick 3.6s ease infinite paused;
}
.is-running .pay,
.is-running .pay__text,
.is-running .pay__spin,
.is-running .pay__tick path { animation-play-state: running; }
@keyframes pay-btn {
  0%, 22%   { width: 156px; background: var(--ink); transform: scale(1); }
  26%       { transform: scale(.94); }
  32%, 66%  { width: 44px; background: var(--ink); transform: scale(1); }
  72%, 90%  { width: 44px; background: var(--orange); transform: scale(1.08); }
  100%      { width: 156px; background: var(--ink); transform: scale(1); }
}
@keyframes pay-text { 0%, 24% { opacity: 1; } 28%, 94% { opacity: 0; } 100% { opacity: 1; } }
@keyframes pay-spin-fade { 0%, 30% { opacity: 0; } 34%, 64% { opacity: 1; } 68%, 100% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pay-tick { 0%, 68% { stroke-dashoffset: 22; } 78%, 90% { stroke-dashoffset: 0; } 96%, 100% { stroke-dashoffset: 22; } }

/* Messy → tidy */
.tidy {
  display: flex;
  font-size: 104px;
  font-weight: 600;
  letter-spacing: -0.05em;
  color: var(--ink);
  user-select: none;
}
.tidy span {
  display: inline-block;
  transition: transform .7s var(--spring), color .4s ease;
  animation: jitter 2.8s ease-in-out infinite alternate paused;
}
.tidy span:nth-child(1) { --r: -14deg; --y: -10px; animation-delay: -.2s; }
.tidy span:nth-child(2) { --r: 9deg;   --y: 14px;  animation-delay: -1.1s; }
.tidy span:nth-child(3) { --r: -6deg;  --y: -18px; animation-delay: -.6s; }
.tidy span:nth-child(4) { --r: 16deg;  --y: 8px;   animation-delay: -1.8s; }
.tidy span:nth-child(5) { --r: -10deg; --y: -6px;  animation-delay: -1.4s; }
.is-running .tidy span { animation-play-state: running; }
@keyframes jitter {
  from { transform: translateY(var(--y)) rotate(var(--r)); }
  to   { transform: translateY(calc(var(--y) * -0.6)) rotate(calc(var(--r) * -0.7)); }
}
.ptile[data-exp="tidy"]:hover .tidy span,
.ptile[data-exp="tidy"].is-tidy .tidy span { animation: none; transform: none; }
.ptile[data-exp="tidy"]:hover .tidy span:nth-child(odd),
.ptile[data-exp="tidy"].is-tidy .tidy span:nth-child(odd) { color: var(--orange); }

/* Hobby trail */
.ptile__stage--trail { cursor: crosshair; touch-action: pan-y; }
.trail__hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
  transition: opacity .4s ease;
}
.ptile__stage--trail.is-used .trail__hint { opacity: 0; }
.trail__item {
  position: absolute;
  left: 0;
  top: 0;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 30px;
  line-height: 1;
  pointer-events: none;
  animation: trail-pop 1.4s var(--ease) forwards;
}
@keyframes trail-pop {
  0%   { transform: translate(var(--x), var(--y)) translate(-50%, -50%) scale(0) rotate(var(--r)); opacity: 1; }
  18%  { transform: translate(var(--x), var(--y)) translate(-50%, -50%) scale(1.1) rotate(0deg); }
  30%  { transform: translate(var(--x), var(--y)) translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 28px)) translate(-50%, -50%) scale(.6) rotate(0deg); opacity: 0; }
}

/* ================= 5. About — stamp cards ================= */
.about__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.about__lead { font-size: 19px; line-height: 1.55; color: var(--faint); }
.about__lead b { font-weight: 500; }

.fan {
  position: relative;
  height: 410px;                         /* ~25% less empty space above the resting stack */
  margin-top: 16px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
/* Instant print: white border, square photo, note on the bottom strip */
.fan__card {
  position: absolute;
  left: 50%;
  bottom: 44px;
  width: 230px;
  margin: 0 0 0 -115px;
  padding: 10px 10px 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 18px 30px -20px rgba(0, 0, 0, .28);
  transform-origin: 50% 420%;            /* low pivot: opens like a hand of cards */
  transform: rotate(var(--f0));
  transition: transform .8s var(--spring), box-shadow .5s ease;
}
.fan__card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.fan__note {
  display: block;
  padding: 12px 0 14px;
  font-family: var(--hand);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  transform: rotate(-2deg);
}
.fan__card:nth-child(1) { --f0: -2deg;  --f1: -16deg;  z-index: 1; }
.fan__card:nth-child(2) { --f0: -.5deg; --f1: -5.5deg; z-index: 2; }
.fan__card:nth-child(3) { --f0: .8deg;  --f1: 5.5deg;  z-index: 3; }
.fan__card:nth-child(4) { --f0: 2deg;   --f1: 16deg;   z-index: 4; }
.fan.is-open .fan__card { transform: rotate(var(--f1)); }
.fan__hint {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: opacity .3s ease;
}
.fan.is-open .fan__hint { opacity: 0; }
.fan:focus-visible .fan__card:last-child { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
@media (hover: hover) {
  .fan.is-open .fan__card:hover {
    z-index: 9;
    transform: rotate(var(--f1)) translateY(-28px) scale(1.04);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 28px 40px -24px rgba(0, 0, 0, .32);
  }
}

.about__more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 64px;
  text-align: center;
}
.about__personal { max-width: 560px; font-size: 18px; color: var(--ink); }

/* ================= 6. Contact ================= */
.contact {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 220px auto 0;
  padding: 0 var(--gutter);
  text-align: center;
}
.contact__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}
.contact__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); animation: pulse 2.4s ease-out infinite; }
.contact__title {
  margin-top: 18px;
  font-size: 72px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.05em;
  color: var(--ink);
}
/* Emphasis with the same typeface: orange + a hand-drawn underline */
.contact__messy {
  position: relative;
  display: inline-block;
  font-weight: 700;
  color: var(--orange);
}
.scribble {
  position: absolute;
  left: -2%;
  bottom: -0.08em;
  width: 104%;
  height: 0.22em;
  overflow: visible;
}
.scribble path {
  fill: none;
  stroke: var(--orange);
  stroke-width: 3.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.js .contact__title .scribble path { stroke-dashoffset: 1; transition: stroke-dashoffset .9s var(--ease) .5s; }
.js .contact__title .scribble path + path { transition-delay: .8s; }
.js .contact__title.is-in .scribble path { stroke-dashoffset: 0; }

.contact__mail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}
.contact__email {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
  background: linear-gradient(var(--ink), var(--ink)) left bottom / 0% 1.5px no-repeat;
  padding-bottom: 2px;
  transition: background-size .45s var(--ease);
}
.contact__email:hover { background-size: 100% 1.5px; }
.contact__copy {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .3s var(--spring);
}
.contact__copy:hover { transform: scale(1.05); }
.contact__copy.is-copied { background: var(--ink); color: #fff; }
.contact__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 120px;
  padding: 24px 0 36px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.contact__links { display: flex; gap: 32px; }
.contact__row a span { color: var(--ink); transition: color .2s ease, transform .3s var(--spring); display: inline-block; }
.contact__row a:hover span { color: var(--orange); transform: translate(2px, -2px); }
.contact__row a { transition: color .2s ease; }
.contact__row a:hover { color: var(--orange); }

/* ================= Motion: load intro + scroll reveals ================= */
.js .intro {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(6px);
  animation: rise-in .9s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes rise-in { to { opacity: 1; transform: none; filter: blur(0); } }
.js .reveal {
  opacity: 0;
  translate: 0 18px;
  transition: opacity .8s var(--ease), translate .8s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-in { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .intro { animation: fade .3s ease forwards; transform: none; filter: none; }
  @keyframes fade { to { opacity: 1; } }
  .js .reveal { translate: 0 0; transition: opacity .3s ease; }
  .hero__role-word { transition: opacity .3s ease; }
  .hero__role-word:not(.is-current) { filter: none; transform: none; }
  .hero__hint-dot, .contact__dot { animation: none; }
  .case, .case__shot, .case__fan span, .case__icon, .fan__card, .ptile__stage, .ptile__inner { transition: none; }
  .tidy span, .pay, .pay__text, .pay__spin, .pay__tick path { animation: none !important; }
  .pay__tick path { stroke-dashoffset: 22; }
  .hero__badge, .hero__wave, .hero__avatar img { transition: opacity 0.15s ease !important; }
  .hero__avatar:hover .hero__wave,
  .hero__avatar:focus-visible .hero__wave,
  .hero__avatar.is-active .hero__wave { animation: none; }
  .js .contact__title .scribble path { transition: none; stroke-dashoffset: 0; }
}

/* ================= Responsive ================= */

/* Touch screens: no cursor, so show the label directly */
@media (hover: none) {
  .case .case__arrow { display: none; }
  .wcard__cursor {
    top: 18px; left: auto; right: 18px;
    padding: 7px 12px;
    font-size: 12px;
    opacity: 1;
    transform: none;
    background: var(--orange);
  }
}

/* Small laptop */
@media (max-width: 1199px) {
  :root { --display: 76px; --hs: 1.1; }
  .hero__role { margin-bottom: 108px; }
  .contact__title { font-size: 64px; }
}

/* Tablet */
@media (max-width: 1023px) {
  :root { --gutter: 28px; --hs: 0.95; --display: 64px; }
  .hero { padding-top: 88px; }
  .hero__role { margin-bottom: 96px; }
  .section { margin-top: 140px; }
  .work { margin-top: 92px; }
  .section__title { font-size: 40px; }

  .case--wide { height: 420px; padding-left: 24px; }
  .case__text { flex-basis: 210px; padding: 24px 0; }
  .case__shots { gap: 10px; }
  .case__shot { width: 132px; height: 300px; }
  .case__shot--main { width: 152px; height: 340px; }
  .case__shot:first-child { display: none; }
  .case--sm { height: 300px; }
  .case__fan span { width: 88px; height: 88px; }
  .case__fan span:nth-child(2) { width: 78px; height: 78px; }

  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ptile--span-8 { grid-column: 1 / -1; }
  .ptile--span-4 { grid-column: span 1; }
  .ptile--dots .ptile__stage { height: 360px; }
  .ptile--phone .ptile__stage { height: 440px; }
  .ptile__stage { height: 300px; }
  .ptile[data-exp="dither"] .ptile__stage,
  .ptile[data-exp="tidy"] .ptile__stage { height: 440px; }
  .ptile[data-exp="trail"] { grid-column: 1 / -1; }
  .ptile[data-exp="trail"] .ptile__stage { height: 300px; }
  .tidy { font-size: 88px; }

  .fan { height: 372px; }
  .fan__card { width: 190px; margin-left: -95px; }
  .fan__note { font-size: 22px; }

  .contact { margin-top: 180px; }
  .contact__title { font-size: 56px; }
}

/* Mobile */
@media (max-width: 767px) {
  :root { --gutter: 16px; --hs: 0.58; --display: 9.3vw; }
  .header { padding: 16px var(--gutter); flex-wrap: wrap; row-gap: 10px; }
  .header__nav { order: 3; width: 100%; justify-content: center; font-size: 13px; }
  .btn--sm { padding: 8px 12px; font-size: 13px; }

  .hero { padding: 72px 12px 0; }
  .hero__role { margin-bottom: 64px; font-size: 13px; padding: 6px 14px; }
  .hero__badge { padding: 3px 6px; border-radius: 6px; }
  .hero__badge-small { font-size: 9px; }
  .hero__badge-name { font-size: 12px; }
  .hero__hint { margin-top: 32px; font-size: 13px; }
  .messy__tip { font-size: 11px; }


  .section { margin-top: 112px; }
  .work { margin-top: 76px; }
  .section__head { flex-direction: column; gap: 6px; margin-bottom: 24px; }
  .section__title { font-size: 32px; }
  .section__note { font-size: 13px; }

  .work__title { font-size: 30px; }
  .work__sub { font-size: 14px; }
  .cases { grid-template-columns: 1fr; gap: 12px; }
  .case { border-radius: 16px; }
  .case--wide { flex-direction: column; height: auto; padding: 22px 22px 0; }
  .case__text { flex: none; gap: 16px; padding: 0; }
  .case__icon { width: 52px; height: 52px; font-size: 22px; }
  .case__title { font-size: 20px; }
  .case__shots { padding-top: 24px; }
  .case__shot { width: 110px; height: 230px; padding: 14px 10px; gap: 8px; }
  .case__shot--main { width: 124px; height: 260px; }
  .case__shot:first-child { display: flex; }
  .case__shot i:nth-child(2) { height: 70px; }
  .case--sm { height: 280px; padding: 20px; }

  .pgrid { grid-template-columns: 1fr; gap: 18px; }
  .ptile--span-8, .ptile--span-4, .ptile[data-exp="trail"] { grid-column: auto; }
  .ptile--dots .ptile__stage { height: auto; aspect-ratio: 4 / 3; }
  .ptile--phone .ptile__stage { height: 440px; }
  .ptile[data-exp="dither"] .ptile__stage { height: auto; aspect-ratio: 4 / 5; }
  .ptile[data-exp="tidy"] .ptile__stage { height: auto; aspect-ratio: 1; }
  .ptile[data-exp="trail"] .ptile__stage { height: auto; aspect-ratio: 4 / 3; }
  .tidy { font-size: 76px; }

  .about__lead, .about__personal { font-size: 17px; }
  .fan {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 16px;
    height: auto;
    margin-top: 36px;
    cursor: default;
  }
  .fan__card,
  .fan.is-open .fan__card {
    position: relative;
    left: auto;
    bottom: auto;
    width: auto;
    margin: 0;
    padding: 7px 7px 0;
    transform-origin: 50% 50%;
    transform: rotate(var(--m, -3deg));
  }
  .fan__card:nth-child(1) { order: 4; --m: 3deg; }
  .fan__card:nth-child(2) { order: 3; --m: -2deg; }
  .fan__card:nth-child(3) { order: 2; --m: 2.5deg; }
  .fan__card:nth-child(4) { order: 1; --m: -3deg; }
  .fan__card.is-lift { z-index: 9; transform: rotate(0deg) scale(1.04); }
  .fan__note { padding: 9px 0 11px; font-size: 21px; }
  .fan__hint { display: none; }
  .about__more { margin-top: 56px; }

  .contact { margin-top: 140px; }
  .contact__title { font-size: 10.6vw; }
  .contact__mail { flex-direction: column; gap: 12px; margin-top: 24px; }
  .contact__email { font-size: 19px; }
  .contact__row { flex-direction: column; gap: 14px; margin-top: 72px; font-size: 15px; }
  .contact__links { gap: 22px; }
}

@media (max-width: 374px) {
  :root { --hs: 0.5; }
}
