@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;1,400&family=Inter:wght@300;400;500&display=swap');

/* ── Variables ─────────────────────────────────── */
:root {
  --bg:         #ffffff;
  --bg-off:     #f5f5f5;
  --bg-dark:    #111111;
  --text:       #111111;
  --text-mid:   #444444;
  --text-light: #888888;
  --accent:     #C8102E;
  --accent-dk:  #A00D25;
  --accent-lt:  #f8d7db;
  --border:     #DDDDDD;
  --border-str: #222222;
  --white:      #ffffff;

  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --nav-h:   64px;
  --max-w:   1280px;
  --gutter:  clamp(1.5rem, 4vw, 3rem);
}

/* ── 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(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; }

/* ── Nav ────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 2px solid var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  z-index: 200;
}
.nav-logo {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 2.5rem;
}
.nav-links a {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--text); border-bottom: 1.5px solid var(--text); padding-bottom: 1px; }

/* ── Page wrapper ───────────────────────────────── */
.page { min-height: 100vh; padding-top: var(--nav-h); }

/* ── Hero ───────────────────────────────────────── */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 9rem) var(--gutter) clamp(3rem, 6vw, 5rem);
}
.hero-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 400;
  line-height: 1.03;
  margin-bottom: 2rem;
}
.hero h1 em { font-style: italic; color: var(--text-mid); }
.hero-bio {
  max-width: 520px;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-mid);
  margin-bottom: 2.5rem;
}
.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: all 0.22s ease;
  border-radius: 2px;
}
.btn-dark {
  background: var(--text);
  color: var(--bg);
}
.btn-dark:hover { background: var(--accent); }
.btn-outline {
  border: 1.5px solid var(--text);
  color: var(--text);
}
.btn-outline:hover { background: var(--text); color: var(--bg); }
.btn-accent {
  background: var(--accent);
  color: var(--white);
}
.btn-accent:hover { background: var(--accent-dk); }

/* ── Divider ────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border); }

/* ── Section ────────────────────────────────────── */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--gutter);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--text);
  margin-bottom: 2rem;
}
.section-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 400;
}
.section-sub {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
}

/* ── Year sections ──────────────────────────────── */
.year-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(2rem, 5vw, 4rem);
}

.year-banner {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 2.5rem 0 2rem;
  border-top: 2px solid var(--text);
  margin-bottom: 2rem;
}
.year-number {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}
.year-label {
  font-size: 0.8rem;
  color: var(--text-mid);
  line-height: 1.5;
}

/* ── Year tiles (index page) ────────────────────── */
.year-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}
@media (max-width: 640px) { .year-tiles { grid-template-columns: 1fr; } }

.year-tile {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-dark);
  cursor: pointer;
  text-decoration: none;
}
.year-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(.25,.46,.45,.94);
  filter: brightness(0.65);
}
.year-tile:hover img { transform: scale(1.04); filter: brightness(0.45); }

.year-tile-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
}
.year-tile-sub {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.year-tile-label {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}
.year-tile-count {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

/* No-image tile */
.year-tile.no-img { background: var(--bg-dark); }
.year-tile.no-img:hover { background: #222; }

/* ── Year page header ───────────────────────────── */
.year-page-hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3rem,8vw,6rem) var(--gutter) 2rem;
  border-bottom: 2px solid var(--text);
}
.year-page-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.year-page-title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 400;
  line-height: 1.05;
}
.year-page-sub {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  letter-spacing: 0.04em;
}

/* ── Section blocks (within year pages) ─────────── */
.year-sections {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 5rem;
}
.section-block {
  padding-top: 2.5rem;
  margin-top: 0;
}
.section-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.section-block-name {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text);
}
.section-block-count {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-light);
}

/* ── Card grid ──────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}
@media (max-width: 1100px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .card-grid { grid-template-columns: 1fr; } }

/* ── Project Grid (legacy alias) ────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}
@media (max-width: 1100px) { .project-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .project-grid { grid-template-columns: 1fr; } }

.project-card {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-dark);
}
.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
}
.project-card:hover img { transform: scale(1.05); }

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(17,17,17,0.9) 0%,
    rgba(17,17,17,0.2) 55%,
    transparent 100%);
  opacity: 0;
  transition: opacity 0.25s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
}
.project-card:hover .card-overlay { opacity: 1; }

/* no-image card variant */
.card-noimg {
  background: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  transition: background 0.2s;
}
.card-noimg:hover { background: var(--accent); }
.card-noimg .card-overlay {
  opacity: 1;
  background: none;
  position: static;
  padding: 0;
  flex: 1;
  justify-content: flex-end;
}

