/* Ruturaj Parhi, video editor. One page. Plain CSS.
   Theme, colours, font and video brightness are chosen in settings.js, which sets the variables below. */

:root {
  --bg: #000;
  --fg: #fff;
  --rgb: 255, 255, 255;                       /* the text colour as numbers, for the faded greys */
  --btn-bg: var(--accent, #fff);
  --btn-fg: var(--accent-fg, #000);
  --tile-bg: #0c0c0c;
  --vid-bright: .82;
  --vid-grey: 0;
  --sans: "Helvetica Neue", Helvetica, "Inter Tight", Arial, sans-serif;
  --ease: cubic-bezier(.2, .75, .15, 1);
  --pad: max(clamp(16px, 3vw, 44px), env(safe-area-inset-left, 0px));
  color-scheme: dark;
}
:root[data-theme="white"] { --bg: #fff; --fg: #000; --rgb: 0, 0, 0; --btn-bg: var(--accent, #000); --btn-fg: var(--accent-fg, #fff); --tile-bg: #e6e6e6; color-scheme: light; }
/* The first screen and the thumbnails sit on footage, so their text stays white in every theme */
.hero, .tile { --fg: #fff; --rgb: 255, 255, 255; }
.hero { --btn-bg: var(--accent, #fff); --btn-fg: var(--accent-fg, #000); }
:root, .hero, .tile { --soft: rgba(var(--rgb), .62); --faint: rgba(var(--rgb), .42); --line: rgba(var(--rgb), .12); --mute: rgba(var(--rgb), .5); --dim: rgba(var(--rgb), .36); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; -webkit-tap-highlight-color: transparent; }
img { display: block; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

/* ---------- Opening: the two halves of the mark splice together, then the screen lifts away ---------- */
.intro { display: none; }
.js .intro { display: block; position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.no-intro .intro { display: none; }
.intro-cols { position: absolute; inset: 0; display: flex; background: #000; }
.intro.open .intro-cols { background: transparent; }
.intro-cols i { flex: 1; background: #000; margin-right: -1px; transition: transform .8s cubic-bezier(.76, 0, .24, 1); }
.intro-cols i:nth-child(2) { transition-delay: .06s; }
.intro-cols i:nth-child(3) { transition-delay: .12s; }
.intro-cols i:nth-child(4) { transition-delay: .18s; }
.intro.open .intro-cols i { transform: translateY(-101%); }
.intro-mark { position: absolute; top: 50%; left: 50%; width: clamp(54px, 6vw, 78px); height: auto; margin: 0; transform: translate(-50%, -50%); color: #fff; transition: opacity .3s linear; }
.intro-mark .a { animation: splice-l .55s cubic-bezier(.65, 0, .35, 1) both; }
.intro-mark .b { animation: splice-r .55s cubic-bezier(.65, 0, .35, 1) both; }
.intro.open .intro-mark { opacity: 0; }
@keyframes splice-l { from { transform: translateX(-38px); opacity: 0; } }
@keyframes splice-r { from { transform: translateX(38px); opacity: 0; } }

/* ---------- First screen ---------- */
.hero { position: relative; color: var(--fg); min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; isolation: isolate; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; height: clamp(90px, 16vh, 170px); background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
:root[data-theme="white"] .hero::after { background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }   /* on a white page the first screen ends on a clean edge */

/* The reel: a looping background video, 16:9 on laptops, 9:16 on phones, with a dark grade and grain on top */
.reel { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: #000; }
.reel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; filter: grayscale(var(--vid-grey)) saturate(.88) contrast(1.06) brightness(var(--vid-bright)); }
.reel::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(115% 85% at 50% 46%, rgba(0, 0, 0, .18) 30%, rgba(0, 0, 0, .66) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .62) 0%, rgba(0, 0, 0, .34) 34%, rgba(0, 0, 0, .4) 66%, rgba(0, 0, 0, .9) 100%);
}
.grain {
  position: absolute; inset: -50%; z-index: 1; pointer-events: none; opacity: .13; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.1 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  animation: grain .8s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(2%, -3%); } 50% { transform: translate(-3%, 2%); } 75% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }

/* Header: the mark and name in the top-left corner */
.top { display: flex; align-items: center; justify-content: space-between; padding: clamp(16px, 2vw, 26px) var(--pad); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: .9375rem; font-weight: 500; letter-spacing: -.01em; }
.brand svg { width: 26px; height: auto; display: block; }

/* Headline, buttons */
.hero-in { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: clamp(30px, 6vh, 80px) var(--pad); }
.title { margin: 0; font-weight: 500; font-size: clamp(3.1rem, 11vw, 8.6rem); line-height: .93; letter-spacing: -.052em; text-shadow: 0 2px 30px rgba(0, 0, 0, .25); }
.title .w { display: inline-block; }
.sub { margin: clamp(18px, 2.4vw, 28px) 0 0; color: var(--soft); font-size: clamp(.95rem, .5vw + .8rem, 1.15rem); font-weight: 500; letter-spacing: -.01em; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: clamp(30px, 4vw, 46px); }

.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 152px; height: 52px; padding: 0 28px; border-radius: 999px;
  font-size: 1rem; font-weight: 500; letter-spacing: -.01em; text-decoration: none;
  transition: color .45s var(--ease), box-shadow .45s var(--ease), transform .3s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-white { background: var(--btn-bg); color: var(--btn-fg); }
.btn-ghost { color: #fff; background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.btn-ghost::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: #fff; transform: scale(.4); opacity: 0; transition: transform .55s var(--ease), opacity .35s var(--ease); }
/* Label rolls up on hover and a copy follows it in */
.lbl { display: block; height: 1.25em; line-height: 1.25; overflow: hidden; }
.lbl span { display: block; transition: transform .5s var(--ease); }
.lbl span::after { content: attr(data-t); display: block; }
@media (hover: hover) {
  .btn:hover .lbl span { transform: translateY(-50%); }
  .btn-ghost:hover { color: #000; box-shadow: inset 0 0 0 1px #fff; }
  .btn-ghost:hover::before { transform: none; opacity: 1; }
}
.btn:focus-visible .lbl span { transform: translateY(-50%); }

/* Nudge to scroll */
.cue { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: calc(clamp(18px, 3vh, 30px) + env(safe-area-inset-bottom, 0px)); color: var(--faint); font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; }
.cue i { width: 1px; height: 36px; background: linear-gradient(#fff, rgba(255, 255, 255, 0)); transform-origin: top; animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* Entry: words land one at a time like captions, then the rest follows (3.5s fallback if scripts fail) */
.js .title .w, .js .fade { opacity: 0; animation: show 0s linear 3.5s forwards; }
.js .title .w { transform: translateY(.14em) scale(.96); filter: blur(12px); }
.js .fade { transform: translateY(14px); }
.go .title .w { opacity: 1; transform: none; filter: none; transition: opacity .6s var(--ease), transform .8s var(--ease), filter .6s var(--ease); transition-delay: calc(var(--i, 0) * 170ms); }
.go .fade { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(450ms + var(--i, 0) * 110ms); }
@keyframes show { to { opacity: 1; transform: none; filter: none; } }

/* ---------- Showcase ---------- */
.work { max-width: 1440px; margin: 0 auto; padding: clamp(60px, 9vw, 120px) var(--pad) clamp(70px, 9vw, 120px); }
.work-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 18px; margin-bottom: clamp(18px, 2.4vw, 30px); border-bottom: 1px solid var(--line); }
.work-head h2 { margin: 0; font-size: clamp(2rem, 3.6vw, 3.4rem); font-weight: 500; line-height: 1; letter-spacing: -.045em; }
.work-head span { color: var(--faint); font-size: .9375rem; font-variant-numeric: tabular-nums; }

/* One mosaic for everything: wide edits take two columns, vertical edits one */
.mosaic { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 1vw, 14px); }
.tile { position: relative; isolation: isolate; display: block; overflow: hidden; aspect-ratio: 3 / 4; border-radius: 12px; background: var(--tile-bg); color: var(--fg); text-decoration: none; }
.tile.wide { grid-column: span 2; aspect-ratio: auto; }
.tile img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(.6) contrast(1.06); transform: scale(1.01); transition: filter .7s var(--ease), transform 1.2s var(--ease); }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, .38) 0%, rgba(0, 0, 0, 0) 24%, rgba(0, 0, 0, 0) 54%, rgba(0, 0, 0, .86) 100%); }
.t-n { position: absolute; top: 14px; left: 16px; color: var(--soft); font-size: 12px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.t-go { position: absolute; top: 11px; right: 11px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #000; opacity: 0; transform: scale(.6); transition: opacity .35s var(--ease), transform .5s var(--ease); }
.t-go svg { width: 13px; height: 13px; }
.t-play { position: absolute; top: 50%; left: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .12); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); transition: transform .5s var(--ease), background-color .4s var(--ease); }
.t-play svg { width: 20px; height: 20px; margin-left: 3px; }
.t-meta { position: absolute; left: 16px; right: 16px; bottom: 15px; }
.t-meta b { display: block; font-size: clamp(.95rem, .5vw + .75rem, 1.2rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.t-meta span { display: block; margin-top: 4px; color: var(--soft); font-size: .8125rem; }
@media (hover: hover) {
  .tile:hover img { filter: none; transform: scale(1.05); }
  .tile:hover .t-go { opacity: 1; transform: none; }
  .tile:hover .t-play { transform: scale(1.12); background: rgba(255, 255, 255, .2); }
}
.tile:focus-visible img { filter: none; }
@media (hover: none) { .tile img { filter: grayscale(1) brightness(.72) contrast(1.06); } }
.tiles-colour .tile img { filter: brightness(.86); }
.tiles-colour .tile:hover img { filter: none; }
@media (max-width: 1000px) {
  .mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile.wide { aspect-ratio: 16 / 10; }
}
@media (max-width: 480px) { .t-play { width: 48px; height: 48px; margin: -24px 0 0 -24px; } .t-meta { left: 12px; right: 12px; bottom: 12px; } .t-n { left: 12px; top: 12px; } }

.rv { transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--k, 0) * 70ms); }
.js .rv { opacity: 0; transform: translateY(26px); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
.ft { border-top: 1px solid var(--line); }
.ft-in { max-width: 1440px; margin: 0 auto; padding: clamp(48px, 7vh, 80px) var(--pad) clamp(28px, 4vh, 40px); }
.ft-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px clamp(48px, 7vw, 120px); align-items: start; }
.ft-logo { display: inline-flex; align-items: center; gap: .45em; text-decoration: none; font-size: clamp(1.5rem, 1.4vw + .9rem, 2.25rem); font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.ft-logo svg { height: .7em; width: auto; display: block; }
.ft-brand p { margin: 14px 0 0; color: var(--mute); font-size: 1.0625rem; line-height: 1.35; }
.ft-brand .btn { margin-top: 26px; }
.ft-col h3 { margin: 6px 0 22px; font-size: 1.0625rem; font-weight: 500; letter-spacing: -.01em; }
.ft-col ul { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.ft-col a { color: var(--mute); font-size: 1.0625rem; text-decoration: none; transition: color .2s var(--ease); }
.ft-col a:hover { color: var(--fg); }
.ft-col a[target="_blank"]::after { content: "\2197"; display: inline-block; margin-left: .3em; font-size: .8em; opacity: .7; }
.ft-bot { display: flex; justify-content: space-between; gap: 16px; margin-top: clamp(48px, 7vh, 80px); padding-top: 20px; border-top: 1px solid var(--line); color: var(--dim); font-size: .8125rem; }
.ft-bot a { text-decoration: none; transition: color .2s var(--ease); }
.ft-bot a:hover { color: var(--fg); }
@media (max-width: 640px) {
  .ft-grid { grid-template-columns: 1fr; }
  .ft-brand .btn { width: 100%; }
  .ft-col { padding-top: 26px; border-top: 1px solid var(--line); }
  .ft-col h3 { margin: 0 0 16px; font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
  .ft-col a { color: rgba(var(--rgb), .86); }
}

/* ---------- Less motion when asked ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .cue i { animation: none; }
  .js .intro { display: none; }
  .js .title .w, .js .fade, .js .rv { opacity: 1; transform: none; filter: none; animation: none; transition: none; }
  .lbl span, .tile img, .t-go, .t-play, .btn-ghost::before { transition: none; }
}
