/* =========================================================
   Dayana Akhmadeeva — Portfolio (Draft 03)
   Minimal · Typographic · Restrained
   ========================================================= */

:root {
  --bg:       #EDE8DF;
  --bg-2:     #E4DED2;
  --ink:      #14130F;
  --ink-2:    #2A2823;
  --mute:     #A8A49A;
  --mute-2:   #8A867C;
  --on-dark:  #F2EEE4;

  --sans:     "Geist", system-ui, -apple-system, sans-serif;
  --display:  "Poppins", system-ui, -apple-system, sans-serif;
  --display-nav-weight: 600;
  --display-title-weight: 700;

  --ease:     cubic-bezier(0.32, 0.72, 0, 1);

  --pad-x:    clamp(22px, 4vw, 56px);
  --nav-h:    88px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: 0; z-index: 5;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.07 0 0 0 0 0.06 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* =========================================================
   Top Navigation — distributed across the full width
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  height: var(--nav-h);
  padding: 0 var(--pad-x);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(48px, 6vw, 102px);
  color: var(--ink);
  transition: color 400ms var(--ease);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(48px, 6vw, 102px);
}
.nav-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-icon {
  color: currentColor;
  opacity: 0.45;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: opacity 350ms var(--ease);
}
.nav-icon svg {
  width: 22px;
  height: 22px;
}
.nav-icon:hover { opacity: 1; }
.nav::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 100%);
  opacity: 0;
  transition: opacity 500ms var(--ease);
}
body[data-route="home"] .nav { color: var(--on-dark); }
body[data-route="home"] .nav::before { opacity: 1; }

.nav-item {
  position: relative;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: var(--display-nav-weight);
  -webkit-text-stroke: 0.18px currentColor;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: currentColor;
  opacity: 0.45;
  transition: opacity 350ms var(--ease);
  white-space: nowrap;
}
.nav-item:hover { opacity: 0.85; }
.nav-item.active { opacity: 1; }
.nav-mark {
  font-weight: var(--display-nav-weight);
  letter-spacing: 0.04em;
}
.nav-mark.active { font-weight: var(--display-nav-weight); }

/* =========================================================
   Views
   ========================================================= */
.view {
  display: none;
  min-height: 100dvh;
  width: 100%;
  position: relative;
  animation: viewIn 600ms var(--ease) both;
}
.view.is-active { display: block; }
.view-film.is-active { display: grid; }

@keyframes viewIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =========================================================
   HOME — full-screen background video
   ========================================================= */
.view-home {
  height: 100dvh;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: #0b0a08;
}
.home-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  object-fit: cover;
  z-index: 1;
}

/* =========================================================
   FILM
   ========================================================= */
.view-film {
  grid-template-columns: 280px 1fr;
  min-height: 100dvh;
  padding-top: var(--nav-h);
}

.film-rail {
  position: sticky;
  top: var(--nav-h);
  height: calc(100dvh - var(--nav-h));
  padding: clamp(32px, 4vw, 56px) var(--pad-x);
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.film-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.film-list-item {
  padding: 8px 10px;
  cursor: pointer;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
  border-radius: 3px;
  transition: color 300ms var(--ease), background 300ms var(--ease);
}
.film-list-item:hover {
  color: var(--ink-2);
  background: rgba(20,19,15,0.05);
}
.film-list-item.active {
  color: var(--ink);
  background: rgba(20,19,15,0.08);
}

/* ---------- Film detail ---------- */
.film-stage {
  padding: clamp(32px, 4vw, 56px) clamp(16px, 2.5vw, 48px) clamp(80px, 10vw, 160px);
  min-width: 0;
}

.fd {
  display: flex;
  flex-direction: column;
  max-width: 860px;
}

.fd-title {
  font-family: var(--display);
  font-size: clamp(22px, 2.6vw, 36px);
  font-weight: var(--display-title-weight);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 12px;
  max-width: 26ch;
}
.fd-sub {
  font-size: 15px;
  color: var(--mute-2);
  margin-bottom: clamp(24px, 3vw, 36px);
}

.fd-synopsis {
  max-width: 64ch;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: clamp(40px, 5vw, 72px);
}

.fd-stills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2vw, 28px);
}
.fd-stills figure {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  aspect-ratio: 16/9;
}
.fd-stills img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.fd-empty {
  padding: clamp(40px, 6vw, 80px);
  color: var(--mute-2);
  font-size: 14px;
  text-align: center;
}

/* =========================================================
   Photo / Info shared wrappers
   ========================================================= */
