@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

:root {
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-caption: "Inter", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  --base-size: 13px;
  --viewport-height: 100vh;
  --min-viewport-height: 100vh;
  --mobile-scale: 1;
  font-size: var(--base-size);
  -webkit-text-size-adjust: none;
  touch-action: manipulation;
}

@supports (height: 100svh) {
  html {
    --viewport-height: 100svh;
    --min-viewport-height: 100svh;
  }
}

html.mobile {
  font-size: calc(var(--base-size) * var(--mobile-scale));
}

body {
  margin: 0;
  padding: 0;
  min-height: var(--viewport-height);
  background-color: #fffefb;
  color: rgba(28, 28, 28, 0.85);
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.125;
  letter-spacing: 0;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

a:active {
  opacity: 0.7;
}

hr {
  background: rgba(0, 0, 0, 0.25);
  border: 0;
  height: 1px;
  display: block;
  margin-top: 0.7rem;
  margin-bottom: 0.7rem;
}

.caption {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.45);
  font-family: var(--font-caption);
  font-style: normal;
  line-height: 1.125;
  letter-spacing: 0;
  display: block;
  font-variation-settings: "slnt" 0, "MONO" 0;
}

.caption a {
  color: rgba(0, 0, 0, 0.75);
  text-decoration: none;
}

/* ——— Shell ——— */

.site {
  position: relative;
  min-height: var(--viewport-height);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;
  padding: 1rem;
  pointer-events: none;
}

.top-nav-inner {
  display: grid;
  grid-template-columns: 3fr 9fr;
  gap: 1rem;
  align-items: start;
  pointer-events: auto;
  font-size: 1.1rem;
}

.brand {
  justify-self: start;
  font-weight: 500;
  letter-spacing: 0;
}

.nav-links {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.nav-links a {
  color: rgba(28, 28, 28, 0.85);
  font-weight: 500;
}

.nav-links a.active {
  color: rgba(0, 0, 0, 0.4);
}

.nav-links a + a {
  margin-left: 0.55em;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 400;
  padding: 1rem;
  pointer-events: none;
}

.bottom-nav-inner {
  display: flex;
  justify-content: flex-end;
}

.digital-clock {
  font-size: calc(1.1rem * 0.82);
  pointer-events: auto;
  font-variant-numeric: tabular-nums;
}

/* ——— Main views ——— */

.view {
  display: none;
  flex: 1;
  min-height: var(--viewport-height);
}

.view.is-active {
  display: flex;
  flex-direction: column;
}

/* ——— Selected slideshow ——— */

.view-selected {
  align-items: center;
  justify-content: flex-start;
  padding: 8.33rem 1rem 1rem;
}

.slideshow {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  cursor: default;
}

.slideshow-stage {
  position: relative;
  width: 100%;
  height: calc(50rem + 1.6rem);
  display: flex;
  justify-content: center;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  pointer-events: none;
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.slide .media {
  display: block;
  height: 50rem;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

.slide-caption {
  margin-top: 0.7em;
  text-align: center;
  width: 100%;
}

.slideshow-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slideshow-nav:hover {
  color: rgba(0, 0, 0, 0.65);
}

.slideshow-nav.prev {
  left: 0;
}

.slideshow-nav.next {
  right: 0;
}

.slideshow-nav svg {
  width: 10px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
}

.slideshow-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20%;
  max-width: 120px;
  z-index: 4;
  cursor: pointer;
}

.slideshow-hit.left {
  left: 0;
  cursor: w-resize;
}

.slideshow-hit.right {
  right: 0;
  cursor: e-resize;
}

/* ——— Parts + Digitals slideshows (mirror Selected) ——— */

.view-parts,
.view-digitals {
  align-items: center;
  justify-content: flex-start;
  padding: 8.33rem 1rem 1rem;
}

.placeholder {
  background-color: #ecebe6;
  color: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-caption);
  font-size: 0.85rem;
}

/* ——— Information overlay ——— */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.overlay.is-open {
  display: flex;
  opacity: 1;
}

.overlay.is-closing {
  display: flex;
  opacity: 0;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
}

.overlay-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: var(--viewport-height);
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(1.03rem);
  -webkit-backdrop-filter: blur(1.03rem);
  overflow: auto;
}

.info-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1em;
  font-size: 1.1rem;
}

.info-header > div:first-child {
  letter-spacing: 0;
  font-weight: 500;
}

.info-header .close-link {
  text-align: right;
}

.info-columns {
  display: grid;
  grid-template-columns: 6fr 3fr 3fr;
  gap: 1.4rem;
  align-items: start;
}

.info-col {
  min-width: 0;
}

.info-col .caption {
  margin-bottom: 0;
}

.info-body {
  font-size: 1.1rem;
  line-height: 1.125;
  color: rgba(28, 28, 28, 0.85);
}

.info-body a {
  color: inherit;
  text-decoration: underline;
}

.info-body a.muted {
  color: rgba(132, 132, 132, 0.85);
}

.info-lower {
  display: grid;
  grid-template-columns: 6fr 3fr 3fr;
  gap: 1.4rem;
  margin-top: 1.4rem;
  align-items: start;
}

/* ——— Example project overlay ——— */

.project-overlay .overlay-panel {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0.8rem;
  pointer-events: none;
}

.project-card {
  pointer-events: auto;
  width: min(33.33%, 28rem);
  max-width: 100%;
  padding: 0.8rem;
  background-color: rgba(255, 255, 255, 0.75);
  border: 0.1rem solid rgba(0, 0, 0, 0.15);
  border-radius: 0.2rem;
  box-shadow: 0 0.4rem 4rem -1rem rgba(0, 0, 0, 0.25);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.5em;
}

.project-slides {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 1.5em;
}

.project-slides > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  cursor: pointer;
}

.project-slides > .is-active {
  opacity: 1;
}

/* ——— Mobile ——— */

@media (max-width: 800px) {
  html {
    --mobile-scale: 1.5;
  }

  .top-nav-inner {
    grid-template-columns: 1fr 1fr;
  }

  /* Lock content to the small viewport so it stays centered when chrome expands */
  .view-selected,
  .view-parts,
  .view-digitals {
    justify-content: center;
    padding: 1rem;
    min-height: var(--min-viewport-height);
    height: var(--min-viewport-height);
  }

  .info-columns,
  .info-lower {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-card {
    width: 100%;
  }

  .slideshow-hit {
    max-width: 80px;
  }
}
