/* ============================================================
   IVAN SOUSA ARCHIVE — Global Stylesheet
   Editorial-Brutalist / Courier-std / No border-radius
   ============================================================ */

/* --- Fonts --- */
@font-face {
  font-family: 'KH Teka Trial';
  src: url('fonts/KHTekaTRIAL-Light.woff2') format('woff2'),
       url('fonts/KHTekaTRIAL-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'KH Teka Trial';
  src: url('fonts/KHTekaTRIAL-Regular.woff2') format('woff2'),
       url('fonts/KHTekaTRIAL-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'KH Teka Trial';
  src: url('fonts/KHTekaTRIAL-Medium.woff2') format('woff2'),
       url('fonts/KHTekaTRIAL-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'KH Teka Trial';
  src: url('fonts/KHTekaTRIAL-Bold.woff2') format('woff2'),
       url('fonts/KHTekaTRIAL-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
}

/* --- Variables --- */
:root {
  --color-bg:       #F4F4F4;
  --color-text:     #06070E;
  --color-border:   rgba(6, 7, 14, 0.5);
  --color-cv-border:#06070E;

  --font-main:      'KH Teka Trial', sans-serif;

  --size-xs:        1rem;
  --size-sm:        1rem;
  --size-base:      1rem;
  --size-lg:        1.25rem;

  --h1:             3rem;
  --h2:             1.75rem;
  --h3:             1.25rem;

  --space-xs:       15px;
  --space-sm:       15px;
  --space-md:       15px;
  --space-lg:       15px;
  --space-xl:       15px;

  --header-height:  3.5rem;
  --page-margin:    15px;
  --divider:        0.5px solid var(--color-border);
}

/* --- Custom cursors --- */
.mosca-cursor,
.mosca-cursor * {
  cursor: none !important;
}

#mosca-cursor-el {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: multiply;
  transform: translate(-50%, -30%);
  background: url('mosca-cursor-32.png') center / contain no-repeat;
}

/* --- Scrollbar --- */
html::-webkit-scrollbar {
  width: 1px;
  height: 1px;
}

html::-webkit-scrollbar-track {
  background: #F4F4F4;
}

html::-webkit-scrollbar-thumb {
  background: #06070E;
}

html {
  scrollbar-width: thin;
  scrollbar-color: #06070E #F4F4F4;
}

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

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

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: var(--size-base);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

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

ul, ol {
  list-style: none;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  padding: 0;
  position: sticky;
  top: 0;
  background-color: var(--color-bg);
  z-index: 100;
}


.site-header__logo {
  font-size: var(--size-base);
  font-weight: 400;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  padding: var(--page-margin) 0 var(--page-margin) var(--page-margin);
  flex: 1;
}

.site-nav {
  display: flex;
  gap: 0;
  align-items: center;
  margin-left: auto;
  padding: 0 var(--page-margin);
  gap: var(--page-margin);
}

.site-nav a,
.site-nav span {
  font-size: var(--size-base);
  font-weight: 400;
  display: flex;
  align-items: center;
  padding: 3px 10px;
}

.site-nav a.active {
  background-color: #FF70FD;
  text-decoration: none;
  border-radius: 999px;
}

body.home .site-header__logo a {
  background-color: #FF70FD;
  border-radius: 999px;
  padding: 3px 10px;
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-content {
  padding: var(--page-margin);
}

/* ============================================================
   INDEX — NO SCROLL LAYOUT
   ============================================================ */
body.home {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.home-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-center-gif {
  max-height: 80vh;
  max-width: 80vw;
  width: auto;
  height: auto;
  mix-blend-mode: multiply;
}

@media (max-width: 600px) {
  .home-center-gif {
    max-width: 100vw;
    max-height: 90vh;
    width: 100vw;
    height: auto;
  }
}

/* ============================================================
   INDEX — HERO
   ============================================================ */
.hero {
  position: absolute;
  inset: 0;
  top: -150px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.hero__gif {
  width: 120%;
  max-width: none;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}

/* ============================================================
   INDEX — HOME GIF
   ============================================================ */
.home-gif {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: calc(100% - var(--proj-split, 50%) - var(--page-margin));
  bottom: 0;
  z-index: 1;
  overflow: hidden;
  mix-blend-mode: multiply;
}

.home-gif img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ============================================================
   INDEX — PROJECT PANEL (transition target)
   ============================================================ */
#project-panel {
  position: fixed;
  top: var(--header-height);
  left: calc(var(--proj-split, 50%) + var(--page-margin) + 1px);
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--color-bg);
  z-index: 50;
}

#project-panel-divider {
  position: fixed;
  top: 0;
  bottom: 0;
  left: calc(var(--proj-split, 50%) + var(--page-margin));
  width: 1px;
  background-color: var(--color-border);
  z-index: 49;
}

/* Each image slide: sticky within the scrollable panel.
   100vh tall so the panel has scroll distance between each image.
   Starts off-screen below, slides up on .is-visible. */
.panel-slide {
  position: sticky;
  top: 0;
  height: calc(100vh - var(--header-height));
  box-sizing: border-box;
  padding: 15px var(--page-margin) 15px var(--page-margin);
  display: flex;
  align-items: flex-start;
  transform: translateY(100vh);
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1);
}

.panel-slide.is-visible {
  transform: translateY(0);
}

.panel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top left;
  display: block;
}

/* ============================================================
   INDEX — TABLE RAIL
   Two vertical borders that span ghost + desc + remaining rows.
   Driven by --rail-left, --rail-width, --rail-top, --rail-height.
   ============================================================ */
#table-rail {
  position:      fixed;
  will-change:   top, height;
  left:          0px;
  width:         calc(var(--proj-split, 50%));
  top:           var(--rail-top,    0px);
  height:        var(--rail-height, 0px);
  z-index:       400;
  box-sizing:    border-box;
  pointer-events: none;
  visibility:    hidden;
}

