/* ═══════════════════════════════════════════════════════════════
   Diego Risco-Ramirez · personal site
   Dark, cinematic. The page is a frame.
   ═══════════════════════════════════════════════════════════════ */

/* ── tokens ──────────────────────────────────────────────────── */
:root {
  --ink:        #08080A;
  --ink-raised: #101013;
  --bone:       #EDEAE4;
  --ash:        #7A7A82;
  --line:       #22222A;
  --red:        #B0040E;

  --display: "Anton", "Arial Narrow", Impact, sans-serif;
  --body:    "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --frame-inset: 14px;
  --gut: clamp(1.5rem, 5vw, 5rem);   /* page side gutter */
  --max: 1320px;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--red);
  color: #fff;
  padding: .75rem 1.25rem;
  font-family: var(--mono);
  font-size: .75rem;
}
.skip:focus { left: 0; }

/* ── the frame ───────────────────────────────────────────────── */
/* one fixed hairline viewfinder. this is the signature. */
.frame {
  position: fixed;
  inset: var(--frame-inset);
  border: 1px solid var(--line);
  pointer-events: none;
  z-index: 60;
}

/* ── grain ───────────────────────────────────────────────────── */
.grain {
  position: fixed;
  inset: -150%;
  z-index: 55;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 700ms steps(1) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-3%, 2%); }
  50%  { transform: translate(2%, -3%); }
  75%  { transform: translate(-2%, -2%); }
  100% { transform: translate(3%, 1%); }
}

/* ── slate readout ───────────────────────────────────────────── */
.slate {
  position: fixed;
  left: calc(var(--frame-inset) + 14px);
  bottom: calc(var(--frame-inset) + 12px);
  z-index: 61;
  display: flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--mono);
  font-size: .625rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ash);
  pointer-events: none;
}
.slate__mark {
  width: 5px; height: 5px;
  background: var(--red);
  border-radius: 50%;
  flex: none;
}
.slate__text { transition: opacity .3s var(--ease); }

/* ── nav ─────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: calc(var(--frame-inset) + 10px);
  left: calc(var(--frame-inset) + 14px);
  right: calc(var(--frame-inset) + 14px);
  z-index: 61;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.nav.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.nav__id { color: var(--bone); }
.nav__links { display: flex; gap: 1.5rem; }
.nav__links a { color: var(--ash); transition: color .25s; }
.nav__links a:hover { color: var(--bone); }

/* ── shared type ─────────────────────────────────────────────── */
.display {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: .92;
  letter-spacing: -.005em;
  margin: 0;
}

.eyebrow {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ash);
  margin: 0 0 1.75rem;
}

.mono {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ash);
}

.hl    { color: var(--bone); font-weight: 500; }
.dot   { color: var(--red); padding: 0 .15em; }

.prose p { margin: 0 0 1.35rem; color: #B8B6B1; max-width: 46ch; }
.prose p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: #B8B6B1;
  max-width: 54ch;
  margin: 0 0 4rem;
}

/* ── layout ──────────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.section {
  padding-block: clamp(6rem, 13vw, 11rem);
  position: relative;
}
.section + .section { border-top: 1px solid var(--line); }

.section__title {
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  margin-bottom: 3.5rem;
}

/* ═══ 01 · HERO ══════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 0 0 clamp(3.5rem, 7vw, 6rem);
}

.hero__media { position: absolute; inset: 0; z-index: 0; }

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* near-monochrome on purpose: the brand red stays the only colour on the page */
  filter: saturate(.18) contrast(1.14) brightness(.72);
}

/* legibility scrim. heavier bottom-left, where the title card sits. */
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(8,8,10,.94) 0%, rgba(8,8,10,.55) 38%, rgba(8,8,10,.15) 70%, rgba(8,8,10,.5) 100%),
    linear-gradient(to right, rgba(8,8,10,.6) 0%, rgba(8,8,10,0) 55%),
    radial-gradient(ellipse 75% 70% at 34% 62%, rgba(8,8,10,0) 35%, rgba(8,8,10,.62) 100%);
}

