:root {
  --bg: #fbfbfa;
  --fg: #1c1c1c;
  --muted: #6f6f6f;
  --line: #e6e6e3;
  --gap: clamp(20px, 2.6vw, 36px);
  --pad: clamp(20px, 5.5vw, 96px);
  --max: 1280px;
  font-family: "Futura", "Century Gothic", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.6; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.site-header, main, .site-footer {
  max-width: calc(var(--max) + 2 * var(--pad));
  margin: 0 auto;
  padding-left: var(--pad); padding-right: var(--pad);
}

/* Header: big uppercase name, small spaced-out menu */
.site-header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  padding-top: 56px; padding-bottom: 56px;
}
.site-name {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; text-decoration: none;
}
.site-header nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); }
.site-header nav a {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .14em;
  text-decoration: none; color: var(--muted);
}
.site-header nav a:hover { color: var(--fg); }
.lang { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-size: .72rem; color: var(--line); }
.lang button {
  background: none; border: 0; padding: 2px; cursor: pointer; font: inherit; font-size: .72rem;
  letter-spacing: .14em; color: var(--muted);
}
.lang button[aria-pressed="true"] { color: var(--fg); font-weight: 600; }
.lang button:hover { color: var(--fg); }

/* Open project: images left, text right (sticky) */
.project {
  display: grid; grid-template-columns: 2.1fr 1fr; gap: calc(var(--gap) * 1.3);
  margin-bottom: 96px;
  animation: fade .4s ease;
}
.project[hidden] { display: none; }
.project-images { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.project-images img { width: 100%; background: var(--line); }
.project-text { position: sticky; top: 32px; align-self: start; }
.project-title {
  margin: 0 0 14px; font-size: 1.35rem; font-weight: 400;
  text-transform: uppercase; letter-spacing: .06em; line-height: 1.3;
}
.project-meta { margin: 0 0 22px; font-size: .82rem; font-weight: 600; }
.project-description p { margin: 0 0 1.1em; font-size: .9rem; color: #4a4a4a; line-height: 1.85; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Project grid: square thumbnails, small uppercase centred captions */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: calc(var(--gap) * 1.2) var(--gap);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tile a { display: block; text-decoration: none; }
.tile a:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
.tile .thumb { aspect-ratio: 1 / 1; overflow: hidden; background: var(--line); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s ease; }
.tile a:hover img { opacity: .85; }
.tile .title {
  display: block; margin-top: 14px; text-align: center;
  font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: #3a3a3a;
}

.contact { max-width: 620px; margin-top: 140px; }
.about { margin-top: 0; animation: fade .4s ease; }
.about[hidden] { display: none; }
.about-body { max-width: 620px; }
.about-body.has-photo {
  max-width: none; display: grid; gap: calc(var(--gap) * 1.3); align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
}
.about-photo { margin: 0; }
.about-photo[hidden] { display: none; }
.about-photo img { width: 100%; background: var(--line); }
.about-body.has-photo #about-text { max-width: 620px; }
.about h2, .contact h2 {
  font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 14px;
}
.about p, .contact p { font-size: .92rem; color: #4a4a4a; }
.contact h2 a { text-decoration: none; }
.contact h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.contact-page p { font-size: 1.05rem; }

/* Rich text written in the editor (bio and project descriptions) */
.project-description, #about-text { color: #4a4a4a; }
.project-description :is(ul, ol), #about-text :is(ul, ol) { margin: 0 0 1.1em; padding-left: 1.3em; font-size: .9rem; line-height: 1.85; }
#about-text :is(ul, ol) { font-size: .92rem; line-height: 1.6; }
.project-description h3, #about-text h3, .project-description h4, #about-text h4 {
  margin: 1.4em 0 .5em; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--fg);
}
.project-description blockquote, #about-text blockquote {
  margin: 0 0 1.1em; padding-left: 1em; border-left: 2px solid var(--line); font-style: italic;
}
.project-description blockquote, #about-text blockquote { font-size: .9rem; line-height: 1.85; }
.project-description strong, #about-text strong { font-weight: 700; color: var(--fg); }
.project-description a, #about-text a { text-underline-offset: 3px; }
.project-description a:hover, #about-text a:hover { color: var(--muted); }
.site-footer { padding-top: 96px; padding-bottom: 40px; color: var(--muted); font-size: .78rem; }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project { grid-template-columns: 1fr; }
  .project-text { position: static; order: -1; }
  .about-body.has-photo { grid-template-columns: 1fr; }
  .about-photo { max-width: 420px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .site-header { padding-top: 32px; padding-bottom: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .project, .about { animation: none; }
}
