/* ═══════════════════════════════════════════
   TOKENS
   ═══════════════════════════════════════════ */
:root {
  --bg: #08090c;
  --bg-2: #0e1015;
  --surface: #141720;
  --surface-2: #1b1f2b;
  --line: #262b39;
  --text: #f2f3f7;
  --muted: #8a90a2;

  --orange: #ff6a1f;
  --blue: #3d8bff;

  --font-display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --font-ui: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --max: 1280px;
}

/* ═══════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { position: relative; }

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 1rem;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: fit-content;
  z-index: 100;
  display: flex;
  gap: .15rem;
  padding: .35rem;
  background: rgba(14, 16, 21, .78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.nav a {
  position: relative;
  z-index: 1;
  padding: .6rem 1.35rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: 999px;
  transition: color .25s ease;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); }

.nav-indicator {
  --ind: var(--orange);
  position: absolute;
  z-index: 0;
  top: .35rem;
  bottom: .35rem;
  left: 0;
  width: 0;
  background: var(--surface-2);
  border-radius: 999px;
  opacity: 0;
}
.nav-indicator::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 18px;
  height: 2px;
  margin-left: -9px;
  border-radius: 2px;
  background: var(--ind);
  transition: background-color .3s ease;
}
.nav-indicator.ready {
  opacity: 1;
  transition: transform .35s cubic-bezier(.4, 0, .2, 1), width .35s cubic-bezier(.4, 0, .2, 1);
}

/* ═══════════════════════════════════════════
   1. HERO
   ═══════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 6rem var(--gutter) 2rem;
  overflow: hidden;
  /* faint 12-column guide lines, like an editor's safe-area grid */
  background-image: linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: calc((100% - 2 * var(--gutter)) / 12) 100%;
  background-position: var(--gutter) 0;
}

.hero-name {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .24em;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 400;
  /* "IGOR EDITOR" spans ~4.45em: scale it to fill one line of the container */
  font-size: min(calc((100vw - 2 * var(--gutter)) / 4.52), calc(var(--max) / 4.52));
  line-height: .86;
  letter-spacing: .005em;
  text-transform: uppercase;
  max-width: var(--max);
  width: 100%;
  margin-inline: auto;
  padding-block: 1rem 2rem;
}
.hero-name span { display: block; }
.name-igor { color: var(--orange); }
.name-editor { color: var(--blue); }

/* ── Timeline ── */
.timeline {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
}

.tl-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .6rem;
  margin-bottom: .6rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .06em;
}
.timecode { font-variant-numeric: tabular-nums; min-width: 11ch; text-align: right; }

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: .15; } }

.tl-body {
  position: relative;
  display: grid;
  gap: 6px;
  padding-bottom: .25rem;
}

.ruler {
  height: 16px;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(90deg, #4a5166 1px, transparent 1px),
    linear-gradient(90deg, #2d3242 1px, transparent 1px);
  background-size: 10% 100%, 2.5% 45%;
  background-position: 0 100%, 0 100%;
  background-repeat: repeat-x;
}

.track {
  position: relative;
  height: 34px;
  background: rgba(255, 255, 255, .02);
  border-radius: 4px;
}
.track-audio { height: 28px; }

.clip {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--x) * 1%);
  width: calc(var(--w) * 1%);
  border-radius: 4px;
  background: color-mix(in srgb, var(--c) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  overflow: hidden;
  transition: background-color .25s ease, border-color .25s ease;
}
.clip.orange { --c: var(--orange); }
.clip.blue { --c: var(--blue); }
.clip.on {
  background: var(--c);
  border-color: var(--c);
}

/* audio waveform inside clips */
.clip.wave {
  display: flex;
  align-items: center;
  gap: 1px;
  padding-inline: 2px;
}
.clip.wave i {
  flex: 1;
  min-width: 0;
  background: color-mix(in srgb, var(--c) 75%, transparent);
  border-radius: 1px;
  transition: background-color .25s ease;
}
.clip.wave.on { background: color-mix(in srgb, var(--c) 30%, transparent); }
.clip.wave.on i { background: var(--c); }

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--text);
  will-change: transform;
  z-index: 3;
}
.playhead::before { /* head marker */
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 12px;
  height: 14px;
  margin-left: -6px;
  background: var(--text);
  clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%);
}
.playhead::after { /* soft trail rising behind the name */
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 1px;
  height: 55vh;
  margin-bottom: -14px;
  background: linear-gradient(to top, rgba(242, 243, 247, .28), transparent);
}

/* ═══════════════════════════════════════════
   SECTION HEADINGS
   ═══════════════════════════════════════════ */
.section-head {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 10vw, 8.5rem);
  line-height: .85;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.rule {
  flex: 1;
  height: 4px;
  margin-bottom: .55rem;
  background: linear-gradient(90deg, var(--orange) 0 50%, var(--blue) 50% 100%);
}

/* ═══════════════════════════════════════════
   2. PORTFOLIO
   ═══════════════════════════════════════════ */
.portfolio {
  background: var(--bg-2);
  padding-bottom: clamp(5rem, 10vw, 9rem);
}

