/* ==========================================================================
   SirPaul — Portfolio
   Design system: dark, high-contrast, editorial-performance aesthetic.
   ========================================================================== */

:root {
  --bg: #0a0a0a;
  --bg-alt: #101010;
  --bg-raise: #161616;
  --text: #f4f2ec;
  --text-dim: #8d8b84;
  --text-faint: #55534d;
  --accent: #f2503f;      /* red — urgency, appetite, "act now" */
  --accent-soft: #f2503f1a;
  --line: rgba(244, 242, 236, 0.1);
  --line-strong: rgba(244, 242, 236, 0.22);

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.65, 0, 0.35, 1);

  --container: 1280px;
  --gutter: clamp(20px, 5vw, 64px);
}

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

html {
  background: var(--bg);
  color-scheme: dark;
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

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

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; background: none; border: none; color: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------------------------------------------------------------- Type -- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.text-dim { color: var(--text-dim); }

/* --------------------------------------------------------- Scroll fx --- */

/* [data-reveal] elements are visible by default — this is the no-JS /
   JS-failed-to-load fallback. Only when the "js" class lands on <html>
   (added synchronously in <head>, before paint) do they hide-then-reveal.
   This guarantees content is never permanently invisible. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  will-change: transform, opacity;
}
.js [data-reveal].is-visible {
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-delay="1"].is-visible { transition-delay: 0.08s; }
[data-reveal-delay="2"].is-visible { transition-delay: 0.16s; }
[data-reveal-delay="3"].is-visible { transition-delay: 0.24s; }
[data-reveal-delay="4"].is-visible { transition-delay: 0.32s; }

/* ------------------------------------------------------------ Cursor --- */

.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: width 0.25s var(--ease), height 0.25s var(--ease);
}
.cursor-dot.is-hover { width: 46px; height: 46px; }
@media (hover: none), (max-width: 860px) { .cursor-dot { display: none; } }

/* --------------------------------------------------------- Page fade --- */

/* Hidden by default (no-JS fallback) — only ever shown once the "js" class
   confirms the loader/transition script is actually running. Without this
   gate, a page-veil that starts "covering" with no JS to uncover it would
   leave the entire site permanently black. */
.page-veil {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 10000;
  transform-origin: bottom;
  pointer-events: none;
  transform: scaleY(0);
}

.js body.is-loading .page-veil { transform: scaleY(1); }
.js body:not(.is-loading) .page-veil { transform: scaleY(0); transition: transform 0.9s var(--ease-soft) 0.05s; }
.js body.is-leaving .page-veil { transform: scaleY(1); transition: transform 0.6s var(--ease-soft); }

/* ------------------------------------------------------------- Nav ----- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding 0.4s var(--ease), background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  padding-top: 14px;
  padding-bottom: 14px;
  background: rgba(10,10,10,0.72);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.brand {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
}
.nav-links a {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  position: relative;
  padding: 4px 0;
  transition: color 0.3s var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 1px;
  width: 0;
  background: var(--text);
  transition: width 0.35s var(--ease);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.is-active::after { width: 100%; }

.nav-cta {
  border: 1px solid var(--line-strong);
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav-cta:hover { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-links { position: fixed; inset: 0; background: var(--bg); flex-direction: column; justify-content: center; align-items: flex-start; padding: 0 32px; gap: 26px; transform: translateY(-100%); transition: transform 0.5s var(--ease-soft); }
  .nav-links.is-open { transform: translateY(0); }
  .nav-links a { font-size: 32px; }
  .nav-toggle { display: block; z-index: 600; font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
}

/* ---------------------------------------------------------- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.4s var(--ease), background 0.35s var(--ease), color 0.35s var(--ease);
  position: relative;
}
.btn-primary { background: var(--accent); color: #0a0a0a; }
.btn-primary:hover { transform: translateY(-2px); }
.btn-outline { border: 1px solid var(--line-strong); color: var(--text); }
.btn-outline:hover { background: var(--text); color: #0a0a0a; }
.btn-arrow { transition: transform 0.4s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }

.magnetic { display: inline-block; }

/* ---------------------------------------------------------- Marquee ---- */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  white-space: nowrap;
}
.marquee-track {
  display: inline-flex;
  animation: marquee 26s linear infinite;
}
.marquee-track span {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 34px);
  padding: 0 28px;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  gap: 28px;
}
.marquee-track span::after { content: "—"; color: var(--accent); }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* -------------------------------------------------------------- Grid --- */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 90px var(--gutter) 34px;
  margin-top: 160px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 60px;
}
.footer-title {
  font-size: clamp(36px, 6vw, 74px);
  max-width: 780px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 14px;
}
.footer-socials { display: flex; gap: 22px; }
.footer-socials a { color: var(--text-dim); transition: color 0.3s var(--ease); }
.footer-socials a:hover { color: var(--accent); }

