/* heymousa: Apple-style, minimal and warm. The system font, white and #f5f5f7 grounds,
   one link blue, each app tile in its own colour, glass only on the floating nav. */

:root {
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --line: #d2d2d7;
  --blue: #0066cc;
  --blue-hi: #0071e3;
  --ink: #000000;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --wrap: 1040px;
  --wrap-wide: 1200px;
  --gutter: clamp(20px, 5vw, 44px);
  --section: clamp(88px, 12vw, 160px);
  --radius: 28px;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 56px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.47 var(--font);
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: rgb(0 102 204 / .18); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .18em; }
:focus-visible { outline: 3px solid rgb(0 102 204 / .55); outline-offset: 3px; border-radius: 8px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 12px; background: var(--text); color: #fff; }
.skip:focus { top: 12px; }

/* ---------- Nav: a translucent layer; its edge appears only once content scrolls under it ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: 52px;
  background: rgb(255 255 255 / .72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0);
  transition: box-shadow .3s ease;
}
.nav.scrolled { box-shadow: 0 1px 0 rgb(0 0 0 / .08); }
.nav-in { width: min(100% - 2 * var(--gutter), var(--wrap)); height: 100%; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; }
.nav-name { color: var(--text); font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.nav-name:hover { text-decoration: none; }
.nav nav { display: flex; gap: clamp(14px, 3vw, 32px); }
.nav nav a { color: var(--text); font-size: .8125rem; letter-spacing: -0.005em; opacity: .8; transition: opacity .2s; }
.nav nav a:hover { opacity: 1; text-decoration: none; }

/* ---------- Type: tracking tightens as size grows ---------- */
h1 { font-size: clamp(3.25rem, 9vw, 6rem); font-weight: 700; line-height: 1.03; letter-spacing: -0.045em; }
.section-title { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance; }
.section-lede { margin-top: 16px; max-width: 34em; font-size: clamp(1.1875rem, 1.8vw, 1.375rem); line-height: 1.4; letter-spacing: -0.02em; color: var(--text-2); }
.soft { color: var(--text-2); }

/* ---------- Hello ---------- */
.hello { padding: clamp(80px, 13vw, 168px) 0 clamp(64px, 9vw, 112px); text-align: center; overflow: hidden; }
.hello-sub { margin-top: 8px; font-size: clamp(2rem, 5.2vw, 3.5rem); font-weight: 600; line-height: 1.07; letter-spacing: -0.035em; color: var(--text-2); }
.hello-text { margin: 28px auto 0; max-width: 32em; font-size: clamp(1.125rem, 1.6vw, 1.3125rem); line-height: 1.45; letter-spacing: -0.018em; color: var(--text-2); text-wrap: pretty; }
.hello-actions { display: flex; justify-content: center; align-items: center; gap: 28px; margin-top: 36px; }

.pill {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: 980px;
  background: var(--blue); color: #fff; font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.015em;
  transition: background-color .2s ease, transform .1s ease-out;
}
.pill:hover { background: var(--blue-hi); text-decoration: none; }
.pill:active { transform: scale(.97); }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: 1.0625rem; letter-spacing: -0.015em; }
.more svg { width: 11px; height: 11px; transition: transform .25s var(--ease-out); }
.more:hover svg { transform: translateX(2px); }
.more:active { opacity: .6; }

/* The dock: the apps, magnified like macOS as the pointer passes over them */
.dock-wrap { display: flex; justify-content: center; margin-top: clamp(56px, 8vw, 88px); padding: 0 var(--gutter); }
.dock {
  --size: 76px;
  display: flex; align-items: flex-end; gap: 10px;
  height: calc(var(--size) + 20px); overflow: visible;   /* the shelf keeps its height; icons rise above it */
  padding: 10px 12px; border-radius: 26px;
  background: rgb(255 255 255 / .6);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 0 0 .5px rgb(0 0 0 / .1), 0 1px 0 rgb(255 255 255 / .9) inset, 0 20px 50px -18px rgb(0 0 0 / .28);
}
.dock li { width: var(--size); height: var(--size); flex: none; }
.dock a { display: block; width: 100%; height: 100%; }
.dock img { width: 100%; height: 100%; border-radius: 22.5%; box-shadow: 0 0 0 .5px rgb(0 0 0 / .08), 0 4px 10px -4px rgb(0 0 0 / .3); }
.dock a:active img { filter: brightness(.85); }
.dock-label {
  position: fixed; z-index: 60; pointer-events: none;
  padding: 4px 10px; border-radius: 8px; background: rgb(30 30 32 / .86); color: #fff;
  font-size: .8125rem; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap;
  opacity: 0; transform: translate(-50%, calc(-100% + 4px)); transition: opacity .15s ease, transform .15s var(--ease-out);
}
.dock-label.on { opacity: 1; transform: translate(-50%, -100%); }

