/* ===== Variables ===== */
:root {
  --bg: #ffffff;
  --bg-elevated: #f7f6f3;
  --text: #1a1a1a;
  --text-secondary: #5c5c5c;
  --text-muted: #8a8a8a;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --accent: #1a1a1a;
  --radius: 2px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Instrument Sans', var(--font);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition: 0.35s var(--ease);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.4rem 0;
  background: transparent;
  transition: background var(--transition), border-color var(--transition);
  border-bottom: 1px solid transparent;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

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

.logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

.nav-link {
  font-size: 0.9rem;
  font-weight: 450;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.nav-link:hover {
  color: var(--text);
}

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 4px;
  z-index: 110;
}

.menu-btn span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.3s var(--ease);
}

.menu-btn.active span:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

.menu-btn.active span:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  padding: 11rem 0 5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
  max-width: 16ch;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 40ch;
  line-height: 1.65;
}

/* ===== Filters ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 2rem;
  margin-bottom: 3.5rem;
  padding-top: 1rem;
}

.filter-btn {
  font-size: 0.95rem;
  font-weight: 450;
  color: var(--text-muted);
  padding: 0.35rem 0;
  position: relative;
  transition: color var(--transition);
  letter-spacing: -0.01em;
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.active {
  color: var(--text);
  font-weight: 500;
}

/* ===== Projects Grid (Tiled) ===== */
.work {
  padding: 2rem 0 7rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.project-card {
  position: relative;
  display: block;
  overflow: hidden;
  background: #f0eeea;
  aspect-ratio: 1 / 1.05;
  transition: opacity 0.4s var(--ease);
}

.project-card.wide {
  grid-column: span 2;
  aspect-ratio: 2.05 / 1;
}

.project-card.hidden {
  display: none;
}

.project-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.7s var(--ease);
}

.project-image img,
.project-hero-image img,
.gallery-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card:hover .project-image {
  transform: scale(1.04);
}

.project-placeholder-icon {
  color: rgba(0, 0, 0, 0.18);
}

.project-placeholder-icon.light {
  color: rgba(255, 255, 255, 0.25);
}

/* Overlay on hover */
.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.35s var(--ease), background 0.35s var(--ease);
}

.project-card:hover .project-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.35);
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
  transform: translateY(8px);
  transition: transform 0.35s var(--ease);
}

.project-card:hover .project-title {
  transform: translateY(0);
}

.project-cat {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 0.2rem;
  transform: translateY(8px);
  transition: transform 0.35s var(--ease) 0.05s;
}

.project-card:hover .project-cat {
  transform: translateY(0);
}

/* ===== About ===== */
.about {
  padding: 7rem 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 5rem;
  align-items: start;
}

.about-heading {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
  max-width: 14ch;
}

.about-right p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1.3rem;
  line-height: 1.75;
  max-width: 52ch;
}

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

.detail {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  align-items: baseline;
}

.detail-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail-value {
  font-size: 0.95rem;
}

/* ===== Contact ===== */
.contact {
  padding: 8rem 0;
}

.contact-inner {
  max-width: 540px;
}

.contact-heading {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1.15rem;
}

.contact-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2.25rem;
}

.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  border-bottom: 1.5px solid var(--text);
  padding-bottom: 2px;
  transition: opacity var(--transition);
  margin-bottom: 2.25rem;
}

.contact-email:hover {
  opacity: 0.55;
}

.contact-links {
  display: flex;
  gap: 2rem;
}

.contact-links a {
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.contact-links a:hover {
  color: var(--text);
}

/* ===== Footer ===== */
.footer {
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Project Detail Page ===== */
.project-hero {
  padding: 8rem 0 3rem;
}

.project-hero-inner {
  max-width: 800px;
}

.project-client {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.project-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.project-hero-desc {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 42ch;
}

.project-hero-image {
  margin: 3.5rem 0 0;
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, #d9d4cd 0%, #a8a29a 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,0.15);
}

.project-content {
  padding: 5rem 0 7rem;
}

.project-content .container {
  max-width: 720px;
}

.project-section {
  margin-bottom: 4rem;
}

.project-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.project-section p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.project-section blockquote {
  border-left: 2px solid var(--border-strong);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.7;
}

.project-section blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-style: normal;
  color: var(--text-muted);
}

.project-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.meta-item h4 {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.meta-item p {
  font-size: 1rem;
  color: var(--text);
  margin: 0;
}

.project-gallery {
  display: grid;
  gap: 1.25rem;
  margin: 3rem 0;
}

.project-gallery .gallery-img {
  aspect-ratio: 16 / 10;
  background: #eee;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,0.12);
}

.project-gallery .gallery-img.tall {
  aspect-ratio: 4 / 5;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--text);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-card.wide {
    grid-column: span 2;
    aspect-ratio: 2 / 1;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(280px, 80vw);
    height: 100vh;
    background: var(--bg);
    border-left: 1px solid var(--border);
    flex-direction: column;
    padding: 6rem 2rem 2rem;
    gap: 1.75rem;
    transition: right 0.35s var(--ease);
    z-index: 105;
  }

  .nav.open {
    right: 0;
  }

  .menu-btn {
    display: flex;
  }

  .hero {
    padding: 8.5rem 0 3.5rem;
  }

  .filters {
    gap: 0.4rem 1.25rem;
    margin-bottom: 2.5rem;
  }

  .filter-btn {
    font-size: 0.9rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .project-card,
  .project-card.wide {
    grid-column: span 1;
    aspect-ratio: 1 / 1;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .about-heading {
    max-width: none;
  }

  .detail {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .project-meta-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.3rem;
  }
}