.card-title {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 0.2rem;
  line-height: 1.25;
}
.card-meta {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

/* ── Project Detail ─────────────────────────────── */
.project-hero-img {
  width: 100%;
  height: clamp(300px, 55vw, 640px);
  object-fit: cover;
  display: block;
}

.project-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem var(--gutter) 6rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 2.5rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

.project-header-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}
.project-detail-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
}
.project-meta-col {
  text-align: right;
  flex-shrink: 0;
}
.project-year {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}
.tag {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-light);
}

.project-body-cols {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}
@media (max-width: 700px) { .project-body-cols { grid-template-columns: 1fr; gap: 2rem; } }

.sidebar-block { margin-bottom: 2rem; }
.sidebar-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.5rem;
}
.sidebar-value {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.7;
}

.project-description {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-mid);
}
.project-description p + p { margin-top: 1.25rem; }

/* Gallery */
.gallery {
  columns: 2;
  column-gap: 3px;
}
.gallery img {
  width: 100%;
  margin-bottom: 3px;
  break-inside: avoid;
  transition: opacity 0.3s;
}
.gallery img:hover { opacity: 0.92; }
@media (max-width: 600px) { .gallery { columns: 1; } }

.pdf-label {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.6rem;
  font-weight: 500;
}
.pdf-embed {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-top: 0;
}
.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.project-year-tag {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
}

/* ── Experience Page ────────────────────────────── */
.exp-hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) var(--gutter) clamp(2rem, 4vw, 3rem);
  border-bottom: 2px solid var(--text);
  margin-bottom: 0;
}
.exp-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 6rem;
}

/* Two-column experience layout — no sticky, no overlap */
.exp-cols {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 4rem;
  padding-top: 3rem;
}
@media (max-width: 860px) {
  .exp-cols { grid-template-columns: 1fr; gap: 2rem; }
}

.exp-section-label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: block;
  font-weight: 500;
}

/* Section divider within experience */
.exp-sub-section {
  padding-top: 3rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.exp-sub-section:first-child {
  padding-top: 0;
  border-top: none;
  margin-top: 0;
}

/* Timeline */
.timeline-item {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; padding-bottom: 0; }
.timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.3rem;
}
.timeline-role {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
}
.timeline-dates {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  color: var(--text-light);
  white-space: nowrap;
  flex-shrink: 0;
}
.timeline-company {
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.timeline-bullets li {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.7;
  padding-left: 1.2rem;
  position: relative;
  margin-bottom: 0.2rem;
}
.timeline-bullets li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--border);
}

/* Education */
.edu-item { margin-bottom: 2rem; }
.edu-inst {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}
.edu-degree {
  font-size: 0.88rem;
  color: var(--text-mid);
  margin-bottom: 0.15rem;
  line-height: 1.5;
}
.edu-period {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  color: var(--text-light);
}

/* Skills */
.skills-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2rem;
}
.skill-block { margin-bottom: 1.5rem; }
.skill-lbl {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
  display: block;
}
.skill-val {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.75;
}

/* ── Work page — view toggle ────────────────────── */
.view-toggle-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem var(--gutter) 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.view-toggle {
  display: inline-flex;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.view-btn {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.45rem 1.25rem;
  border: none;
  background: none;
  color: var(--text-light);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.view-btn:not(:last-child) {
  border-right: 1.5px solid var(--border);
}
.view-btn:hover { color: var(--text); background: var(--bg-off); }
.view-btn.active {
  background: var(--text);
  color: var(--white);
}

/* ── Browse by Type page ────────────────────────── */
.browse-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 1.75rem var(--gutter) 0;
  max-width: var(--max-w);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}
.browse-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 2px;
  color: var(--text-light);
  background: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--sans);
}
.browse-tab:hover {
  border-color: var(--text);
  color: var(--text);
}
.browse-tab.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--white);
}
.browse-tab.active .tab-count { color: rgba(255,255,255,0.55); }
.tab-count {
  font-size: 0.65rem;
  color: var(--text-light);
}

.browse-sections {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 5rem;
}
.type-section {
  padding-top: 2.5rem;
}

/* ── Utility ────────────────────────────────────── */
.fade-in {
  animation: fadeUp 0.45s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mt-lg { margin-top: 3rem; }
.mb-sm { margin-bottom: 1rem; }

/* ── Footer ─────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
}
footer a:hover { color: var(--accent); }
