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

:root {
  /* 0px at ≤800px wide, grows to 350px at ≥1500px */
  --side: clamp(0px, calc((100vw - 800px) / 2), 350px);
}

body {
  background: #fff;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.stage {
  clip-path: inset(0);   /* clips 3D-transformed descendants reliably */
  height: 100vh;
  margin-left: var(--side);
  margin-right: var(--side);
}

ul {
  perspective: 50vh;
  height: 100vh;
  width: 100%;
  list-style: none;
  position: relative;
}

li {
  position: absolute;
  top: 0;
  width: 100%;
  text-align: center;
  font-family: Georgia, serif;
  font-size: clamp(14px, 2.5vw, 40px);
  color: #36f;
  letter-spacing: 0.01em;
  line-height: 1.3;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  animation: corkscrew 41s linear infinite;
  animation-fill-mode: backwards;
}

li.name {
  letter-spacing: 0.05em;
}

/* Default keyframe: standard landscape */
@keyframes corkscrew {
  0%   { transform: translateY(120vh) rotateY(-60deg) rotate(-2deg); }
  100% { transform: translateY(-20vh) rotateY(60deg)  rotate(2deg);  }
}

/* ── Per-item animation delays (25 items, −32s → +18.4s, step 2.1s) ── */
li:nth-child(1)  { animation-delay: -32.0s; }
li:nth-child(2)  { animation-delay: -29.9s; }
li:nth-child(3)  { animation-delay: -27.8s; }
li:nth-child(4)  { animation-delay: -25.7s; }
li:nth-child(5)  { animation-delay: -23.6s; }
li:nth-child(6)  { animation-delay: -21.5s; }
li:nth-child(7)  { animation-delay: -19.4s; } /* li.name — Stefan Lendi */
li:nth-child(8)  { animation-delay: -17.3s; }
li:nth-child(9)  { animation-delay: -15.2s; }
li:nth-child(10) { animation-delay: -13.1s; }
li:nth-child(11) { animation-delay: -11.0s; }
li:nth-child(12) { animation-delay:  -8.9s; }
li:nth-child(13) { animation-delay:  -6.8s; }
li:nth-child(14) { animation-delay:  -4.7s; }
li:nth-child(15) { animation-delay:  -2.6s; }
li:nth-child(16) { animation-delay:  -0.5s; }
li:nth-child(17) { animation-delay:   1.6s; }
li:nth-child(18) { animation-delay:   3.7s; }
li:nth-child(19) { animation-delay:   5.8s; }
li:nth-child(20) { animation-delay:   7.9s; }
li:nth-child(21) { animation-delay:  10.0s; }
li:nth-child(22) { animation-delay:  12.1s; }
li:nth-child(23) { animation-delay:  14.2s; }
li:nth-child(24) { animation-delay:  16.3s; }
li:nth-child(25) { animation-delay:  18.4s; }

/* ── Responsive: 5 aspect-ratio breakpoints ── */

/* 1. Ultra-wide (> 2:1) */
@media (min-aspect-ratio: 2/1) {
  li { font-size: clamp(12px, 2vw, 32px); }
  @keyframes corkscrew {
    0%   { transform: translateY(130vh) rotateY(-65deg) rotate(-2deg); }
    100% { transform: translateY(-30vh) rotateY(65deg)  rotate(2deg);  }
  }
}

/* 2. Wide landscape (16:9 – 2:1) */
@media (min-aspect-ratio: 16/9) and (max-aspect-ratio: 2/1) {
  li { font-size: clamp(13px, 2.2vw, 36px); }
  @keyframes corkscrew {
    0%   { transform: translateY(125vh) rotateY(-62deg) rotate(-2deg); }
    100% { transform: translateY(-25vh) rotateY(62deg)  rotate(2deg);  }
  }
}

/* 3. Standard (4:3 – 16:9) — uses base styles above */

/* 4. Portrait (3:4 – 4:3) */
@media (min-aspect-ratio: 3/4) and (max-aspect-ratio: 4/3) {
  li { font-size: clamp(16px, 3.5vw, 52px); }
  @keyframes corkscrew {
    0%   { transform: translateY(115vh) rotateY(-55deg) rotate(-2deg); }
    100% { transform: translateY(-15vh) rotateY(55deg)  rotate(2deg);  }
  }
}

/* 5. Tall portrait (< 3:4) */
@media (max-aspect-ratio: 3/4) {
  li { font-size: clamp(18px, 4.5vw, 64px); }
  @keyframes corkscrew {
    0%   { transform: translateY(110vh) rotateY(-50deg) rotate(-2deg); }
    100% { transform: translateY(-10vh) rotateY(50deg)  rotate(2deg);  }
  }
}