/* film-strip edge: marks the start of the portfolio */
.filmstrip {
  height: 38px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='38'%3E%3Crect x='9' y='7' width='12' height='7' rx='2' fill='%230e1015'/%3E%3Crect x='9' y='24' width='12' height='7' rx='2' fill='%230e1015'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--orange) 0 50%, var(--blue) 50% 100%) 1;
  margin-bottom: clamp(4rem, 8vw, 7rem);
}

.projects {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(1.25rem, 3vw, 2.5rem);
  row-gap: clamp(3.5rem, 6vw, 5.5rem);
  align-items: start;
}

.p1 { grid-column: 1 / 8; }
.p2 { grid-column: 8 / 13; margin-top: clamp(4rem, 9vw, 8rem); }
.p3 { grid-column: 1 / 6;  margin-top: clamp(0rem, 2vw, 1.5rem); }
.p4 { grid-column: 6 / 13; margin-top: clamp(2rem, 7vw, 6.5rem); }

.project-link {
  display: block;
  position: relative;
}

.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: var(--surface);
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 11px,
    rgba(255, 255, 255, .025) 11px 12px
  );
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.frame .media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.frame .media img,
.frame .media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* viewfinder crop marks */
.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 0 solid var(--accent);
  pointer-events: none;
  z-index: 2;
}
.corner.tl { top: -9px;    left: -9px;  border-top-width: 2px;    border-left-width: 2px; }
.corner.tr { top: -9px;    right: -9px; border-top-width: 2px;    border-right-width: 2px; }
.corner.bl { bottom: -9px; left: -9px;  border-bottom-width: 2px; border-left-width: 2px; }
.corner.br { bottom: -9px; right: -9px; border-bottom-width: 2px; border-right-width: 2px; }

.project-meta {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-top: 1.4rem;
}
.num {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.25rem);
  line-height: .9;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
  letter-spacing: .02em;
}
.bar {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0 14%, var(--line) 14% 100%);
}

.project.no-link .project-link { cursor: default; }

/* ═══════════════════════════════════════════
   3. CONTACT
   ═══════════════════════════════════════════ */
.contact {
  padding: clamp(6rem, 11vw, 9rem) 0 clamp(5rem, 9vw, 8rem);
  border-top: 1px solid var(--line);
}

/* centered heading: title on top, two-tone rule below */
.contact .section-head {
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}
.contact .section-head .rule {
  flex: none;
  width: clamp(72px, 10vw, 120px);
  margin-bottom: 0;
}

.contact-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.avatar {
  flex: none;
  width: clamp(120px, 13vw, 168px);
  aspect-ratio: 1;
}
.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  display: grid;
  place-items: end center;
}
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-ph {
  width: 62%;
  fill: var(--surface-2);
  stroke: #303649;
  stroke-width: .6;
  margin-bottom: -2px;
}

.contact-links {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: .6rem;
}

.contact-btn {
  --accent: var(--blue);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: center;
  width: 136px;
  height: 44px;
  padding: 0 .5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .25s ease, transform .15s ease;
}
.contact-btn:hover { border-color: var(--accent); }
.contact-btn:active { transform: scale(.985); }

.contact-btn .ic {
  position: relative;
  z-index: 1;
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.contact-btn .ic svg { width: 16px; height: 16px; }

.contact-btn .label {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1;
}

/* click feedback */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  opacity: .32;
  transform: scale(0);
  pointer-events: none;
  animation: ripple .6s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes ripple {
  to { transform: scale(1); opacity: 0; }
}

.contact-btn.pulse { animation: flash .5s ease; }
.contact-btn.pulse .ic { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }

@keyframes flash {
  0%   { border-color: var(--accent); }
  100% { border-color: var(--line); }
}
@keyframes pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(.78) rotate(-8deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .p1 { grid-column: 1 / 8; }
  .p2 { grid-column: 8 / 13; }
  .p3 { grid-column: 1 / 6; }
  .p4 { grid-column: 6 / 13; }

  .contact-body { gap: 2.5rem; }
}

@media (max-width: 720px) {
  .hero { padding-top: 5.5rem; }

  .ruler { height: 12px; }
  .track { height: 28px; }
  .track-audio { height: 22px; }
  .tl-head { font-size: .72rem; }

  .projects {
    display: flex;
    flex-direction: column;
    row-gap: 3.5rem;
  }
  .project { width: 100%; margin-top: 0 !important; }
  .p2, .p4 { width: 88%; align-self: flex-end; }
  .p1, .p3 { width: 94%; align-self: flex-start; }

  .avatar { width: 128px; }
}

@media (max-width: 480px) {
  .contact-links { gap: .4rem; }
  .contact-btn { width: 104px; height: 40px; gap: .5rem; padding: 0 .4rem; }
  .contact-btn .ic { width: 26px; height: 26px; }
  .contact-btn .label { font-size: .9rem; }
}

@media (max-width: 420px) {
  .nav a { padding: .55rem .95rem; font-size: .72rem; letter-spacing: .12em; }
  .section-head { gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rec-dot { animation: none; }
  .ripple, .contact-btn.pulse, .contact-btn.pulse .ic { animation: none; }
}
