/* ============================================================
   hedges studio — content portfolio
   ============================================================ */

:root {
  --ink:    #0a0a0a;
  --paper:  #ffffff;
  --muted:  #6b7280;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Frame / tile gradients */
  --g-amber: linear-gradient(135deg, #FDB022 0%, #F0438A 50%, #7A3FF2 100%);
  --g-blue:  linear-gradient(150deg, #3B82F6 0%, #7C3AED 100%);
  --g-pink:  linear-gradient(140deg, #F0438A 0%, #5B7CFA 100%);
  --g-red:   linear-gradient(150deg, #FF4D4D 0%, #7A3FF2 100%);

  /* Panel backgrounds */
  --web-bg: linear-gradient(180deg, #ffffff 0%, #fff3e9 36%, #ff7a18 100%);

  --ease: cubic-bezier(0.83, 0, 0.17, 1);
  --radius-frame: clamp(18px, 2.4vw, 30px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  height: 100dvh;
  overflow: hidden;            /* the deck handles all movement */
  overscroll-behavior: none;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; padding: 0; background: none; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   Deck + panels
   ============================================================ */

.deck {
  display: flex;
  flex-direction: column;
  height: 300dvh;              /* three stacked panels */
  transform: translateY(calc(var(--i, 1) * -100dvh));
  transition: transform 0.95s var(--ease);
  will-change: transform;
}

.panel {
  position: relative;
  flex: 0 0 100dvh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(18px, 4vh, 40px) 20px;
}

.panel--home   { justify-content: space-between; background: var(--paper); }
.panel--photos { justify-content: flex-start; background: var(--paper); }
.panel--web    { justify-content: flex-start; background: var(--web-bg); }

/* Panel background image (photos) */
.panel__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.panel__bg--photo {
  background: url("assets/photo-hero.jpg") center 60% / cover no-repeat;
  filter: grayscale(100%) contrast(1.02);
  -webkit-mask-image:
    linear-gradient(180deg, #fff 0%, rgba(255,255,255,.55) 16%, rgba(255,255,255,0) 42%,
                    rgba(255,255,255,0) 64%, rgba(255,255,255,.92) 100%);
          mask-image:
    linear-gradient(180deg, #fff 0%, rgba(255,255,255,.55) 16%, rgba(255,255,255,0) 42%,
                    rgba(255,255,255,0) 64%, rgba(255,255,255,.92) 100%);
  opacity: .9;
}
.panel--photos > * { position: relative; z-index: 1; }

/* ============================================================
   Home — brand cluster + floating frames
   ============================================================ */

.stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  max-width: 1100px;
  display: grid;
  place-items: center;
}

.brand {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2.2vh, 22px);
}
.brand__mark {
  width: clamp(200px, 34vw, 440px);
  height: auto;
}
.brand__nav {
  display: flex;
  gap: clamp(8px, 1.2vw, 14px);
  flex-wrap: wrap;
  justify-content: center;
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: clamp(.78rem, 1.5vw, .95rem);
  letter-spacing: -0.01em;
  padding: .55em 1.05em;
  border-radius: 999px;
  transition: transform .25s var(--ease), opacity .25s ease, background .25s ease;
}
.pill:hover { transform: translateY(-2px); background: #1d1d1f; }
.pill:active { transform: translateY(0); }

.pill--cta {
  z-index: 2;
  font-size: clamp(.95rem, 2.2vw, 1.25rem);
  padding: .62em 1.25em;
  margin-top: clamp(14px, 3vh, 30px);
}

/* Floating gradient frames */
.frame {
  position: absolute;
  z-index: 1;
  border-radius: var(--radius-frame);
  box-shadow: 0 22px 50px -22px rgba(40, 20, 80, .45);
  overflow: hidden;
}
.frame::after {                 /* soft top sheen */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.22), rgba(255,255,255,0) 55%);
}
.frame > img, .frame > video {
  position: absolute;        /* fill the frame even though its height comes from aspect-ratio */
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;   /* clean own edge — avoids the 1px clip-AA hairline */
}

.frame--a { width: clamp(64px, 9vw,  118px); aspect-ratio: 1/1;     top: 22%; left: 70%; }
.frame--b { width: clamp(96px, 15vw, 196px); aspect-ratio: 12/13;   top: 50%; left: 6%;  }
.frame--c { width: clamp(92px, 14vw, 184px); aspect-ratio: 13/12;   top: 62%; left: 84%; }
.frame--d { width: clamp(70px, 10vw, 132px); aspect-ratio: 1/1;     top: 80%; left: 30%; }

.g-amber { background: var(--g-amber); }
.g-blue  { background: var(--g-blue); }
.g-pink  { background: var(--g-pink); }
.g-red   { background: var(--g-red); }

/* ============================================================
   Hints (animated chevron prompts)
   ============================================================ */

.hint {
  z-index: 4;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 600;
  font-size: clamp(.82rem, 1.7vw, 1rem);
  letter-spacing: -0.01em;
  padding: 6px 10px;
}
.hint__label { white-space: nowrap; }
.chev {
  width: clamp(22px, 3vw, 30px);
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hint--up   { order: -1; }
.hint:hover .chev { stroke-width: 2.8; }

/* ============================================================
   Filmstrips (photos + websites)
   ============================================================ */

.strip-head { margin-top: clamp(6px, 2vh, 18px); }
.strip-title {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-size: clamp(1.5rem, 5vw, 3rem);
  text-align: center;
}
.strip-head--web { margin-top: clamp(40px, 9vh, 110px); }

.filmstrip {
  flex: 1 1 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
  padding: 0 max(20px, 6vw);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filmstrip::-webkit-scrollbar { display: none; }
.filmstrip { cursor: grab; touch-action: pan-x; user-select: none; -webkit-user-select: none; }
.filmstrip.is-grabbing, .filmstrip.is-grabbing .tile { cursor: grabbing; }
.filmstrip--web { flex: 0 0 auto; height: clamp(180px, 34vh, 360px); }

.tile {
  position: relative;
  flex: 0 0 auto;
  width: clamp(210px, 26vw, 360px);
  height: clamp(150px, 30vh, 300px);
  border-radius: var(--radius-frame);
  background: transparent;   /* no dark backing → no 1px edge behind the media */
  overflow: hidden;
  scroll-snap-align: center;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.tile:hover { transform: translateY(-6px); box-shadow: 0 26px 50px -24px rgba(0,0,0,.5); }
.tile__media {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;   /* clean own edge — avoids the 1px clip-AA hairline */
  transition: transform .6s var(--ease);
  user-select: none;
  -webkit-user-drag: none;
}
.tile:hover .tile__media { transform: scale(1.05); }

/* website screenshots read better in a wider, landscape frame */
.tile--site { width: clamp(300px, 46vw, 620px); }

.tile--grad.g-amber { background: var(--g-amber); }
.tile--grad.g-pink  { background: var(--g-pink); }
.tile--grad.g-red   { background: var(--g-red); }
.tile--dark         { background: #050505; }

.tile__label {
  position: absolute;
  z-index: 2;
  left: 14px; bottom: 12px;
  color: #fff;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .01em;
  text-shadow: 0 1px 10px rgba(0,0,0,.5);
}
/* readability scrim, only on tiles that carry a label */
.tile:has(.tile__label)::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
  pointer-events: none;
}

.tile__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.tile__play svg {
  width: clamp(44px, 6vw, 62px);
  height: auto;
  fill: #fff;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,.45));
  transition: transform .3s var(--ease);
}
.tile.is-video:hover .tile__play svg { transform: scale(1.12); }

/* expand affordance for autoplaying video tiles (click = fullscreen) */
.tile__expand {
  position: absolute;
  z-index: 2;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .38);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  opacity: .85;
  transition: opacity .25s ease, transform .25s var(--ease);
}
.tile:hover .tile__expand { opacity: 1; transform: scale(1.08); }
.tile__expand svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   Page dots
   ============================================================ */

.dots {
  position: fixed;
  right: clamp(14px, 2.4vw, 26px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink);
  opacity: .22;
  transition: opacity .3s ease, transform .3s var(--ease);
}
.dot:hover { opacity: .5; }
.dot.is-active { opacity: 1; transform: scale(1.35); }
/* dots flip to white over the orange web panel */
body[data-index="2"] .dot { background: #fff; }

/* ============================================================
   Lightbox
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(6, 6, 8, .82);
  backdrop-filter: blur(8px);
  padding: 4vmin;
  opacity: 0;
  transition: opacity .35s ease;
}
/* when closed, fully remove it so it can't intercept clicks/scroll */
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox__stage img,
.lightbox__stage video {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 16px;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.8);
}
.lightbox__close {
  position: absolute;
  top: max(16px, 3vh); right: max(16px, 3vw);
  width: 44px; height: 44px;
  font-size: 30px; line-height: 1;
  color: #fff;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  transition: background .25s ease, transform .25s var(--ease);
}
.lightbox__close:hover { background: rgba(255,255,255,.24); transform: rotate(90deg); }

/* ============================================================
   Motion — entrance + ambient
   ============================================================ */

/* Reveal (filmstrip tiles + CTA), triggered when a panel becomes active */
.reveal { opacity: 0; transform: translateY(26px); }
.panel.is-active .reveal {
  opacity: 1;
  transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--d, 0s);
}

@media (prefers-reduced-motion: no-preference) {

  /* Brand cluster on first load */
  .brand__mark { animation: rise 1s var(--ease) both .12s; }
  .brand__nav  { animation: rise .9s var(--ease) both .55s; }

  /* Frames: float in, then breathe */
  .frame {
    animation:
      pop 1s var(--ease) both var(--d),
      drift 9s ease-in-out infinite calc(var(--d) + 1s);
  }
  .frame--b { animation-duration: 1s, 11s; }
  .frame--c { animation-duration: 1s, 10s; }
  .frame--d { animation-duration: 1s, 12s; }

  /* Chevron bob */
  .hint--up   .chev { animation: bobUp 2.2s ease-in-out infinite; }
  .hint--down .chev { animation: bobDown 2.2s ease-in-out infinite; }
  .hint__label { animation: fade 1s ease both 1.1s; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@keyframes pop {
  0%   { opacity: 0; transform: translateY(22px) scale(.72) rotate(-6deg); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-12px) rotate(1.5deg); }
}
@keyframes bobUp {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes bobDown {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 680px) {
  /* keep frames clear of the centered logo: top, bottom, and bleeding off the sides */
  .frame--a { top: 14%; left: 72%; }
  .frame--b { top: 76%; left: 4%;  }
  .frame--c { top: 30%; left: 84%; }
  .frame--d { top: 88%; left: 34%; }
  .dots { right: 10px; gap: 10px; }
  .pill--cta { margin-top: 18px; }
}

@media (max-width: 420px) {
  .hint__label { font-size: .78rem; }
}