#table-rail-bottom {
  position:      fixed;
  left:          0px;
  width:         calc(var(--proj-split, 50%));
  top:           var(--rail-bottom, 0px);
  height:        1px;
  z-index:       400;
  background:    var(--color-border);
  pointer-events: none;
  display:       none;
}

#table-rail-bottom.is-visible {
  display: block;
}

#table-rail.is-visible {
  visibility: visible;
}

#table-rail.is-animating {
  transition: top    0.5s cubic-bezier(0.77,0,0.175,1),
              height 0.5s cubic-bezier(0.77,0,0.175,1);
}

/* ============================================================
   INDEX — ROW PROXIES
   Each row is a fixed element. Its top is driven by --row-top,
   which is set inline as var(--row-N-top) so the global var
   can be updated per-row without touching inline styles.
   ============================================================ */
.table-row-proxy {
  position:      fixed;
  will-change:   top;
  left:          var(--page-margin);
  width:         calc(var(--proj-split, 50%) - var(--page-margin));
  top:           var(--row-top,   0px);
  height:        var(--row-height, auto);
  z-index:       300;
  box-sizing:    border-box;
  background:    var(--color-bg);
  border-top:    0.5px solid var(--color-border);
  border-bottom: 0.5px solid var(--color-border);
  overflow:      hidden;
}

.table-row-proxy.is-animating {
  transition: top 0.5s cubic-bezier(0.77,0,0.175,1);
}

.table-row-proxy.is-active {
  border-bottom: none;
}

/* ============================================================
   INDEX — PROJECT DESCRIPTION BOX
   Geometry driven by --desc-left, --desc-width, --desc-top, --desc-height.
   No side borders — rail covers those.
   ============================================================ */
#project-desc-box {
  position:      fixed;
  will-change:   top;
  left:          0px;
  width:         var(--proj-split, 50%);
  top:           var(--desc-top,    0px);
  height:        var(--desc-height, 0px);
  z-index:       200;
  box-sizing:    border-box;
  background:    var(--color-bg);
  overflow:      hidden;
  padding:       var(--page-margin);
  visibility:    hidden;
}

#project-desc-box.is-visible {
  visibility: visible;
}

#project-desc-box.is-animating {
  transition: top 0.5s cubic-bezier(0.77,0,0.175,1);
}

#project-desc-text {
  font-family: var(--font-main);
  font-size: var(--size-base);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-text);
}

/* ============================================================
   INDEX — PROJECT LIST
   ============================================================ */
.project-list {
  position: absolute;
  bottom: 15px;
  left: 15px;
  width: calc(var(--proj-split, 50%) - var(--page-margin));
  z-index: 10;
}

.project-list__name,
.project-list__category,
.project-list__year {
  padding: var(--page-margin);
}

.project-list__year {
  text-align: left;
}

.project-list__category,
.project-list__year {
  white-space: nowrap;
}

.project-list__item {
  display: grid;
  grid-template-columns: 1fr var(--col-cat, max-content) var(--col-year, max-content);
  align-items: stretch;
  overflow: hidden;
}

.project-list__item a {
  display: contents;
}

.project-list__item:hover .project-list__name,
.project-list__item:hover .project-list__category,
.project-list__item:hover .project-list__year {
  background-color: var(--color-text);
  color: var(--color-bg);
}