section { position: relative; }

.section-pad { padding: clamp(70px, 12vh, 150px) 0; }

.hr {
  height: 1px;
  background: var(--line);
  border: none;
  width: 100%;
}

::selection { background: var(--accent); color: #0a0a0a; }

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

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}
.filter-pill {
  border: 1px solid var(--line-strong);
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  transition: all 0.3s var(--ease);
}
.filter-pill:hover { color: var(--text); border-color: var(--text-dim); }
.filter-pill.is-active { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  margin-top: 46px;
}

.work-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-alt);
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.work-card:hover { border-color: var(--line-strong); transform: translateY(-4px); }

.work-card-media {
  display: block;
  position: relative;
  aspect-ratio: 4 / 5;
  background: #000;
  overflow: hidden;
}
.work-card-media video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.work-card-fallback {
  position: absolute; inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-faint);
  background: repeating-linear-gradient(135deg, var(--bg-raise), var(--bg-raise) 10px, var(--bg-alt) 10px, var(--bg-alt) 20px);
}
.work-card-media.is-missing .work-card-fallback { display: flex; }
.work-card-media.is-missing video { display: none; }

.work-card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.work-card-media:hover .work-card-overlay { opacity: 1; transform: translateY(0); }
.play-hint {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.work-card-body { padding: 22px; }
.work-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.work-card-top h3 { font-size: 19px; }
.work-card-year { font-size: 12.5px; color: var(--text-faint); }
.work-card-brand { font-size: 13.5px; margin-top: 4px; }
.work-card-hook { font-size: 14.5px; line-height: 1.6; color: var(--text); margin-top: 12px; opacity: 0.85; }

.work-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 10px;
}
.work-card-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.work-card-tags span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 100px;
}
.work-card-metric {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* ------------------------------------------------------------ Tool chip */

.tool-chip {
  border: 1px solid var(--line-strong);
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.tool-chip:hover { border-color: var(--accent); color: var(--accent); }

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

.contact-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  padding: 16px 4px;
  font-size: 17px;
  color: var(--text);
  font-family: var(--font-body);
  transition: border-color 0.3s var(--ease);
}
.contact-input:focus { outline: none; border-color: var(--accent); }
.contact-input::placeholder { color: var(--text-faint); }

.contact-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-bottom: 8px;
}

.contact-field { margin-bottom: 30px; }

.big-link {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 52px);
  display: inline-flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 14px;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.big-link:hover { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------------- Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(6px);
}

.lightbox-inner {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 520px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.96) translateY(10px);
  transition: transform 0.4s var(--ease);
}
.lightbox.is-open .lightbox-inner { transform: scale(1) translateY(0); }

.lightbox-video {
  width: 100%;
  max-height: 78vh;
  border-radius: 12px;
  background: #000;
  outline: none;
}

.lightbox-title {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  margin-top: 16px;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -46px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.lightbox-close:hover { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }

@media (max-width: 640px) {
  .lightbox-close { top: -42px; right: 4px; }
}