.portrait {
  position: fixed;
  top: 3vh;
  left: calc(3vw + var(--side));
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.26em;
}

.portrait-name {
  font-family: Georgia, serif;
  font-size: clamp(12px, 1.04vw, 20x);
  margin-bottom: 10px;
  color: #000;
  letter-spacing: 0.02em;
  text-align: center;
  width: 100%;
}

.portrait img {
  width: clamp(52px, 7.8vw, 117px);
  height: auto;
  display: block;
}

/* ── Social icons ── */
.social-icons {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 10px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #333;
  border: none;
  cursor: pointer;
  padding: 3px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.social-icon:hover {
  background: #000;
  color: #fff;
}

.social-icon svg {
  width: 100%;
  height: 100%;
}

.social-icon[hidden] { display: none; }

/* ── Email modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay[hidden] { display: none; }

.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 32px 36px 36px;
  width: min(520px, 92vw);
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.frmtx {
  --font-size: 100%;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-color: inherit;
  --background-color: #fff;
  --border-color: #aaa;
  --border-width: 1px;
  --border-radius: 5px;
  margin: 1rem 0 0;
  min-width: 0;
}
.frmtx * { color: var(--font-color); font-family: var(--font-family); font-size: var(--font-size); margin: 0; padding: 0; appearance: auto; outline: none; box-sizing: border-box; }
.frmtx label { padding: 0; margin: 1em 0 .3em; display: block; line-height: 1.3; }
.frmtx label:first-child { margin-top: 0; }
.frmtx input, .frmtx textarea, .frmtx button { border: var(--border-width) solid var(--border-color); border-radius: var(--border-radius); background-color: var(--background-color); }
.frmtx input, .frmtx textarea { width: 100%; resize: none; padding: .5em; line-height: 1.3; }
.frmtx input[name="_gotcha"] { display: none; }
.frmtx input[type="checkbox"] { display: inline; width: 1.1em; height: 1.1em; appearance: auto; margin-right: .2em; }
.frmtx button[type="submit"] { display: block; padding: .5em 1.5em; margin: 1.5em 0 0; line-height: 1.5; font-weight: bold; cursor: pointer; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #555;
}

.modal-close:hover { color: #000; }

/* ── Portfolio section ── */
.portfolio {
  position: fixed;
  bottom: 0;
  left: var(--side);
  right: var(--side);
  z-index: 10;
  padding-bottom: 2.5vh;
  background: linear-gradient(to top, rgba(255,255,255,0.97) 60%, rgba(255,255,255,0) 100%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ptabs-pill {
  display: inline-flex;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.06);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  margin-bottom: 1.5vh;
  pointer-events: all;
  max-width: calc(100vw - 4vw);
  box-sizing: border-box;
}

.ptab {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(11px, 1vw, 16px);
  font-weight: 500;
  padding: 0.3em 0.9em;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  color: #888;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.ptab.active {
  background: #000;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  pointer-events: all;
  width: 100%;
  box-sizing: border-box;
}

.carr-btn {
  position: absolute;
  z-index: 2;
  background: none;
  border: none;
  font-size: clamp(24px, 3.5vw, 52px);
  color: #222;
  cursor: pointer;
  padding: 0 clamp(8px, 2vw, 28px);
  line-height: 1;
  user-select: none;
}

.carr-prev { left: 0; }
.carr-next { right: 0; }

.carousel-viewport {
  overflow-x: clip;
  overflow-y: visible;
  width: 100%;
  padding: clamp(30px, 5vh, 60px) clamp(32px, 7vw, 80px);
  box-sizing: border-box;
}

.carousel-track {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 24px);
  transition: transform 0.4s ease;
  will-change: transform;
}

.carr-item {
  flex: 0 0 auto;
  height: clamp(100px, 22vh, 220px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
  cursor: pointer;
  position: relative;
}

.carr-item img {
  height: 100%;
  width: auto;
  display: block;
  border-radius: 2px;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.18));
}

.portfolio-empty {
  width: 100%;
  text-align: center;
  font-family: Georgia, serif;
  color: #bbb;
  font-size: clamp(13px, 1.3vw, 20px);
  padding: 3vh 0 1vh;
  letter-spacing: 0.05em;
}

/* ── Lang toggle ── */
.lang-toggle {
  position: fixed;
  top: 3vh;
  right: calc(3vw + var(--side));
  z-index: 10;
  display: flex;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.06);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(11px, 1vw, 16px);
  padding: 0.3em 0.9em;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  color: #888;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.lang-btn.active {
  background: #000;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