.project-list__name,
.project-list__category,
.project-list__year {
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-list__name {
  font-size: var(--size-base);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-content: flex-start;
  align-items: flex-start;
  padding-left: var(--page-margin);
  min-width: 0;
}

.project-list__category {
  font-size: var(--size-sm);
  justify-content: flex-start;
  padding-left: var(--page-margin);
}

.project-list__year {
  font-size: var(--size-sm);
  justify-content: flex-start;
  padding-left: var(--page-margin);
}

/* ============================================================
   ARQUIVO — FULL-WIDTH LIST LAYOUT
   ============================================================ */
body.arquivo {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.arquivo .arquivo-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
}

.arquivo-list {
  width: 100%;
}

.arquivo-list__item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  border-top: 1px solid #06070E;
  margin: 0 var(--page-margin);
}

.arquivo-list__item:last-child {
  border-bottom: 1px solid #06070E;
}

.arquivo-list__item a {
  display: contents;
}

.arquivo-list__item:hover .arquivo-list__name,
.arquivo-list__item:hover .arquivo-list__client,
.arquivo-list__item:hover .arquivo-list__category,
.arquivo-list__item:hover .arquivo-list__year {
  background-color: var(--color-text);
  color: var(--color-bg);
}

.arquivo-list__name,
.arquivo-list__client,
.arquivo-list__category,
.arquivo-list__year {
  display: flex;
  align-items: center;
  padding: var(--page-margin);
  font-size: var(--size-base);
  font-weight: 400;
}

.arquivo-list__client,
.arquivo-list__category,
.arquivo-list__year {
  font-size: var(--size-sm);
}

.arquivo-list__name {
  justify-content: flex-start;
}

.arquivo-list__client,
.arquivo-list__category,
.arquivo-list__year {
  justify-content: flex-start;
}

body.arquivo .project-list {
  position: absolute;
  bottom: 15px;
  left: 15px;
  right: 15px;
  width: auto;
}

/* ============================================================
   PROJECT PAGE — EDITORIAL HERO
   ============================================================ */
.proj-hero {
  display: grid;
  grid-template-columns: var(--proj-split, 50%) 1fr;
  min-height: calc(100vh - var(--header-height));
}

.proj-hero__left {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-md) var(--space-md) var(--space-md) 0;
  gap: var(--space-xs);
}

.proj-hero__title {
  font-size: var(--h1);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: var(--page-margin);
}

.proj-meta-table {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 0.5px solid rgba(6,7,14,0.15);
  font-size: var(--size-sm);
  width: 100%;
  max-width: none;
}

.proj-meta-table__value {
  padding: 4px 0;
  border-bottom: 0.5px solid rgba(6,7,14,0.15);
}

.proj-hero__meta {
  font-size: var(--size-sm);
}

.proj-hero__desc {
  font-size: var(--size-sm);
  line-height: 1.2;
  max-width: 50ch;
  margin-top: var(--space-sm);
}

.proj-hero__right {
  display: flex;
  align-items: flex-start;
  padding: var(--space-md) 0 var(--space-md) var(--space-md);
}

.proj-hero__img {
  width: 100%;
  height: auto;
  display: block;
}


/* ============================================================
   PROJECT PAGE — HEADER (kept for oliveiras/mosca fixed layouts)
   ============================================================ */
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-sm) 0;
}

.project-header__title {
  font-size: var(--size-base);
  font-weight: 400;
}

.project-header__meta {
  font-size: var(--size-sm);
  text-align: right;
}

/* ============================================================
   PROJECT PAGE — DESCRIPTION ROW
   ============================================================ */
.project-description {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}

.project-description__text {
  font-size: var(--size-sm);
  line-height: 1.2;
  max-width: 55ch;
}

.project-description__credit {
  font-size: var(--size-sm);
  text-align: right;
  align-self: start;
}

/* ============================================================
   MOSCA MANIFESTO PROJETO — TOP LAYOUT (fixed text + title)
   ============================================================ */
.mosca-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  align-items: start;
}

/* invisible spacer holds the left column so images stay right */
.mosca-top__spacer {
  grid-column: 1;
  grid-row: 1;
}

.mosca-top__text {
  font-size: var(--size-sm);
  position: fixed;
  left: var(--page-margin);
  top: 50px;
  width: calc(50% - var(--page-margin) * 2);
  max-height: 85vh;
  overflow-y: auto;
  z-index: 10;
}

