/* Homepage: the typing headline, the cat who walks the line as you scroll, and the work grid.
   Shared pieces (nav, footer, the line and cat) live in site.css. */
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-weight: 300; }

/* first screen: nav, headline, and the line sitting just above the fold */
.first { min-height: 100svh; display: flex; flex-direction: column; }
.logo { width: 28px; height: 27px; display: block; }
.hero { flex: 1; display: flex; flex-direction: column; width: 100%; padding-top: 48px; padding-bottom: 26px; }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(46px, 7.5vw, 96px); line-height: 1.18; margin: auto 0 0; }
/* the sub-headline: says senior, plainly, right under the big hello. The h1 and this line centre together. */
.hero__sub { margin: 20px 0 auto; padding-bottom: 48px; font-size: clamp(18px, 1.7vw, 24px); line-height: 1.45; }
/* the reach stays in one piece, so a wrap lands before "for" */
.hero__reach { white-space: nowrap; }
.hero__sub strong { font-weight: 400; }
.hero__dot { opacity: .7; }
h1 .photo { display: inline-block; width: 0.99em; height: 1.06em; border-radius: 9px; overflow: hidden; vertical-align: -0.2em; margin: 0 0.2em; }
h1 .photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.verb { white-space: nowrap; position: relative; }
.caret { position: absolute; right: -0.04em; top: 0.2em; width: 0.04em; min-width: 2px; height: 0.86em; background: var(--ink); animation: blink 1.05s steps(1) infinite; }
.typing .caret { animation: none; }
@keyframes blink { 50% { opacity: 0; } }

/* the line, and the cat who lives on it */
.line { position: relative; width: 100%; height: 52px; }
.line svg.rule { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 14px; overflow: visible; }
.cat { position: absolute; left: 6px; bottom: 7px; width: 25px; height: 42px; overflow: visible; will-change: transform; transform-origin: 12.5px 50%; }
.cat path { stroke: currentColor; }

/* selected work: a clean two-column grid */
.work { padding-top: 56px; padding-bottom: 120px; }
.work h2 { font-family: var(--sans); font-weight: 300; font-size: 32px; letter-spacing: -0.01em; margin: 0 0 24px; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 3.5vw, 48px) clamp(16px, 3.5vw, 45px); }
.card { display: grid; gap: 12px; color: inherit; text-decoration: none; }
.card__img { position: relative; aspect-ratio: 1092 / 662; border-radius: 9px; overflow: hidden; background: var(--tile); }
.card__img img { position: absolute; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card__img .cover { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__img .phone { left: 50%; top: 9%; width: 27%; height: auto; transform: translateX(-50%); }
/* one real screen per tile, big enough to read, rising out of the bottom edge */
.card__img .scr { left: 50%; top: 12%; width: 40%; height: auto; transform: translateX(-50%); border-radius: 14px 14px 0 0; box-shadow: 0 24px 60px -10px rgba(0, 0, 0, .55); }
.card__img .scr--win { width: 84%; border-radius: 10px 10px 0 0; }
.card:hover .scr { transform: translateX(-50%) translateY(-2.5%); }
.card__img .window { left: 50%; top: 50%; width: 76%; height: auto; transform: translate(-50%, -50%); border-radius: 6px; box-shadow: 0 16px 36px rgba(30, 20, 60, .14); }
.card__img--lockup { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(18px, 2.4vw, 30px); }
.lockup { display: flex; align-items: baseline; gap: .38em; font-family: 'Instrument Serif', serif; font-size: clamp(32px, 4vw, 58px); line-height: 1; white-space: nowrap; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.lockup__x { font-size: .62em; opacity: .7; transform: translateY(-.1em); }
.card:hover .lockup { transform: translateY(-3px); }
.lock { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); font-size: 13px; white-space: nowrap; }
.card:hover .cover { transform: scale(1.025); }
.card:hover .phone { transform: translateX(-50%) translateY(-3%); }
.card:hover .window { transform: translate(-50%, -51.5%); }
.card__text { display: flex; justify-content: space-between; gap: 16px; font-size: 16px; }
.card__name { font-weight: 400; }
/* password-protected case studies get a small hand-drawn lock after the name */
.card__lock { display: inline-block; width: .9em; height: 1em; margin-left: .38em; vertical-align: -.1em; opacity: .85; }
.card__note { text-align: right; opacity: .8; }
.card:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; border-radius: 9px; }
.foot { padding-top: 96px; margin: 0; }


/* earlier work: one quiet line under the grid */
.work { padding-bottom: 40px !important; }
.earlier { margin: 48px 0 0; font-size: 16px; max-width: 46em; line-height: 1.5; opacity: .9; }
.earlier a { color: inherit; font-weight: 400; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.earlier a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

/* ---- loading + scroll-in animations (only with the .anim class, set when motion is OK) ---- */
.ln { display: inline-block; }
.anim .anim .ln, .anim h1 .photo { opacity: 0; }
.go .go .ln1 { animation: rise .9s cubic-bezier(.2,.7,.2,1) .15s both; }
.go .ln2 { animation: rise .9s cubic-bezier(.2,.7,.2,1) .32s both; }
.anim .hero__sub { opacity: 0; }
.go .hero__sub { animation: rise .9s cubic-bezier(.2,.7,.2,1) .5s both; }
.go h1 .photo { animation: pop .8s cubic-bezier(.3,1.6,.5,1) .4s both; }
.go #line svg.rule { animation: draw 1s cubic-bezier(.6,.1,.3,1) .55s both; }
.go #cat { animation: drop .7s cubic-bezier(.3,1.5,.55,1) 1.4s both; }
@keyframes rise { from { opacity: 0; transform: translateY(.35em); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.5) rotate(-8deg); } to { opacity: 1; transform: none; } }
/* phones: one tile per row, with the caption stacked under the name */
@media (max-width: 760px) {
  /* the first screen sizes to its content instead of filling the phone, so the work starts sooner */
  .first { min-height: 0; }
  .hero { padding-top: 96px; padding-bottom: 10px; }
  h1 { margin: 0; font-size: clamp(38px, 11.6vw, 56px); }
  .hero__sub { margin: 16px 0 0; padding-bottom: 40px; font-size: 18px; }
  /* on a phone the title and the domains sit on two lines, so the dot between them goes */
  .hero__dot { display: none; }
  .hero__beat { display: block; }
  .work { padding-top: 56px; }
  .grid { grid-template-columns: 1fr; }
  .card__text { flex-direction: column; gap: 2px; }
  .card__note { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } .card__img img { transition: none; } }
