/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg: #FAF9F5;
  --surface: #FFFFFF;
  --ink: #171613;
  --ink-soft: #55534C;
  --muted: #918D80;
  --border: #DFDBCF;
  --border-strong: #171613;

  --c-logo-bg: #FAECE7;   --c-logo-text: #712B13;
  --c-event-bg: #EAF3DE;  --c-event-text: #27500A;
  --c-social-bg: #E6F1FB; --c-social-text: #0C447C;
  --c-signage-bg: #EEEDFE;--c-signage-text: #3C3489;
  --c-flyer-bg: #FDF3DC;  --c-flyer-text: #7A5B06;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 249, 245, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.wordmark {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  font-weight: 500;
}

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

.site-nav {
  display: flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
}

.site-nav a {
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--ink);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 96px 32px 64px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 20px;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  max-width: 820px;
}

.hero-sub {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 0 48px;
}

.hero-meta {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-meta-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

.hero-meta-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ============================================================
   WORK INDEX
   ============================================================ */
.work-section {
  padding: 72px 32px 96px;
}

.index-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 4px;
}

.index-header-label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.index-header-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.index-row {
  border-bottom: 1px solid var(--border);
}

.index-row-head {
  width: 100%;
  display: grid;
  grid-template-columns: 48px auto 1fr 24px;
  align-items: center;
  gap: 20px;
  padding: 28px 0;
  text-align: left;
}

.index-num {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
}

.index-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.tag-logo    { background: var(--c-logo-bg);    color: var(--c-logo-text); }
.tag-event   { background: var(--c-event-bg);   color: var(--c-event-text); }
.tag-social  { background: var(--c-social-bg);  color: var(--c-social-text); }
.tag-signage { background: var(--c-signage-bg); color: var(--c-signage-text); }
.tag-flyer   { background: var(--c-flyer-bg);   color: var(--c-flyer-text); }

.index-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
}

.index-chevron {
  width: 12px;
  height: 12px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  justify-self: end;
}

.index-row-head[aria-expanded="true"] .index-chevron {
  transform: rotate(225deg);
}

.index-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.panel-inner {
  padding: 0 0 48px 68px;
}

.panel-intro {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 700px;
  margin: 0 0 40px;
}

/* Project sub-entries */
.project {
  display: grid;
  grid-template-columns: minmax(0, 380px) 1fr;
  gap: 40px;
  margin-bottom: 44px;
  align-items: start;
}

.project:last-child {
  margin-bottom: 0;
}

.project-text h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 10px;
  line-height: 1.35;
}

.project-text .year {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.project-text p {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.project-text p:last-child {
  margin-bottom: 0;
}

.project-text p.usage {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.project-media {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.project-media.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.project-media.grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.thumb {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
  transition: transform 0.4s ease;
}

/* Single-image projects show the full piece, uncropped */
.project-media:not(.grid-2):not(.grid-3) .thumb img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
  max-height: 640px;
  background: var(--surface);
}

.thumb::before,
.thumb::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--ink);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.thumb::before {
  top: 6px; left: 6px;
  border-right: none; border-bottom: none;
}

.thumb::after {
  bottom: 6px; right: 6px;
  border-left: none; border-top: none;
}

.thumb:hover::before,
.thumb:hover::after,
.thumb:focus-visible::before,
.thumb:focus-visible::after {
  opacity: 1;
}

.thumb:hover img {
  transform: scale(1.035);
}

.thumb-video {
  position: relative;
}

.play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-icon::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 18px solid #fff;
  margin-left: 4px;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.4));
}

.play-icon {
  background: radial-gradient(circle, rgba(23,22,19,0.45) 0%, rgba(23,22,19,0.15) 65%, transparent 70%);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-section {
  padding: 96px 32px;
  border-bottom: 1px solid var(--border);
}

.about-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.about-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.about-body {
  max-width: 640px;
}

.about-body p {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 20px;
}

.about-body p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-section {
  background: var(--ink);
  color: var(--bg);
  padding: 96px 32px;
}

.contact-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
  margin: 0 0 40px;
  max-width: 600px;
}

.contact-links {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.contact-link {
  font-family: var(--font-mono);
  font-size: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(250,249,245,0.35);
  transition: border-color 0.15s ease;
}

.contact-link:hover {
  border-color: var(--bg);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  padding: 28px 32px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(23,22,19,0.94);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-stage {
  max-width: 90vw;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-stage img,
.lightbox-stage video {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-caption {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(250,249,245,0.7);
  margin-top: 20px;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 28px;
  right: 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--bg);
  letter-spacing: 0.03em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  .wrap { padding: 0 20px; }

  .header-inner { height: 64px; }
  .site-nav { gap: 18px; }

  .hero { padding: 56px 20px 40px; }
  .hero-meta { gap: 32px; }

  .work-section { padding: 48px 20px 64px; }

  .index-row-head {
    grid-template-columns: 32px 1fr 20px;
    grid-template-areas:
      "num tag chev"
      "title title title";
    row-gap: 10px;
    padding: 22px 0;
  }
  .index-num { grid-area: num; }
  .index-tag { grid-area: tag; justify-self: start; }
  .index-chevron { grid-area: chev; }
  .index-title { grid-area: title; font-size: 17px; }

  .panel-inner { padding: 0 0 36px 0; }

  .project {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .project-media.grid-2,
  .project-media.grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .about-header { gap: 12px; }

  .contact-section { padding: 64px 20px; }
  .site-footer .footer-inner { flex-direction: column; gap: 6px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
