:root {
  --bg:          #f6f1eb;
  --border:      #e0d8cf;
  --text:        #1e1a16;
  --text-muted:  #9a8f82;
  --text-subtle: #c0b5ac;
  --text-body:       #4a3f35;
  --text-body-light: #7a6f65;
  --accent:      #c05a2f;

  --page-width:  1400px;
  --page-pad:    2rem;
  --page-pad-s:    1.5rem;
  --page-x: max(var(--page-pad), calc((100% - var(--page-width)) / 2));
  --page-xs: max(var(--page-pad-s), calc((100% - var(--page-width)) / 2));

  --mono-size: 1rem;
}

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

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ── */


.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem var(--page-x);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  font-family: 'Geist Mono', monospace;
  font-size: var(--mono-size);
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
  transition: padding-bottom 0.35s ease;
}

@media (max-width: 767px) {
  :root { --mono-size: 0.75rem; }

  .site-header {
    font-size: var(--mono-size);
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem var(--page-xs);
    transition: padding 0.3s ease;
  }
}


.header-name {
  display: block;
}

.header-name .name {
  color: var(--text);
  display: flex;
  margin: 0 0 0.25rem 0;
}

.site-header .header-nav {
  display: none;
}

@media (min-width: 768px) {
  .site-header .header-nav {
    display: block;
  }

  .header-name .name {
    display: inline;
    margin: 0 2rem 0 0;
  }
}


.site-header a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-header a:hover,
.site-header a.active { color: var(--text); border-bottom: 2px solid var(--text); }

.site-header ul,
.site-footer ul { margin: 0; padding: 0; list-style-type: none; }

.site-header li,
.site-footer li { 
  display: inline;
  margin-left: 0.5rem;
}

.site-header li.divider,
.site-footer li.divider { opacity: 0.5; }

/* ── Header top row ── */

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* ── Hamburger ── */

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Geist Mono', monospace;
  line-height: 1;
}

@media (max-width: 767px) {
  .menu-toggle { display: block; }
}

/* ── Mobile expanding nav ── */

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding-top: 0;
}

@media (max-width: 767px) {
  .mobile-nav { display: flex; }
}

.site-header.menu-open .mobile-nav {
  max-height: 300px;
  padding-top: 2rem;
}

.mobile-nav-link {
  font-family: 'Geist Mono', monospace;
  font-size: var(--mono-size);
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  align-self: flex-start;
}

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

/* ── Footer ── */

.site-footer {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 2rem calc(50vw - 50%);
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  font-family: 'Geist Mono', monospace;
  font-size: var(--mono-size);
  text-transform: uppercase;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .site-footer { flex-direction: row; }
}



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

.site-footer a:hover { color: var(--text); border-bottom: 2px solid var(--text); }

/* ── Content area ── */

.content-area {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}


.content-pane {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 4rem var(--page-xs) 0;
  overflow-y: auto;
  overflow-x: clip;
  scrollbar-width: none;
}

@media (min-width: 768px) {
  padding: 4rem var(--page-x) 0;
}

.content-top {
  padding: clamp(4rem, 12dvh, 10rem) 0 8rem;
}

h1, .h1 {
  font-family: 'Manrope', sans-serif;
  font-size: 2.25rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text);
}

h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text);
}

h3 {
  font-weight: 400;
}

