/* ---------------------------------------------------------
   Quiet Institute — aibabbler studios
   One page, all video/image. Chrome floats over the hero,
   no bar above it. Everything else is full-bleed pieces.
--------------------------------------------------------- */

:root{
  --ink: #f3f1ec;
  --ink-dim: rgba(243,241,236,.66);
  --void: #08090a;
  --panel: #111214;
  --accent: #c9a24a;
  --gap: clamp(16px, 3vw, 40px);
  --edge: clamp(20px, 4vw, 56px);
  --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

*{ box-sizing: border-box; }
html{ background: var(--void); scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

img, video{ display:block; max-width:100%; }

/* ============ overlay chrome ============ */
.chrome{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap);
  padding: var(--edge) var(--edge) 0;
  pointer-events: none; /* only children re-enable */
}
.chrome:before{
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 220px;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0));
  pointer-events: none;
  z-index: -1;
}

.wordmark{
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--ink);
}
.wordmark__main{
  font-family: var(--serif);
  font-size: clamp(18px, 2.2vw, 26px);
  letter-spacing: .12em;
  font-weight: 400;
  text-shadow: 0 1px 12px rgba(0,0,0,.5);
}
.wordmark__sub{
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}

.sound{
  pointer-events: auto;
  background: transparent;
  border: 1px solid rgba(243,241,236,.4);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: .12em;
  cursor: pointer;
  backdrop-filter: blur(2px);
  transition: border-color .25s ease, background .25s ease;
}
.sound:hover{ border-color: var(--ink); background: rgba(0,0,0,.25); }
.sound__icon{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink-dim);
}
.sound[aria-pressed="true"] .sound__icon{ background: var(--accent); }

/* menu */
.menu{ pointer-events: auto; position: relative; text-align: right; }
.menu__toggle{
  background: transparent;
  border: 1px solid rgba(243,241,236,.4);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: .18em;
  cursor: pointer;
  backdrop-filter: blur(2px);
  transition: border-color .25s ease, background .25s ease;
}
.menu__toggle:hover{ border-color: var(--ink); background: rgba(0,0,0,.25); }
.menu__toggle-icon{ display:inline-flex; flex-direction:column; gap:3px; }
.menu__toggle-icon i{
  display:block; width:14px; height:1px; background: var(--ink);
  transition: transform .25s ease, opacity .25s ease;
}
.menu__toggle[aria-expanded="true"] .menu__toggle-icon i:first-child{ transform: translateY(2px) rotate(45deg); }
.menu__toggle[aria-expanded="true"] .menu__toggle-icon i:last-child{ transform: translateY(-2px) rotate(-45deg); }

.menu__panel{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  background: rgba(8,9,10,.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(243,241,236,.15);
  border-radius: 14px;
  padding: 22px 24px;
  min-width: 180px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.menu__panel.is-open{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.menu__panel a{
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: .04em;
  opacity: .85;
  transition: opacity .2s ease;
}
.menu__panel a:hover{ opacity: 1; color: var(--accent); }

/* ============ hero ============ */
.hero{
  position: relative;
  height: 100svh;
  width: 100%;
  overflow: hidden;
  background: #000;
}
.hero__video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__vignette{
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 30%),
    linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,0) 22%);
  pointer-events: none;
}
.hero__scroll{
  position: absolute;
  left: 50%;
  bottom: var(--edge);
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--ink-dim);
}
.hero__scroll:after{
  content: "";
  display: block;
  width: 1px;
  height: 34px;
  margin: 10px auto 0;
  background: linear-gradient(to bottom, var(--ink-dim), transparent);
  animation: pulse-line 2.2s ease-in-out infinite;
}
@keyframes pulse-line{
  0%, 100%{ opacity: .25; }
  50%{ opacity: 1; }
}

/* ============ showcase pieces ============ */
main{ position: relative; z-index: 1; background: var(--void); }

.piece{
  position: relative;
  width: 100%;
  min-height: 100svh;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border-top: 1px solid rgba(243,241,236,.08);
}