.hero__plate {
  position: relative;
  z-index: 1;
  padding-inline: var(--gut);
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
}

.hero__eyebrow { margin-bottom: 1.25rem; }

/* the title card. bleeds slightly past the frame edge on purpose. */
.hero__name {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(3.25rem, 12.5vw, 11.5rem);
  line-height: .84;
  letter-spacing: -.015em;
  margin: 0 0 1.5rem;
  margin-left: -.045em;
}

.hero__role {
  font-size: clamp(1.0625rem, 2vw, 1.375rem);
  font-weight: 500;
  margin: 0 0 .5rem;
  color: var(--bone);
}

.hero__line {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ash);
  margin: 0;
  max-width: 60ch;
  line-height: 2;
}

.hero__scroll {
  position: absolute;
  right: calc(var(--gut));
  bottom: clamp(3.5rem, 7vw, 6rem);
  z-index: 1;
  font-family: var(--mono);
  font-size: .625rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ash);
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: color .25s;
}
.hero__scroll::after {
  content: "";
  width: 44px;
  height: 1px;
  background: currentColor;
  animation: pull 2.4s var(--ease) infinite;
  transform-origin: left;
}
.hero__scroll:hover { color: var(--bone); }
@keyframes pull {
  0%, 100% { transform: scaleX(1); opacity: .5; }
  50%      { transform: scaleX(1.5); opacity: 1; }
}

/* ═══ 02 · ABOUT ═════════════════════════════════════════════ */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}

.about__body .display {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 2.5rem;
}

/* offset down so the grid reads composed, not tabular */
.about__figure {
  margin: 0;
  padding-top: clamp(0rem, 6vw, 5rem);
}
.about__figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--ink-raised);
  /* matches the hero grade. site photography is monochrome, content thumbs are not. */
  filter: saturate(.18) contrast(1.16) brightness(.88);
}
.about__figure figcaption {
  margin-top: .875rem;
  display: block;
}

/* ═══ 03 · PATH ══════════════════════════════════════════════ */
.path__list { border-top: 1px solid var(--line); }

.path__item {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: 2.25rem;
  border-bottom: 1px solid var(--line);
}

.path__no {
  color: var(--red);
  padding-top: .45rem;
  font-size: .75rem;
}

.path__body h3 {
  font-family: var(--body);
  font-size: clamp(1.125rem, 2.2vw, 1.5rem);
  font-weight: 600;
  margin: 0 0 .5rem;
  letter-spacing: -.01em;
}
.path__body p {
  margin: 0;
  color: var(--ash);
  max-width: 52ch;
}

/* ═══ 04 · WHAT I DO ═════════════════════════════════════════ */
/* full-width rows, not cards */
.lane {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) minmax(0, 2fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
  padding: 2.5rem clamp(.75rem, 2vw, 1.5rem);
  border-top: 1px solid var(--line);
  transition: background-color .35s var(--ease);
  position: relative;
}
.lane:last-child { border-bottom: 1px solid var(--line); }
.lane:hover { background: var(--ink-raised); }

/* the red mark only appears on intent */
.lane::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  height: 1px;
  width: 0;
  background: var(--red);
  transition: width .5s var(--ease);
}
.lane:hover::before { width: 100%; }

.lane__title {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(1.375rem, 2.6vw, 2rem);
  line-height: 1;
  margin: 0;
  letter-spacing: -.005em;
}
.lane__text {
  margin: 0;
  color: var(--ash);
  max-width: 50ch;
}
.lane__tag { padding-top: .35rem; }

/* ═══ 05 · WORK ══════════════════════════════════════════════ */
.proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.proof__item {
  background: var(--ink);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  /* meta pinned to the bottom so it lines up across cards of unequal length */
  display: flex;
  flex-direction: column;
}
.proof__title {
  font-family: var(--body);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 .75rem;
  letter-spacing: -.01em;
}
.proof__text {
  margin: 0 0 1.75rem;
  color: var(--ash);
  font-size: .9375rem;
}
.proof__meta { margin: auto 0 0; padding-top: 1rem; }

