/* The opening film: croqi's version of Raspberry's end-to-end video, drawn in code.
   One garment goes through four studios: photo → flat → product shot → look → video.
   A re-drawn panel on the left, the result on the right, a cursor that types the note and presses the button.
   film.js drives the timeline; this file only describes the states it switches. */

.film {
  position: relative;
  width: min(100%, 1240px);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  padding: clamp(14px, 2vw, 28px);
  border-radius: 28px;
  background: #e9e6df;
  overflow: hidden;
  font-family: var(--sans);
}
.film-canvas {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: 34% 1fr;
  align-items: center;
  gap: 4%;
  padding: 0 5%;
  border-radius: 18px;
  background: var(--paper);
}

/* the panel: a calm sketch of a croqi studio */
.film-panel {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 18px 50px -30px rgba(0, 25, 60, 0.35);
  font-size: 13px;
  transition: opacity 0.6s, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.film-tool { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.film-tool b { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.film-tool .mono { font-size: 10px; }
.film-input { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: var(--ground); }
.film-thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: contain; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
/* the second input: an "add" row first, the picked file once the cursor clicks it */
.film-add { border: 1px dashed var(--line); background: none; }
.film-add[hidden] { display: none; }
.film-add .film-thumb, .film-add .film-file { display: none; }
.film-add-label { font-weight: 600; font-size: 12px; color: var(--brand); }
.film-add.is-added { border-style: solid; background: var(--ground); }
.film-add.is-added .film-thumb, .film-add.is-added .film-file { display: block; }
.film-add.is-added .film-add-label { display: none; }
.film-file { font-family: var(--mono); font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.film-field { display: grid; gap: 6px; }
.film-label { font-weight: 600; font-size: 12px; }
.film-note {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ground);
  line-height: 1.4;
  transition: box-shadow 0.5s, background 0.5s;
}
.film-note .placeholder { color: #a3a6ab; }
.film-caret { display: inline-block; width: 1.5px; height: 1.05em; margin-left: 1px; vertical-align: -2px; background: var(--brand); opacity: 0; }
/* typing: the whole panel comes a little closer and the field lights up; it never reaches the picture */
.film-panel { transform-origin: 0 50%; }
.film-panel:has(.film-field.is-zoomed) { transform: scale(1.1); }
.film-field.is-zoomed .film-note { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(0, 61, 116, 0.12), 0 18px 40px -24px rgba(0, 25, 60, 0.45); }
.film-field.is-zoomed .film-caret { opacity: 1; animation: caret 0.9s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.film-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  transition: transform 0.15s, filter 0.15s;
}
.film-btn small { font-weight: 500; opacity: 0.7; }
.film-btn.is-pressed { transform: scale(0.96); filter: brightness(1.25); }
.film-status { height: 14px; margin: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--brand); }

/* the result: two stacked pictures, the new one comes in over the old; the video takes the last step */
.film-out { position: relative; height: 92%; }
.film-shot,
.film-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* a white ground, so a transparent drawing fully covers the picture under it */
.film-shot { background: var(--paper); }
.film-shot.is-next { clip-path: inset(0 0 100% 0); }
.film-shot.is-next.is-in { clip-path: inset(0 0 0 0); transition: clip-path 1.4s cubic-bezier(0.45, 0, 0.25, 1); }
.film-shot.is-fade { clip-path: none; opacity: 0; transform: scale(0.985); }
.film-shot.is-fade.is-in { opacity: 1; transform: none; transition: opacity 0.9s, transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.film-video { opacity: 0; border-radius: 12px; transition: opacity 0.8s; }
.film-video.is-in { opacity: 1; }
.film-scan {
  position: absolute;
  left: -4%;
  right: -4%;
  top: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  box-shadow: 0 0 18px 2px rgba(0, 61, 116, 0.35);
  opacity: 0;
  z-index: 5;
}
.film-scan.is-running { opacity: 1; top: 100%; transition: top 1.4s cubic-bezier(0.45, 0, 0.25, 1); }

/* the drawing, large: front and back under the scan line, then the back leaves and the front comes closer */
.film-pair {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 3%;
  background: var(--paper);
  clip-path: inset(0 0 100% 0);
  transition: opacity 0.9s;
}
.film-pair img {
  flex: 0 1 48.5%;
  min-width: 0;
  height: 100%;
  object-fit: contain;
  transition: flex-basis 1.1s cubic-bezier(0.45, 0, 0.25, 1), opacity 0.7s, transform 1.1s cubic-bezier(0.45, 0, 0.25, 1);
}
.film-pair.is-on { clip-path: inset(0 0 0 0); transition: clip-path 1.4s cubic-bezier(0.45, 0, 0.25, 1), opacity 0.9s; }
.film-pair.is-solo { gap: 0; }
.film-pair.is-solo .film-on { flex-basis: 100%; }
.film-pair.is-solo .film-arka { flex-basis: 0; opacity: 0; transform: translateX(40%); }
.film-pair.is-gone { clip-path: none; opacity: 0; }

/* right after the drawing: the stage goes dark, the front lies down and comes apart into croqi's SVG groups,
   the way the "Dosyanın içinde" section shows them; then it settles back into one drawing on white */
.film-canvas { transition: background 0.8s; }
.film.is-dark .film-canvas { background: #141518; }
.film-layers {
  position: absolute;
  inset: 0;
  z-index: 4;
  perspective: 2200px; /* no preserve-3d: the canvas's own plane would cut the tilted sheets in half */
  background: var(--paper);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s, background 0.8s;
}
.film-layers.is-on { opacity: 1; }
.film.is-dark .film-layers { background: #141518; } /* the same dark as the canvas, so the stage has no edge */
/* each sheet lies exactly on the front drawing: as tall as the canvas, the drawing's own proportions */
.film-sheet {
  position: absolute;
  inset: 0;
  height: 100%;
  aspect-ratio: var(--ar);
  margin: auto;
  border-radius: 16px;
  border: 1px solid transparent;
  transition: transform 1.1s cubic-bezier(0.45, 0, 0.25, 1), border-color 0.8s, background 0.8s;
}
.film-sheet i {
  position: absolute;
  inset: 0;
  background: var(--ink);
  -webkit-mask: var(--mask) center / contain no-repeat;
  mask: var(--mask) center / contain no-repeat;
  transition: background 0.8s, opacity 0.8s;
}
/* on white it is the drawing as croqi gives it: black lines, no fill */
.film-sheet[data-layer="panels"] i { opacity: 0; }
.film.is-dark .film-sheet i { background: #eef0f3; }
.film.is-dark .film-sheet[data-layer="topstitch"] i { background: #e0b252; }
.film.is-dark .film-sheet[data-layer="panels"] i { background: #3c6db0; opacity: 0.6; }
.film-layers.is-tilt .film-sheet { transform: translateX(-15%) scale(0.7) rotateX(58deg) rotateZ(-34deg); }
.film-layers.is-apart .film-sheet {
  transform: translateX(-15%) scale(0.7) rotateX(58deg) rotateZ(-34deg) translateZ(calc((var(--i) - 2) * 105px));
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
}

/* the layer list, upright beside the stack, top to bottom like the sheets */
.film-legend {
  position: absolute;
  top: 50%;
  right: -2%;
  z-index: 5;
  display: grid;
  min-width: 250px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 11px;
  color: #b9bbc1;
  opacity: 0;
  transform: translate(14px, -50%);
  transition: opacity 0.6s, transform 0.6s;
}
.film-legend.is-on { opacity: 1; transform: translate(0, -50%); }
.film-legend li { display: grid; grid-template-columns: 30px auto 1fr; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.film-legend li:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.film-legend b { font-weight: 500; color: #eef0f3; }
.film-legend span { justify-self: end; }
.film-legend i { display: block; width: 26px; border-top: 2px solid #eef0f3; }
.film-legend [data-layer="seams"] i { border-top-width: 1.5px; }
.film-legend [data-layer="topstitch"] i { border-top: 2px dashed #e0b252; }
.film-legend [data-layer="buttons"] i { width: 9px; height: 9px; margin-left: 8px; border: 2px solid #eef0f3; border-radius: 50%; }
.film-legend [data-layer="panels"] i { height: 9px; border: 0; border-radius: 3px; background: #3c6db0; }

/* the last step: the panel steps aside and the video takes the canvas */
.film.is-full .film-panel { opacity: 0; transform: translateX(-30px); }
.film.is-full .film-out { position: absolute; inset: 6% 5% 14%; height: auto; }

/* the four studios, a quiet progress line under the canvas */
.film-steps {
  position: absolute;
  left: 50%;
  bottom: clamp(22px, 3vw, 40px);
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 5px;
  list-style: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(0, 25, 60, 0.4);
  z-index: 6;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
/* each step is a button: a click jumps the film there and it plays on */
.film-steps button {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: background 0.4s, color 0.4s;
}
.film-steps button:hover { color: var(--ink); background: var(--ground); }
.film-steps button.is-on { background: var(--ink); color: #fff; }
.film-steps button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.film-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  width: 26px;
  height: 26px;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
  transition: transform 0.75s cubic-bezier(0.45, 0, 0.25, 1);
}

/* phone: the result alone, the studio name and the note as a caption */
@media (max-width: 720px) {
  .film { aspect-ratio: 2 / 3; }
  .film-canvas { grid-template-columns: 1fr; grid-template-rows: 1fr auto; padding: 5% 6% 64px; }
  .film-out { height: 100%; grid-row: 1; }
  .film-panel { grid-row: 2; gap: 8px; padding: 12px; }
  .film-input, .film-btn, .film-status, .film-label { display: none; }
  .film-field.is-zoomed { transform: none; }
  .film-cursor { display: none; }
  .film-steps li:not(:has(.is-on)) { display: none; }
  /* the layers beat: the list on top, the sheets under it, the studio card out of the way */
  .film.is-dark .film-panel { opacity: 0; }
  .film-legend { top: 7%; left: 7%; right: 7%; min-width: 0; transform: translateY(-8px); }
  .film-legend.is-on { transform: none; }
  .film-legend li { grid-template-columns: 30px 1fr; padding: 7px 0; }
  .film-legend span { display: none; }
  .film-layers.is-tilt .film-sheet { transform: translateY(27%) scale(0.6) rotateX(58deg) rotateZ(-34deg); }
  .film-layers.is-apart .film-sheet { transform: translateY(27%) scale(0.6) rotateX(58deg) rotateZ(-34deg) translateZ(calc((var(--i) - 2) * 60px)); }
}
