* {
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family-sans);
  font-size: 1.25rem;
  line-height: var(--line-height);
  color: var(--color-black);
  background-color: #f5f5f5;
}

img {
  width: 100%;
  height: auto;
  vertical-align: middle;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
  padding: var(--spacing-m);
  max-width: 1400px;
  margin: 0 auto;
  line-height: 1.4;
}
summary,
strong {
  font-weight: 600;
}
main {
  margin-top: var(--spacing-xl);
}

/* RESETS */

li {
  list-style: none;
}
a {
  color: currentColor;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}
button {
  font: inherit;
  background: none;
  border: 0;
  color: currentColor;
}
button:not(:disabled) {
  cursor: pointer;
}

/* HELPER CLASSES */
.color-gray-100 {
  color: var(--color-gray-100);
}
.color-gray-200 {
  color: var(--color-gray-200);
}
.color-gray-300 {
  color: var(--color-gray-300);
}
.color-gray-400 {
  color: var(--color-gray-400);
}
.color-gray-500 {
  color: var(--color-gray-500);
}
.color-gray-600 {
  color: var(--color-gray-600);
}
.color-gray-700 {
  color: var(--color-gray-700);
}
.color-gray-800 {
  color: var(--color-gray-800);
}
.color-gray-900 {
  color: var(--color-gray-900);
}

.text-xs {
  font-size: var(--text-xs);
}
.text-s {
  font-size: var(--text-s);
}
.text-m {
  font-size: var(--text-m);
}
.text-l {
  font-size: var(--text-l);
}
.text-xl {
  font-size: var(--text-xl);
}
.text-xxl {
  font-size: var(--text-xxl);
}
.text-3xl {
  font-size: var(--text-3xl);
}
.text-4xl {
  font-size: var(--text-4xl);
}
.text-5xl {
  font-size: var(--text-5xl);
}
.text-6xl {
  font-size: var(--text-6xl);
}

.stack-s > * + * {
  margin-top: var(--spacing-s);
}
.stack-m > * + * {
  margin-top: var(--spacing-m);
}

/* STANDARD COMPONENTS */

h1 {
  margin-bottom: var(--spacing-l);
  line-height: 1.3;
}

h2 {
  font-size: 1.4rem;
  margin-bottom: var(--spacing-m);
}

.text > * {
  margin-block: 0;
}
.text > * + * {
  margin-block-start: var(--spacing-s);
}
.table td,
.table th {
  text-align: start;
  padding: var(--spacing-xs);
}

.button {
  display: inline-block;
  padding: var(--spacing-s) var(--spacing-m);
  font-weight: 500;
  color: var(--color-white);
  background-color: var(--color-gray-900);
  text-decoration: none;
}
.button[disabled] {
  color: var(--color-white);
  background-color: var(--color-gray-600);
}
.button-white {
  display: inline-block;
  padding: 4px 15px 6px;
  color: var(--color-black);
  background-color: var(--color-white);
}

.error {
  color: var(--color-red);
}

.global-message {
  display: block;
  padding: var(--spacing-m);
  text-align: center;
  color: var(--color-white);
  background-color: var(--color-black);
}


/***********
VARIABLES
***********/

:root {
  --spacing-xs: 0.25rem;
  --spacing-s: 0.5rem;
  --spacing-m: 1rem;
  --spacing-l: 1.5rem;
  --spacing-xl: 2rem;
  --color-black: #000;
  --color-white: #fff;
  --color-gray-100: #f7f1f7;
  --color-gray-200: #efe9ef;
  --color-gray-300: #ddd8dd;
  --color-gray-400: #ccc7cc;
  --color-gray-500: #999499;
  --color-gray-600: #777277;
  --color-gray-700: #595359;
  --color-gray-800: #3e383e;
  --color-gray-900: #292329;
  --color-red: #cc1111;

  --text-xs: 0.75rem;
  --text-s: 0.875rem;
  --text-m: 1rem;
  --text-l: 1.125rem;
  --text-xl: 1.25rem;
  --text-xxl: 1.5rem;
  --text-3xl: 1.75rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3rem;
  --text-6xl: 4rem;

  --line-height: 1.2;

  --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-family-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

/***********
GRID
***********/

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-l);
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(12, 1fr);
  }

  .grid > [data-width="1/1"],
  .grid > [data-width="12/12"],
  .grid > [data-width="2/2"],
  .grid > [data-width="3/3"],
  .grid > [data-width="4/4"],
  .grid > [data-width="6/6"] {
    grid-column-start: span 12;
  }

  .grid > [data-width="11/12"] {
    grid-column-start: span 11;
  }

  .grid > [data-width="10/12"],
  .grid > [data-width="5/6"] {
    grid-column-start: span 10;
  }

  .grid > [data-width="3/4"],
  .grid > [data-width="9/12"] {
    grid-column-start: span 9;
  }

  .grid > [data-width="2/3"],
  .grid > [data-width="4/6"],
  .grid > [data-width="8/12"] {
    grid-column-start: span 8;
  }

  .grid > [data-width="7/12"] {
    grid-column-start: span 7;
  }

  .grid > [data-width="1/2"],
  .grid > [data-width="2/4"],
  .grid > [data-width="3/6"],
  .grid > [data-width="6/12"] {
    grid-column-start: span 6;
  }

  .grid > [data-width="5/12"] {
    grid-column-start: span 5;
  }

  .grid > [data-width="1/3"],
  .grid > [data-width="2/6"],
  .grid > [data-width="4/12"] {
    grid-column-start: span 4;
  }

  .grid > [data-width="1/4"],
  .grid > [data-width="3/12"] {
    grid-column-start: span 3;
  }

  .grid > [data-width="1/6"],
  .grid > [data-width="2/12"] {
    grid-column-start: span 2;
  }

  .grid > [data-width="1/12"] {
    grid-column-start: span 1;
  }
}

