@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

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

html {
  scroll-behavior: auto;
  background: var(--color-bg);
  scrollbar-color: var(--color-border) var(--color-bg);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-dim);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

ul { list-style: none; margin: 0; padding: 0; }

button {
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

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

/* Grain / atmosphere overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Nav ---------- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--gutter);
  mix-blend-mode: difference;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: var(--space-md);
}

.nav-links a {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  padding-bottom: 2px;
  cursor: pointer;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transition: right var(--duration-normal) var(--ease-out-expo);
}

.nav-links a:hover::after { right: 0; }

.nav-toggle {
  display: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--space-lg) + 3rem) var(--gutter) var(--space-lg);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 20%, rgba(255,78,47,0.14), transparent 60%),
    linear-gradient(180deg, #0a0a0b 0%, #0e0e10 100%);
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.hero-eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

.hero-hud {
  position: absolute;
  top: calc(var(--space-lg) + 3rem);
  right: var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-variant-numeric: tabular-nums;
}

.hero-hud .hud-sep {
  color: var(--color-border);
}

@media (max-width: 640px) {
  .hero-hud { display: none; }
}

.hero-title {
  font-size: var(--text-hero);
}

.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}

.hero-title .line span {
  display: inline-block;
  will-change: transform;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: var(--space-lg);
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero-role {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 34ch;
  overflow: hidden;
}

.hero-role span { display: inline-block; }

.scroll-cue {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
}

.scroll-cue .line-anim {
  width: 1px;
  height: 40px;
  background: var(--color-text-dim);
  position: relative;
  overflow: hidden;
}

.scroll-cue .line-anim::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0; right: 0;
  height: 100%;
  background: var(--color-accent);
  animation: scrollcue 1.8s ease-in-out infinite;
}

@keyframes scrollcue {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}

/* ---------- Section shell ---------- */
.section {
  padding: var(--space-section) var(--gutter);
  position: relative;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.section-index {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  color: var(--color-text-dim);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.section-index::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--color-accent);
}

.section-title {
  font-size: var(--text-section);
  max-width: 16ch;
}

.section-sub {
  max-width: 42ch;
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

/* ---------- Work grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-md) var(--gutter);
}

.work-card {
  grid-column: span 12;
  position: relative;
  cursor: pointer;
}

.work-card:nth-child(1) { grid-column: span 12; }
.work-card:nth-child(2) { grid-column: span 7; }
.work-card:nth-child(3) { grid-column: span 5; }
.work-card:nth-child(4) { grid-column: span 5; }
.work-card:nth-child(5) { grid-column: span 7; }

.work-card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--color-surface);
  border-radius: var(--radius-md);
}

.work-card:nth-child(1) .work-card-media { aspect-ratio: 21 / 9; }

.work-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  filter: grayscale(0.5) brightness(0.75);
  transition: filter var(--duration-normal) var(--ease-out-quart);
}

.work-card:hover .work-card-media img {
  filter: grayscale(0) brightness(0.9);
}

.work-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: var(--space-md);
  background: linear-gradient(0deg, rgba(0,0,0,0.55), transparent 55%);
}

.work-card-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.work-card-title {
  font-size: var(--text-lg);
  font-weight: 500;
}

.work-card-tags {
  display: flex;
  gap: var(--space-xs);
  margin-top: 0.4rem;
}

.work-card-tags span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.work-card-year {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.work-card-arrow {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  transform: scale(0.85) rotate(-40deg);
  opacity: 0;
  transition: transform var(--duration-normal) var(--ease-out-expo), opacity var(--duration-normal) var(--ease-out-expo), background var(--duration-fast);
  background: rgba(10,10,11,0.5);
  backdrop-filter: blur(6px);
}

.work-card:hover .work-card-arrow {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}

.work-card-arrow svg { width: 18px; height: 18px; }

/* Devices without hover (touch) can't reveal the arrow via :hover, so show
   it by default there instead of hiding an affordance no one can trigger. */
@media (hover: none) {
  .work-card-arrow {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* ---------- Pinned reel ---------- */
.reel {
  position: relative;
  background: var(--color-bg-raised);
}

.reel-pin {
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.reel-track {
  display: flex;
  gap: var(--gutter);
  padding-inline: var(--gutter);
  will-change: transform;
}

.reel-item {
  flex: 0 0 auto;
  width: min(60vw, 640px);
}

.reel-item-media {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}

.reel-item-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(0.4) brightness(0.8);
}

.reel-item-caption {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-sm);
  font-size: var(--text-sm, var(--text-base));
  color: var(--color-text-muted);
}

.reel-heading {
  position: absolute;
  top: var(--space-lg);
  left: var(--gutter);
  z-index: 2;
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.about-statement {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1.25;
  font-weight: 500;
}

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

.about-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.stat {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-xs);
}

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill-list span {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

/* ---------- Contact / footer ---------- */
.contact {
  background: var(--color-bg-raised);
  border-top: 1px solid var(--color-border);
}

.contact-title {
  font-size: var(--text-section);
  max-width: 20ch;
}

.contact-link {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-sm);
  font-size: var(--text-2xl);
  font-family: var(--font-display);
  margin-top: var(--space-md);
  position: relative;
}

.contact-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.contact-link:hover::after { transform: scaleX(1); }

.contact-link-sub {
  display: flex;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-section);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-socials {
  display: flex;
  gap: var(--space-md);
}

.footer-socials a {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  transition: color var(--duration-fast);
}

.footer-socials a:hover { color: var(--color-text); }

/* ---------- Cursor ---------- */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--color-accent);
  pointer-events: none;
  z-index: 300;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .cursor-dot { display: block; }
  /* the dot replaces the native pointer on devices that actually have one;
     !important beats the explicit cursor:pointer set on buttons/links */
  * { cursor: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .work-card,
  .work-card:nth-child(n) { grid-column: span 12; }

  .about { grid-template-columns: 1fr; }

  .nav-links { gap: var(--space-sm); }
}

@media (max-width: 640px) {
  .hero {
    min-height: auto;
    justify-content: flex-start;
    padding-top: 7rem;
    padding-bottom: var(--space-lg);
  }
  .section { padding-block: var(--space-lg); }
  .stat-row { grid-template-columns: 1fr 1fr; }

  .site-header { padding: var(--space-xs) var(--gutter); }
  .nav-links { gap: 0.85rem; }
  .nav-links a { font-size: 0.65rem; }

  .work-card:nth-child(1) .work-card-media { aspect-ratio: 4 / 3; }

  .reel-item { width: 82vw; }

  .contact-link { flex-wrap: wrap; word-break: break-word; }
  .contact-link svg { width: 22px; height: 22px; }

  .footer-bottom { justify-content: flex-start; }
}

@media (max-width: 380px) {
  .site-header { flex-wrap: wrap; row-gap: 0.4rem; }
  .nav-links { gap: 0.65rem; }
  .nav-links a { font-size: 0.6rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
