:root {
  --paper: #FCFCFB;
  --ink: #141414;
  --ink-2: #141414;
  --ink-3: #141414;
  --line: #E4E2DB;
  --line-2: #d4d2c9;
  --hair: #efeee9;
  --card: #ffffff;
  --serif: "Host Grotesk", system-ui, sans-serif;
  --sans: "Host Grotesk", system-ui, sans-serif;
  --mono: "Host Grotesk", system-ui, sans-serif;
  --title: "Cormorant Garamond", Georgia, serif;
}

/* ---------- Night mode ---------- */
:root[data-theme="night"] {
  --paper: #0E0E0E;
  --ink: #FDFDFC;
  --ink-2: #FDFDFC;
  --ink-3: #FDFDFC;
  --line: rgba(253,253,252,0.18);
  --line-2: rgba(253,253,252,0.30);
  --hair: rgba(253,253,252,0.10);
  --card: #1C1C1C;
}
html { background: var(--paper); transition: background .3s ease; }
#root { position: relative; z-index: 1; }
body { background-color: var(--paper); }
:root[data-theme="night"] .sort select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23A9BBD2'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 34px clamp(24px, 5vw, 64px) 28px;
  position: sticky; top: 0; background: transparent;
  border-bottom: 1px solid var(--ink); z-index: 20;
}
.wordmark {
  font-family: var(--serif); font-weight: 500; font-size: clamp(20px, 2.1vw, 27px);
  letter-spacing: -0.01em; line-height: 1; white-space: nowrap;
  display: inline-flex; align-items: center;
}
/* logo gif: clip away the transparent padding so only the artwork shows */
.wordmark-logo {
  display: block; position: relative; overflow: hidden;
  width: 154px; height: 26px;
}
.wordmark-logo img {
  position: absolute; width: 165px; height: auto;
  left: -5.6px; top: -43.3px;
}
/* night mode: invert the black artwork to white on the dark background */
:root[data-theme="night"] .wordmark-logo img { filter: invert(1); }
.site-nav { display: flex; gap: clamp(18px, 2.6vw, 38px); align-items: center; }
.nav-link {
  font-size: 15px; color: var(--ink-2); letter-spacing: 0.01em;
  padding-bottom: 2px; border-bottom: 1px solid transparent; transition: color .18s, border-color .18s;
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--ink); border-color: var(--ink); }
.theme-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2);
  cursor: pointer; line-height: 0; transition: color .18s, border-color .18s, background .18s;
}
.theme-btn:hover { color: var(--ink); border-color: var(--ink); }
:root[data-theme="night"] .theme-btn { color: #FDFDFC; }
/* day mode: white moon in a filled slate circle */
:root:not([data-theme="night"]) .theme-btn {
  color: #FFFFFF; background: var(--ink); border-color: var(--ink);
}
:root:not([data-theme="night"]) .theme-btn:hover {
  color: #FFFFFF; background: color-mix(in srgb, var(--ink) 82%, #fff);
  border-color: color-mix(in srgb, var(--ink) 82%, #fff);
}

/* ---------- Filter bar ---------- */
.site-main { flex: 1; padding: 0 clamp(24px, 5vw, 64px); }
.filterbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap; padding: 30px 0 26px;
}
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab {
  background: none; border: none; cursor: pointer; font-size: 15px;
  color: var(--ink-3); padding: 7px 14px; border-radius: 999px; letter-spacing: 0.01em;
  transition: color .16s, background .16s;
}
.filter-tab:hover { color: var(--ink); }
.filter-tab.is-active { color: var(--paper); background: var(--ink); }
.filter-right { display: flex; align-items: center; gap: 22px; }

/* view toggle */
.viewtog { display: flex; border: 1px solid var(--line-2); }
.viewtog-btn {
  border: none; background: var(--paper); color: var(--ink-3); cursor: pointer;
  padding: 6px 9px; line-height: 0; display: grid; place-items: center; transition: background .14s, color .14s;
}
.viewtog-btn + .viewtog-btn { border-left: 1px solid var(--line-2); }
.viewtog-btn:hover { color: var(--ink); }
.viewtog-btn.is-active { background: var(--ink); color: var(--paper); }
.filter-count { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-3); text-transform: uppercase; }
.sort { display: flex; align-items: center; gap: 8px; }
.sort-label { font-size: 13px; color: var(--ink-3); }
.sort select {
  font-family: var(--sans); font-size: 14px; color: var(--ink); background: transparent;
  border: none; border-bottom: 1px solid var(--line-2); padding: 3px 18px 3px 2px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a877c'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 2px center;
}

