:root {
  --bg: #fbfaf5;
  --text: #262220;
  --muted: #8c8078;
  --line: #e9e2d8;
  --accent: #8a5142;

  /* sampled from your X banner gradient */
  --cream: #fbfaf5;
  --sand: #efd9c0;
  --rose: #caa99b;
  --mauve: #9c8ca0;
  --dark: #6f6072;

  --max-width: 640px;
  --serif: "Source Serif 4", Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "Instrument Serif", "Source Serif 4", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
  animation: page-fade-in 0.55s ease both;
}

/* opacity-only: a transform here (even translateY(0)) would make body a
   containing block for position:fixed children, breaking the cursor dot */
@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.is-leaving {
  animation: page-fade-out 0.32s ease forwards;
}

@keyframes page-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
  body.is-leaving {
    animation: none;
  }
}

@media (hover: hover) and (pointer: fine) {
  body, a, button {
    cursor: none;
  }
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--dark);
  opacity: 0.55;
  pointer-events: none;
  z-index: 999;
  transform: translate(-100px, -100px) scale(1);
  transition: width 0.18s ease, height 0.18s ease,
    margin 0.18s ease, opacity 0.18s ease, background 0.18s ease;
  will-change: transform;
}

.cursor-dot.is-hovering {
  width: 34px;
  height: 34px;
  margin-left: -17px;
  margin-top: -17px;
  opacity: 0.28;
  background: var(--accent);
}

.cursor-dot.is-hidden {
  opacity: 0;
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot {
    display: none;
  }
}

/* --- Living background, inspired by the X banner gradient --- */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  filter: blur(55px);
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.blob-sand {
  width: 60vw;
  height: 60vw;
  top: -15%;
  left: -15%;
  background: var(--sand);
  opacity: 0.85;
  animation: drift-a 16s ease-in-out infinite;
}

.blob-rose {
  width: 50vw;
  height: 50vw;
  top: 0%;
  right: -12%;
  background: var(--rose);
  opacity: 0.75;
  animation: drift-b 20s ease-in-out infinite;
}

.blob-mauve {
  width: 48vw;
  height: 48vw;
  bottom: -18%;
  left: 18%;
  background: var(--mauve);
  opacity: 0.6;
  animation: drift-c 24s ease-in-out infinite;
}

.blob-dark {
  width: 30vw;
  height: 30vw;
  top: -8%;
  right: -6%;
  background: var(--dark);
  opacity: 0.45;
  animation: drift-d 14s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(14%, 12%) scale(1.18) rotate(8deg); }
}

@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(-16%, 12%) scale(1.12) rotate(-10deg); }
}

@keyframes drift-c {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(12%, -14%) scale(1.2) rotate(10deg); }
}

@keyframes drift-d {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-14%, 12%) scale(1.3); }
}

.bg-veil {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: rgba(251, 250, 245, 0.32);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .blob {
    animation: none !important;
  }
}

.site-header,
main,
footer {
  position: relative;
  z-index: 1;
}

.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.name {
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  text-decoration: none;
  font-size: 25px;
  letter-spacing: 0.01em;
  font-family: var(--display);
}

nav {
  display: flex;
  gap: 20px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-family: var(--sans);
  position: relative;
  padding-bottom: 2px;
  letter-spacing: 0;
  transition: color 0.2s ease, letter-spacing 0.2s ease;
}

nav a:hover {
  color: var(--accent);
  letter-spacing: 0.03em;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}

.section:last-of-type {
  border-bottom: none;
}

.intro {
  padding-top: 40px;
}

/* --- Avatar + break interaction --- */
.avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 0 16px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  box-shadow: 0 2px 14px rgba(111, 96, 114, 0.3);
  cursor: pointer;
  background: var(--line);
  position: relative;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.avatar.is-hit {
  animation: avatar-shake 0.28s ease;
}

