:root {
  --bg: #0c0c0c;
  --surface: #161616;
  --border: rgba(255, 255, 255, 0.08);
  --ink: #f0ece4;
  --muted: #7a7370;
  --accent: #c8a96e;
  --max-width: 1200px;
  --gap: 5px;

  /* Modular type scale — Golden Ratio ×1.618 */
  --text-xs:      max(0.8125rem, 0.618rem);
  --text-sm:      max(0.9375rem, 0.764rem);
  --text-base:    1rem;
  --text-md:      1.236rem;
  --text-lg:      1.618rem;
  --text-xl:      2.058rem;
  --text-2xl:     2.618rem;
  --text-3xl:     4.236rem;
  --text-display: 6.854rem;
  --leading-tight:  1.1;
  --leading-snug:   1.25;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  /* Fibonacci spacing (8px base) */
  --space-1: 8px;  --space-2: 13px; --space-3: 21px;
  --space-4: 34px; --space-5: 55px; --space-6: 89px; --space-7: 144px;

  /* Semantic status tokens */
  --success: #1a7f5a; --success-bg: #e6f5ef;
  --warning: #b45309; --warning-bg: #fef3c7;
  --error:   #b91c1c; --error-bg:   #fee2e2;

  /* Motion tokens (§14.1) */
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 500ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Typography --- */
h1,
h2,
h3 {
  font-family: "Playfair Display", serif;
  line-height: 1.05;
  font-weight: 400;
}

em {
  font-style: italic;
  font-family: "Playfair Display", serif;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

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

/* Skip-nav (§9.5) */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 24px;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.82rem;
  z-index: 9999;
  transition: top var(--duration-fast) var(--ease-default);
}
.skip-nav:focus { top: 12px; }

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 44px;
  transition:
    background 0.4s,
    padding 0.4s,
    border-color 0.4s;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(12, 12, 12, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px 44px;
  border-bottom-color: var(--border);
}

.brand {
  font-family: "Playfair Display", serif;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 36px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
}

/* --- Hero --- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 44px;
  max-width: var(--max-width);
  margin-inline: auto;
  position: relative;
}

.hero-inner {
  padding-top: 80px;
}

.hero-name {
  font-size: clamp(5.5rem, 14vw, 12rem);
  line-height: 0.88;
  display: flex;
  flex-direction: column;
  gap: 0.04em;
  margin: 1.2rem 0 2rem;
}

.hero-name span {
  display: block;
  color: var(--ink);
}

.hero-name em {
  display: block;
  color: var(--accent);
}

.hero-sub {
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-scroll {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  animation: bob 2.2s ease-in-out infinite;
}

.hero-scroll a {
  color: inherit;
  display: block;
  transition: color 0.2s;
}

.hero-scroll a:hover {
  color: var(--ink);
}

@keyframes bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(9px);
  }
}

/* --- Work / Gallery --- */
.work {
  padding: 120px 44px;
  max-width: var(--max-width);
  margin-inline: auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 48px;
  flex-wrap: wrap;
  gap: 20px;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 400;
}

/* Filter */
.filter-bar {
  display: flex;
  gap: 6px;
}

.filter-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
}

/* Gallery grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 260px;
  gap: var(--gap);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  margin: 0;
  background: var(--surface);
  cursor: pointer;
}

.gallery-item.wide {
  grid-column: span 2;
}

.gallery-item.tall {
  grid-row: span 2;
}

.gallery-item.big {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item.hidden {
  display: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition:
    transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    filter 0.4s;
  filter: grayscale(18%);
}

.gallery-item:hover img {
  transform: scale(1.05);
  filter: grayscale(0%);
}

.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 48px 20px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  color: rgba(240, 236, 228, 0.88);
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.3s,
    transform 0.3s;
}

.gallery-item:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

/* --- About --- */
.about {
  padding: 120px 44px;
  max-width: var(--max-width);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-image img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  filter: grayscale(12%);
}

.about-text {
  max-width: 460px;
}

.about-text h2 {
  font-size: clamp(2.2rem, 3.5vw, 3.2rem);
  margin-bottom: 2rem;
}

.about-text p {
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
}

.about-text p em {
  color: var(--ink);
  font-style: normal;
  font-family: "Inter", sans-serif;
}

.about-awards {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.award {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.award-year {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.1em;
  min-width: 36px;
}

.award-name {
  font-size: 0.83rem;
  color: var(--muted);
}

/* --- Contact --- */
.contact {
  border-top: 1px solid var(--border);
  padding: 120px 44px;
}

.contact-inner {
  max-width: var(--max-width);
  margin-inline: auto;
}

.contact h2 {
  font-size: clamp(2.8rem, 5.5vw, 5.5rem);
  margin-bottom: 1.5rem;
  max-width: 640px;
}

.contact-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2.8rem;
}

.contact-email {
  display: inline-block;
  font-size: clamp(1rem, 2.2vw, 1.45rem);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  transition:
    color 0.2s,
    border-color 0.2s;
}

.contact-email:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  gap: 28px;
  margin-top: 2.2rem;
}

.social-links a {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 44px;
  max-width: var(--max-width);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.75s ease,
    transform 0.75s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .site-header {
    padding: 22px 24px;
  }

  .site-header.scrolled {
    padding: 16px 24px;
  }

  .site-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 44px;
    z-index: 99;
  }

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

  .site-nav a {
    font-size: 1.3rem;
    letter-spacing: 0.14em;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }

  .hero,
  .work,
  .about,
  .site-footer {
    padding-inline: 24px;
  }

  .contact {
    padding: 80px 24px;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }

  .gallery-item.big {
    grid-column: span 2;
    grid-row: span 1;
  }

  .about {
    grid-template-columns: 1fr;
    padding-block: 80px;
    gap: 44px;
  }

  .about-image img {
    aspect-ratio: 4/3;
  }

  .about-text {
    max-width: 100%;
  }

  .work {
    padding-block: 80px;
  }
}

@media (max-width: 560px) {
  .gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 280px;
  }

  .gallery-item.wide,
  .gallery-item.big,
  .gallery-item.tall {
    grid-column: span 1;
    grid-row: span 1;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-bar {
    flex-wrap: wrap;
  }

  .site-footer {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding-block: 24px;
  }
}

/* ============================================================
   LIGHT MODE (§14.3 — respect OS colour preference)
   ============================================================ */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f1ea;
    --surface: #ffffff;
    --border: rgba(36, 34, 31, 0.12);
    --ink: #1f1b16;
    --muted: #5f564d;
    --accent: #8f6a2f;
  }

  .site-header.scrolled {
    background: rgba(245, 241, 234, 0.92);
  }

  .filter-btn:hover,
  .filter-btn.active {
    color: #fffaf2;
    background: #1f1b16;
    border-color: #1f1b16;
  }

  .gallery-item figcaption {
    color: rgba(255, 250, 242, 0.95);
  }
}

/* ============================================================
   REDUCED MOTION (§9.7 — respect vestibular/motion sensitivity)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
