/* Sandro Tordo Videomaker — editorial, high-contrast, zero dependencies */

:root {
  --black: #0a0a0a;
  --white: #f5f4f0;
  --grey: #d9d8d3;
  --line: #2a2a28;
  --accent: #e8402a;
  --wrap: 1680px;
  --gap: 2rem;

  /* Type system: one face per role, used everywhere for consistency.
     Title face is a bold condensed display sans — matches the video
     title-card look (the portfolio's actual dominant visual language)
     better than a novelty/handwritten face. No external font request. */
  --ff-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ff-title: Impact, "Arial Narrow Bold", Haettenschweiler, sans-serif;
  --ff-info: ui-monospace, "SF Mono", "Courier New", monospace;
}

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

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

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--ff-body);
  font-weight: 500;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("../logo/logo.png");
  background-repeat: no-repeat;
  background-position: center 55%;
  background-size: min(85vw, 850px) auto;
  filter: brightness(0) invert(1);
  opacity: 0.5;
  animation: bgDrift 24s ease-in-out infinite;
  transform-origin: center 55%;
}

@keyframes bgDrift {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(6deg) scale(1.06); }
}

.container {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

@media (min-width: 900px) {
  .container { padding-inline: 3rem; }
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
}

@media (min-width: 900px) {
  .site-header { padding: 1.75rem 3rem; }
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--ff-title);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 420px) {
  .logo { font-size: 1.05rem; }
}

@media (min-width: 500px) {
  .logo { font-size: 1.3rem; gap: 0.6rem; }
}

.logo-text {
  display: none;
  color: var(--white);
  text-shadow: 0 0 6px rgba(245, 244, 240, 0.85), 0 0 18px rgba(245, 244, 240, 0.45), 1px 0 rgba(255, 60, 120, 0.35), -1px 0 rgba(0, 200, 255, 0.2);
}

@media (min-width: 420px) {
  .logo-text { display: inline; }
}

.logo img { height: 22px; width: auto; flex-shrink: 0; }

@media (min-width: 500px) {
  .logo img { height: 27px; }
}

nav.main-nav {
  display: flex;
  gap: 0.7rem;
}

@media (min-width: 420px) {
  nav.main-nav { gap: 1rem; }
}

@media (min-width: 500px) {
  nav.main-nav { gap: 1.75rem; }
}

nav.main-nav a {
  display: inline-block;
  font-family: var(--ff-title);
  font-size: 0.95rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--white);
  text-shadow: 0 0 6px rgba(245, 244, 240, 0.85), 0 0 18px rgba(245, 244, 240, 0.45), 1px 0 rgba(255, 60, 120, 0.35), -1px 0 rgba(0, 200, 255, 0.2);
  position: relative;
  padding-bottom: 2px;
  white-space: nowrap;
}

@media (min-width: 420px) {
  nav.main-nav a { font-size: 1.05rem; }
}

@media (min-width: 500px) {
  nav.main-nav a { font-size: 1.3rem; }
}

nav.main-nav a .ch {
  display: inline-block;
}

nav.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0;
  height: 1.5px;
  background: currentColor;
  transition: width 0.25s ease;
}

nav.main-nav a:hover::after,
nav.main-nav a[aria-current="page"]::after {
  width: 100%;
}

/* ---------- Section scaffolding ---------- */

section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--line);
}

/* ---------- About page ---------- */

.about-page {
  padding-top: 7rem;
  border-bottom: none;
}

@media (min-width: 900px) {
  .about-page { padding-top: 8.5rem; }
}

.about-wrap {
  max-width: 960px;
  margin-inline: auto;
  padding: 2rem 1.5rem;
  background: rgba(10, 10, 10, 0.5);
  border-radius: 10px;
  transform: rotate(-0.3deg);
}

@media (min-width: 900px) {
  .about-wrap { padding: 3rem; }
}

.about-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 700px) {
  .about-top {
    grid-template-columns: minmax(220px, 320px) 1fr;
    align-items: center;
    gap: 3rem;
  }
}

