/* Guppy Studio — quiet edition */
:root {
  --bg: #f6f5f1;
  --ink: #141414;
  --muted: #8a877f;
  --line: rgba(20, 20, 20, .12);
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --rainbow: linear-gradient(90deg, #ffc400, #ff7a00, #ff2d55, #e021c4, #7b2cff, #2f6bff, #0fc4e0, #28d47c);
  --pad: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
::selection { background: #141414; color: var(--bg); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* scroll progress: the only colour besides the fish */
.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 60; }
.progress span { display: block; height: 100%; background: var(--rainbow); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* header */
.top { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 22px var(--pad); mix-blend-mode: normal; transition: background .5s, backdrop-filter .5s; }
.top.solid { background: rgba(246, 245, 241, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.mark { display: flex; align-items: center; gap: 12px; font: 400 13px/1 var(--mono); letter-spacing: .02em; }
.mark img { width: 126px; }
.top nav { display: flex; gap: clamp(18px, 3vw, 40px); font: 400 13px/1 var(--mono); }
.top nav a { position: relative; color: var(--muted); transition: color .3s; }
.top nav a:hover { color: var(--ink); }
.top nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.top nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* hero */
.hero { height: 260vh; position: relative; }
.hero-in { position: sticky; top: 0; height: 100svh; min-height: 620px; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(110px, 16vh, 180px) var(--pad) clamp(36px, 6vh, 70px); overflow: clip; }
.meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; font: 400 12px/1.4 var(--mono); color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.meta span:nth-child(2) { text-align: center; } .meta span:nth-child(3) { text-align: right; }
.avail i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #28d47c; margin-right: 8px; vertical-align: 1px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.headline { align-self: center; font: 400 clamp(58px, 11.5vw, 196px)/.9 var(--serif); letter-spacing: -.035em; margin: clamp(40px, 8vh, 90px) 0; }
.headline em { font-style: italic; }
.headline .ln { display: block; overflow: hidden; padding-bottom: .22em; margin-bottom: -.16em; }
.headline .ln > span { display: inline-block; transform: translateY(105%); transition: transform 1.4s var(--ease); }
.headline .ln:nth-child(2) > span { transition-delay: .12s; padding-left: 12vw; }
.ready .headline .ln > span { transform: none; }

.hero-foot { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 40px; }
.lede { max-width: 330px; color: var(--muted); font-size: 15px; opacity: 0; transition: opacity 1.4s var(--ease) .5s; }
.ready .lede { opacity: 1; }
.fish { margin: 0; justify-self: end; width: min(36vw, 540px); aspect-ratio: 1648 / 801; position: relative; cursor: pointer; perspective: 800px; }
.fish-swim { position: absolute; inset: 0; will-change: transform; transform-style: preserve-3d; }
.fish-side, .fish-front { position: absolute; inset: 0; width: 100%; height: 100%; will-change: transform; }
.fish-side svg { width: 100%; height: 100%; overflow: visible; display: block; }
.fish-front { width: 60%; height: auto; aspect-ratio: 1; inset: 50% auto auto 50%; translate: -50% -50%; overflow: visible; backface-visibility: hidden; }
.fish-side { backface-visibility: hidden; transform-origin: 50% 50%; }
.fish-side .tail, .fish-side .finTop, .fish-side .finBot, .fish-side .body { transform-box: view-box; }
@keyframes swim { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(-1deg); } }

/* blocks */
.block { display: grid; grid-template-columns: minmax(140px, 1fr) 3fr; gap: 40px; padding: clamp(120px, 20vh, 220px) var(--pad) 0; }
.label { font: 400 12px/1.4 var(--mono); color: var(--muted); position: sticky; top: 90px; align-self: start; }
.body { min-width: 0; }
.statement { font: 400 clamp(30px, 3.6vw, 56px)/1.12 var(--serif); letter-spacing: -.015em; max-width: 22ch; }

.crafts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-top: clamp(70px, 12vh, 140px); }
.crafts li { border-top: 1px solid var(--line); padding-top: 16px; }
.crafts .n { font: italic 400 18px/1 var(--serif); color: var(--muted); }
.crafts h3 { font: 500 15px/1.3 var(--sans); margin: 22px 0 8px; }
.crafts p { color: var(--muted); font-size: 14px; max-width: 26ch; }

/* work index */
.index { border-top: 1px solid var(--line); }
.index li { border-bottom: 1px solid var(--line); }
.index a { display: grid; grid-template-columns: 50px minmax(0, 1.2fr) minmax(0, 1.6fr) 90px 24px; align-items: baseline; gap: 20px; padding: clamp(22px, 3.4vh, 34px) 0; transition: padding .6s var(--ease), color .4s; }
.index .i, .index .kind { font: 400 12px/1 var(--mono); color: var(--muted); }
.index .name { font: 400 clamp(34px, 4.4vw, 68px)/1 var(--serif); letter-spacing: -.02em; transition: transform .6s var(--ease); }
.index .what { color: var(--muted); font-size: 14px; }
.index .arr { justify-self: end; color: var(--muted); transition: transform .5s var(--ease), color .3s; }
.index a:hover .name { transform: translateX(14px); }
.index a:hover .arr { color: var(--ink); transform: translate(3px, -3px); }
.index:hover a { color: rgba(20,20,20,.35); }
.index:hover a:hover { color: var(--ink); }
.index .thumb { display: none; }
.index .next .name em { font-style: italic; }

.hover-img { position: fixed; left: 0; top: 0; width: 380px; pointer-events: none; z-index: 40; opacity: 0; transform: translate3d(var(--mx, 0), var(--my, 0), 0) translate(-50%, -50%) scale(.92); transition: opacity .35s var(--ease), scale .5s var(--ease); }
.hover-img.on { opacity: 1; }
.hover-img img { width: 100%; border-radius: 4px; box-shadow: 0 30px 60px -30px rgba(20,20,20,.45); }
.hover-img.tall { width: 220px; }

/* principles */
.principles { counter-reset: p; }
.principles li { counter-increment: p; display: grid; grid-template-columns: 50px 1fr; align-items: baseline; font: 400 clamp(28px, 3.4vw, 52px)/1.15 var(--serif); letter-spacing: -.015em; padding: 16px 0; }
.principles li::before { content: "0" counter(p); font: 400 12px/1 var(--mono); color: var(--muted); }

/* contact */
.contact { padding-bottom: clamp(120px, 20vh, 220px); }
.contact .small { color: var(--muted); margin-bottom: 26px; }
.mail { display: inline-block; font: 400 clamp(44px, 8.4vw, 150px)/1 var(--serif); letter-spacing: -.035em; position: relative; padding-bottom: .08em; }
.mail::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--rainbow); transform: scaleX(0); transform-origin: right; transition: transform .9s var(--ease); }
.mail:hover::after { transform: scaleX(1); transform-origin: left; }

.foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 26px var(--pad) 34px; border-top: 1px solid var(--line); margin: 0 var(--pad); padding-inline: 0; font: 400 12px/1 var(--mono); color: var(--muted); }
.foot img { width: 40px; opacity: .9; }
.foot span:last-child { text-align: right; }

