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

:root {
  --bg: #f4f2ee;
  --ink: #1c1b19;
  --mid: #888480;
  --line: rgba(28,27,25,0.12);
  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── HEADER ── */
header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  padding: 32px 32px 20px;
  border-bottom: 1px solid var(--line);
}

.header-name {
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.header-center {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
}

.header-nav {
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  list-style: none;
}

.header-nav a {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s;
}

.header-nav a:hover,
.header-nav a.active { color: var(--ink); }

/* ── INDEX ── */
.index { width: 100%; }

/* Column header row */
.index-row {
  display: grid;
  grid-template-columns: 52px 1fr 180px 120px 180px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  min-height: 52px;
  transition: background 0.2s var(--ease);
}

.index-header {
  min-height: 36px;
  pointer-events: none;
}

.col-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
}

/* Data row — hover bg handled by parent .index-entry */
.index-entry .index-row {
  cursor: default;
}

.index-entry:hover .index-row {
  background: rgba(28,27,25,0.035);
}

/* Cells */
.col-num {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--mid);
}

.col-title {
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  letter-spacing: 0.01em;
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Thumbnail — fades in on row hover */
.row-thumb {
  width: 44px;
  height: 36px;
  object-fit: cover;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.index-entry:hover .row-thumb {
  opacity: 1;
  transform: scale(1);
}

.col-client,
.col-type {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
}

.col-coords {
  font-family: var(--serif);
  font-size: 12px;
  font-style: italic;
  color: rgba(28,27,25,0.32);
  letter-spacing: 0.02em;
}

/* ── EXPANDED PANEL — smooth height animation ── */
/*
  The trick: wrap content in a grid with grid-template-rows.
  Animating from 0fr → 1fr gives a smooth height transition
  without needing to know the exact pixel height.
*/
.expanded-row {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s var(--ease);
  border-bottom: 1px solid transparent;
  background: rgba(28,27,25,0.02);
  overflow: hidden;
}

.expanded-row.open {
  grid-template-rows: 1fr;
  border-bottom-color: var(--line);
}

/* The overflow:hidden child is what makes the animation work */
.expanded-row > .expanded-inner {
  overflow: hidden;
  /* fade in content slightly after panel opens */
  opacity: 0;
  transition: opacity 0.25s var(--ease) 0.1s;
}

.expanded-row.open > .expanded-inner {
  opacity: 1;
}

.expanded-inner {
  display: grid;
  grid-template-columns: 52px 1fr;
  padding: 0 32px;
}

.expanded-spacer { /* aligns content under title col */ }

.expanded-content {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 48px;
  padding: 32px 0 36px;
}

.expanded-img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  display: block;
}

.expanded-img.portrait {
  aspect-ratio: 2/3;
  max-width: 280px;
}

.expanded-meta {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 20px;
  padding-bottom: 4px;
}

.expanded-title {
  font-family: var(--serif);
  font-size: 28px;
  font-style: italic;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.expanded-details {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.expanded-detail {
  display: flex;
  gap: 20px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.detail-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  width: 72px;
  flex-shrink: 0;
}

.detail-val {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.detail-val.italic {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* ── INFO PAGE ── */
.info-page {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 80px;
  padding: 72px 32px 80px;
  max-width: 1100px;
}

.info-left {
  position: sticky;
  top: 72px;
  height: fit-content;
}

.info-portrait {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: center top;
  display: block;
  margin-bottom: 24px;
}

.info-name {
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
  line-height: 1.25;
  margin-bottom: 6px;
}

.info-location {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
}

.info-right {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding-top: 4px;
}

.info-bio {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.7;
  max-width: 52ch;
}

.info-section { display: flex; flex-direction: column; gap: 0; }

.info-section-label {
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mid);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

.client-list { display: flex; flex-direction: column; }

.client-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.client-row-name {
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
}

.client-row-type {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
}

.contact-block { display: flex; flex-direction: column; }

.contact-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-line:hover { color: var(--mid); }

.contact-line-label {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
}

/* ── FOOTER ── */
footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 20px 32px;
  border-top: 1px solid var(--line);
  margin-top: 80px;
}

.footer-name {
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  color: var(--mid);
}

.footer-center {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
}

.footer-right {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
}

.footer-right a {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s;
}

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