:root {
  color-scheme: light;
  --ink: #111;
  --muted: #6f6f73;
  --line: #dbdbdb;
  --paper: #fff;
  --soft: #f5f5f5;
  --red: #e33158;
  --pink: #ff79a8;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-size: 1rem; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link { position: fixed; z-index: 100; top: .5rem; left: .5rem; transform: translateY(-200%); padding: .7rem 1rem; color: #fff; background: #000; }
.skip-link:focus { transform: none; }

.topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: baseline; justify-content: space-between; min-height: 64px; padding: .8rem max(1.25rem, calc((100vw - 940px) / 2)); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.wordmark { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 4vw, 2.35rem); font-style: italic; font-weight: 700; letter-spacing: -.07em; text-decoration: none; }
.project-label { color: var(--muted); font-size: .8rem; }

main { width: min(940px, 100%); margin: 0 auto; padding: 0 1.25rem 4rem; }
.profile { display: grid; grid-template-columns: 180px 1fr; gap: clamp(2rem, 7vw, 6rem); align-items: center; padding: clamp(2.4rem, 7vw, 5rem) clamp(0rem, 4vw, 3rem); }
.portrait { width: 160px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; object-fit: cover; object-position: 63% 30%; }
.placeholder { display: grid; place-items: center; color: #777; background: repeating-linear-gradient(135deg, #f5f5f5 0 10px, #ececec 10px 20px); text-align: center; }
.profile-title { display: flex; gap: 1rem; align-items: center; }
h1 { margin: 0; font-size: 1.45rem; font-weight: 400; }
.fame-button { min-height: 3.15rem; padding: .65rem 1.35rem; border: 2px solid var(--ink); border-radius: .65rem; color: #fff; background: var(--ink); box-shadow: 4px 4px 0 var(--red); font-size: 1.05rem; font-weight: 800; cursor: pointer; transform: translate(0, 0); transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.fame-button:hover { background: #2a2a2a; transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--red); }
.fame-button:active, .fame-button.is-boosting { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--red); }
.fame-button:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.stats { display: flex; gap: clamp(1rem, 4vw, 2.6rem); margin: 1.7rem 0; }
.stats div { display: flex; gap: .35rem; }
.stats dt { order: 2; }
.stats dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; }
.bio p { margin: .35rem 0 0; }

