@font-face {
  font-family: 'TiemposFine';
  src: url('../assets/fonts/TiemposFine-RegularItalic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: block;
}
@font-face {
  font-family: 'SuisseIntl';
  src: url('../assets/fonts/SuisseIntl-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

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

/* Visually hidden — readable by screen readers and search engines,
   invisible to sighted users. Safe alternative to display:none for SEO. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Scrollbar hidden — infinite teleport trick handles scroll bounds */
html, body { scrollbar-width: none; }
::-webkit-scrollbar { display: none; }

html, body {
  height: 100%;
  overflow: hidden;     /* no page scroll — orbit is driven by wheel events */
  overscroll-behavior: none;
}
body {
  background: #010101;
  font-family: 'SuisseIntl', sans-serif;
  color: #fff;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* ── Fixed scene ─────────────────────────────────── */
#scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}



/* ── Brand (top-center) ──────────────────────────────── */
#brand {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  pointer-events: none;
}
.brand-logo {
  height: 22px;
  width: auto;
  opacity: 0.82;
}

/* ── Corner nav links ─────────────────────────────── */
.corner-nav {
  position: absolute;
  top: 42px;
  z-index: 600;
  font-family: 'SuisseIntl', sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  transition: color 0.25s ease;
  cursor: pointer;
}
.corner-nav:hover { color: rgba(255,255,255,0.55); }
#nav-contact { left: 32px; }
#nav-about   { right: 32px; }

/* ── Orbit anchor (positioned by JS) ─────────────── */
#orbit-anchor {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 0;
  pointer-events: none;
}

/* ── Card slot: owns position in orbit ───────────── */
.card-slot {
  position: absolute;
  pointer-events: none;
}

/* ── Card: owns 3-D rotation ──────────────────────── */
.card {
  width: 100%;
  height: 100%;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
}

/* Card image fill */
.card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  display: block;
}

/* Specular highlight: soft white bloom near top-left */
.card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 28% 22%, rgba(255,255,255,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 78%, rgba(0,0,0,0.18) 0%, transparent 45%);
  border-radius: 20px;
}

/* Outer border: inset shadow so it sits above the image without covering it */
.card-border {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.14),
    inset 0 1px 0   rgba(255,255,255,0.22);
  pointer-events: none;
  z-index: 2;
}

/* ── Bottom label ─────────────────────────────────── */
#bottom-label {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  pointer-events: none;
  text-align: center;
  width: max-content;
  max-width: 50vw;
  visibility: hidden; /* JS removes this once the intro reveals the label */
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bl-eyebrow {
  display: none;
}
.bl-name {
  font-family: 'SuisseIntl', sans-serif;
  font-size: 20px;
  font-weight: 400;
  font-style: normal;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0;
  line-height: 1.2;
  transition: opacity 0.3s ease;
  margin-bottom: 8px;
}
.bl-name.fade { opacity: 0; }
.bl-headline {
  font-family: 'SuisseIntl', sans-serif;
  font-size: 64px;
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.01em;
  line-height: 1.1; /* ≥1 keeps mask containers tall enough for descenders */
  color: rgba(255,255,255,0.92);
  margin-bottom: 24px;
  transition: opacity 0.3s ease;
}
.bl-headline em {
  font-family: 'TiemposFine', serif;
  font-style: italic;
  font-weight: 400;
}
.bl-headline.fade { opacity: 0; }
.bl-readmore {
  --rm-underline: 0; /* animated by JS: 0→1 after text reveals */
  display: inline-flex;
  align-items: center;
  column-gap: 0.28em; /* re-adds word spacing lost when SplitText makes words into flex children */
  position: relative;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  color: rgba(255,255,255,0.92);
  pointer-events: auto;
  cursor: pointer;
}
.bl-readmore::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.35);
  transform: scaleX(var(--rm-underline));
  transform-origin: left center;
  transition: background 0.25s ease;
}
.bl-readmore:hover::after { background: rgba(255,255,255,0.92); }
.bl-readmore-arrow { display: none; }

/* ── Modal overlay ────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
#modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Project modal ────────────────────────────────── */
#project-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 100px));
  width: 656px;
  max-height: calc(100vh - 80px);
  background: #19191a;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
#project-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