/* reveal */
.rise { opacity: 0; transform: translateY(24px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.rise.in { opacity: 1; transform: none; }
.crafts li:nth-child(2) { transition-delay: .08s; } .crafts li:nth-child(3) { transition-delay: .16s; } .crafts li:nth-child(4) { transition-delay: .24s; }

@media (max-width: 860px) {
  .top { padding: 16px var(--pad); }
  .mark span { display: none; }
  .meta { grid-template-columns: 1fr 1fr; } .meta span:nth-child(2) { display: none; } .meta span:nth-child(3) { text-align: right; }
  .headline .ln:nth-child(2) > span { padding-left: 0; }
  .hero-foot { grid-template-columns: 1fr; gap: 56px; }
  .fish { width: 84vw; justify-self: center; }
  .hero { height: 230vh; }
  .block { grid-template-columns: 1fr; gap: 28px; }
  .label { position: static; }
  .crafts { grid-template-columns: 1fr 1fr; gap: 40px 20px; }
  .index a { grid-template-columns: 34px 1fr 20px; row-gap: 6px; }
  .index .what { grid-column: 2; grid-row: 2; }
  .index .kind { display: none; }
  .index .arr { grid-column: 3; grid-row: 1; }
  .index .thumb { display: block; width: 100%; max-height: 200px; object-fit: cover; object-position: top left; border-radius: 4px; margin: 0 0 24px; }
  .index .thumb.tall { width: 38%; max-height: none; }
  .hover-img { display: none; }
  .principles li { grid-template-columns: 34px 1fr; }
  .foot { grid-template-columns: 1fr auto; } .foot img { display: none; }
}

@media (hover: none) { .hover-img { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .rise, .lede { opacity: 1; transform: none; }
  .headline .ln > span { transform: none; }
  html { scroll-behavior: auto; }
}

/* ---- small delights ---- */

/* "good" cycles through other words on hover / tap */
.swap { position: relative; display: inline-block; cursor: default; transition: opacity .35s var(--ease), filter .35s var(--ease), transform .35s var(--ease); }
.swap.out { opacity: 0; filter: blur(6px); transform: translateY(.08em); }

/* the statement reads itself as you scroll: words go from faint to ink */
.statement .w { opacity: calc(.16 + var(--o, 0) * .84); transition: opacity .25s linear; }

/* mono labels decode when they arrive */
.label.scramble { color: var(--ink); }

/* the fish: poke it and it swims off, then comes back */
@keyframes dash {
  0% { transform: none; }
  18% { transform: translateX(-3%) rotate(2deg); }
  55% { transform: translateX(120vw) rotate(-4deg); opacity: 1; }
  56% { transform: translateX(-140vw); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: none; }
}
.bubble { position: fixed; z-index: 45; width: var(--s, 10px); height: var(--s, 10px); border-radius: 50%; border: 1px solid rgba(47, 107, 255, .55); background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.95), rgba(255,255,255,.2) 45%, rgba(15,196,224,.08)); pointer-events: none; animation: rise var(--d, 2s) ease-out forwards; }
@keyframes rise { to { transform: translate(var(--dx, 0), -140px) scale(1.15); opacity: 0; } }

/* type g-u-p-p-y anywhere: a school swims through */
.school { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.school img { position: absolute; left: 0; width: var(--w, 120px); animation: school var(--d, 6s) cubic-bezier(.45, .05, .55, .95) var(--delay, 0s) both; }
@keyframes school {
  0% { transform: translate(130vw, 0); }
  25% { transform: translate(90vw, -2vh) rotate(2deg); }
  50% { transform: translate(50vw, 2vh) rotate(-1deg); }
  75% { transform: translate(15vw, -1vh) rotate(1deg); }
  100% { transform: translate(-30vw, 1vh); }
}

/* the mail address: click copies too */
.copied { position: fixed; left: 50%; bottom: 32px; translate: -50% 0; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 400 12px/1 var(--mono); opacity: 0; transform: translateY(10px); transition: opacity .4s var(--ease), transform .4s var(--ease); z-index: 80; pointer-events: none; }
.copied.on { opacity: 1; transform: none; }

/* a tiny guppy follows the pointer along the footer */
.foot { position: relative; overflow: hidden; }
.foot .pet { position: absolute; bottom: 6px; left: 0; width: 26px; opacity: .55; transform: translateX(var(--fx, 50vw)) scaleX(var(--dir, 1)); transition: transform 1.2s var(--ease); pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .statement .w { opacity: 1; }
  .bubble, .school, .foot .pet { display: none; }
}

/* film player */
.player { width: min(1200px, 94vw); padding: 0; border: 0; border-radius: 10px; background: #0d0d0d; color: var(--bg); box-shadow: 0 40px 120px -40px rgba(0,0,0,.6); overflow: visible; }
.player::backdrop { background: rgba(246, 245, 241, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.player video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #000; }
.player-title { position: absolute; left: 0; top: -38px; color: var(--ink); font: 400 13px/1 var(--mono); }
.player-close { position: absolute; right: -6px; top: -48px; width: 40px; height: 40px; border: 0; background: none; font: 400 30px/1 var(--serif); color: var(--ink); cursor: pointer; }
.index a[data-film] .arr { font-size: 11px; }

/* the logo is a live rig (fish.js): it swims while the page scrolls */
.mark-rig { display: block; width: 126px; transform-origin: 30% 55%; will-change: transform; }
.mark-rig svg { display: block; width: 100%; height: auto; overflow: visible; }
.mark-rig .tail, .mark-rig .finTop, .mark-rig .finBot, .mark-rig .body { transform-box: view-box; }
@media (max-width: 860px) {
  .mark .mark-rig { display: block; width: 112px; }
  .hero { height: auto; }
  .hero-in { position: relative; height: 100svh; min-height: 560px; }
  .hero-foot { grid-template-columns: 1fr; }
  .fish { display: none; }
}
