/* ==========================================================================
   TOKENS
   ========================================================================== */
:root {
  --paper: #FAFAF7;
  --paper-dim: #F1F0EA;
  --ink: #16171B;
  --ink-soft: #3A3B40;
  --stone: #8A8A82;
  --stone-light: #C9C8BF;
  --accent: #5C6B4A;
  --accent-soft: #E5E8DD;

  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stone-light);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.mark-dot { color: var(--accent); }

.nav {
  display: flex;
  gap: 2.5rem;
}

.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 22px;
  height: 1.5px;
  background: var(--ink);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  padding: clamp(5rem, 14vw, 9rem) var(--gutter) clamp(3rem, 8vw, 5rem);
  max-width: var(--container);
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: rise 0.7s var(--ease) forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  max-width: 15ch;
  opacity: 0;
  animation: rise 0.8s var(--ease) 0.1s forwards;
}

.hero-sub {
  margin-top: 2rem;
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 38ch;
  opacity: 0;
  animation: rise 0.8s var(--ease) 0.25s forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   GALLERY
   ========================================================================== */
.gallery {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4rem var(--gutter) 2rem;
}

.gallery-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--stone-light);
  padding-bottom: 1.25rem;
  margin-bottom: 2.5rem;
}

.gallery-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
}

.gallery-count {
  font-size: 0.85rem;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.piece {
  grid-column: span 3;
  cursor: pointer;
}

.piece--wide { grid-column: span 6; }

.piece-media {
  position: relative;
  overflow: hidden;
  background: var(--paper-dim);
  aspect-ratio: 4 / 3;
}

.piece--wide .piece-media { aspect-ratio: 16 / 9; }

.piece-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.5s var(--ease);
}

.piece:hover .piece-media img {
  transform: scale(1.035);
  filter: saturate(0.85);
}

.piece-info {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin-top: 0.9rem;
  padding-bottom: 0.1rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.piece:hover .piece-info {
  border-color: var(--accent);
}

.piece-index {
  font-size: 0.8rem;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}

.piece-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  flex: 1;
  transform: translateX(0);
  transition: transform 0.35s var(--ease), color 0.3s var(--ease);
}

.piece:hover .piece-title {
  transform: translateX(4px);
  color: var(--accent);
}

.piece-year {
  font-size: 0.8rem;
  color: var(--stone);
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about {
  background: var(--paper-dim);
  margin-top: 6rem;
  padding: clamp(4rem, 8vw, 6rem) var(--gutter);
}

.about-inner {
  max-width: 720px;
  margin: 0 auto;
}

.about-eyebrow {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.about-copy {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin-top: 2.5rem;
}

.about-skills li {
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--stone-light);
  border-radius: 999px;
  color: var(--ink-soft);
}

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact {
  padding: clamp(5rem, 12vw, 8rem) var(--gutter);
  max-width: var(--container);
  margin: 0 auto;
  text-align: center;
}

.contact-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.contact-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.15rem;
  transition: opacity 0.2s var(--ease);
}

.contact-link:hover { opacity: 0.7; }

.contact-social {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.contact-social a {
  font-size: 0.9rem;
  color: var(--stone);
  transition: color 0.2s var(--ease);
}

.contact-social a:hover { color: var(--ink); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--stone-light);
  padding: 1.5rem var(--gutter);
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--stone);
}

.back-top {
  color: var(--stone);
  transition: color 0.2s var(--ease);
}

.back-top:hover { color: var(--accent); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 860px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--stone-light);
  }

  .nav.nav--open { display: flex; }

  .nav a {
    padding: 1rem var(--gutter);
    border-top: 1px solid var(--stone-light);
  }

  .nav-toggle { display: flex; }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .piece, .piece--wide { grid-column: span 2; }
}

@media (max-width: 540px) {
  .site-footer { flex-direction: column; gap: 0.5rem; text-align: center; }
}