.portrait-frame {
  aspect-ratio: 4 / 5;
  max-width: 420px;
  width: 100%;
  margin-inline: auto;
  background: linear-gradient(160deg, #1c1c1a, #0a0a0a);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  transform: rotate(-1deg);
}

@media (min-width: 700px) {
  .portrait-frame { max-width: none; margin-inline: 0; }
}

.portrait-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.signature {
  margin-top: 2.5rem;
  font-family: var(--ff-title);
  text-transform: uppercase;
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  font-weight: 400;
  color: var(--white);
  text-shadow: 3px 3px 0 rgba(232, 64, 42, 0.9), -1px -1px 0 rgba(0, 200, 255, 0.15);
  transform: rotate(-4deg) skewX(-4deg);
  display: inline-block;
  position: relative;
}

@media (min-width: 700px) {
  .signature { margin-top: 0; }
}

.signature::after {
  content: "";
  display: block;
  height: 5px;
  width: 75%;
  background: var(--accent);
  margin-top: -0.3rem;
  transform: rotate(-2deg) translateX(6%);
}

.about-bio {
  margin-top: 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.7;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #d8d7d3;
  max-width: 46ch;
}

/* Percurso: hand-drawn credit-roll list — role, connecting line, detail */
.path-section {
  margin-top: 3.5rem;
}

.path-heading {
  display: inline-block;
  font-family: var(--ff-title);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 1.2rem;
  color: var(--accent);
  transform: rotate(-2deg);
  margin-bottom: 1.5rem;
}

.path-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px dotted rgba(245, 244, 240, 0.15);
}

.path-row:last-child { border-bottom: none; }

.path-label {
  flex-shrink: 0;
  width: 3.5rem;
  font-family: var(--ff-title);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.9rem;
  color: var(--white);
}

.path-line {
  flex: 1;
  min-width: 1.5rem;
  border-bottom: 1px dashed rgba(245, 244, 240, 0.35);
  transform: translateY(-5px) rotate(-0.6deg);
}

.path-value {
  flex-shrink: 0;
  font-family: var(--ff-info);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--grey);
  text-align: right;
}

.social-row {
  margin-top: 2.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
}

.social-row a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--ff-info);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.social-row a:hover { color: var(--accent); }

.mark-asterisk {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.mark-asterisk img {
  width: 100%;
  height: 100%;
  filter: grayscale(1) brightness(1.7);
  animation: spin-slow 7s linear infinite;
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

.meta-row {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--ff-info);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--grey);
}

/* ---------- Portfolio grid (home) ---------- */

.portfolio-shell {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
  padding-top: 6rem;
}

@media (min-width: 900px) {
  .portfolio-shell { padding-top: 7.5rem; padding-inline: 3rem; gap: 2rem; }
}

.side-label {
  display: none;
}

@media (min-width: 900px) {
  .side-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    flex-shrink: 0;
    align-self: stretch;
    background: rgba(10, 10, 10, 0.5);
    border-radius: 6px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--ff-title);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--grey);
  }
}

.project-grid-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Loose, hand-cut divider lines — irregular width/rotation, not a clean rule */
.scratch-line {
  height: 1px;
  background: rgba(245, 244, 240, 0.25);
  pointer-events: none;
}

.scratch-line--a { width: 55%; margin: 0 auto 0 3%; transform: rotate(-1.4deg); }
.scratch-line--b { width: 38%; margin: 0 8% 0 auto; background: var(--accent); opacity: 0.55; transform: rotate(2.2deg); }

/* Shared button reset for every playable cell (hero / filmstrip / grid) */
.project-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.project-cell-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(155deg, #201f1c, #0a0a0a);
}

.project-cell-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.4s ease;
}

.project-cell:hover .project-cell-thumb { transform: scale(1.04); }

.project-cell-media::after {
  content: "Project image";
  position: absolute;
  right: 0.75rem;
  bottom: 0.6rem;
  font-family: var(--ff-info);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(245, 244, 240, 0.16);
  pointer-events: none;
}