.mosca-top__images {
  display: flex;
  flex-direction: column;
  gap: 0;
  grid-column: 2;
  grid-row: 1;
}

.mosca-top__img img {
  width: 100%;
  height: auto;
  display: block;
}

.mosca-list {
  list-style: none;
  counter-reset: mosca-counter;
  margin-top: var(--space-sm);
}

.mosca-list li {
  counter-increment: mosca-counter;
  font-size: var(--size-sm);
  line-height: 1.2;
}

.mosca-list li::before {
  content: "(" counter(mosca-counter) ") ";
}

.mosca-list li {
  opacity: 0.3;
  transition: opacity 0.3s;
}

.mosca-list li.mosca-list--active {
  opacity: 1;
}

@media (max-width: 600px) {
  .mosca-top {
    grid-template-columns: 1fr;
  }

  .mosca-top__text {
    position: relative;
    top: 0;
  }
}

/* ============================================================
   PROJECT PAGE — EDITORIAL STICKY (text fixed at bottom, slides right)
   ============================================================ */
.proj-editorial {
  display: grid;
  grid-template-columns: 50% 50%;
}

.proj-editorial__spacer {
}

.proj-editorial__text {
  position: fixed;
  left: var(--page-margin);
  bottom: var(--page-margin);
  width: calc(50% - var(--page-margin) * 2);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.proj-editorial__slides {
  padding-left: 0;
}

/* ============================================================
   PROJECT PAGE — IMAGE GRID
   ============================================================ */
.spread-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: var(--space-md) 0;
  border-top: var(--divider);
}

.spread-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

.spread-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

.spread-grid__item {
  overflow: hidden;
  background-color: var(--color-bg);
}

.spread-grid__item img {
  width: 100%;
  height: auto;
  display: block;
}

/* spread that spans full width */
.spread-grid__item--full {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 7;
}

/* ============================================================
   PROJECT PAGE — NUMBERED ITEM LIST (Mosca Manifesto)
   ============================================================ */
.project-items {
  padding: var(--space-md) 0;
}

.project-items__intro {
  font-size: var(--size-sm);
  margin-bottom: var(--space-sm);
  max-width: 60ch;
}

.project-items ol {
  padding-left: 0;
  list-style: none;
  counter-reset: item-counter;
}

.project-items li {
  counter-increment: item-counter;
  font-size: var(--size-sm);
  line-height: 1.2;
}

.project-items li::before {
  content: "(" counter(item-counter) ") ";
}

/* ============================================================
   AS OLIVEIRINHAS — fixed image swap on scroll
   ============================================================ */
.oliveiras-page {
  padding-top: 0;
  padding-bottom: 0;
}

.oliveiras-layout {
  display: grid;
  grid-template-columns: 50% 50%;
}

.oliveiras-left {
  grid-column: 1;
}

.oliveiras-text {
  position: fixed;
  left: var(--page-margin);
  top: 60px;
  width: calc(50% - var(--page-margin) * 2);
  z-index: 10;
  font-size: var(--size-sm);
}

.oliveiras-right {
  grid-column: 2;
  position: relative;
}

.oliveiras-slide {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: flex-start;
}

.oliveiras-slide img {
  width: 100%;
  height: 100vh;
  object-fit: contain;
  object-position: top center;
  display: block;
}

@media (max-width: 600px) {
  .oliveiras-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .oliveiras-text {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--page-margin) 0;
  }
  .oliveiras-right {
    grid-column: 1;
  }
  .oliveiras-fixed-imgs {
    position: relative;
    top: 0;
    right: 0;
    width: 100%;
  }
  .oliveiras-img {
    position: relative;
    opacity: 1;
    max-height: none;
  }
  .oliveiras-zone {
    display: none;
  }
}

/* ============================================================
   INFO PAGE
   ============================================================ */
.info-layout {
  display: block;
  max-width: 50%;
  padding: var(--space-md) 0;
}

.info-bio {
  font-size: var(--size-sm);
  line-height: 1.5;
  text-wrap: pretty;
}

.info-contact {
  padding: var(--space-md) 0;
  margin-top: var(--space-md);
}

.info-contact__intro {
  font-size: var(--size-sm);
  margin-bottom: var(--space-md);
}

.info-contact__links {
  display: flex;
  flex-direction: column;
}

.info-contact__links a {
  display: grid;
  grid-template-columns: 5em 1fr;
  font-size: var(--size-sm);
  gap: var(--space-sm);
}

.info-contact__links a span:first-child {
  color: var(--color-text);
}