/* ═══ 06 · CONTENT ═══════════════════════════════════════════ */
.reel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.25rem);
}
.reel__item { display: block; }

.reel__thumb {
  overflow: hidden;
  background: var(--ink-raised);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
}
/* the poster is baked into the <video>, so one rule covers both states */
.reel__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--ink-raised);
  filter: saturate(.8) contrast(1.05) brightness(.85);
  transition: transform .7s var(--ease), filter .5s var(--ease);
}
.reel__item:hover .reel__video {
  transform: scale(1.04);
  filter: saturate(1) contrast(1.05) brightness(1);
}

.reel__title {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 .375rem;
}
.reel__meta { margin: 0; }
.reel__item:hover .reel__meta { color: var(--red); }

/* ═══ 07 · CONTACT ═══════════════════════════════════════════ */
.contact__big {
  font-size: clamp(3rem, 11vw, 9rem);
  margin: 0 0 2.5rem;
  margin-left: -.04em;
}

.contact__mail {
  display: inline-block;
  font-size: clamp(1.125rem, 2.6vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -.015em;
  border-bottom: 1px solid var(--line);
  padding-bottom: .3rem;
  margin-bottom: 3rem;
  transition: border-color .3s, color .3s;
}
.contact__mail:hover { border-color: var(--red); color: var(--red); }

.contact__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.contact__socials a { color: var(--ash); transition: color .25s; }
.contact__socials a:hover { color: var(--bone); }

/* ── footer ──────────────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--line);
  padding-block: 2rem calc(2rem + var(--frame-inset));
}
.foot__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* ── reveal on scroll ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ── page-load title sequence ────────────────────────────────── */
.hero__eyebrow,
.hero__name,
.hero__role,
.hero__line,
.hero__scroll {
  opacity: 0;
  transform: translateY(22px);
  animation: rise .95s var(--ease) forwards;
}
.hero__eyebrow { animation-delay: .25s; }
.hero__name    { animation-delay: .40s; }
.hero__role    { animation-delay: .62s; }
.hero__line    { animation-delay: .74s; }
.hero__scroll  { animation-delay: .95s; }

.frame {
  clip-path: inset(0 0 100% 0);
  animation: frameIn 1s var(--ease) .05s forwards;
}
@keyframes frameIn { to { clip-path: inset(0 0 0 0); } }

@keyframes rise { to { opacity: 1; transform: none; } }

/* ═══ responsive ═════════════════════════════════════════════ */
@media (max-width: 900px) {
  .about__grid  { grid-template-columns: 1fr; }
  .about__figure { padding-top: 0; }
  .lane         { grid-template-columns: 1fr; gap: .75rem; }
  .lane__tag    { padding-top: 0; }
  .proof        { grid-template-columns: 1fr; }
  .reel         { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 620px) {
  :root { --frame-inset: 0px; }

  /* frame collapses on small screens, it would only crowd the content */
  .frame { display: none; }

  .nav__links { gap: 1rem; font-size: .625rem; }
  .nav__id { display: none; }

  .slate {
    left: 1rem;
    bottom: 1rem;
    background: rgba(8,8,10,.7);
    padding: .35rem .6rem;
    backdrop-filter: blur(6px);
  }

  .hero__scroll { display: none; }
  .hero__line { font-size: .6875rem; line-height: 1.9; }
  .path__item { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .foot__row { flex-direction: column; gap: .35rem; }
}

/* ═══ print ══════════════════════════════════════════════════ */
@media print {
  .grain, .frame, .slate, .nav, .hero__scroll { display: none; }
  .hero { min-height: auto; padding-block: 4rem; }
  .reveal { opacity: 1; transform: none; }
}

/* ═══ accessibility ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .grain { animation: none; opacity: .035; }
  .reveal { opacity: 1; transform: none; }

  .hero__eyebrow, .hero__name, .hero__role, .hero__line, .hero__scroll {
    opacity: 1; transform: none;
  }
  .frame { clip-path: none; }
}
