/* ─────────────────────────────────────────────
   Zenycat — brand tokens (from the character guide)
   ───────────────────────────────────────────── */
:root {
  --cream: #FFF6E9;
  --cream-2: #FBEAD2;
  --ink: #200903;
  --ink-soft: #5b4a42;
  --fur: #FAFAFC;
  --blue: #1BC6F1;
  --blue-soft: #CDEFFA;
  --amber: #BA6105;
  --red: #F2121E;
  --blush: #FF8FA3;

  --line: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --radius: 26px;

  --f-display: "Fredoka", "Zen Maru Gothic", system-ui, sans-serif;
  --f-body: "Zen Maru Gothic", "Fredoka", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.02; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--cream); padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; border-radius: 12px; }

.eyebrow {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.eyebrow--light { color: var(--blue); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-display); font-weight: 600; font-size: 18px;
  padding: 14px 24px;
  background: var(--blue); color: var(--ink);
  border: var(--line); border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn--ghost { background: var(--cream); }
.btn--small { font-size: 15px; padding: 8px 16px; box-shadow: 3px 3px 0 var(--ink); }

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.nav__brand img { width: 128px; height: auto; }
.nav__links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); }
.nav__links a:not(.btn) { font-family: var(--f-display); font-weight: 500; font-size: 17px; text-decoration: none; }
.nav__links a:not(.btn):hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; text-decoration-color: var(--blue); }

/* ─────────────────────────────────────────────
   HERO
   ───────────────────────────────────────────── */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) var(--gutter) clamp(40px, 6vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
}
.hero__title { font-size: clamp(46px, 6vw, 88px); margin: 18px 0 22px; }
.hero__title .line { display: block; white-space: nowrap; }
.hero__title .hl {
  display: inline-block;
  background: var(--blue);
  border: var(--line); border-radius: 20px;
  padding: 0 .18em .06em; margin-top: .08em;
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}
.hero__title .w { display: inline-block; }
.hero__lede { font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-soft); max-width: 30em; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* Tipsy headline wobble */
body[data-tipsy="3"] .hero__title .w,
body[data-tipsy="4"] .hero__title .w,
body[data-tipsy="5"] .hero__title .w { animation: wobble 2.4s ease-in-out infinite; }
body[data-tipsy="5"] .hero__title .w { animation-duration: 1.6s; }
.hero__title .w:nth-child(2n) { animation-delay: -.6s; }
.hero__title .w:nth-child(3n) { animation-delay: -1.2s; }
@keyframes wobble {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-3px) rotate(-2.5deg); }
}