/* ── Modal header (sticky) ────────────────────────── */
#modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px;
  background: #19191a;
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
}
#modal-title {
  font-family: 'SuisseIntl', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: #e3e3e6;
  letter-spacing: 0;
}
#modal-close {
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  transition: opacity 0.2s ease;
}
#modal-close:hover { opacity: 1; }
#modal-close svg {
  width: 14px;
  height: 14px;
}

/* ── Modal scrollable body ────────────────────────── */
#modal-body {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: none;
}
#modal-body::-webkit-scrollbar { display: none; }

/* ── Modal content sections ───────────────────────── */
.m-headline {
  font-family: 'TiemposFine', serif;
  font-size: 40px;
  font-weight: 400;
  font-style: italic;
  color: #e3e3e6;
  letter-spacing: -0.8px;
  line-height: 1.1;
  padding: 0 40px 40px;
}
.m-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  background: #111;
  flex-shrink: 0;
}
/* ── Generic media wrapper (img or video) ─────────── */
.m-media-wrap {
  width: 100%;
  height: 100%;
  display: block;
}
.m-media-wrap img,
.m-media-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.m-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 40px 40px;
}
.m-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.m-label {
  font-family: 'SuisseIntl', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #e3e3e6;
  flex: 1 0 0;
  line-height: 1.2;
  padding-top: 2px;
}
.m-text {
  font-family: 'SuisseIntl', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #767676;
  width: 424px;
  flex-shrink: 0;
  line-height: 1.5;
}
.m-text p + p { margin-top: 1em; }
.m-images-2col {
  display: flex;
  gap: 32px;
}
.m-images-2col .m-media-wrap {
  flex: 1 0 0;
  min-width: 0;
  height: 340px;
  border-radius: 8px;
  overflow: hidden;
}
.m-image-full .m-media-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
}
.m-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
  padding-bottom: 4px;
}
.m-meta-label {
  font-family: 'SuisseIntl', sans-serif;
  font-size: 14px;
  color: #e3e3e6;
  flex: 1 0 0;
  line-height: 1.4;
}
.m-meta-value {
  font-family: 'SuisseIntl', sans-serif;
  font-size: 16px;
  color: #767676;
  width: 424px;
  flex-shrink: 0;
  line-height: 1.4;
}
.m-meta-value a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Tablet modal (≤783px) ────────────────────────── */
@media (max-width: 783px) {
  #modal-header        { padding: 24px 32px; }
  .m-headline          { padding: 0 32px 32px; }
  .m-content           { padding: 24px 32px 32px; }
}

/* ── Mobile modal (≤656px — modal natural width) ─── */
@media (max-width: 656px) {
  #project-modal {
    inset: 0;
    top: 0; left: 0;
    transform: translateY(20px);
    width: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  #project-modal.open {
    transform: translateY(0);
  }
  #modal-header        { padding: 20px 16px; }
  .m-headline          { padding: 0 16px 20px; font-size: 32px; }
  .m-content           { padding: 16px 16px 32px; gap: 24px; }
  .m-row               { flex-direction: column; gap: 6px; }
  .m-text              { width: auto; flex: 1; }
  .m-meta              { flex-direction: column; gap: 4px; }
  .m-meta-value        { width: auto; flex: 1; }
  .m-images-2col       { gap: 8px; }
  .m-images-2col .m-media-wrap { height: calc((100vw - 48px) / 2 * 340 / 272); }
}


/* ══════════════════════════════════════════════════════
   CONTACT MODAL
   ══════════════════════════════════════════════════════ */
#contact-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 100px));
  width: 656px;
  max-height: calc(100vh - 80px);
  background: #19191a;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
#contact-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

/* ── Contact header ───────────────────────────────── */
#contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 40px;
  background: #19191a;
  flex-shrink: 0;
}
#contact-title {
  font-family: 'SuisseIntl', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: #e3e3e6;
  line-height: 1.2;
}
#contact-close {
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  transition: opacity 0.2s ease;
}
#contact-close:hover { opacity: 1; }
#contact-close svg   { width: 14px; height: 14px; }

/* ── Contact scrollable body ──────────────────────── */
#contact-body {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: none;
  padding: 8px 40px 40px;
}
#contact-body::-webkit-scrollbar { display: none; }

