/* ============================================================
   Sebastian Jurić — portfolio styles
   Palette: studio-console dark + VU-meter amber
   ============================================================ */

/* ---------- Font ---------- */
@font-face {
  font-family: "Archivo";
  src: url("../vendor/fonts/archivo-latin-standard-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62.5% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E;
}
@font-face {
  font-family: "Archivo";
  src: url("../vendor/fonts/archivo-latin-ext-standard-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62.5% 125%;
  font-display: swap;
  unicode-range: U+0100-024F, U+1E00-1EFF; /* ć, š, ž … */
}

/* ---------- Tokens ---------- */
:root {
  --bg: #101218;
  --bg-raised: #171a22;
  --surface: #1c202b;
  --line: #262b38;
  --text: #e9e7e0;
  --muted: #98a0af;
  --amber: #f2a43c;
  --amber-soft: rgba(242, 164, 60, 0.14);
  --wave: #46506244;
  --wave-solid: #465062;

  --font-display: "Archivo", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --container: 1100px;
  --header-h: 64px;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

img, video { max-width: 100%; height: auto; display: block; }

.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}

section { scroll-margin-top: calc(var(--header-h) + 12px); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-stretch: 112%;
  line-height: 1.08;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); font-weight: 780; }
h2 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 720; }
h3 { font-size: 1.25rem; font-weight: 640; }

p { margin: 0 0 1em; }

a { color: var(--text); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

.accent { color: var(--amber); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1rem;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 200;
  background: var(--amber);
  color: #14161d;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  height: var(--header-h);
  z-index: 100;
  background: rgba(16, 18, 24, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; color: var(--text); }
.brand-mark svg { width: 34px; height: 34px; display: block; }
.brand:hover { color: var(--amber); }
.brand, .brand-mark svg { transition: color 0.25s var(--ease); }

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-family: var(--font-display);
  font-stretch: 105%;
  font-weight: 520;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--muted);
  padding: 0.35rem 0.1rem;
  position: relative;
  transition: color 0.25s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--amber);
  transition: right 0.3s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link[aria-current="true"] { color: var(--text); }
.nav-link[aria-current="true"]::after { right: 0; }