.project-cell:nth-of-type(2) .project-cell-media { background: linear-gradient(155deg, #241a17, #0a0a0a); }
.project-cell:nth-of-type(3) .project-cell-media { background: linear-gradient(155deg, #1b1f22, #0a0a0a); }
.project-cell:nth-of-type(4) .project-cell-media { background: linear-gradient(155deg, #201a24, #0a0a0a); }
.project-cell:nth-of-type(5) .project-cell-media { background: linear-gradient(155deg, #1a2320, #0a0a0a); }
.project-cell:nth-of-type(6) .project-cell-media { background: linear-gradient(155deg, #231d17, #0a0a0a); }
.project-cell:nth-of-type(7) .project-cell-media { background: linear-gradient(155deg, #1c1c24, #0a0a0a); }
.project-cell:nth-of-type(8) .project-cell-media { background: linear-gradient(155deg, #241b1d, #0a0a0a); }
.project-cell:nth-of-type(9) .project-cell-media { background: linear-gradient(155deg, #1a1f24, #0a0a0a); }
.project-cell:nth-of-type(10) .project-cell-media { background: linear-gradient(155deg, #201f17, #0a0a0a); }

/* Title card overlay: big glowing title + small credit line, on the image itself */
.project-cell-caption {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1.25rem;
  padding-bottom: 18%;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.65) 100%);
  pointer-events: none;
}

.cap-title {
  font-family: var(--ff-title);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 0.92;
  color: var(--accent);
  font-size: clamp(1.3rem, 3vw, 2rem);
  text-shadow: 0 0 6px rgba(232, 64, 42, 0.85), 0 0 18px rgba(232, 64, 42, 0.45), 1px 0 rgba(255, 60, 120, 0.35), -1px 0 rgba(0, 200, 255, 0.2);
}

.cap-meta {
  display: flex;
  gap: 1rem;
}

.cap-tag,
.cap-year {
  font-family: var(--ff-info);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 64, 42, 0.85);
}

/* Hero: one big featured project up top */
.project-cell--hero .project-cell-media { aspect-ratio: 16 / 8; }
.project-cell--hero .project-cell-thumb { filter: contrast(1.05); }
.project-cell--hero .cap-title { font-size: clamp(2rem, 5.5vw, 3.6rem); }
.project-cell--hero .cap-tag, .project-cell--hero .cap-year { font-size: 0.7rem; }

/* Filmstrip: paginated set of videos, 3 across, 6 per page, cycled with an arrow */
.filmstrip {
  position: relative;
}

.filmstrip-page {
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.filmstrip-page.is-active { display: grid; }

@media (min-width: 700px) {
  .filmstrip-page { grid-template-columns: repeat(3, 1fr); }
}

.filmstrip-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.filmstrip-dots {
  display: flex;
  gap: 0.4rem;
}

.filmstrip-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(245, 244, 240, 0.25);
}

.filmstrip-dots span.is-active { background: var(--accent); }

.filmstrip-next {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid rgba(245, 244, 240, 0.35);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-family: var(--ff-title);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.filmstrip-next:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.filmstrip-next::after {
  content: "\2192";
  font-size: 1rem;
  line-height: 1;
}

.project-cell-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.55);
  border: 1.5px solid rgba(245, 244, 240, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
  pointer-events: none;
}

.project-cell--hero .project-cell-play { width: 60px; height: 60px; }

.project-cell-play img {
  width: 55%;
  height: 55%;
  object-fit: contain;
}

.project-cell:hover .project-cell-play {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.08);
}

.project-cell-iframe {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  border: 0;
}

.project-cell.is-playing .project-cell-play { opacity: 0; pointer-events: none; }
.project-cell.is-playing { cursor: default; }

.placeholder-note {
  margin: 2rem 0 0;
  padding: 1.25rem 1.5rem;
  background: rgba(10, 10, 10, 0.5);
  border: 1px dashed rgba(245, 244, 240, 0.25);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--grey);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 2.5rem 0;
  background: rgba(10, 10, 10, 0.55);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--ff-info);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--grey);
}

.site-footer a:hover { color: var(--white); }

.site-credit {
  margin-top: 1rem;
  text-align: center;
  font-family: var(--ff-info);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(245, 244, 240, 0.3);
}

/* ---------- Intro animation ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--accent);
  animation: introFade 0.7s ease forwards;
  animation-delay: 3.3s;
}

.intro::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.12), transparent 65%),
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
  animation: introBgPulse 2.6s ease-in-out infinite;
}

.intro-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
}

.intro-logo {
  width: 84px;
  opacity: 0;
  filter: brightness(0) invert(1);
  transform: scale(0.15) rotate(-260deg);
  animation:
    introLogoSpin 0.9s cubic-bezier(0.2, 1, 0.3, 1) forwards,
    introLogoPulse 1.6s ease-in-out 0.9s infinite;
}

.intro-tag {
  margin-top: 1.5rem;
  opacity: 0;
  font-family: var(--ff-body);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--white);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  transform: translateY(10px);
  animation: introUpFlat 0.6s ease forwards;
  animation-delay: 0.75s;
}

@keyframes introLogoSpin {
  0% { opacity: 0; transform: scale(0.15) rotate(-260deg); }
  55% { opacity: 1; transform: scale(1.15) rotate(15deg); }
  75% { transform: scale(0.94) rotate(-8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes introLogoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

@keyframes introBgPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes introUpFlat {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes introFade {
  0% { opacity: 1; visibility: visible; }
  99% { opacity: 0; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .intro { display: none; }
}
