@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --paper: #f6f4eb;
  --ink: #243627;
  --muted: #58634f;
  --green: #dce7c6;
  --lilac: #c7b7e4;
  --lilac-paper: #eae4f0;
  --line: #d1d7c7;
  --small: .875rem;
  --body: 1rem;
  --lead: clamp(1.5rem, 2.4vw, 2rem);
  --heading: clamp(2rem, 3.5vw, 2.75rem);
  --hero: clamp(2.75rem, 5.2vw, 4.75rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--body)/1.65 'DM Sans', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: var(--hero); font-weight: 600; line-height: 1.02; letter-spacing: -.055em; }
h2 { font-size: var(--heading); font-weight: 500; line-height: 1.15; letter-spacing: -.04em; }
h3 { font-size: 1.5rem; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid #705098; outline-offset: 5px; }
img { display: block; max-width: 100%; }
::selection { background: var(--lilac); color: var(--ink); }
.wrap { width: min(1160px, calc(100% - 112px)); margin-inline: auto; }

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  min-height: 104px;
}
.wordmark { font-size: 1.375rem; font-weight: 700; letter-spacing: -.04em; text-decoration: none; }
nav { display: flex; gap: 2rem; font-size: var(--small); }
nav a { display: flex; align-items: center; min-height: 44px; text-decoration: none; }
nav a:hover { text-decoration: underline; }

.hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-block: 3.75rem 5.5rem;
}
.hero-copy > p { max-width: 45ch; color: var(--muted); }
.hero-copy .intro { margin-block: 2rem 1rem; font-size: 1.25rem; color: var(--ink); max-width: 34ch; }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1.75rem; margin-top: 2rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .75rem 1.75rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  text-decoration: none;
  transition: background .2s, scale .2s;
}
.button:hover { background: #3d5433; }
.button:active { scale: .96; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--small); }
.portrait { padding-top: 1.25rem; }
.portrait-image {
  background: var(--lilac);
  border-radius: 48% 48% 10px 10px;
  overflow: hidden;
  outline: 1px solid #0000001a;
}
.portrait-image img { width: 100%; height: 445px; object-fit: cover; object-position: center top; }
.portrait figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: var(--small);
  color: var(--muted);
}

.music-slot { margin-top: 1.25rem; }
.music-player {
  display: flex;
  align-items: center;
  gap: .875rem;
  width: 100%;
  min-height: 64px;
  padding: .625rem .875rem .625rem .625rem;
  border: 0;
  border-radius: 16px;
  background: var(--lilac-paper);
  color: var(--ink);
  font: inherit;
  font-size: var(--small);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px #24362708, inset 0 0 0 1px #2436270d;
  transition: background-color .15s;
}
.music-player[hidden], .music-slot[hidden] { display: none; }
@media (hover: hover) {
  .music-player:hover { background: #e2d9ec; }
}
.music-player:active { background: #d8cce5; }
.music-player:focus-visible { outline: 3px solid #705098; outline-offset: 5px; }
.music-art {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--green), var(--lilac));
  overflow: hidden;
}
.music-art > span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 3px, #24362718 4px 5px), var(--ink);
  position: relative;
}
.music-art > span::after {
  content: '';
  position: absolute;
  inset: 11px;
  border: 3px solid var(--lilac);
  border-radius: 50%;
  background: var(--ink);
}
.music-title { flex: 1; font-weight: 500; }
.music-icon { position: relative; width: 20px; height: 20px; flex-shrink: 0; color: oklch(0.269 0.065 301.197); }
.music-icon::before, .music-icon::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: currentColor;
  transition: opacity .15s;
}
.music-icon::before { clip-path: polygon(22% 0, 100% 50%, 22% 100%); }
.music-icon::after { clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0); opacity: 0; }
.is-playing .music-icon::before { opacity: 0; }
.is-playing .music-icon::after { opacity: 1; }

.music-floating {
  position: fixed;
  right: 0;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 20;
  width: 52px;
  min-height: 52px;
  padding: 16px;
  justify-content: center;
  border-radius: 16px 0 0 16px;
  box-shadow: 0 4px 24px #2436271a, 0 1px 4px #24362712;
}
.music-floating .music-art, .music-floating .music-title { display: none; }
.music-bars { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; gap: 2px; }
.music-bars > span { width: 2px; height: 18px; border-radius: 1px; background: currentColor; transform: scaleY(.45); }
.music-bars > span:nth-child(2), .music-bars > span:nth-child(4) { transform: scaleY(.7); }
.music-bars > span:nth-child(3) { transform: scaleY(1); }
.music-floating.is-playing .music-icon::after { opacity: 0; }
.music-floating.is-playing .music-bars { display: flex; }

.music-status { display: block; font-size: var(--small); color: var(--muted); }
.music-status:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .music-player, .music-icon::before, .music-icon::after { transition: none; }
}