/* ---------- Grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-auto-flow: dense;
  gap: clamp(28px, 3vw, 48px) clamp(20px, 2.4vw, 36px);
  padding-bottom: 72px;
}
.app--dense .grid { grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 30px 22px; }

.tile {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 10px 10px 14px;
  transition: border-color .18s ease;
}
.tile:hover {
  border-color: var(--ink);
}
.tile-caption { margin: 4px 0 14px; text-align: left; }
.tile-title {
  font-family: var(--title); font-style: italic; font-weight: 500;
  font-size: 20px; line-height: 1.22; margin: 0 0 4px;
  letter-spacing: 0; text-wrap: pretty; color: var(--ink);
}
.tile-sub { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tile-kind { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.tile-meta { font-size: 12.5px; color: var(--ink-3); }
.tile-blurb {
  margin: 9px 0 0; font-size: 11px; line-height: 1.55; color: var(--ink-3);
  text-wrap: pretty;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}

/* thumbnail frame */
.thumb {
  position: relative; overflow: hidden; background: var(--hair);
  aspect-ratio: 4 / 5; border-radius: 11px;
}
.app--shape-square .thumb { aspect-ratio: 1 / 1; }
.app--shape-landscape .thumb { aspect-ratio: 4 / 3; }
/* per-type crops (override the global shape tweak) */
.tile--writing .thumb { aspect-ratio: 16 / 9; }
/* video spans 2 grid columns; its thumb is cropped to the SAME height as the
   single-column image thumbs — wider box, so the aspect ratio differs per shape */
.tile--video { grid-column: span 2; }
.tile--video .thumb { aspect-ratio: 9 / 5; }                      /* default 4/5 images */
.app--shape-square .tile--video .thumb { aspect-ratio: 9 / 4; }   /* square images */
.app--shape-landscape .tile--video .thumb { aspect-ratio: 3 / 1; }/* landscape images */
/* when the grid collapses toward 1 column, video is the same width as an image
   thumb, so it matches height at the image's own ratio */
@media (max-width: 539px) {
  .tile--video { grid-column: auto; }
  .tile--video .thumb { aspect-ratio: 4 / 5; }
  .app--shape-square .tile--video .thumb { aspect-ratio: 1 / 1; }
  .app--shape-landscape .tile--video .thumb { aspect-ratio: 4 / 3; }
}
/* text block sits at the top; image is pushed to the bottom of the card */
.tile { height: 100%; }
.thumb { margin-top: auto; }
.thumb-art { position: absolute; inset: 0; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.thumb-art svg { width: 100%; height: 100%; }
.thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-figure--lead { margin-bottom: 26px; }

.thumb-corner {
  position: absolute; left: 10px; bottom: 9px; font-family: var(--mono);
  font-size: 9.5px; letter-spacing: 0.1em; color: var(--ink-2);
  background: color-mix(in srgb, var(--paper) 78%, transparent); padding: 2px 6px;
  backdrop-filter: blur(2px);
}

/* monogram (writing) */
.thumb--mono {
  display: grid; place-items: center;
  background: var(--paper); border: 1px solid var(--line);
}
.thumb-mono-letters {
  font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 9vw, 84px);
  line-height: 1; letter-spacing: -0.02em; color: var(--ink);
}
.thumb--mono .thumb-corner { background: transparent; backdrop-filter: none; }

/* play badges */
.thumb-badge {
  position: absolute; right: 11px; top: 11px; width: 34px; height: 34px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--ink); color: var(--paper); padding-left: 2px;
}
.thumb-badge--video { width: 38px; height: 38px; }