@keyframes avatar-shake {
  0% { transform: translate(0, 0) rotate(0); }
  20% { transform: translate(-3px, 1px) rotate(-6deg); }
  40% { transform: translate(3px, -1px) rotate(5deg); }
  60% { transform: translate(-2px, 1px) rotate(-3deg); }
  80% { transform: translate(2px, 0) rotate(2deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

.reaction-bubble {
  position: absolute;
  top: -6px;
  left: 50%;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, 0) scale(0.7);
  opacity: 0;
  animation: bubble-pop 0.9s ease forwards;
  z-index: 5;
}

@keyframes bubble-pop {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -8px) scale(1.05); }
  35% { transform: translate(-50%, -10px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(0.95); }
}

.shard {
  position: absolute;
  top: 0;
  left: 0;
  background-repeat: no-repeat;
  border-radius: 3px;
  transition: transform 0.75s cubic-bezier(.2,.7,.3,1), opacity 0.75s ease;
  will-change: transform, opacity;
}

.shard.is-flying {
  transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
  opacity: 0;
}

.avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: linear-gradient(135deg, var(--sand), var(--rose) 55%, var(--dark));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
  animation: placeholder-in 0.4s ease;
}

@keyframes placeholder-in {
  0% { opacity: 0; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}

.avatar-placeholder svg {
  width: 30px;
  height: 30px;
}

.avatar-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 4px);
  min-width: 160px;
  background: var(--text);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}

.avatar-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--text);
}

.avatar-placeholder:hover .avatar-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* Centered on the 72px avatar, the tooltip's min-width overflows the left
   edge of the viewport on narrow screens where the avatar sits close to
   the page edge. Anchor it to the avatar's left edge there instead. */
@media (max-width: 480px) {
  .avatar-tooltip {
    left: 0;
    transform: translate(0, 4px);
  }
  .avatar-placeholder:hover .avatar-tooltip {
    transform: translate(0, 0);
  }
  .avatar-tooltip::after {
    left: 36px;
  }
}

/* --- Status pill / mascot --- */
.status-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: rgba(233, 226, 216, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  margin: 0 0 24px;
  outline: none;
}

.mascot {
  width: 26px;
  height: 26px;
  overflow: visible;
  display: none;
  flex-shrink: 0;
}

.status-pill.is-working #mascotAwake,
.status-pill.is-sleeping #mascotAsleep {
  display: block;
}

#mascotAwake #mascotBody {
  animation: type-bounce 1s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: bottom center;
}

#mascotCursor {
  animation: blink-cursor 1s steps(1) infinite;
}

@keyframes type-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.7px); }
}

@keyframes blink-cursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

#mascotBodyAsleep {
  animation: breathe 2.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.z {
  transform-box: fill-box;
  transform-origin: center;
  animation: float-z 2.6s ease-in-out infinite;
}

.z1 { animation-delay: 0s; }
.z2 { animation-delay: 0.9s; }

@keyframes float-z {
  0% { opacity: 0; transform: translate(0, 3px) scale(0.75); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(2px, -5px) scale(1.1); }
}

.status-text {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1;
}

.status-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: max-content;
  max-width: 220px;
  background: var(--text);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  z-index: 10;
}

.status-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 18px;
  border: 6px solid transparent;
  border-top-color: var(--text);
}

.status-pill:hover .status-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lead {
  font-size: 21px;
  line-height: 1.55;
  margin: 0 0 20px;
}

h2 {
  font-size: 14px;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 28px;
}

