/* --- Reset & Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  background-color: #ffffff;
  color: #000000;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- UI Bars --- */
.top-bar, .bottom-bar {
  position: fixed;
  left: 0;
  width: 100%;
  padding: 0 0.75rem;
  z-index: 11000;
  display: flex;
  align-items: center;
  color: black;
  background-color: rgba(255 255 255 / 0.15);
}

.top-bar {
  top: env(safe-area-inset-top);
  height: 2.5rem;
  justify-content: space-between;
}

.bottom-bar {
  bottom: env(safe-area-inset-bottom);
  height: 2rem;
}

.top-bar.light-text,
.bottom-bar.light-text {
  color: white;
  background-color: rgba(0 0 0 / 0.3);
}

#info-toggle {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}

/* --- Image & Navigation --- */
#image-container {
  position: fixed;
  top: calc(2.5rem + env(safe-area-inset-top));
  bottom: calc(2rem + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#image-container img,
#image-container video {
  max-width: 100%;
  max-height: 100%;
  padding: 0 0.6rem;
  object-fit: contain;
  pointer-events: none;
}

#image-container video { pointer-events: none; }

.click-zone {
  position: fixed;
  top: calc(2.5rem + env(safe-area-inset-top));
  bottom: calc(2rem + env(safe-area-inset-bottom));
  width: 50%;
  z-index: 1000;
}

.left-zone { left: 0; cursor: w-resize; }
.right-zone { right: 0; cursor: e-resize; }

/* --- Info Panel --- */
#info-panel {
  display: none;
  position: fixed;
  top: calc(1.8rem + env(safe-area-inset-top));
  left: 0;
  width: 100vw;
  height: calc(100vh - 1.8rem - env(safe-area-inset-bottom));
  background: white;
  padding: 0 0.75rem calc(3rem + env(safe-area-inset-bottom));
  z-index: 12000;
  overflow-y: auto;
  line-height: 1.2;
}

#info-text {
  padding-bottom: 2rem;
}

.intro-fullwidth {
  white-space: pre-wrap;
  margin-bottom: 0rem;
  font-size: 1em;
  padding-left: 0;
}

.three-column-layout { display: block; }
.empty-column { display: none; }
.content-column { font-size: 1em; }

.content-block { margin: 0; padding: 0; }
.indented-heading { 
  padding-left: 2em; 
  margin-bottom: 0em; 
  margin-top: 1.2em; 
}
.content-block:first-child .indented-heading { margin-top: 0; }
.fully-indented { padding-left: 2em; margin: 0; margin-top: 1.2em; }

/* --- Experience Section --- */
.experience-item {
  display: flex;
  margin-bottom: 0;
  padding-left: 0;
}

.year {
  min-width: 3.6em;
  flex-shrink: 0;
  white-space: nowrap;
}

.experience-content {
  flex: 1;
}

.experience-indent {
  display: block;
  padding-left: 0;
  margin-top: 0;
}

#info-text .experience-item:first-of-type {
  margin-top: 0;
}

/* --- Desktop layout with clamp for safe mobile --- */
@media (min-width: 900px) {
  html, body {
    font-size: clamp(14px, calc(14px + (32 - 14) * ((100vw - 900px) / (1920 - 900))), 32px);
  }

  .top-bar { top: 0; }
  .bottom-bar { bottom: 0; }
  #image-container { top: 2.5rem; bottom: 2rem; }
  .click-zone { top: 2.5rem; bottom: 2rem; }
  #info-panel { top: 1.8rem; height: calc(100vh - 1.8rem); padding-bottom: 2rem; }

  #info-text {
    max-width: 100%;
    text-align: left;
  }

  .three-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
  }

  .empty-column { display: block; }
  .content-column { font-size: calc(1em / 1.8); }
  .intro-fullwidth { font-size: 1em; padding-left: 0; }
  .indented-heading { margin-top: calc(1.8em / 1.6); }
}

/* --- Mobile adjustments --- */
@media (max-width: 767px) {
  .bottom-bar { display: flex !important; }
  .desktop-only { display: none; }
  .mobile-only { display: flex !important; }
  .top-bar .desktop-only { display: none !important; }
  .content-column { font-size: 1em; }
  
  .experience-item {
    padding-left: 0;
  }
  
  .year {
    min-width: 4em;
  }
}

/* --- Links --- */
#info-panel a {
  color: inherit;
  text-decoration: none;
}
#info-panel a:hover {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: currentColor;
}

/* --- Visibility control --- */
.mobile-only { display: none; }
.desktop-only { display: inline; }

body.info-panel-open { background-color: #ffffff !important; }
body.info-panel-open #info-panel { display: block; }
body.info-panel-open .top-bar {
  color: black !important;
  background-color: #ffffff !important;
}
body.info-panel-open .bottom-bar,
body.info-panel-open .click-zone,
body.info-panel-open #image-container { display: none; }
body.info-panel-open .top-bar .desktop-only { display: none; }

/* --- Desktop sticky footer inside info panel --- */
@media (min-width: 900px) {
  .contact-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 1rem 0.75rem 1rem 0.75rem;
    font-size: clamp(18px, calc(18px + (38 - 18) * ((100vw - 900px) / (1920 - 900))), 38px);
    letter-spacing: 0.03em;
    line-height: 1.2;
    z-index: 13000;
    text-indent: 0;
  }

  .contact-info {
    padding-bottom: 3rem;
  }
}

/* --- Mobile: normal inline flow --- */
@media (max-width: 767px) {
  .contact-footer {
    position: static;
    padding-left: 2em;
    padding-right: 0;
    padding-bottom: 0;
    background: none;
  }
}