:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #4c4c4c;
  --border: #b3b0a8;
  --accent: #bd3e1a;
  --accent-soft: #eef2f6;
  --max-width: 1400px;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif: 'Noto Serif', Georgia, 'Times New Roman', serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1b1e23;
    --text: #ecebe8;
    --text-muted: #b2b2b2;
    --border: #2b2e33;
    --accent: #8fb4d9;
    --accent-soft: #202631;
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* header / nav */

header.site {
  border-bottom: 1px solid var(--border);
}

body.no-header-line header.site {
  border-bottom: none;
}

header.site .wrap {
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.brand:hover {
  text-decoration: none;
  opacity: 0.75;
}

nav.primary {
  display: flex;
  gap: 24px;
}

nav.primary a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

nav.primary a:hover,
nav.primary a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

nav.primary a[aria-current="page"] {
  font-style: italic;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--accent-soft);
  text-decoration: none;
}

/* hero */

.hero {
  padding: 72px 0 48px;
}

.hero .eyebrow {
  position: fixed;
  top: calc(50% - 20px);
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.0rem;
  color: var(--text);
  margin: 0;
  z-index: 30;
}

.blink-cursor {
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.prev-titles {
  position: fixed;
  bottom: 24px;
  left: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  z-index: 30;
}

.prev-titles li {
  margin-bottom: 4px;
}

.hero-links {
  position: fixed;
  top: calc(50% + 20px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 32px;
  font-size: 0.9rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  z-index: 30;
}

.site-copyright {
  position: fixed;
  bottom: 24px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  z-index: 30;
}

.hero .site-copyright {
  right: 24px;
}

.hero-links a {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* sections */

section.page {
  padding: 56px 0;
}

section.page h2 {
  font-size: 1.6rem;
  margin: 0 0 8px;
}

section.page p.intro {
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 40px;
}

.about-content p {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 20px;
}

/* work filters */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.page-header-left {
  flex: 0 0 auto;
  min-width: 260px;
}

.page-header .search-bar {
  width: 260px;
  max-width: 100%;
  flex-shrink: 0;
  margin-bottom: 0;
}

.tag-filter-group {
  flex: 1;
  min-width: 200px;
}

@media (max-width: 640px) {
  .page-header .search-bar {
    width: 100%;
  }
}

.tag-filter-label {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.tag-scrollbar {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.tag-row {
  display: flex;
  gap: 8px;
  width: max-content;
}

.tag-row + .tag-row {
  margin-top: 8px;
}

.tag-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-family: inherit;
  text-transform: lowercase;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-pill:hover {
  border-color: var(--accent);
  color: var(--text);
}

.tag-count {
  margin-left: 5px;
  font-size: 0.75rem;
  opacity: 0.65;
}

.tag-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface);
}

.search-bar {
  width: 100%;
  padding: 10px 16px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.search-bar:focus {
  outline: none;
  border-color: var(--accent);
}

.no-results {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* card grid (work) */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.project-card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.project-card .tags,
.modal-body .tags {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}

.project-card .tags {
  margin-bottom: 10px;
}

.project-card .project-dates,
.modal-body .project-dates {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0 0 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.project-card .project-dates {
  margin-bottom: 16px;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 14px;
}

.project-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 4px;
}

.project-card .link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
}

.project-card .card-footer span.link {
  font-size: 0.775rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* art gallery */

.art-grid {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.art-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
}

.art-row.art-row-group {
  grid-template-columns: 1fr 1fr;
  max-width: 100%;
}

.art-grid figure {
  margin: 0;
}

.art-grid .frame {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(var(--image-count, 1), 1fr);
  gap: 2px;
  overflow: hidden;
}

.art-grid .frame img {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  display: block;
}

.art-grid figcaption {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.art-grid .art-meta {
  margin: 2px 0 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: lowercase;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* footer */

footer.site {
  margin-top: 40px;
}

footer.site .wrap {
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 32px 24px;
}

footer.site .site-copyright {
  position: static;
}

.footer-links {
  display: flex;
  gap: 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 5px;
}

@media (max-width: 560px) {
  header.site .wrap {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .hero {
    padding: 48px 0 32px;
  }

  /* prev-titles wraps to several lines on narrow screens, which was tall
     enough to run into .site-copyright sitting at the same bottom offset. */
  .prev-titles {
    bottom: 120px;
  }

  .hero-links {
    top: calc(50% + 60px);
  }
}

/* project quick-view modal */

body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 1100px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
}

.tableau-container {
  margin: 4px 0 20px;
  overflow-x: auto;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  opacity: 0.8;
}

.modal-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.modal-images img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.modal-body h3 {
  margin: 0 0 12px;
  padding-right: 32px;
  font-size: 1.3rem;
}

.modal-body p {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin: 0 0 16px;
}

.modal-body .link {
  font-size: 0.825rem;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* custom cursor (studio page) */

body.custom-cursor,
body.custom-cursor * {
  cursor: none;
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  transition: opacity 0.15s ease;
}

/* wind tiles */

.wind-tile {
  position: fixed;
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
  pointer-events: none;
  z-index: 40;
}

.wind-north {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.wind-south {
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.wind-east {
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
}

.wind-west {
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
}