/* ── Form layout ──────────────────────────────────── */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Field wrapper ────────────────────────────────── */
.cf-field {
  position: relative;
  background: #010101;
  border-radius: 8px;
  border: 1px solid #232323;
  height: 60px;
  cursor: text;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cf-field:focus-within {
  border-color: #e3e3e6;
}
.cf-field.cf-error {
  background: #1d0606;
  border-color: #671313;
}
.cf-field--tall {
  height: 204px;
}

/* ── Floating label ───────────────────────────────── */
.cf-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'SuisseIntl', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #5d5d5d;
  pointer-events: none;
  transition: top 0.15s ease, font-size 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
}
/* Active (focused) or filled — label floats to top */
.cf-field.cf-active   .cf-label,
.cf-field.cf-has-value .cf-label {
  top: 11px;
  font-size: 12px;
  transform: none;
}
.cf-field.cf-error .cf-label {
  color: #9a1c1c;
}
/* Tall field (textarea): uses native placeholder, hide label */
.cf-field--tall .cf-label {
  display: none;
}

/* ── Input ────────────────────────────────────────── */
.cf-input {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  background: none;
  border: none;
  outline: none;
  font-family: 'SuisseIntl', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #e3e3e6;
  width: calc(100% - 32px);
  line-height: 1.2;
  transition: color 0.15s ease;
}
.cf-input::placeholder { color: transparent; }
.cf-field.cf-error .cf-input {
  color: #da2a2a;
}

/* ── Textarea ─────────────────────────────────────── */
.cf-textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 16px;
  box-sizing: border-box;
  bottom: auto;
  top: 0;
  left: 0;
  right: 0;
  resize: none;
  overflow-y: auto;
  scrollbar-width: none;
  line-height: 1.5;
  font-size: 16px;
  color: #e3e3e6;
}
.cf-textarea::placeholder {
  color: #5d5d5d;
  font-family: 'SuisseIntl', sans-serif;
  font-size: 16px;
  line-height: 1.2;
}
.cf-textarea::-webkit-scrollbar { display: none; }

/* ── Submit button ────────────────────────────────── */
#cf-submit {
  width: 100%;
  height: 60px;
  padding: 11px 16px 12px;
  background: #e3e3e6;
  color: #010101;
  border: 1px solid #010101;
  border-radius: 8px;
  font-family: 'SuisseIntl', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  cursor: not-allowed;
  opacity: 0.4;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}
#cf-submit.cf-ready {
  opacity: 1;
  cursor: pointer;
}
#cf-submit.cf-sent {
  opacity: 1;
  cursor: default;
}
#cf-submit.cf-failed {
  background: #1d0606;
  color: #da2a2a;
  border-color: #671313;
  opacity: 1;
  cursor: default;
}

/* ── Contact tablet (≤783px) ──────────────────────── */
@media (max-width: 783px) {
  #contact-header { padding: 24px 32px; }
  #contact-body   { padding: 8px 32px 32px; }
}

/* ── Contact mobile (≤656px) ──────────────────────── */
@media (max-width: 656px) {
  #contact-modal {
    inset: 0;
    top: 0; left: 0;
    transform: translateY(20px);
    width: 100%; max-height: 100%;
    border-radius: 0;
  }
  #contact-modal.open { transform: translateY(0); }
  #contact-header     { padding: 20px 16px; }
  #contact-body       { padding: 8px 16px 32px; }
  .cf-grid            { grid-template-columns: 1fr; }
}

/* ── Mobile ───────────────────────────────────────── */
@media (max-width: 540px) {
  #brand {
    top: 24px;
  }
  .brand-logo {
    height: 20px;
  }
  .corner-nav {
    top:       24px;
    font-size: 14px;
  }
  #nav-contact { left:  24px; }
  #nav-about   { right: 24px; }
  #bottom-label {
    bottom:    48px;
    max-width: 90vw;
  }
  .bl-name {
    font-size: 18px;
  }
  .bl-headline {
    font-size:   40px;
    line-height: 1;
  }
  .bl-readmore {
    font-size: 14px;
  }
  /* Gradient veil — obscures the far-end orbit cards peeking below the text.
     Sits above the cards but behind the bottom-label (z-index 600). */
  #scene::after {
    content: '';
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 40vh;
    background: linear-gradient(to bottom, transparent 0%, #000 60%);
    z-index: 500;
    pointer-events: none;
  }
}