.muted {
  color: var(--muted);
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.thumb-item {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 2px 14px rgba(111, 96, 114, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thumb-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(111, 96, 114, 0.28);
}

.thumb-image {
  width: 100%;
  height: 100%;
  display: block;
  /* no-ops on the placeholder <div>s, but make real <img>s crop the same
     way background-size: cover used to */
  object-fit: cover;
  object-position: center;
}

.thumb-image.ph-1 { background: linear-gradient(135deg, var(--sand), var(--rose)); }
.thumb-image.ph-2 { background: linear-gradient(135deg, var(--rose), var(--mauve)); }
.thumb-image.ph-3 { background: linear-gradient(135deg, var(--mauve), var(--dark)); }
.thumb-image.ph-4 { background: linear-gradient(135deg, var(--dark), var(--sand)); }
.thumb-image.ph-5 { background: linear-gradient(135deg, var(--sand), var(--mauve)); }
.thumb-image.ph-6 { background: linear-gradient(135deg, var(--rose), var(--dark)); }

.thumb-views {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(38, 34, 32, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.thumb-item:hover .thumb-views {
  opacity: 1;
}

.thumb-views svg {
  width: 11px;
  height: 11px;
  opacity: 0.85;
}

.thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(38, 34, 32, 0.72) 0%, rgba(38, 34, 32, 0) 55%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.thumb-item:hover .thumb-overlay {
  opacity: 1;
}

/* Title/channel and view count are hover-reveal on desktop; on touch
   devices there's no reliable hover to reveal them, and forcing them
   always-visible made the grid look crowded. Just hide them there. */
@media (hover: none) {
  .thumb-overlay,
  .thumb-views {
    display: none;
  }
}

.thumb-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--cream);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thumb-meta {
  font-family: var(--sans);
  font-size: 11px;
  color: rgba(251, 250, 245, 0.8);
}

.clients {
  margin-top: 28px;
}

.clients-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.client-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  /* overflow-x: auto forces overflow-y to clip too, so hovered avatars
     (which scale up and lift) need headroom here or their tops get cut off */
  padding: 8px 2px 6px;
  margin: -8px -2px -6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* On narrow screens this row doesn't fit in one line and becomes
     swipeable; the hidden scrollbar leaves no hint of that, so fade the
     right edge as a "there's more" affordance. Invisible when it all fits. */
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 20px), transparent 100%);
  mask-image: linear-gradient(to right, black calc(100% - 20px), transparent 100%);
}

.client-row::-webkit-scrollbar {
  display: none;
}

.client-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  box-shadow: 0 1px 6px rgba(111, 96, 114, 0.22);
  transition: transform 0.2s ease;
}

.client-avatar:hover {
  transform: translateY(-2px) scale(1.08);
}

.client-avatar.ph-1 { background: linear-gradient(135deg, var(--sand), var(--rose)); }
.client-avatar.ph-2 { background: linear-gradient(135deg, var(--rose), var(--mauve)); }
.client-avatar.ph-3 { background: linear-gradient(135deg, var(--mauve), var(--dark)); }
.client-avatar.ph-4 { background: linear-gradient(135deg, var(--dark), var(--sand)); }
.client-avatar.ph-5 { background: linear-gradient(135deg, var(--sand), var(--mauve)); }
.client-avatar.ph-6 { background: linear-gradient(135deg, var(--rose), var(--dark)); }

.client-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(111, 96, 114, 0.14);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  cursor: default;
}

.browse-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(251, 250, 245, 0.5);
  color: var(--text);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease, gap 0.2s ease;
}

.browse-more svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.browse-more:hover {
  border-color: var(--rose);
  background: rgba(239, 217, 192, 0.35);
  gap: 11px;
}

.browse-more:hover svg {
  transform: translateX(2px);
}

/* --- Portfolio page (wider layout for browsing thumbnails) --- */
.wide-main {
  max-width: 900px;
}

.portfolio-intro {
  padding-top: 48px;
}

.page-title {
  font-size: 32px;
  font-weight: 500;
  margin: 8px 0 24px;
}

.wide-main .thumb-grid {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 720px) {
  .wide-main .thumb-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .thumb-grid {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: 26px;
  }
}

.social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.social-list a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 15px;
  transition: color 0.2s ease, gap 0.2s ease;
}

.social-list a:hover {
  color: var(--accent);
  gap: 16px;
}

.social-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.social-list a:hover .social-icon {
  transform: scale(1.12);
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 3px;
  background: var(--accent);
  vertical-align: baseline;
  animation: blink-cursor 1s steps(1) infinite;
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 64px;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }
  .lead {
    font-size: 18px;
  }
  .work-row {
    flex-direction: column;
    gap: 2px;
  }
}
