/* ============================================================
   ANURAG TIWARI — AI Filmmaker · Editorial Portfolio
   ============================================================ */

:root {
  --bg: #f4f3ef;
  --panel: #f4f3ef;
  --ink: #0e0e0c;
  --soft: #6f6e69;
  --faint: #b6b4ad;
  --line: #d9d7cf;
  --accent: #e1432a;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --pad: clamp(20px, 2.4vw, 40px);
  --easo: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
img { display: block; max-width: 100%; }

::selection { background: var(--accent); color: var(--bg); }

/* ---------- Film grain ---------- */
.grain {
  position: fixed; inset: 0; z-index: 9000; pointer-events: none;
  opacity: 0.04; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 8000; background: var(--bg);
  display: flex; align-items: flex-end; padding: var(--pad);
}
.intro__row {
  display: flex; justify-content: space-between; align-items: baseline;
  width: 100%; border-top: 1px solid var(--ink); padding-top: 14px;
}
.intro__name { font-size: 12px; letter-spacing: 0.05em; }
.intro__count { font-size: clamp(60px, 16vw, 220px); font-weight: 500; line-height: 0.8; }

/* ============================================================
   LAYOUT — two panels
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
}

/* ---------- LEFT : INDEX ---------- */
.index {
  border-right: 1px solid var(--line);
  padding: 0 0 0 0;
  min-height: 100vh;
}

.row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(16px, 2vw, 36px);
  padding: var(--pad);
  border-bottom: 1px solid var(--line);
}

.row--masthead { align-items: start; padding-top: clamp(22px, 3vw, 38px); }

.name {
  font-family: var(--mono);
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  line-height: 1.25; margin-bottom: 22px;
}
.socials { display: flex; flex-direction: column; gap: 3px; }
.socials a {
  font-size: 12px; color: var(--soft); width: max-content;
  transition: color 0.25s var(--easo);
}
.socials a:hover { color: var(--accent); }

.role { font-size: 12px; letter-spacing: 0.02em; margin-bottom: 16px; }
.bio { font-size: 13px; color: var(--ink); max-width: 46ch; margin-bottom: 18px; }
.email {
  font-size: 13px; position: relative; width: max-content;
  transition: color 0.25s var(--easo);
}
.email::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--easo);
}
.email:hover { color: var(--accent); }
.email:hover::after { transform: scaleX(1); }

/* ---------- Work list ---------- */
.worklist { list-style: none; }

.work-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(16px, 2vw, 36px);
  padding: 20px var(--pad);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  transition: background 0.4s var(--easo);
}
.work-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent); transform: scaleY(0); transform-origin: top;
  transition: transform 0.4s var(--easo);
}
.work-item:hover { background: rgba(0,0,0,0.015); }
.work-item.is-active::before { transform: scaleY(1); }

.work-item .thumb {
  aspect-ratio: 16 / 10; width: 100%; overflow: hidden;
  background: #111; position: relative;
  filter: grayscale(0.15);
  transition: filter 0.5s var(--easo);
}
.work-item .thumb > * { width: 100%; height: 100%; }
.work-item:hover .thumb,
.work-item.is-active .thumb { filter: grayscale(0); }

.work-item .meta { align-self: center; }
.work-item .cat {
  display: block; font-size: 11px; letter-spacing: 0.06em; color: var(--soft);
  text-transform: uppercase; margin-bottom: 6px;
  transition: color 0.3s var(--easo);
}
.work-item .wtitle {
  font-family: var(--sans);
  font-size: clamp(18px, 1.5vw, 24px); font-weight: 500; letter-spacing: -0.01em;
  line-height: 1.12; color: var(--ink);
  transition: color 0.3s var(--easo);
}
.work-item.is-active .cat,
.work-item.is-active .wtitle { color: var(--accent); }

.index__foot {
  display: flex; justify-content: space-between;
  padding: 18px var(--pad) 28px; color: var(--faint); font-size: 11px;
  letter-spacing: 0.04em;
}

/* ============================================================
   INFO ROW (areas / tools / recognition / awards)
   ============================================================ */
.info {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 52px);
  padding: clamp(40px, 5vw, 76px) var(--pad);
  border-top: 1px solid var(--line);
}
.info__h {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding-bottom: 9px; margin-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}
.info__col ul { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.info__col li {
  font-size: 13px; color: var(--soft); line-height: 1.35;
}
.info__col li em { font-style: italic; color: var(--faint); }

.site-foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
  padding: 20px var(--pad) 30px; border-top: 1px solid var(--line);
  color: var(--faint); font-size: 11px; letter-spacing: 0.05em;
}

/* ============================================================
   RIGHT : VIEWER (sticky)
   ============================================================ */
.viewer {
  position: sticky; top: 0; align-self: start;
  height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  padding: var(--pad);
}

.viewer__top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; letter-spacing: 0.06em; margin-bottom: 18px;
}
.viewmode {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; font: inherit; color: var(--ink);
  letter-spacing: 0.06em; cursor: pointer; padding: 0;
}
.viewmode .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: blink 2.4s steps(1) infinite;
}
@keyframes blink { 0%,60% { opacity: 1; } 61%,100% { opacity: 0.25; } }
.clock { color: var(--ink); font-variant-numeric: tabular-nums; }