.about { display: grid; grid-template-columns: 1fr 1.6fr; gap: 5rem; padding-block: 4.5rem 6rem; }
.about h2 { max-width: 8ch; }
.about-copy { max-width: 64ch; }
.about-copy .lead { font-size: var(--lead); line-height: 1.4; letter-spacing: -.025em; color: var(--ink); }
.about-copy p + p { margin-top: 1.5rem; color: var(--muted); }
.project-note { margin-top: 2.5rem; }
.project-note h3, .service h3 { margin-bottom: 1rem; }
.project-note p, .service p { color: var(--muted); }
.project-note .text-link { margin-top: .75rem; }
.service + .service { margin-top: 2.5rem; }
.direction { --section-tint: var(--lilac-paper); }
.work { --section-tint: var(--green); padding-block: 4.5rem; }

.work, .direction {
  position: relative;
  isolation: isolate;
  --section-inset: clamp(12px, 2.5vw, 40px);
}
.work::before, .direction::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--section-tint);
  clip-path: inset(0 var(--section-inset) round 64px);
}
.work h2 { margin-bottom: 3.5rem; max-width: 18ch; }
.experience { display: grid; grid-template-columns: 1fr 1.6fr; gap: 5rem; }
.experience + .experience { margin-top: 3rem; padding-top: 3rem; border-top: 1px solid var(--line); }
.experience-copy .lead { font-size: 1.25rem; line-height: 1.4; }
.experience-heading p { margin-top: 1rem; font-size: var(--small); color: var(--muted); }
.experience-heading .text-link { margin-top: 1rem; }
.experience-copy { max-width: 64ch; }
.experience-copy p + p { margin-top: 1.25rem; }
.experience-copy .tools { font-size: var(--small); color: var(--muted); }

.earlier { margin-top: 2.5rem; margin-inline-start: calc((100% - 5rem) / 2.6 + 5rem); font-size: var(--small); color: var(--muted); }
.earlier .text-link { margin-top: .75rem; color: var(--ink); }

.contact { display: grid; grid-template-columns: 1fr 1.6fr; gap: 5rem; padding-block: 5rem; align-items: center; }
.contact h2 { max-width: 16ch; }
.contact p { max-width: 64ch; color: var(--muted); margin-bottom: 1rem; }
.email { display: inline-block; font-size: clamp(1.125rem, 2.5vw, 1.75rem); min-height: 44px; overflow-wrap: anywhere; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding-block: 1.25rem; font-size: var(--small); }
footer > span { font-weight: 600; }

footer > div { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; }
footer a { display: flex; align-items: center; min-height: 44px; }
.skip { position: absolute; inset-inline-start: 1rem; top: -100px; padding: .75rem 1rem; background: var(--ink); color: white; z-index: 10; }
.skip:focus { top: 1rem; }

@media (max-width: 1000px) {
  .wrap { width: calc(100% - 64px); }
  .hero { gap: 2rem; }
  .portrait-image img { height: 385px; }
  .portrait figcaption { font-size: .8125rem; }
  .about, .experience, .contact { gap: 3rem; grid-template-columns: 1fr 1.5fr; }
  .earlier { margin-inline-start: calc((100% - 3rem) / 2.5 + 3rem); }
}

@media (max-width: 700px) {
  .wrap { width: calc(100% - 40px); }
  .header { min-height: 84px; gap: 1rem; }
  .wordmark { font-size: 1.125rem; white-space: nowrap; }
  nav { gap: 1rem; font-size: .8125rem; }
  nav a[href="#help"] { display: none; }
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding-block: 2.5rem 3rem; }
  .hero-copy .intro { margin-top: 1.5rem; font-size: 1.125rem; }
  .hero-links { margin-top: 1.5rem; gap: 1.25rem; }
  .portrait { width: min(100%, 340px); justify-self: center; padding: 0; }
  .portrait-image img { height: 340px; }
  .about, .experience, .contact { grid-template-columns: 1fr; gap: 1.75rem; }
  .about { padding-block: 2.5rem 3.5rem; }
  .about h2, .contact h2 { max-width: none; }
  .work { padding-block: 3rem; }
  .work h2 { margin-bottom: 2.5rem; }
  .experience-heading p { margin-top: .75rem; }
  .experience-heading .text-link { margin-top: .5rem; }

  .earlier { margin-inline-start: 0; }
  .contact { padding-block: 3rem; gap: 1.25rem; }
  footer { flex-wrap: wrap; gap: .5rem; }
  footer > div { gap: 1.5rem; }
}

@keyframes section-expand {
  from { clip-path: inset(0 var(--section-inset) round 64px); }
  to { clip-path: inset(0 0 round 0); }
}

@keyframes heading-arrive {
  from { opacity: .8; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) and (animation-range: entry 0% entry 100%) {
    .work, .direction { view-timeline: --section block; }
    .work::before, .direction::before {
      animation: section-expand linear both;
      animation-timeline: --section;
      animation-range: entry 0% entry 100%;
    }
  }

  #direction-title.arrived { animation: heading-arrive 320ms cubic-bezier(.2, 0, 0, 1); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