.tabs { display: flex; justify-content: center; height: 53px; border-top: 1px solid var(--line); }
.tabs span { display: flex; align-items: center; border-top: 1px solid var(--ink); margin-top: -1px; font-size: .78rem; font-weight: 700; letter-spacing: .11em; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tile { position: relative; aspect-ratio: 1; overflow: hidden; color: inherit; text-decoration: none; }
.art-placeholder { display: grid; width: 100%; height: 100%; place-items: center; border: 1px solid #d8d8d8; color: #686868; background: linear-gradient(145deg, #f6f6f6, #e7e7e7); font: 700 .8rem/1.5 Arial, sans-serif; letter-spacing: .12em; text-align: center; }
.artwork { display: block; max-width: 100%; }
.tile-artwork { width: 100%; height: 100%; object-fit: cover; object-position: 50% 51%; }
.tile-meta { position: absolute; inset: 0; display: flex; gap: .5rem; align-items: center; justify-content: center; color: #fff; background: rgba(0,0,0,.44); opacity: 0; transition: opacity .16s ease; font-weight: 700; }
.tile:hover .tile-meta, .tile:focus-visible .tile-meta { opacity: 1; }
.comment-icon { width: 1.25rem; height: 1.25rem; margin-left: .75rem; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.project-note { display: flex; justify-content: space-between; gap: 2rem; align-items: center; margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.text-button { padding: 0; border: 0; color: var(--ink); background: none; font-weight: 700; text-decoration: underline; cursor: pointer; }

dialog { padding: 0; border: 0; }
dialog::backdrop { background: rgba(0,0,0,.82); }
.post-dialog { width: min(1180px, calc(100vw - 48px)); max-width: none; overflow: visible; background: #000; }
.dialog-shell { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr); height: min(780px, calc(100vh - 64px)); background: #fff; }
.close-button { position: absolute; z-index: 5; top: -2.4rem; right: 0; width: 2rem; height: 2rem; padding: 0; border: 0; color: #fff; background: transparent; font-size: 2rem; line-height: 1; cursor: pointer; }
.close-button.dark { top: 1rem; right: 1rem; color: #111; }
.post-image-wrap { position: relative; display: grid; place-items: center; overflow: hidden; background: #0d0d0d; }
.post-art { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.image-like { position: absolute; right: 1rem; bottom: 1rem; width: 3rem; height: 3rem; border: 0; border-radius: 50%; color: #fff; background: rgba(0,0,0,.55); font-size: 1.55rem; cursor: pointer; }
.image-like.is-liked { color: var(--red); }
.post-copy { display: grid; grid-template-rows: auto auto auto auto; min-height: 0; overflow-y: auto; }
.post-header, .story, .comments, .post-actions { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.post-header { display: flex; gap: .8rem; align-items: center; }
.avatar-small { width: 34px; height: 34px; border-radius: 50%; font-size: .7rem; font-weight: 700; }
.story { line-height: 1.48; }
.story p { margin: 0 0 .75rem; }
.story-language + .story-language { margin-top: 1.35rem; padding-top: 1.15rem; border-top: 1px solid var(--line); }
.story-language p:last-child { margin-bottom: 0; }
.comments { overflow-y: auto; font-size: .9rem; line-height: 1.45; }
.comments p { margin: 0 0 1rem; }
.comments strong { margin-right: .35rem; }
.demo-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.post-actions { border-bottom: 0; }
.like-button { padding: 0; border: 0; background: none; font-size: 1.8rem; cursor: pointer; }
.like-button.is-liked { color: var(--red); }
.post-actions p { margin: .5rem 0; }
.post-actions time { color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.heart-field { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.floating-heart { position: absolute; left: var(--heart-left); bottom: 7%; color: var(--red); font-size: var(--heart-size); animation: float-heart 1.8s ease-out forwards; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.floating-heart:nth-child(even) { color: var(--pink); }
@keyframes float-heart { from { opacity: 0; transform: translate3d(0, 0, 0) scale(.6) rotate(-8deg); } 20% { opacity: 1; } to { opacity: 0; transform: translate3d(var(--heart-drift), -300px, 0) scale(1.2) rotate(10deg); } }
.fame-heart-field { position: fixed; z-index: 30; inset: 0; overflow: hidden; pointer-events: none; }
.fame-heart { position: absolute; left: var(--fame-left); bottom: 14%; color: var(--red); font-size: var(--fame-size); opacity: 0; animation: fame-heart-rise 2.4s var(--fame-delay) cubic-bezier(.2,.7,.3,1) forwards; filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); }
.fame-heart:nth-child(even) { color: var(--pink); }
@keyframes fame-heart-rise { 0% { opacity: 0; transform: translate3d(0, 0, 0) scale(.45) rotate(-8deg); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate3d(var(--fame-drift), -72vh, 0) scale(1.25) rotate(12deg); } }

.about-dialog { width: min(560px, calc(100vw - 40px)); background: #fff; }
.about-copy { padding: clamp(2rem, 7vw, 4rem); }
.eyebrow { margin: 0 0 .8rem; font: italic 700 1.6rem Georgia, serif; }
.about-copy h2 { margin: 0 0 1.6rem; font: 400 clamp(1.8rem, 6vw, 3.1rem)/1.05 Georgia, serif; }
.about-copy p { line-height: 1.55; }
.noscript { padding: 1rem; background: #fff4b8; text-align: center; }

@media (max-width: 720px) {
  .topbar { min-height: 54px; }
  .project-label { display: none; }
  main { padding-inline: 0; }
  .profile { grid-template-columns: 88px minmax(0, 1fr); gap: 1rem; padding: 1.4rem 1rem 1.1rem; }
  .portrait { width: 82px; }
  .profile-main { display: contents; }
  .profile-title { align-self: center; align-items: flex-start; flex-direction: column; gap: .55rem; }
  .fame-button { min-height: 2.75rem; padding: .5rem 1rem; font-size: .95rem; }
  .stats { grid-column: 1 / -1; justify-content: space-around; width: 100%; gap: 1rem; margin: .3rem 0 0; padding: .9rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .875rem; }
  .stats div { min-width: 4.5rem; align-items: center; flex-direction: column; gap: .2rem; text-align: center; }
  .stats dt { order: 2; }
  .bio { grid-column: 1 / -1; font-size: .95rem; line-height: 1.4; }
  .bio p { max-width: 30rem; }
  .gallery { gap: 2px; }
  .project-note { display: block; margin: 2rem 1rem 0; font-size: .9rem; line-height: 1.45; }
  .project-note .text-button { margin-top: .4rem; }
  .post-dialog { width: 100vw; height: 100dvh; max-height: none; margin: 0; }
  .dialog-shell { display: block; height: 100%; overflow-y: auto; }
  .close-button { position: fixed; top: .55rem; right: .55rem; border-radius: 50%; color: #fff; background: rgba(0,0,0,.65); }
  .post-image-wrap { height: min(100vw, 68vh); }
  .post-copy { display: block; overflow: visible; }
  .story { padding-block: 1.25rem; }
  .story-language + .story-language { margin-top: 1.1rem; padding-top: 1rem; }
  .comments { max-height: none; }
  .post-actions { padding-bottom: 2rem; }
}

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