.viewer__stage { position: relative; flex: 1; min-height: 0; }

/* ---------- Player ---------- */
.player {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column;
}
.player__media {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: #0c0c0c;
}
.player__media > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.player.is-vertical .player__media { display: flex; align-items: center; justify-content: center; background: #000; }
.player.is-vertical .player__media > *:not(.soon) {
  position: relative; inset: auto; width: auto; height: 100%;
  aspect-ratio: 9 / 16; max-width: 100%; object-fit: cover;
}
.player__media .frame-cap {
  position: absolute; right: 14px; bottom: 14px; z-index: 3;
  font-size: 10px; letter-spacing: 0.1em; color: rgba(255,255,255,0.82);
  mix-blend-mode: difference;
}

.player__controls {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 2px 0;
}
.ctrl {
  background: none; border: none; color: var(--ink); cursor: pointer;
  display: inline-flex; padding: 2px; opacity: 0.85;
  transition: opacity 0.25s, transform 0.25s var(--easo);
}
.ctrl:hover { opacity: 1; transform: scale(1.12); }
.ctrl-group { display: flex; align-items: center; gap: 14px; margin-left: auto; }

.scrub { flex: 1; position: relative; }
.scrub__bar {
  height: 3px; background: var(--line); position: relative; cursor: pointer;
}
.scrub__fill {
  position: absolute; left: 0; top: 0; height: 100%; width: 14%;
  background: var(--ink);
}
.scrub__tip {
  position: absolute; bottom: 12px; left: 14%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); font-size: 10px;
  padding: 3px 6px; white-space: nowrap; pointer-events: none;
}

/* ---------- Contact sheet (grid) ---------- */
.contact {
  position: absolute; inset: 0; overflow-y: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  align-content: start;
  scrollbar-width: thin;
}
.contact figure { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background:#0c0c0c; }
.contact figure > * { width: 100%; height: 100%; }
.contact figure figcaption {
  position: absolute; left: 10px; bottom: 8px; font-size: 10px;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.8); mix-blend-mode: difference;
}

/* ---------- Caption / synopsis ---------- */
.viewer__caption { margin-top: 18px; }
.viewer__caption .cat {
  display: block; font-size: 11px; letter-spacing: 0.06em; color: var(--soft);
  text-transform: uppercase; margin-bottom: 6px;
}
.cap-title {
  font-family: var(--sans); font-weight: 500; letter-spacing: -0.015em;
  font-size: clamp(22px, 2vw, 30px); line-height: 1.05;
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.cap-title .status {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent);
  padding: 3px 7px; border-radius: 100px; transform: translateY(-3px);
}
.cap-tag {
  font-family: var(--sans); font-size: 14px; color: var(--soft);
  margin-top: 8px; font-style: italic; letter-spacing: -0.01em;
}

/* "uploading soon" overlay on placeholder player */
.soon {
  position: absolute; inset: 0; z-index: 4; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; color: rgba(255,255,255,0.92);
}
.soon b { font-family: var(--mono); font-size: 12px; letter-spacing: 0.28em; font-weight: 500; }
.soon span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: rgba(255,255,255,0.6); }
.soon::before {
  content: ""; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.45); margin-bottom: 4px;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.18), transparent 70%);
}
.is-soon .player__controls { opacity: 0.4; pointer-events: none; }
/* Real video (Vimeo / mp4) brings its own controls — hide our placeholder bar */
.player.is-live .player__controls { display: none; }
.player.is-live .player__media { background: #000; }

.viewer__synopsis {
  display: grid; grid-template-columns: 1.3fr 1fr;
  gap: clamp(20px, 3vw, 56px); margin-top: 16px;
}
.desc { font-size: 13px; color: var(--ink); max-width: 52ch; }
.desc em { font-style: italic; color: var(--soft); }
.credits { font-size: 11.5px; color: var(--faint); line-height: 1.7; }
.credits b { color: var(--soft); font-weight: 400; }

/* reveal helpers */
.rv { will-change: transform, opacity; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .row, .work-item { grid-template-columns: 150px minmax(0,1fr); }
}

@media (max-width: 900px) {
  .info { grid-template-columns: 1fr 1fr; gap: 32px clamp(20px, 4vw, 44px); }
}

@media (max-width: 860px) {
  .layout { display: flex; flex-direction: column; }
  .viewer {
    position: relative; height: auto; min-height: 0;
    border-bottom: 1px solid var(--line);
    order: -1;
  }
  .viewer__stage { height: auto; }
  .player { height: auto; }
  .player__media { aspect-ratio: 16 / 10; flex: none; }
  .contact { position: relative; max-height: 70vh; }
  .index { border-right: none; }
  .row--masthead { grid-template-columns: 1fr; gap: 18px; }
  .name { font-size: 14px; }
  .viewer__synopsis { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 560px) {
  .row, .work-item { grid-template-columns: 110px minmax(0,1fr); gap: 14px; }
  .work-item .wtitle { font-size: 16px; }
  body { font-size: 12.5px; }
  .info { grid-template-columns: 1fr; gap: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