/* ── Stage ── */
.stage {
  position: relative;
  aspect-ratio: 1100 / 1010;
  width: 100%;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.stage__blob {
  position: absolute; inset: 8% 2% 4% 4%;
  background: var(--blue-soft);
  border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%;
  transition: background-color .8s ease;
}
.stage[data-tipsy="2"] .stage__blob { background: #D9EAF6; }
.stage[data-tipsy="3"] .stage__blob { background: #EBDDEF; }
.stage[data-tipsy="4"] .stage__blob { background: #F7D6E0; }
.stage[data-tipsy="5"] .stage__blob { background: #FFCBD3; }

.stage__shadow {
  position: absolute; left: 14%; right: 10%; bottom: 7%; height: 7%;
  background: var(--ink); opacity: .1; border-radius: 50%;
  filter: blur(2px);
}

.cat {
  all: unset;
  position: absolute; left: 0; right: 0; top: 0;
  aspect-ratio: 1100 / 972;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M8 30c-3-5-3-10 1-12l2 5V6a3 3 0 0 1 6 0v12-3a3 3 0 0 1 6 0v3-2a3 3 0 0 1 6 0v3-1a3 3 0 0 1 6 0v9c0 6-4 11-10 11h-8c-4 0-7-3-9-8z' fill='%23FAFAFC' stroke='%23200903' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 14 2, pointer;
  -webkit-tap-highlight-color: transparent;
}
.cat:focus-visible { outline: 3px dashed var(--blue); outline-offset: -10px; border-radius: 40px; }
.cat__body {
  position: absolute; inset: 0;
  transform-origin: 52% 92%;
  will-change: transform;
}
.cat__body img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0;
  pointer-events: none;
}
.cat__body img.is-on { opacity: 1; }

/* blush: traced from the tipsy reference art, one overlay per pose,
   pixel-aligned with the cat images; strength grows with tipsiness */
.stage[data-pose="sleep"] .cat__blush[data-blush="sleep"],
.stage[data-pose="yawn"]  .cat__blush[data-blush="yawn"],
.stage[data-pose="drink"] .cat__blush[data-blush="drink"] { --on: 1; }
.cat__body img.cat__blush { opacity: calc(var(--on, 0) * var(--blush-a, 0)); }
.stage[data-tipsy="1"] { --blush-a: .35; }
.stage[data-tipsy="2"] { --blush-a: .55; }
.stage[data-tipsy="3"] { --blush-a: .75; }
.stage[data-tipsy="4"],
.stage[data-tipsy="5"] { --blush-a: 1; }

/* ── Speech bubble ── */
.bubble {
  position: absolute; left: 56%; top: 0%;
  max-width: min(320px, 46%);
  background: var(--fur);
  border: var(--line); border-radius: 22px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 12px 16px;
  font-family: var(--f-display); font-weight: 500; font-size: clamp(14px, 1.3vw, 17px); line-height: 1.3;
  transform-origin: 18% 120%;
  opacity: 0; transform: scale(.6) translateY(10px);
  transition: opacity .18s ease, transform .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
  z-index: 5;
}
.bubble::after {
  content: ""; position: absolute; left: 18%; bottom: -14px;
  width: 22px; height: 22px; background: var(--fur);
  border-right: var(--line); border-bottom: var(--line);
  transform: rotate(45deg) skew(8deg, 8deg);
  border-bottom-right-radius: 6px;
}
.bubble.is-on { opacity: 1; transform: none; }

/* ── FX layer (Zzz, pokes, hic, glug) ── */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.fx > * { position: absolute; font-family: var(--f-display); font-weight: 700; color: var(--ink); white-space: nowrap; }
.fx .z { font-size: clamp(22px, 2.8vw, 38px); animation: zfloat 3.6s ease-out forwards; }
.fx .z.z--s { font-size: clamp(13px, 1.6vw, 20px); }
@keyframes zfloat {
  0% { opacity: 0; transform: translate(0, 0) rotate(-10deg) scale(.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(40px, -110px) rotate(12deg) scale(1.15); }
}
.fx .poke {
  width: 64px; height: 64px; margin: -32px 0 0 -32px;
  animation: poke .5s ease-out forwards;
}
@keyframes poke { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.fx .word {
  font-size: clamp(16px, 1.6vw, 22px);
  background: var(--fur); border: var(--line); border-radius: 12px; padding: 0 10px;
  animation: pop 1.1s cubic-bezier(.34,1.56,.64,1) forwards;
}
.fx .word--hic { background: var(--blush); }
.fx .word--glug { background: #F6C58E; }
@keyframes pop {
  0% { opacity: 0; transform: translateY(8px) scale(.5) rotate(var(--r, -6deg)); }
  25% { opacity: 1; transform: translateY(0) scale(1) rotate(var(--r, -6deg)); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-30px) scale(1) rotate(var(--r, -6deg)); }
}
.fx .heart { font-size: 22px; color: var(--red); animation: zfloat 1.8s ease-out forwards; }

/* ── Tray + sake ── */
.tray {
  position: absolute; left: 0; bottom: -2%;
  display: flex; align-items: flex-end; gap: 10px;
  z-index: 6;
}
.sake {
  all: unset;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  width: clamp(44px, 5vw, 62px);
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(3px 3px 0 rgba(32,9,3,.18));
  transition: transform .2s ease, opacity .2s ease;
  transform: rotate(-8deg);
}
.sake:hover { transform: rotate(-14deg) translateY(-4px); }
.sake:focus-visible { outline: 3px dashed var(--blue); outline-offset: 6px; border-radius: 12px; }
.sake.is-dragging { opacity: .25; }
.sake[disabled] { cursor: not-allowed; opacity: .4; }
.tray__cup {
  width: clamp(22px, 2.4vw, 30px); height: clamp(16px, 1.8vw, 22px);
  background: var(--fur); border: var(--line); border-top-width: 4px;
  border-radius: 4px 4px 12px 12px;
  margin-bottom: 2px;
}
.tray__hint {
  font-family: var(--f-display); font-weight: 500; font-size: 14px; line-height: 1.25;
  color: var(--ink-soft); margin: 0 0 4px 6px;
}
.tray__hint .arrow { display: inline-block; font-size: 18px; color: var(--amber); }

.sake-ghost {
  position: fixed; left: 0; top: 0; z-index: 200;
  width: clamp(44px, 5vw, 62px);
  pointer-events: none;
  transform-origin: 50% 20%;
  filter: drop-shadow(4px 4px 0 rgba(32,9,3,.2));
}

/* ── Meter ── */
.meter {
  position: absolute; right: 0; bottom: -2%;
  background: var(--fur);
  border: var(--line); border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 14px 10px;
  min-width: 168px;
  z-index: 6;
}
.meter__label { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.meter__cups { list-style: none; display: flex; gap: 6px; padding: 0; margin: 6px 0 4px; }
.meter__cups li {
  width: 20px; height: 15px;
  border: 2.5px solid var(--ink); border-top-width: 3px;
  border-radius: 3px 3px 9px 9px;
  background: var(--fur);
  transition: background-color .3s ease, transform .3s cubic-bezier(.34,1.56,.64,1);
}
.meter__cups li.is-full { background: linear-gradient(to top, #F6C58E 70%, var(--fur) 70%); transform: rotate(-6deg); }
.meter__state { font-family: var(--f-display); font-weight: 600; font-size: 16px; line-height: 1.2; }
.meter__stats { font-size: 12px; color: var(--ink-soft); }

/* ─────────────────────────────────────────────
   MARQUEE
   ───────────────────────────────────────────── */
.marquee {
  background: var(--ink); color: var(--cream);
  border-block: var(--line);
  overflow: hidden;
  transform: rotate(-1.2deg);
  margin: 10px 0 0;
  width: 100%;
}
.marquee__track {
  display: flex; gap: 28px; width: max-content;
  padding: 16px 0;
  font-family: var(--f-display); font-weight: 600; font-size: clamp(20px, 2.4vw, 30px);
  animation: marquee 32s linear infinite;
}
.marquee i { font-style: normal; color: var(--blue); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ─────────────────────────────────────────────
   SECTIONS
   ───────────────────────────────────────────── */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 9vw, 120px) var(--gutter) 0; }
.section__head { display: flex; flex-direction: column; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); }
.section h2 { font-size: clamp(36px, 5vw, 64px); }

.card {
  background: var(--fur);
  border: var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.service { padding: 28px 26px 30px; display: flex; flex-direction: column; gap: 12px; }
.service:nth-child(1) { transform: rotate(-1deg); }
.service:nth-child(3) { transform: rotate(1deg); }
.service--blue { background: var(--blue); }
.service__num {
  font-family: var(--f-display); font-weight: 700; font-size: 15px;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: var(--line); border-radius: 50%; background: var(--cream);
}
.service h3 { font-size: 28px; margin-top: 8px; }
.service p { color: var(--ink); opacity: .82; }

/* Work */
.work { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.project {
  display: flex; flex-direction: column; overflow: hidden;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.project:hover { transform: translate(-3px, -3px) rotate(-.6deg); box-shadow: 8px 8px 0 var(--ink); }
.project__art {
  position: relative; aspect-ratio: 16 / 10;
  border-bottom: var(--line);
  overflow: hidden;
}
.project__body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project h3 { font-size: 32px; }
.project p:not(.tag) { color: var(--ink-soft); }
.tag { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.project__go { margin-top: auto; padding-top: 8px; font-family: var(--f-display); font-weight: 600; }

/* DuctTake art: blueprint with ducts */
.project__art--duct {
  background-color: #0E3A66;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 18px 18px;
}
.project__art--duct span { position: absolute; background: transparent; border: 3px solid #9fe4f7; border-radius: 4px; }
.project__art--duct span:nth-child(1) { left: 8%; top: 30%; width: 70%; height: 16%; }
.project__art--duct span:nth-child(2) { left: 60%; top: 30%; width: 14%; height: 58%; }
.project__art--duct span:nth-child(3) { left: 20%; top: 46%; width: 12%; height: 38%; }
.project__art--duct i { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--blue); border: 3px solid var(--cream); }
.project__art--duct i:nth-of-type(1) { left: 24%; top: 78%; }
.project__art--duct i:nth-of-type(2) { left: 64%; top: 80%; }
.project__art--duct i:nth-of-type(3) { left: 82%; top: 32%; }
.project:hover .project__art--duct i { animation: blip 1s ease-in-out infinite; }
.project:hover .project__art--duct i:nth-of-type(2) { animation-delay: .2s; }
.project:hover .project__art--duct i:nth-of-type(3) { animation-delay: .4s; }
@keyframes blip { 50% { transform: scale(1.35); background: #FFD25A; } }

/* CrossClear art: level crossing barrier */
.project__art--cross { background: #FFE9A8; }
.project__art--cross .bar {
  position: absolute; left: 12%; top: 58%; width: 80%; height: 12%;
  border: var(--line); border-radius: 8px;
  background: repeating-linear-gradient(90deg, var(--red) 0 14%, var(--fur) 14% 28%);
  transform-origin: 2% 50%;
  transform: rotate(-4deg);
  transition: transform .6s cubic-bezier(.34,1.56,.64,1);
}
.project__art--cross::before {
  content: ""; position: absolute; left: 9%; top: 52%; width: 7%; height: 40%;
  background: var(--ink); border-radius: 6px;
}
.project__art--cross .light {
  position: absolute; left: 66%; top: 16%; width: 13%; aspect-ratio: 1;
  border: var(--line); border-radius: 50%; background: var(--red);
}
.project__art--cross .light--2 { left: 81%; background: #7a1a1a; }
.project:hover .project__art--cross .bar { transform: rotate(-58deg); }
.project:hover .project__art--cross .light { animation: flash .8s steps(1) infinite; }
.project:hover .project__art--cross .light--2 { animation-delay: .4s; }
@keyframes flash { 0% { background: var(--red); } 50% { background: #7a1a1a; } }

/* PeopleCloud locked art */
.project__art--locked {
  background:
    radial-gradient(circle at 25% 35%, var(--blue) 0 14%, transparent 15%),
    radial-gradient(circle at 70% 60%, #F6C58E 0 18%, transparent 19%),
    radial-gradient(circle at 48% 80%, var(--blush) 0 10%, transparent 11%),
    var(--cream-2);
  display: grid; place-items: center;
}
.project__art--locked::before { content: ""; position: absolute; inset: 0; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.project__art--locked svg { position: relative; width: 22%; transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.project--locked:hover .project__art--locked svg { transform: rotate(-10deg) scale(1.1); }

/* About teaser */
.about-teaser {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center; gap: clamp(24px, 4vw, 64px);
  padding-bottom: clamp(64px, 9vw, 120px);
}
.about-teaser__year {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(80px, 11vw, 168px); line-height: .9;
  color: var(--blue);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-4deg);
}
.about-teaser h2 { margin: 14px 0 18px; }
.about-teaser p:not(.eyebrow) { color: var(--ink-soft); max-width: 34em; margin-bottom: 26px; }

/* Footer */
.footer {
  background: var(--ink); color: var(--cream);
  padding: clamp(64px, 9vw, 120px) var(--gutter) 28px;
  border-radius: 40px 40px 0 0;
}
.footer__inner { max-width: var(--max); margin-inline: auto; }
.footer__title { font-size: clamp(40px, 6.4vw, 92px); margin: 16px auto 28px; }
.footer__mail {
  display: inline-block;
  font-family: var(--f-display); font-weight: 600; font-size: clamp(22px, 3vw, 40px);
  color: var(--blue); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px;
}
.footer__mail:hover { color: var(--cream); }
.footer__base {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-top: clamp(56px, 8vw, 100px); padding-top: 20px;
  border-top: 1px solid rgba(255,246,233,.2);
  font-size: 14px; opacity: .7;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero__copy { order: 2; }
  .stage { order: 1; margin-bottom: 30px; }
  .services, .work { grid-template-columns: 1fr; }
  .service:nth-child(n) { transform: none; }
  .about-teaser { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav__links a:not(.btn) { display: none; }
  .nav__brand img { width: 110px; }
  .stage { margin-bottom: 96px; }
  .tray { bottom: -16%; }
  .meter { bottom: -16%; min-width: 0; padding: 8px 12px; }
  .meter__cups li { width: 16px; height: 13px; }
  .tray__hint { font-size: 12px; max-width: 118px; }
  .bubble { max-width: 56%; left: 40%; }
}

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

.sake svg, .sake-ghost svg { pointer-events: none; }