@media (min-width: 768px) {
  h1, .h1 {
    font-size: 4.5rem;
    letter-spacing: -0.05em;
  }

  h2 {
    font-size: 2.25rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
}

.content-title {
  margin-bottom: 0.5rem;
}

.content-title,
.content-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.content-summary {
  color: var(--text-body-light);
  margin: 0 0 2rem 0;
  -webkit-line-clamp: 2;
}

.content-intro {
  color: var(--text-body);
  font-size: 1.25rem;
  line-height: 2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
}

@media (min-width: 768px) {
  .content-top {padding: clamp(4rem, 24dvh, 20rem) 0 8rem;}

  .content-title,
  .content-summary {
    -webkit-line-clamp: 1;
  }

  .content-summary {
    margin: -2rem 0 4rem;
  }

  .content-title {
    margin-bottom: 1rem;
  }

  .content-intro {
    -webkit-line-clamp: 2;
    max-width: 75%;
  }
}

/* ── Work grid ── */

.work-grid {
  columns: 1;
  column-gap: 2rem;
  padding: 6rem 0;
}

@media (min-width: 1024px) {
  .work-grid { columns: 2; }
}

.work-card-link {
  display: block;
  text-decoration: none;
  break-inside: avoid;
  transition: transform 0.2s ease;
}

.work-card-link:hover { transform: translateY(-4px); }

.work-card-link .card-media { transition: box-shadow 0.2s ease; }

.work-card-link:hover .card-media {
  box-shadow: 0 12px 32px rgba(30, 26, 22, 0.1);
}

.work-card {
  break-inside: avoid;
  margin-bottom: 4rem;
}

.card-media {
  width: 100%;
  background: var(--border);
  border-radius: 0.5rem;
  display: block;
}

.card-media--landscape { aspect-ratio: 4 / 3; }
.card-media--square    { aspect-ratio: 1 / 1; }

.card-info {
  display: flex;
  flex-direction: column;
  align-items: baseline;
  margin-bottom: 1rem;
  gap: 1rem;
}

@media (min-width: 767px) {
  .card-info {
    flex-direction: row;
    justify-content: space-between;
  }
}

.card-title {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
}

.card-meta {
  font-family: 'Geist Mono', monospace;
  font-size:  0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ─────────────────────────── PROJECT PAGE ─────────────────────────── */

body.is-project {
  height: auto;
  min-height: 100dvh;
  width: 100%;
  overflow: auto;
}

body.is-project .site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}

@media (max-width: 767px) {
  body.is-project .site-header {
    position: relative;
  }
}

.mobile-back {
  display: none;
}

@media (max-width: 767px) {
  .mobile-back {
    display: block;
    margin-bottom: 1.5rem;
  }
}

body.is-project .site-footer {
  width: 100%;
  margin-left: 0;
  padding: 2rem var(--page-x);
}

.project-layout {
  overflow-x: hidden;
      padding: 4rem var(--page-xs) 0;
}


@media (min-width: 768px) {
  .project-layout {
    display: grid;
    grid-template-columns: 16rem 1fr;
  }
}


/* ── Sidebar ── */

.project-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: clamp(4rem, 12dvh, 10rem) 2rem 3rem 0;
  display: none;
  flex-direction: column;
  gap: 2rem;
  border-right: 1px solid var(--border);
}

@media (min-width: 768px) {
  .project-sidebar {
    display: flex;
  }
}

.project-heading {
  margin-bottom: 1rem;
}

.back-link {
  font-family: 'Geist Mono', monospace;
  font-size: var(--mono-size);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-decoration: none;
}
.back-link:hover { color: var(--text); }

.toc {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 3.5rem;
}


.toc-link {
  font-family: 'Geist Mono', monospace;
  font-size: var(--mono-size);
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  align-self: flex-start;
}
.toc-link:hover,
.toc-link.active { color: var(--text); }

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

.toc-link.active { border-bottom: 2px solid var(--text); }

.toc-link.active .toc-num { color: var(--text); }

.toc-num,
.section-num {
  font-family: 'Geist Mono', monospace;
  font-size: var(--mono-size);
  color: var(--text-subtle);
}

.toc-text { margin-left: 0.5rem; }

/* ── Main content ── */

.project-content {
  width: 100%;
  padding: clamp(2rem, 5.5dvh, 10rem) 0 8rem;
}

@media (min-width: 768px) {
  .project-content {
    padding: clamp(4rem, 20dvh, 20rem) 0 16rem 8rem;
  }
}

.project-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: var(--mono-size);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .project-eyebrow {
    margin-bottom: 1.5rem;
  }
}

.project-title {
  font-size: 4.5rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 3rem;
}

.project-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--border);
  border-radius: 0.5rem;
  margin-bottom: 4rem;
}

/* ── Meta row ── */

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  flex: 1 0 40%;
}

@media (min-width: 768px) {
  .project-meta {
    flex-wrap: nowrap;
  }

  .meta-item {
    flex: 1 0 auto;
  }
}

.meta-label {
  font-family: 'Geist Mono', monospace;
  font-size: var(--mono-size);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.meta-value {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.5;
}

@media (min-width: 768px) {
  .meta-value {
    font-size: 1.25rem;
  }
}

.meta-value ul { list-style: none; padding: 0; margin: 0; }

.meta-value li::before { content: '•'; margin-right: 0.25rem; }

/* ── Sections ── */

.project-section {
  margin-bottom: 5rem;
  scroll-margin-top: 6rem;
}

.section-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: var(--mono-size);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-lead {
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
  max-width: 640px;
}

.section-body {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-body);
  line-height: 1.8;
  max-width: 640px;
}

.section-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--border);
  border-radius: 0.5rem;
  margin: 2rem 0;
}

.section-img--short { aspect-ratio: 21 / 9; }

.section-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.section-col-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.section-col-body {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-body);
  line-height: 1.7;
}