/* video pieces: full-bleed, caption overlaid bottom-left, ON the video */
.piece--video{ background:#000; }
.piece__video{
  width: 100%;
  height: 100%;
  min-height: 100svh;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.piece__caption{
  position: absolute;
  left: var(--edge);
  bottom: var(--edge);
  z-index: 2;
  max-width: min(520px, 78vw);
  background: linear-gradient(to top, rgba(0,0,0,.05), rgba(0,0,0,0));
}
.piece--video:before{
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
  z-index: 1;
  pointer-events: none;
}
.piece__index{
  display: inline-block;
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--accent);
  margin-bottom: 10px;
}
.piece__title{
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 3.4vw, 34px);
  margin: 0 0 8px;
  text-shadow: 0 2px 18px rgba(0,0,0,.6);
}
.piece__desc{
  margin: 0;
  font-size: clamp(13px, 1.4vw, 15px);
  line-height: 1.5;
  color: var(--ink-dim);
  text-shadow: 0 2px 14px rgba(0,0,0,.6);
}

.piece__mute{
  position: absolute;
  right: var(--edge);
  bottom: var(--edge);
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(243,241,236,.4);
  background: rgba(0,0,0,.25);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  backdrop-filter: blur(2px);
  transition: border-color .25s ease, background .25s ease, transform .2s ease;
}
.piece__mute:hover{ border-color: var(--ink); transform: scale(1.06); }
.piece__mute[aria-pressed="true"]{ color: var(--accent); border-color: var(--accent); }

/* image pieces: full-bleed slide, click/tap to turn for description */
.piece--image{ padding: 0; }
.flip{
  position: relative;
  width: 100%;
  min-height: 100svh;
  perspective: 1800px;
  cursor: pointer;
}
.flip__inner{
  position: relative;
  width: 100%;
  min-height: 100svh;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.2,.8,.2,1);
}
.flip.is-flipped .flip__inner{ transform: rotateY(180deg); }

.flip__face{
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip__face--front{ overflow: hidden; }
.flip__face--front img{
  width: 100%;
  height: 100%;
  min-height: 100svh;
  object-fit: cover;
}
.flip__face--front:after{
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 35%;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
  pointer-events: none;
}
.flip__hint{
  position: absolute;
  left: var(--edge);
  bottom: var(--edge);
  z-index: 2;
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--ink);
  border: 1px solid rgba(243,241,236,.5);
  border-radius: 999px;
  padding: 8px 16px;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(2px);
}
.piece__index--onimage{
  position: absolute;
  left: var(--edge);
  top: var(--edge);
  margin: 0;
}

.flip__face--back{
  background: var(--panel);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--edge);
}
.flip__face--back .piece__title{ text-shadow: none; }
.flip__face--back .piece__desc{
  text-shadow: none;
  max-width: 560px;
  color: var(--ink-dim);
}
.flip__face--back:before{
  content: "TURN BACK";
  position: absolute;
  right: var(--edge);
  bottom: var(--edge);
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--ink-dim);
}

/* ============ footer ============ */
.info{
  background: var(--void);
  border-top: 1px solid rgba(243,241,236,.1);
  padding: clamp(60px, 8vw, 100px) var(--edge) 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.info__row{ display: flex; flex-wrap: wrap; align-items: baseline; gap: 18px; }
.wordmark__main--footer{ font-size: clamp(20px, 3vw, 30px); }
.info p, .info a{
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: .02em;
}
.info a{ text-decoration: none; }
.info a:hover{ color: var(--accent); }
.info__row--meta{
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border-top: 1px solid rgba(243,241,236,.1);
  padding-top: 24px;
}

/* ============ responsive ============ */
@media (max-width: 640px){
  .chrome{ padding: 18px 18px 0; }
  .wordmark__sub{ display: none; }
  .piece__caption{ max-width: 84vw; }
  .sound__label{ display: none; }
  .sound{ padding: 8px; }
}
