/* ============================================================
   ScrapsWorld — vanilla stylesheet, no frameworks
   Layout: 3 flex blocks filling the viewport (logo / gallery / email)
   ============================================================ */

:root {
  /* Crossfade duration; overridden at runtime by js/gallery.js from gallery.json */
  --fade-duration: 800ms;

  --color-bg: #ffffff;
  --color-text: #1f2937;
  --color-mail: #6b7280; /* simple gray for the email link */
  --color-mail-hover: #374151;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh; /* fallback */
  height: 100dvh; /* dynamic viewport height (mobile toolbars) */
  overflow: hidden; /* the page is a single fixed screen, no scrolling */
  background: var(--color-bg);
  color: var(--color-text);
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------
   Top block: logo
   ------------------------------------------------------------ */
.site-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vh, 32px) 16px;
}

.logo {
  display: block;
  width: auto;
  height: clamp(48px, 14vh, 120px);
}

/* Double the logo size on desktop (same breakpoint as big/small images) */
@media (min-width: 768px) {
  .logo {
    height: clamp(96px, 28vh, 240px);
  }
}

/* ------------------------------------------------------------
   Center block: gallery
   ------------------------------------------------------------ */
.site-main {
  flex: 1 1 auto;
  min-height: 0; /* allow the flex child to shrink below its content size */
  display: grid;
  place-items: center;
  padding: 0 0;
  container-type: size; /* enables cqw/cqh units on the gallery frame */
}

.site-main,
.site-main * {
  outline: none; /* remove the default focus outline on the main container */
}

/* Portrait 2:3 frame that always fits inside .site-main.
   Fallback (no container-query support): full height, clamped width. */
.gallery-frame {
  position: relative;
  aspect-ratio: 2 / 3;
  height: 100%;
  max-width: 100%;
  width: min(100cqw, calc(100cqh * 2 / 3)); /* exact fit where supported */
  overflow: hidden;
}

/* Two stacked <picture> layers; the visible one fades in/out. */
.gallery-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--fade-duration) ease-in-out;
}

.gallery-layer.is-visible {
  opacity: 1;
}

/* The image inside each layer fills the whole frame. */
.gallery-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------
   Bottom block: email link
   ------------------------------------------------------------ */
.site-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vh, 40px) 16px;
}

.mail-link {
  color: var(--color-mail);
  font-size: clamp(14px, 2.2vh, 18px);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 250ms ease;
}

.mail-link:hover,
.mail-link:focus-visible {
  color: var(--color-mail-hover);
}

/* Slightly smaller email text on mobile */
@media (max-width: 767px) {
  .mail-link {
    font-size: clamp(12px, 2vh, 14px);
  }
}