/* ---------- Apps ---------- */
.apps { padding: var(--section) 0; background: var(--bg); }
.apps .wrap { width: min(100% - 2 * var(--gutter), var(--wrap-wide)); }
.apps .section-title, .apps > .wrap > .section-lede { text-align: center; margin-inline: auto; }
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; margin-top: clamp(48px, 6vw, 72px); }
.tile {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; min-height: 600px;
  border-radius: var(--radius); background: #fff; color: var(--text);
  grid-column: span 2;
}
.tile-stamp { grid-column: span 4; background: radial-gradient(80% 90% at 75% 20%, #3E5BB5, #1E2F6E 55%, #121A3D); color: #F4F2EC; }
.tile-pup { grid-column: span 2; background: #F6EDE4; }
.apps .tile { box-shadow: 0 0 0 1px rgb(0 0 0 / .04); }
.tile-dice { background: #6721A0; color: #fff; }
.tile-time { background: #152538; color: #fff; }
.tile-plot { background: #0E1E31; color: #fff; }

.tile-copy { padding: 40px 40px 0; text-align: center; display: grid; justify-items: center; }
.tile-copy > *:not(.tile-links) { position: relative; z-index: 2; }   /* above the artwork; the tile link's overlay (z 3) still covers everything */
.tile-stamp .tile-copy { text-align: left; justify-items: start; max-width: 380px; padding-top: 48px; }
.tile-icon { width: 64px; height: 64px; border-radius: 22.5%; box-shadow: 0 0 0 .5px rgb(0 0 0 / .1), 0 8px 18px -8px rgb(0 0 0 / .45); }
.tile h3 { margin-top: 20px; font-size: clamp(1.875rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.08; letter-spacing: -0.035em; }
.tile p { margin-top: 10px; max-width: 22em; font-size: 1.1875rem; line-height: 1.38; letter-spacing: -0.02em; opacity: .82; }
.tile-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 18px; }
.more-light { color: #7cc0ff; }
.tile-stamp .more-light { color: #5DD9A8; }

.tile-media { position: relative; flex: 1; margin-top: 28px; display: flex; justify-content: center; align-items: flex-end; }
/* The App Store image fills the tile edge to edge on the tile's own colour, its top edge faded so no seam shows. */
.tile-shot { width: 100%; height: auto; -webkit-mask-image: linear-gradient(transparent, #000 24px); mask-image: linear-gradient(transparent, #000 24px); }
.tile-pup .tile-shot { -webkit-mask-image: none; mask-image: none; }
.tile-pup .tile-media { margin-top: 24px; }

.stamp-media { position: absolute; inset: 0 0 0 42%; margin: 0; }
.mini-phone {
  position: absolute; right: 18%; bottom: -120px; width: 270px;
  padding: 7px; border-radius: 44px; background: #0A0B0D;
  box-shadow: 0 0 0 1px #34478D, 0 40px 80px -30px rgb(0 0 0 / .8);
}
.mini-phone img { width: 100%; height: auto; border-radius: 37px; }
.mini-stamp { position: absolute; left: var(--x); top: var(--y); width: 104px; color: var(--ink); transform: rotate(var(--tilt)); filter: drop-shadow(0 6px 14px rgb(5 10 30 / .35)); }
.mini-stamp text { fill: currentColor; font: 800 27px/1 ui-rounded, var(--font); }
.mini-stamp .cap { font: 700 10.5px/1 ui-monospace, "SF Mono", Menlo, monospace; }

/* The whole tile is one link: the tile's main link stretches over it; any second link sits above. */
.tile-link::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
.tile-links a:not(.tile-link) { position: relative; z-index: 4; }
.tile { cursor: pointer; }
.tile:has(.tile-link:focus-visible) { outline: 3px solid rgb(0 102 204 / .55); outline-offset: 4px; }
.tile-link:focus-visible { outline: none; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -30px rgb(0 0 0 / .35); }
  .tile:hover .tile-link svg { transform: translateX(2px); }
}

/* Press feedback on the whole tile, the way a card answers a finger */
.tile { transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out); }
.tile:active { transform: scale(.985); transition-duration: .1s; }


/* ---------- About ---------- */
.about { padding: var(--section) 0; background: var(--bg-2); }
.statement { margin-top: clamp(32px, 4vw, 48px); max-width: 24em; font-size: clamp(1.75rem, 3.6vw, 2.75rem); font-weight: 600; line-height: 1.18; letter-spacing: -0.03em; text-wrap: pretty; }
.statement .w { transition: color .35s ease; }
.js .statement[data-words] .w { color: #bdbdc2; }
.js .statement[data-words] .w.lit { color: var(--text); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 48px; margin-top: clamp(64px, 8vw, 96px); padding-top: 40px; border-top: 1px solid var(--line); }
.facts dt { font-size: .875rem; font-weight: 600; color: var(--text-2); letter-spacing: -0.005em; }
.facts dd { margin-top: 6px; font-size: 1.0625rem; line-height: 1.47; letter-spacing: -0.015em; }

/* ---------- Writing ---------- */
.writing { padding: var(--section) 0; background: var(--bg-2); text-align: center; }
.writing .section-lede { margin-inline: auto; }
.post-card {
  display: block; max-width: 680px; margin: clamp(40px, 5vw, 56px) auto 0; padding: clamp(28px, 4vw, 40px);
  border-radius: var(--radius); background: #fff; color: var(--text); text-align: left;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .04); transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.post-card:hover { text-decoration: none; box-shadow: 0 0 0 1px rgb(0 0 0 / .04), 0 24px 50px -24px rgb(0 0 0 / .25); }
.post-card:active { transform: scale(.985); transition-duration: .1s; }
.post-card time { font-size: .875rem; font-weight: 500; color: var(--text-2); }
.post-card h3 { margin-top: 8px; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.12; letter-spacing: -0.03em; }
.post-card p { margin-top: 10px; color: var(--text-2); font-size: 1.0625rem; line-height: 1.45; }
.post-card .more { margin-top: 16px; color: var(--blue); }
.post-card + .post-card { margin-top: 16px; }
.writing-all { margin-top: 24px; }

/* ---------- Contact ---------- */
.contact { padding: var(--section) 0 calc(var(--section) * .8); text-align: center; }
.contact-title { font-size: clamp(3.5rem, 11vw, 7.5rem); font-weight: 700; line-height: 1; letter-spacing: -0.05em; }
.contact .section-lede { margin-inline: auto; }
.mail-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.socials { display: flex; justify-content: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.socials a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 980px;
  background: var(--bg-2); color: var(--text); font-size: .9375rem; font-weight: 500;
  transition: background-color .2s ease, transform .1s ease-out;
}
.socials a:hover { background: #e8e8ed; text-decoration: none; }
.socials a:active { transform: scale(.97); }
.socials svg { width: 18px; height: 18px; }

.foot { padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); background: var(--bg-2); color: var(--text-2); font-size: .75rem; letter-spacing: 0; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(24px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes tile-in { from { opacity: .001; transform: translateY(60px) scale(.96); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .reveal { animation: rise .9s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 90ms + 60ms); }
  .js .tile.pre, .js   .js .tile.in, .js }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: fade .4s ease both; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}
@media (prefers-reduced-transparency: reduce) {
  .nav, .dock { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .nav { background: #fff; box-shadow: 0 1px 0 var(--line); }
  .js .statement[data-words] .w { color: var(--text); }
  :root { --text-2: #424245; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1068px) {
  .tile-stamp { grid-column: span 6; }
  .tile-pup { grid-column: span 6; min-height: 0; }
  .tile-pup .tile-media { max-height: 420px; overflow: hidden; }
  }
@media (max-width: 834px) {
  .bento { grid-template-columns: 1fr; }
  .tile, .tile-stamp, .tile-pup { grid-column: auto; min-height: 560px; }
  .tile-stamp .tile-copy { max-width: none; text-align: center; justify-items: center; }
  .stamp-media { position: relative; inset: auto; flex: none; height: 400px; margin-top: 28px; }
  .mini-phone { right: auto; left: 50%; width: 230px; margin-left: -115px; bottom: -110px; }
  .mini-stamp { width: 72px; }
  .mini-stamp:nth-of-type(1) { left: 2%; top: 46%; }
  .mini-stamp:nth-of-type(2) { left: auto; right: 2%; top: 4%; }
  .mini-stamp:nth-of-type(3) { left: auto; right: 0; top: 58%; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .dock { --size: 56px; gap: 8px; padding: 8px 10px; border-radius: 20px; height: calc(var(--size) + 16px); }
}
@media (max-width: 560px) {
  .nav nav { gap: 16px; }
  .nav-name { font-size: 1.0625rem; }
  .nav nav a[href="#writing"] { display: none; }
  .hello-actions { flex-direction: column; gap: 18px; }
  .tile-copy { padding: 32px 24px 0; }
    .facts { gap: 28px; }
}

/* Narrow phones: subpages carry four links, so they drop "About" (one tap away on the home page). */
@media (max-width: 430px) {
  .nav nav a[href$="#about"]:not([href="#about"]) { display: none; }
}
