/* =========================
   styles.css (FULL) — Panels + Header + Footer (always visible, mobile-safe)
   ========================= */

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

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: #000;
}

/* =========================
   Footer token (single source of truth)
   ========================= */

:root{
  --footer-h: 42px;
}

/* =========================
   Floating Header (SOLID)
   ========================= */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  z-index: 1000;

  background: #000;
  isolation: isolate;

  /* allow clicks only on header contents */
  pointer-events: none;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  z-index: -1;
}

.site-header * {
  pointer-events: auto;
}

.header-inner {
  height: 100%;
  padding: 0 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 28px;
  width: auto;
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-actions a {
  width: 28px;
  height: 28px;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-actions a:hover {
  opacity: 1;
  transform: scale(1.05);
}

.header-actions img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* =========================
   Panels Container
   ========================= */

.container {
  display: flex;
  width: 100%;

  /* Reserve space so footer is always visible */
  height: calc(100vh - var(--footer-h));
  overflow: hidden;

  background: #000;

  /* Desktop header height */
  padding-top: 64px;

  position: relative;
  z-index: 0;
}

/* Better behavior on mobile browsers with dynamic address bars */
@supports (height: 100svh){
  .container{
    height: calc(100svh - var(--footer-h));
  }
}

/* =========================
   Panels
   ========================= */

.panel {
  flex: 1;
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  text-decoration: none;
  color: #fff;
  font-size: 2rem;

  overflow: hidden;

  /* helps reduce flicker during animation */
  transform: translateZ(0);

  transition:
    flex 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Background image layer */
.panel::after {
  content: "";
  position: absolute;
  inset: 0;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  z-index: 0;
}

/* Dark overlay */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.4);

  z-index: 1;
}

.panel span {
  position: relative;
  z-index: 2;

  /* text-transform: uppercase;   optional */
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

/* =========================
   Active / Tap Logic
   ========================= */

.container.has-active .panel {
  flex: 0.9;
  transform: scale(0.985);
}

.panel.active {
  flex: 1.4;
  transform: scale(1);
}

/* =========================
   Background Images
   ========================= */

.panel-0::after { background-image: url("/images/about/portrait_destroyed.jpg"); }
.panel-1::after { background-image: url("/images/design/dv/design.jpg"); }
.panel-2::after { background-image: url("/images/directing/birch/birch-00-gross.jpg"); }
.panel-3::after { background-image: url("images/editing/plateindex.jpg"); }
.panel-4::after { background-image: url("/images/producing/boom.jpg"); }


/* =========================
   Desktop Hover (Safe)
   ========================= */

@media (hover: hover) and (pointer: fine) {
  .container:hover .panel {
    flex: 0.9;
    filter: brightness(0.85);
  }

  .container .panel:hover {
    flex: 1.4;
    filter: brightness(1);
  }
}

/* =========================
   iOS / Touch seam fix (only touch devices)
   ========================= */

@media (hover: none) and (pointer: coarse) {
  .panel {
    margin: -0.5px; /* kills hairline seams on iOS Safari */
  }
}

/* =========================
   Portrait Mobile Layout
   ========================= */

@media (max-width: 768px) and (orientation: portrait) {
  .container {
    flex-direction: column;

    /* Still reserve footer space */
    height: calc(100vh - var(--footer-h));

    /* Mobile header height */
    padding-top: 56px;
  }

  @supports (height: 100svh){
    .container{
      height: calc(100svh - var(--footer-h));
    }
  }

  .panel {
    width: 100%;
    margin: 0; /* not needed when stacked vertically */
  }

  .container.has-active .panel {
    flex: 0.85;
  }

  .panel.active {
    flex: 1.6;
  }
}

/* =========================
   Mobile Header Scaling
   ========================= */

@media (max-width: 768px) {
  .site-header {
    height: 56px;
  }

  .logo img {
    height: 24px;
  }

  .header-actions a {
    width: 24px;
    height: 24px;
  }
}


:root{
  --footer-h: 42px;
}

/* Make sure panels don't occupy footer space */
.container{
  height: calc(100vh - var(--footer-h));
}
@supports (height: 100svh){
  .container{ height: calc(100svh - var(--footer-h)); }
}

/* Footer always visible */
.site-footer{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  /* iPhone safe area */
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(var(--footer-h) + env(safe-area-inset-bottom));

  width: 100%;
  background: #000;
  border-top: 1px solid rgba(255,255,255,0.12);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 2147483647;
  isolation: isolate;

  /* crucial: don’t set transform on fixed element by default */
  transform: none;
  opacity: 1;
  visibility: visible;
}

.footer-inner{
  font-family: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.12em;
}

/* Reserve bottom space (optional) */
body{
  padding-bottom: calc(var(--footer-h) + env(safe-area-inset-bottom));
}

/* =========================================================
   EDGE-SAFE THUMBNAILS (Project section thumbs + Gallery)
   Paste at END of page_wrap.css
   ========================================================= */

/* Ensure the thumbs container is actually laid out */
.thumbs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: 12px;          /* older Edge likes grid-gap */
  gap: 12px;               /* modern browsers */
  align-content: start;
}

/* Some layouts wrap thumbs-grid inside a flex column/row.
   min-width:0 prevents grid items from collapsing weirdly. */
.thumbs-side,
.info-row,
.copy-wide {
  min-width: 0;
}

/* Normalize the button so Edge doesn't apply odd default styles */
.thumb {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;

  /* IMPORTANT: give it a real box so the img can't collapse */
  display: block;
  width: 100%;

  /* rounding + clipping */
  border-radius: 18px;
  overflow: hidden;

  /* Create a square tile WITHOUT aspect-ratio */
  position: relative;
}

/* Square sizing hack (works everywhere) */
.thumb::before {
  content: "";
  display: block;
  padding-top: 100%;
}

/* Make the image fill the tile */
.thumb > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* If you have a "6 thumb" layout, keep it 3x2 */
.thumbs-grid-6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* OPTIONAL: if you want slightly tighter thumbs in the project blocks */
.project-block .thumbs-grid {
  grid-gap: 10px;
  gap: 10px;
}

/* =========================
   Panel Section Titles – DM Serif Display
   ========================= */

.panel span{
  font-family: 'DM Serif Display', serif;
  font-weight: 400;        /* DM Serif looks best at normal weight */
  letter-spacing: 0.02em;  /* subtle polish */
}

.panel span{
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

/* Force panel titles to DM Serif */
.panel span{
  font-family: "DM Serif Display", serif !important;
  font-weight: 400;
  letter-spacing: 0.02em;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.05;
}

/* iPhone Landscape – reduce panel text by 25% */
@media only screen 
  and (min-device-width: 375px) 
  and (max-device-width: 932px) 
  and (orientation: landscape) 
  and (-webkit-min-device-pixel-ratio: 2) {

  .panel span {
    font-size: 75%;
  }

}