.info-contact__links a span:last-child {
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ============================================================
   CV PAGE
   ============================================================ */
.cv-layout {
  display: flex;
  justify-content: center;
  padding: var(--space-xl) 0;
}

.cv-scan {
  width: 100%;
  max-width: 680px;
  border: none;
  display: block;
}

/* ============================================================
   HOVER PREVIEW (desktop)
   ============================================================ */
#hover-preview {
  position: fixed;
  top: calc(var(--header-height) + 15px);
  bottom: 15px;
  left: calc(var(--proj-split, 50%) + var(--page-margin) + 1px + 15px);
  right: 15px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  z-index: 150;
  display: none;
  pointer-events: none;
}

#hover-preview.is-visible {
  display: block;
}

@media (max-width: 600px) {
  #hover-preview { display: none !important; }
}

/* ============================================================
   MOBILE IMAGE STRIP
   ============================================================ */
#mobile-image-strip {
  position: fixed;
  display: none;
  overflow-x: scroll;
  overflow-y: hidden;
  z-index: 210;
  background: var(--color-bg);
  padding: var(--page-margin);
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#mobile-image-strip::-webkit-scrollbar {
  display: none;
}

#mobile-image-strip.is-visible {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: var(--page-margin);
  animation: strip-slide-up 0.5s cubic-bezier(0.77,0,0.175,1) both;
}

@keyframes strip-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

#mobile-image-strip img {
  height: 100%;
  width: auto;
  object-fit: contain;
  object-position: top left;
  flex-shrink: 0;
}

/* ============================================================
   MOBILE LIGHTBOX
   ============================================================ */
#mobile-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(6, 7, 14, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
  padding: var(--page-margin);
  box-sizing: border-box;
}

#mobile-lightbox.is-open {
  display: flex;
}

#mobile-lightbox-close {
  position: fixed;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 510;
  font-family: var(--font-main);
}

#mobile-lightbox-desc {
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: var(--page-margin);
  white-space: pre-wrap;
}

#mobile-lightbox-images {
  display: flex;
  flex-direction: column;
  gap: var(--page-margin);
}

#mobile-lightbox-images img {
  width: 100%;
  height: auto;
  display: block;
  touch-action: pinch-zoom;
}

/* ============================================================
   RESPONSIVE — Mobile  ≤ 600px
   ============================================================ */
@media (max-width: 600px) {
  .site-header__logo {
    padding-top: var(--page-margin);
    padding-bottom: var(--page-margin);
  }

  #project-desc-box {
    overflow: hidden;
  }

  #project-desc-text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
  }

  .arquivo-list__item {
    grid-template-columns: 1fr max-content;
  }

  .arquivo-list__client,
  .arquivo-list__category {
    display: none;
  }

}

@media (max-width: 600px) {
  body:has(.info-layout) {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  body:has(.info-layout) .page-content {
    flex: 1;
    position: relative;
    padding: 0;
    overflow: visible;
  }

  .info-layout {
    max-width: 100%;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }

  .info-bio {
    max-width: 100%;
    padding: var(--page-margin) var(--page-margin) 0 var(--page-margin);
    margin: 0;
  }

  .info-contact {
    padding: 0;
    margin: 0;
  }

  .info-contact__intro {
    padding: 0 var(--page-margin) 0 var(--page-margin);
    margin: 0;
  }

  /* Contact table pinned to bottom */
  .info-contact__links {
    position: absolute;
    bottom: var(--page-margin);
    left: var(--page-margin);
    right: var(--page-margin);
    border: var(--divider);
  }

  .info-contact__links a {
    display: grid;
    grid-template-columns: 5em 1fr;
    padding: var(--page-margin);
    border-top: var(--divider);
  }

  .info-contact__links a:first-child {
    border-top: none;
  }
}

@media (max-width: 600px) {
  /* Hide image panel — no room */
  #project-panel,
  #project-panel-divider {
    display: none;
  }

  /* Project list: full width, no side margins, names only */
  .project-list {
    width: 100%;
    left: 0;
    right: 0;
    bottom: 0;
  }

  body.arquivo .project-list {
    left: 0;
    right: 0;
  }

  .project-list__item,
  .table-row-proxy .project-list__item {
    grid-template-columns: 1fr max-content;
  }

  .project-list__category,
  .table-row-proxy .project-list__category {
    display: none;
  }

  .project-list__year,
  .table-row-proxy .project-list__year {
    display: flex;
  }

  .project-list__name,
  .table-row-proxy .project-list__name {
    padding: 10px var(--page-margin);
  }

  #table-rail-bottom {
    left: 0;
    width: 100%;
  }

  .home-gif {
    right: 0;
  }
}