/* Hamburger (mobile only) */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.nav-toggle-bar {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(16, 18, 24, 0.97);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 0 1rem;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.28s var(--ease), opacity 0.28s var(--ease), visibility 0s linear 0.28s;
  }
  .nav-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.28s var(--ease), opacity 0.28s var(--ease);
  }
  .nav-menu li { text-align: center; }
  .nav-link {
    display: block;
    padding: 0.9rem 1rem;
    font-size: 1.1rem;
  }
  .nav-link::after { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: calc(var(--header-h) + clamp(3rem, 9vh, 6rem)) 0 clamp(3rem, 8vh, 6rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero-lead { font-size: 1.25rem; max-width: 34ch; }
.hero-sub { color: var(--muted); max-width: 40ch; }

.hero-photo img {
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 0 var(--amber-soft), 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* Signature: VU-meter EQ bars (doubles as an easter-egg button) */
.eq {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  margin-top: 0.6rem;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s var(--ease);
}
.eq:active { transform: scale(0.9); }
.eq span {
  width: 6px;
  height: 100%;
  background: var(--amber);
  border-radius: 3px;
  animation: eq-bounce 1.15s var(--ease) infinite;
  transform-origin: center;
}
.eq span:nth-child(1) { animation-delay: 0s;    animation-duration: 1.30s; }
.eq span:nth-child(2) { animation-delay: 0.18s; animation-duration: 1.05s; }
.eq span:nth-child(3) { animation-delay: 0.32s; animation-duration: 1.42s; }
.eq span:nth-child(4) { animation-delay: 0.11s; animation-duration: 0.96s; }
.eq span:nth-child(5) { animation-delay: 0.26s; animation-duration: 1.22s; }

@keyframes eq-bounce {
  0%, 100% { transform: scaleY(0.25); }
  50%      { transform: scaleY(1); }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { max-width: 420px; }
}

/* ---------- Why work with me ---------- */
.why { padding: clamp(3rem, 8vh, 5.5rem) 0; border-top: 1px solid var(--line); }
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}
.why-item h3 { color: var(--amber); }
.why-item p { color: var(--muted); }
@media (max-width: 760px) { .why-grid { grid-template-columns: 1fr; } }

/* ---------- Demo reel ---------- */
.reel { padding: clamp(3rem, 8vh, 6rem) 0; border-top: 1px solid var(--line); }

.reel-subhead {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 3rem 0 1.4rem;
}

/* Video grid: portrait = 1 cell, landscape = 2 cells of a 4-col grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
}
.video-card { grid-column: span 1; }
.video-card.landscape { grid-column: span 2; }

@media (max-width: 1020px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .video-card.landscape { grid-column: span 2; }
}
@media (max-width: 620px) {
  .video-grid { grid-template-columns: 1fr; }
  .video-card, .video-card.landscape { grid-column: span 1; }
}

.video-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--line);
}
.video-card.portrait  .video-frame { aspect-ratio: 295 / 639; }
.video-card.landscape .video-frame { aspect-ratio: 16 / 9; }
.video-frame video,
.video-facade img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* In fullscreen the video element IS the screen — never crop there:
   scale by the longest side and letterbox the rest. */
.video-frame video:fullscreen { object-fit: contain; }
.video-frame video:-webkit-full-screen { object-fit: contain; }

.video-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.video-facade .play-badge {
  position: relative;
  z-index: 1;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(16, 18, 24, 0.72);
  border: 1px solid rgba(233, 231, 224, 0.25);
  display: grid;
  place-items: center;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.video-facade .play-badge::after {
  content: "";
  display: block;
  width: 0; height: 0;
  border-left: 18px solid var(--amber);
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  margin-left: 4px;
}
.video-facade:hover .play-badge,
.video-facade:focus-visible .play-badge {
  transform: scale(1.08);
  background: rgba(16, 18, 24, 0.9);
}

.video-meta { padding: 0.9rem 0.25rem 0; }
.video-meta h4 {
  font-family: var(--font-display);
  font-stretch: 108%;
  font-size: 1.05rem;
  margin: 0 0 0.3rem;
}
.video-meta p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---------- Audio list ---------- */
.audio-list { display: grid; gap: 1.1rem; }

.audio-track {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.2rem;
  align-items: center;
}

.audio-play {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--amber);
  transition: border-color 0.25s var(--ease), transform 0.2s var(--ease);
}
.audio-play:hover { border-color: var(--amber); transform: scale(1.05); }
.audio-play .icon-play,
.audio-play .icon-pause { display: block; }
.audio-play .icon-play {
  width: 0; height: 0;
  border-left: 14px solid currentColor;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 3px;
}
.audio-play .icon-pause {
  width: 12px; height: 16px;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}
.audio-track:not(.is-playing) .icon-pause { display: none; }
.audio-track.is-playing .icon-play { display: none; }

.audio-body { min-width: 0; }

.audio-head {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.audio-head h4 {
  font-family: var(--font-display);
  font-stretch: 108%;
  font-size: 1.02rem;
  margin: 0;
}
.audio-time {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  margin-left: auto;
}

/* mini EQ shows only while playing */
.audio-eq {
  display: inline-flex;
  gap: 3px;
  align-items: flex-end;
  height: 12px;
  visibility: hidden;
}
.audio-track.is-playing .audio-eq { visibility: visible; }
.audio-eq span {
  width: 3px; height: 100%;
  background: var(--amber);
  border-radius: 2px;
  animation: eq-bounce 0.9s ease-in-out infinite;
}
.audio-eq span:nth-child(2) { animation-delay: 0.25s; }
.audio-eq span:nth-child(3) { animation-delay: 0.45s; }

.waveform { width: 100%; }
.waveform > div { cursor: pointer; }

.video-meta a, .audio-blurb a, .group-blurb a, .rec-quote a {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.video-meta a:hover, .audio-blurb a:hover, .group-blurb a:hover, .rec-quote a:hover {
  filter: brightness(1.15);
}

.audio-blurb {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0.5rem 0 0;
}

/* ---- Album / group cards ---- */
.audio-group {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem 0.4rem;
}

.group-head {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.group-cover {
  width: 88px;
  height: 88px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.group-head-text { min-width: 0; }
.group-title {
  font-family: var(--font-display);
  font-stretch: 108%;
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}
.group-blurb {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.group-tracks { border-top: 1px solid var(--line); }

/* member rows: quieter than standalone cards */
.audio-track.in-group {
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.85rem 0;
}
.audio-track.in-group:last-child { border-bottom: 0; }
.audio-track.in-group .audio-play { width: 44px; height: 44px; }
.audio-track.in-group .audio-play .icon-play {
  border-left-width: 12px;
  border-top-width: 8px;
  border-bottom-width: 8px;
}
.audio-track.in-group .audio-head h4 { font-size: 0.95rem; }

.track-no {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  .audio-group { padding: 1rem 1rem 0.3rem; }
  .group-cover { width: 68px; height: 68px; }
}

@media (max-width: 560px) {
  .audio-track { grid-template-columns: 1fr; }
  .audio-play { width: 46px; height: 46px; }
}

/* ---------- Recommendations ---------- */
.recs { padding: clamp(3rem, 8vh, 5.5rem) 0; border-top: 1px solid var(--line); }
.recs-list { display: grid; gap: 1.4rem; margin-top: 1.5rem; }
.rec-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
}
.rec-quote { font-size: 1.1rem; margin-bottom: 0.9rem; }
.rec-by { color: var(--muted); font-size: 0.9rem; margin: 0; }
.rec-by strong { color: var(--text); font-weight: 600; }

/* ---------- Contact ---------- */
.contact { padding: clamp(3rem, 8vh, 6rem) 0; border-top: 1px solid var(--line); }
.contact-inner { max-width: 640px; }
.contact-lead { color: var(--muted); margin-bottom: 2rem; }

.contact-form { display: grid; gap: 1.2rem; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.form-field { display: grid; gap: 0.4rem; }
.form-field label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-field input,
.form-field textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.2s var(--ease);
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--amber);
}
.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] { border-color: #e2604f; }
.field-error { color: #e88b7d; font-size: 0.85rem; margin: 0; }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.btn-submit {
  justify-self: start;
  font-family: var(--font-display);
  font-stretch: 108%;
  font-weight: 640;
  font-size: 1rem;
  color: #14161d;
  background: var(--amber);
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 2.2rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
}
.btn-submit:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn-submit:disabled { opacity: 0.6; cursor: default; transform: none; }

.form-status { min-height: 1.4em; margin: 0; font-size: 0.95rem; }
.form-status.ok { color: #8fd694; }
.form-status.err { color: #e88b7d; }
.form-status a { color: inherit; text-underline-offset: 3px; }

.form-success {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}
.form-success h3 { color: var(--amber); }
.form-success p { color: var(--muted); margin: 0; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0 2.5rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}
.footer-logo { color: var(--text); transition: color 0.25s var(--ease); }
.footer-logo:hover { color: var(--amber); }
.footer-logo svg { width: min(340px, 70vw); height: auto; display: block; }
.footer-note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

/* ---------- Scroll reveals ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal-delay { transition-delay: 0.12s; }
.reveal-delay2 { transition-delay: 0.24s; }
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .eq span, .audio-eq span { animation: none; transform: scaleY(0.55); }
}