.page-wrap {
  padding: calc(var(--nav-h) + clamp(40px, 6vw, 80px)) var(--pad-x) clamp(80px, 10vw, 140px);
}
.page-title {
  font-family: var(--display);
  font-size: clamp(28px, 3.5vw, 52px);
  font-weight: var(--display-title-weight);
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.page-sub {
  margin-top: 10px;
  font-size: 15px;
  color: var(--mute-2);
}

/* =========================================================
   PHOTO
   ========================================================= */
.photo-tools {
  margin-top: clamp(24px, 3vw, 36px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid rgba(20,19,15,0.18);
  border-bottom: 1px solid rgba(20,19,15,0.18);
}
.photo-tools[hidden] {
  display: none;
}
.photo-tools-title {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: var(--display-nav-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.photo-tools-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.photo-save-status {
  color: var(--mute-2);
  font-size: 0.82rem;
  min-height: 1.2em;
  text-align: right;
}
.photo-tool-button {
  appearance: none;
  border: 1px solid rgba(20,19,15,0.28);
  border-radius: 3px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: var(--display-nav-weight);
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 10px 12px;
  text-transform: uppercase;
  transition: border-color 250ms var(--ease), color 250ms var(--ease), background 250ms var(--ease);
}
.photo-tool-button:hover,
.photo-tool-button:focus-visible {
  border-color: rgba(20,19,15,0.72);
  color: var(--ink);
}
.photo-tool-button-strong {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-dark);
}
.photo-tool-button-strong:hover,
.photo-tool-button-strong:focus-visible {
  background: var(--ink-2);
  color: var(--on-dark);
}
.photo-canvas {
  margin-top: clamp(40px, 5vw, 72px);
  columns: 2;
  column-gap: clamp(12px, 1.6vw, 22px);
}
.ph {
  break-inside: avoid;
  margin-bottom: clamp(12px, 1.6vw, 22px);
  overflow: hidden;
}
.ph img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 400ms var(--ease);
}
.ph img:hover { opacity: 0.88; }
.photo-canvas.is-editing {
  columns: 2;
  column-gap: clamp(12px, 1.6vw, 22px);
}
.photo-canvas.is-editing .ph {
  position: relative;
  margin-bottom: clamp(12px, 1.6vw, 22px);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.photo-canvas.is-editing .ph:active {
  cursor: grabbing;
}
.photo-canvas.is-editing .ph img {
  width: 100%;
  height: auto;
  pointer-events: none;
}
.photo-canvas.is-editing .ph.is-dragging {
  opacity: 0.45;
}
.photo-canvas.is-editing .ph.is-drop-target {
  outline: 2px solid rgba(20,19,15,0.72);
  outline-offset: 4px;
}
.photo-controls {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 7px;
  background: rgba(237,232,223,0.84);
  backdrop-filter: blur(8px);
}
.photo-index {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: var(--display-nav-weight);
  letter-spacing: 0.06em;
  color: var(--mute-2);
}
.photo-move-group {
  display: flex;
  gap: 6px;
}
.photo-move-button {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(20,19,15,0.22);
  border-radius: 3px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: var(--display-nav-weight);
  line-height: 1;
  transition: border-color 250ms var(--ease), color 250ms var(--ease), background 250ms var(--ease);
}
.photo-move-button:hover,
.photo-move-button:focus-visible {
  border-color: rgba(20,19,15,0.68);
  color: var(--ink);
  background: rgba(20,19,15,0.05);
}
.photo-move-button:disabled {
  cursor: default;
  opacity: 0.28;
}
.photo-move-button:disabled:hover {
  border-color: rgba(20,19,15,0.22);
  color: var(--ink-2);
  background: transparent;
}

/* =========================================================
   INFO
   ========================================================= */
.info-wrap {
  padding: calc(var(--nav-h) + clamp(40px, 6vw, 80px)) var(--pad-x) clamp(60px, 8vw, 100px);
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(420px, 1.18fr) minmax(340px, 0.82fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: start;
}
.info-portrait {
  width: 100%;
  overflow: hidden;
  background: #0b0a08;
  position: sticky;
  top: calc(var(--nav-h) + 32px);
}
.info-portrait img {
  width: 100%;
  height: auto;
  display: block;
  filter: none;
}

.info-body {
  display: flex;
  flex-direction: column;
  padding-top: 0;
  max-width: 52ch;
}
.info-bio {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.info-bio p {
  font-family: var(--sans);
  font-size: 1.04rem;
  line-height: 1.66;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 1120px) {
  .nav {
    gap: 45px;
  }
  .nav-links {
    gap: 45px;
  }
  .nav-item {
    font-size: 1.35rem;
  }
}

@media (max-width: 860px) {
  :root { --nav-h: 64px; }

  .nav {
    padding: 0 10px;
    gap: 18px;
  }
  .nav-item {
    font-size: 0.75rem;
    letter-spacing: 0.03em;
  }
  .nav-links { gap: 18px; }
  .nav-icons { gap: 8px; }
  .nav-icon {
    width: 18px;
    height: 18px;
  }
  .nav-icon svg {
    width: 16px;
    height: 16px;
  }

  .view-film { grid-template-columns: 1fr; }
  .film-rail {
    position: static;
    height: auto;
    padding: 24px 20px;
  }
  .film-stage { padding: 24px 20px 80px; }
  .fd-stills { grid-template-columns: 1fr; }

  .info-wrap {
    grid-template-columns: 1fr;
    gap: clamp(24px, 4vw, 40px);
  }
  .info-portrait { position: static; }

  .photo-canvas { columns: 1; }
  .ph { margin-bottom: 14px; }
  .photo-tools {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .photo-tools-actions {
    justify-content: flex-start;
  }
  .photo-save-status {
    text-align: left;
  }
  .photo-canvas.is-editing {
    columns: 1;
  }
}