/***********
HEADER
***********/

.header {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto auto;
  justify-content: space-between;
  align-items: end;
  margin-block-start: calc(var(--spacing-m) * -1);
  margin-inline: calc(var(--spacing-m) * -1);
}
.header a,
.header summary {
  text-decoration: none;
}

.header-nav {
  position: relative;
  display: flex;
  grid-column-end: span 2;
  justify-self: stretch;
}
.header-nav::before {
  content: '';
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 0;
  border-top: 2px solid var(--color-black);
}
.header-nav a {
  margin: 0 .5rem .1rem;
  padding: .5rem 0 .4rem;
}

.header-nav a:first-of-type {
  margin-left: 1rem;
}

.header-nav a.is-active {
  background-color: #fff;
  border-bottom: 2px solid black
}
.header-nav a.is-open:not(.is-active) { background-color: #fff; border-bottom: 2px solid black}

.logo {
  grid-row-end: span 2;
  align-self: end;
  font-weight: 600;
  text-decoration: none;
  padding: 1rem;
}

.lang-switch {
  display: flex;
  color: var(--color-gray-600);
  justify-self: end;
}
.lang-switch {
  padding: 0 0.5rem;
}
.lang-switch a {
  padding: 0.5rem;
}


/***********
FOOTER
***********/

.footer {
  margin-top: auto;
}

.footer::before {
  content: '';
  display: block;
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-m);
  border-top: 2px solid var(--color-black);
}

.footer .text {
  font-size: var(--text-xs);
}

/***********
HOME
***********/

.pan-img {
  overflow-x: hidden;
  overflow-y: visible;
  width: 100%;
}
.pan-img .pan-track {
  display: block;       /* no animation by default */
  transform: translateX(0);
}
.pan-img img {
  width: 100%;
  height: auto;
  display: block;
}
.pan-img img + img {
  display: none;
}

/* Mobile portrait only: seamless left→right loop with ~50% visible */
@media (max-width: 640px) and (orientation: portrait) {
  .pan-img .pan-track {
    display: flex;
    will-change: transform;
    animation: pan-ltr 7s linear infinite;
  }
  /* Each slide is 250% wide → only half visible at a time */
  .pan-img img {
    flex: 0 0 250%;
    width: 250%;
  }
  .pan-img img + img {
    display: block;     /* show the duplicate for seamless tiling */
  }

  @keyframes pan-ltr {
    from { transform: translateX(-250%); }  /* start on the second slide */
    to   { transform: translateX(0); }      /* move one full slide to loop */
  }

  @media (prefers-reduced-motion: reduce) {
    .pan-img .pan-track { animation: none; transform: none; }
  }
}


/***********
PROJECTS
***********/


.projects h2 {
  font-size: var(--text-s);
  font-weight: bold;
  text-decoration: none;
  margin-top: var(--spacing-s);
}

.projects.grid {
  margin-bottom: 30px;
}

.blocks .text, .gallery-block, .video-block {
  margin-bottom: var(--spacing-xl);
}


.credits {
  margin-bottom: var(--spacing-xl);
  line-height: 1.4;
}

.blocks {
  margin-bottom: 30px;
}

.blocks p {
  margin-bottom: var(--spacing-l);
}

.blocks .text p:last-of-type {
  margin-bottom: 0;
}

.blocks figcaption p {
  margin: 5px 0 0;
  font-size: .8rem;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

figure {
  margin: 0;
}
