/* ==========================================================================
   tonymode / tonyvideo.co
   ========================================================================== */

:root {
  --bg: #0a0a0b;
  --bg-2: #121214;
  --line: rgba(255, 255, 255, 0.09);
  --text: #ecebe6;
  --muted: #8d8c86;
  --accent: #ff5b2e;

  --display: "Syne", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--bg); }

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

.skip {
  position: fixed; left: 1rem; top: -3rem; z-index: 100;
  padding: 0.5rem 1rem; background: var(--accent); color: var(--bg); font-weight: 600;
}
.skip:focus { top: 1rem; }

/* Keyframe diamond: the site's recurring mark */
.key {
  display: inline-block;
  width: 0.5em; height: 0.5em;
  margin-right: 0.6em;
  background: var(--accent);
  transform: rotate(45deg) translateY(-0.12em);
}

.label {
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Playhead + nav ---------- */

.playhead {
  position: fixed; inset: 0 0 auto; z-index: 60;
  height: 2px;
}
.playhead span {
  display: block; height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
}

.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: 1.1rem var(--pad);
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.is-solid {
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--line);
}

.brand {
  font: 800 1.05rem/1 var(--display);
  letter-spacing: 0.14em;
}

.nav nav { display: flex; gap: 1.75rem; margin-left: auto; }
.nav nav a {
  position: relative;
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.nav nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.45rem;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.nav nav a:hover,
.nav nav a.is-current { color: var(--text); }
.nav nav a:hover::after,
.nav nav a.is-current::after { transform: scaleX(1); transform-origin: left; }

.timecode {
  font: 400 0.78rem/1 var(--mono);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: 7rem var(--pad) 6.5rem;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000 center / cover no-repeat;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.hero-bg.is-ready { opacity: 1; }

.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 70% 30%, transparent 0%, rgba(10, 10, 11, 0.55) 70%),
    linear-gradient(to bottom, rgba(10, 10, 11, 0.3), transparent 30%, rgba(10, 10, 11, 0.85) 88%, var(--bg));
}
/* film grain */
.hero-shade::after {
  content: ""; position: absolute; inset: 0;
  opacity: 0.07;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem;
  margin-bottom: 1.6rem;
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow i {
  width: 0.4rem; height: 0.4rem;
  background: var(--accent);
  transform: rotate(45deg);
}

.hero-title {
  font-size: clamp(3.2rem, 13.2vw, 13rem);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero-title .line > span {
  display: inline-block;
  transform: translateY(105%);
  animation: rise 1.2s var(--ease-out) forwards;
}
.hero-title .line:nth-child(2) > span {
  animation-delay: 0.12s;
  -webkit-text-stroke: 1.5px var(--text);
  color: transparent;
}
@keyframes rise { to { transform: none; } }

.hero-sub {
  margin: 1.8rem 0 2.2rem;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: #c9c8c2;
}

.btn {
  display: inline-flex; align-items: center; gap: 0.7rem;
  padding: 0.95rem 1.5rem 0.95rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  font: 500 0.8rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.btn svg { width: 1rem; height: 1rem; fill: var(--accent); transition: fill 0.3s; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn:hover svg { fill: var(--bg); }

/* Timeline ruler along the bottom of the hero */
.ruler {
  position: absolute; left: 0; right: 0; bottom: 2rem;
  height: 14px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 1px, transparent 1px 80px) bottom / 100% 14px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 16px) bottom / 100% 6px no-repeat;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(5rem, 11vw, 9rem) var(--pad);
  border-top: 1px solid var(--line);
}

.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head .label { margin-bottom: 1.25rem; }
.section h2 {
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  letter-spacing: -0.03em;
}

/* ---------- Work ---------- */

.filters {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-bottom: 2rem;
}
.chip {
  padding: 0.6rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: none;
  color: var(--muted);
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: dense;
  counter-reset: clip;
  gap: clamp(1rem, 2vw, 1.75rem);
}

.card { counter-increment: clip; }
.card.is-hidden { display: none; }
.card.is-entering { animation: card-in 0.6s var(--ease-out) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px); } }

.card--feature { grid-column: span 2; grid-row: span 2; }

.card a { display: flex; flex-direction: column; height: 100%; }

.card figure {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg-2);
}
.card--feature figure { flex: 1; aspect-ratio: auto; min-height: 0; }

.card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out), filter 0.6s var(--ease-out);
  filter: saturate(0.9);
}
/* dark scrim + scanline sweep over the thumbnail on hover */
.card figure > .sweep {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(100deg, transparent 35%, rgba(255, 91, 46, 0.22) 48%, rgba(255, 255, 255, 0.12) 50%, transparent 62%) 120% 0 / 250% 100% no-repeat,
    rgba(10, 10, 11, 0);
  transition: background-color 0.5s;
}