/* ---------- Hover behaviors (disabled — stroke-only) ---------- */
.tile-hover-lift { transition: none; }
.tile--hover-lift:hover { transform: none; }
.tile--hover-lift:hover .thumb { box-shadow: none; }

.tile--hover-zoom:hover .thumb-art { transform: none; }
.tile--hover-zoom:hover .thumb--mono .thumb-mono-letters { transform: none; }

.tile--hover-frame:hover .thumb::after { border-color: transparent; }
.tile--hover-frame:hover .thumb--mono::after { border-color: transparent; }

.tile--hover-reveal .thumb::before { content: none; }
.tile--hover-reveal:hover .thumb::before { opacity: 0; }

.grid-empty { padding: 80px 0; color: var(--ink-3); font-size: 16px; }

/* ---------- List / table view ---------- */
.listview { border-top: 1px solid var(--line); margin-bottom: 72px; }
.lrow {
  display: grid; grid-template-columns: 60px minmax(0, 2.4fr) 100px minmax(0, 1.3fr) 132px 24px;
  align-items: center; gap: 22px; padding: 16px 6px; border-bottom: 1px solid var(--hair);
  transition: background .14s; color: var(--ink);
}
.lrow:hover { background: #faf9f5; }
.lt { position: relative; width: 60px; height: 60px; overflow: hidden; background: var(--hair); border: 1px solid var(--line); }
.lt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lt svg { width: 100%; height: 100%; }
.lt--mono { display: grid; place-items: center; background: var(--paper); }
.lt--mono span { font-size: 26px; letter-spacing: -0.02em; color: var(--ink); }
.lt-badge { position: absolute; right: 4px; bottom: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; padding-left: 1px; }

.lrow-title { font-family: var(--title); font-style: italic; font-size: 21px; font-weight: 500; letter-spacing: 0; line-height: 1.2; min-width: 0; }
.lrow-kind { font-family: var(--mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }
.lrow-meta { font-size: 13.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow-date { font-size: 13.5px; color: var(--ink-2); text-align: right; white-space: nowrap; }
.lrow-go { font-size: 16px; color: var(--ink-3); text-align: right; transition: transform .18s, color .18s; }
.lrow:hover .lrow-go { color: var(--ink); transform: translateX(3px); }

@media (max-width: 680px) {
  .lrow { grid-template-columns: 52px 1fr auto; gap: 14px; }
  .lrow-kind, .lrow-meta { display: none; }
  .lt { width: 52px; height: 52px; }
}

/* ---------- Overlays: modal & sheet ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ink) 32%, transparent);
  backdrop-filter: blur(3px); padding: 24px;
  animation: fade .2s ease;
}
.overlay--sheet { place-items: end stretch; padding: 0; }
@keyframes fade { from { opacity: 0; } }

.modal {
  position: relative; background: var(--paper); width: min(720px, 100%);
  max-height: 88vh; overflow: auto; padding: clamp(28px, 4vw, 52px);
  box-shadow: 0 40px 90px -40px rgba(20,18,12,.6);
  animation: pop .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.sheet {
  position: relative; background: var(--paper); width: 100%;
  max-height: 86vh; overflow: auto; padding: 20px clamp(20px, 5vw, 56px) 48px;
  border-top: 1px solid var(--line);
  box-shadow: 0 -30px 80px -40px rgba(20,18,12,.5);
  animation: slideup .32s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideup { from { transform: translateY(100%); } }
.sheet-grip { width: 44px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 18px; }

.close-btn {
  position: absolute; top: 18px; right: 18px; width: 34px; height: 34px;
  border: 1px solid var(--line); background: var(--paper); cursor: pointer;
  border-radius: 50%; font-size: 13px; color: var(--ink-2); line-height: 1;
  display: grid; place-items: center; transition: background .16s, color .16s; z-index: 2;
}
.close-btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Detail content ---------- */
.detail { max-width: 620px; }
.detail--page { max-width: 760px; margin: 0 auto; }
.detail-kind { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.detail-title { font-family: var(--title); font-style: italic; font-weight: 500; font-size: clamp(34px, 4.6vw, 50px); line-height: 1.04; letter-spacing: 0; margin: 10px 0 10px; text-wrap: balance; }
.detail-meta { font-size: 13.5px; color: var(--ink-3); margin-bottom: 26px; }
.detail-head { border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 26px; }
.detail-body p { font-size: 17.5px; line-height: 1.62; color: var(--ink-2); margin: 0 0 1.1em; max-width: 56ch; text-wrap: pretty; }
.detail-body p:first-child { color: var(--ink); }

.detail-figure { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--hair); }
.detail-figure--sq { aspect-ratio: 1 / 1; }
.detail-music { display: grid; grid-template-columns: 160px 1fr; gap: 26px; align-items: center; }
.detail-music .detail-figure { width: 160px; }

.video-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--hair); }
.video-play {
  position: absolute; inset: 0; margin: auto; width: 74px; height: 74px;
  display: grid; place-items: center; border-radius: 50%; padding-left: 4px;
  background: color-mix(in srgb, var(--ink) 86%, transparent); color: var(--paper);
}
.detail-link { display: inline-block; margin-top: 18px; font-size: 15px; color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.detail-link:hover { color: var(--ink-2); }

/* audio player */
.player { display: flex; align-items: center; gap: 14px; }
.player-btn {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--ink); color: var(--paper); display: grid; place-items: center; padding-left: 2px;
  transition: transform .14s;
}
.player-btn:active { transform: scale(.94); }
.waveform { flex: 1; display: flex; align-items: center; gap: 2px; height: 44px; }
.wf-bar { flex: 1; background: var(--line-2); min-width: 2px; transition: background .12s; }
.wf-bar--on { background: var(--ink); }
.player-time { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.player-dim { color: var(--ink-3); }

/* ---------- Detail page ---------- */
.detail-page { padding: 36px 0 90px; }
.back-btn, .text-link {
  background: none; border: none; cursor: pointer; font-family: var(--sans);
  font-size: 14.5px; color: var(--ink-2); padding: 0; margin-bottom: 30px;
  border-bottom: 1px solid transparent; transition: color .16s, border-color .16s;
}
.back-btn:hover, .text-link:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Pages (Work / Contact) ---------- */
.page { max-width: 720px; padding: clamp(40px, 7vw, 90px) 0 90px; }
/* Work page: two columns — text on the left, portrait on the right */
.page--work {
  max-width: 1180px;
  display: grid; grid-template-columns: 1fr clamp(380px, 46%, 560px);
  gap: clamp(36px, 5vw, 72px); align-items: start;
}
.work-col { min-width: 0; }
.work-portrait { margin: 0; position: sticky; top: 120px; }
.work-portrait img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 2px;
}
@media (max-width: 820px) {
  .page--work { grid-template-columns: 1fr; }
  .work-portrait { position: static; order: -1; max-width: 480px; }
}
.page-lead h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 5vw, 56px); letter-spacing: -0.02em; margin: 0 0 24px; }
.page-lead p { font-size: 18px; line-height: 1.62; color: var(--ink-2); max-width: 58ch; margin: 0 0 1.1em; text-wrap: pretty; }
.work-list, .contact-list { margin: 40px 0 36px; border-top: 1px solid var(--line); }
.work-row, .contact-row {
  display: grid; grid-template-columns: 150px 1fr; gap: 20px;
  padding: 18px 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.work-row dt, .contact-row dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.work-row dd, .contact-row dd { margin: 0; font-size: 16.5px; color: var(--ink); }
.contact-row dd a { border-bottom: 1px solid var(--line-2); padding-bottom: 1px; }
.contact-row dd a:hover { border-color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 26px clamp(24px, 5vw, 64px); border-top: 1px solid var(--ink);
  font-size: 13px; color: var(--ink-3);
}
.footer-dim { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

@media (max-width: 560px) {
  .detail-music { grid-template-columns: 1fr; }
  .detail-music .detail-figure { width: 130px; }
  .work-row, .contact-row { grid-template-columns: 110px 1fr; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
