/* ── Variables ── */
:root {
  --bg:       #f7f6f3;
  --text:     #111111;
  --muted:    #888888;
  --border:   #e0dedd;
  --hover-bg: #efefec;

  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;

  --max-width: 1200px;
  --pad:       clamp(1.5rem, 4vw, 3.5rem);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── Nav ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-name {
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.01em;
}
.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links a {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ── Hero ── */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) var(--pad) clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.25;
  max-width: 820px;
  margin-bottom: 2.5rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--muted);
}
.hero-meta {
  display: flex;
  gap: 2.5rem;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Projects Grid ── */
.projects {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--pad);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem 2.5rem;
}

/* ── Project Card ── */
.project-card {
  display: flex;
  flex-direction: column;
  transition: opacity 0.25s;
  cursor: pointer;
}
.project-image {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: var(--border);
  outline: 1px solid var(--border);
  outline-offset: 6px;
}
.project-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s ease;
}
.project-image .img-hover {
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(0.494);
  transform-origin: center center;
}
.project-card:hover .img-primary         { opacity: 0; }
.project-card:hover .img-hover           { opacity: 1; }
.project-card:hover .project-image       { background: #ffffff; }

/* Cards without a hover image — keep primary visible */
.project-card.no-hover:hover .img-primary { opacity: 1; }
.project-card.no-hover .img-hover         { display: none; }

.image-placeholder {
  position: absolute;
  inset: 0;
  background: var(--border);
}

.project-info {
  padding: 1.25rem 0 0;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.project-num {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-top: 0.3rem;
  flex-shrink: 0;
  min-width: 1.5rem;
}
.project-text h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}
.project-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.project-tags {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Sub-project entry (within a homepage card) ── */
.project-sub-entry {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  align-items: flex-start;
}
.sub-entry-marker {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  padding-top: 0.15rem;
  opacity: 0.6;
}
.sub-entry-name {
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.2rem;
}
.sub-entry-tags {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Footer ── */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem var(--pad);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
footer a:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .projects {
    grid-template-columns: 1fr;
    padding: 0;
    border: none;
    gap: 0;
    background: none;
  }
  .project-card { border-bottom: 1px solid var(--border); }
  .hero-meta { flex-direction: column; gap: 0.5rem; }
  footer { flex-direction: column; gap: 0.5rem; text-align: center; }
}