/* play button + timecode overlay */
.card figure::before {
  content: "";
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: 4.25rem; height: 4.25rem;
  margin: -2.125rem 0 0 -2.125rem;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230a0a0b'%3E%3Cpath d='M8 6v12l10-6z'/%3E%3C/svg%3E") center / 44% no-repeat;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s, transform 0.5s var(--ease-out);
}
.card figure::after {
  content: counter(clip, decimal-leading-zero);
  position: absolute; left: 0.8rem; top: 0.75rem;
  z-index: 2;
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
  background: rgba(10, 10, 11, 0.7);
  font: 500 0.7rem/1 var(--mono);
  color: var(--text);
}

.card a:hover img,
.card a:focus-visible img { transform: scale(1.08); filter: blur(5px) saturate(1.2) brightness(0.8); }
.card a:hover .sweep,
.card a:focus-visible .sweep {
  background-color: rgba(10, 10, 11, 0.25);
  animation: sweep 0.9s var(--ease-out);
}
@keyframes sweep { from { background-position: 120% 0; } to { background-position: -20% 0; } }
.card a:hover figure::before,
.card a:focus-visible figure::before { opacity: 1; transform: none; }

.meta { padding: 1rem 0.15rem 0; }
.tag {
  display: block;
  margin-bottom: 0.55rem;
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.meta h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.card--feature .meta h3 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
.meta p { margin-top: 0.35rem; font-size: 0.92rem; color: var(--muted); }

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

.about-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
}
.about-copy p + p { margin-top: 1.2rem; }
.about-copy p { max-width: 58ch; color: #c2c1bb; font-size: 1.05rem; }
.about-copy .lede {
  color: var(--text);
  font: 500 clamp(1.4rem, 2.4vw, 1.9rem)/1.3 var(--display);
  letter-spacing: -0.01em;
}

.about-list {
  display: grid;
  margin: 0;
  align-content: start;
}
.about-list dt {
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.about-list dd { margin: 0 0 0.45rem; }

/* ---------- Contact ---------- */

.contact { padding-bottom: clamp(4rem, 8vw, 6rem); }
.contact .label { margin-bottom: 1.5rem; }
.contact-title {
  font-size: clamp(2.8rem, 8.5vw, 7.5rem) !important;
  line-height: 0.95 !important;
}
.contact-title em {
  font-style: normal;
  color: var(--accent);
}

.email {
  display: inline-block;
  margin-top: clamp(2rem, 4vw, 3rem);
  font: 500 clamp(1.2rem, 3vw, 2rem)/1.2 var(--display);
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 2px no-repeat;
  padding-bottom: 0.3rem;
  transition: background-size 0.5s var(--ease-out), color 0.3s;
}
.email:hover { background-size: 100% 2px; color: var(--accent); }

.socials { display: flex; gap: 1.75rem; margin-top: 2rem; }
.socials a {
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.socials a::after { content: " \2197"; }
.socials a:hover { color: var(--text); }

.footer {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 1.75rem var(--pad);
  border-top: 1px solid var(--line);
  font: 400 0.75rem/1 var(--mono);
  color: var(--muted);
}
.footer a:hover { color: var(--text); }

/* ---------- Player ---------- */

.player {
  width: min(92vw, 1400px);
  max-width: none; max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.player::backdrop {
  background: rgba(5, 5, 6, 0.92);
  backdrop-filter: blur(6px);
}
.player[open] { animation: player-in 0.45s var(--ease-out); }
@keyframes player-in { from { opacity: 0; transform: scale(0.96); } }

.player-frame {
  aspect-ratio: 16 / 9;
  width: min(100%, calc(85vh * 16 / 9));
  margin: 0 auto;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}
.player-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

.player-close {
  position: fixed; top: 1.25rem; right: 1.25rem;
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(10, 10, 11, 0.6);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.3s var(--ease-out);
}
.player-close svg { width: 1.2rem; height: 1.2rem; stroke: var(--text); stroke-width: 2; stroke-linecap: round; fill: none; }
.player-close:hover { background: var(--accent); border-color: var(--accent); transform: rotate(90deg); }

/* ---------- Scroll reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.js .reveal.is-in { opacity: 1; transform: none; }
.hero .reveal { transition-delay: 0.35s; }
.hero .btn.reveal { transition-delay: 0.5s; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card--feature { grid-row: auto; }
  .card--feature figure { aspect-ratio: 16 / 9; flex: none; }
  .about-body { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav { gap: 1rem; }
  .nav nav { gap: 1.1rem; }
  .timecode { display: none; }
  .grid { grid-template-columns: 1fr; }
  .card--feature { grid-column: auto; }
  .hero { padding-bottom: 5rem; }
  .hero-title .line:nth-child(2) > span { -webkit-text-stroke-width: 1px; }
  .card figure::before {
    left: auto; top: auto; right: 0.75rem; bottom: 0.75rem;
    width: 2.6rem; height: 2.6rem; margin: 0;
    opacity: 1; transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
