/* ————————————————————————————————————————
   Elvis Obanya — portfolio
   Built from Figma: P02 · Site (Website canvas)
   Type is identical at every breakpoint; only
   margins and vertical rhythm adapt.
———————————————————————————————————————— */

/* self-hosted Archivo (variable, latin subset) — no third-party font requests */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/archivo-latin.woff2") format("woff2");
}

:root {
  --margin: 100px;          /* 1920 spec */
  --col: 45.7%;             /* statement / Info column, % of content width */
  --bg: #000;
  --fg: #fff;
  --body-size: 21px;
  --body-lh: 29px;
  --meta-size: 13px;
}

@media (max-width: 1799px) { :root { --margin: 90px; } }   /* 1680 spec */
@media (max-width: 1499px) { :root { --margin: 80px; } }   /* 1440 spec */
@media (max-width: 767px)  { :root { --margin: 24px; --col: 41.4%; } } /* mobile spec */

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

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-size: var(--body-size);
  line-height: var(--body-lh);
  letter-spacing: -0.3px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ——— shared ——— */

.row {
  position: relative;
  margin-left: var(--margin);
  margin-right: var(--margin);
}

.col {
  position: absolute;
  left: var(--col);
  right: 0;
  top: 0;
}

.meta {
  font-size: var(--meta-size);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 14px;
  color: var(--fg);
  text-decoration: none;
}

a.meta { transition: opacity 0.25s ease; }
a.meta:hover { opacity: 0.55; }

.sep { font-size: var(--meta-size); font-weight: 500; letter-spacing: 1px; }

span.d-only { display: inline; }
span.m-only { display: none; }

/* ——— nav ——— */

.nav {
  padding-top: 48px;
  height: 62px; /* 48 + 14 line */
}

.nav .col-anchor { position: absolute; left: var(--col); top: 48px; }
.nav .nav-right  { position: absolute; right: 0; top: 48px; }
.nav > a:first-child { position: absolute; left: 0; top: 48px; }

/* ——— hero ——— */

.hero { margin-top: 216px; } /* nav bottom (62) -> 278 */

.name-block p { width: auto; } /* was 287px; auto so the title line never wraps early */

.statement { max-width: 565px; }

.paragraphs { max-width: 565px; /* was 697px; same measure as the main statement */ display: flex; flex-direction: column; gap: 30px; }

/* hero row height = tallest child; .col is absolute so reserve height */
#page-main .hero { min-height: 58px; }
#page-info .hero { min-height: 205px; }

/* ——— media (main only) ——— */

.media {
  position: relative;
  margin: 265px var(--margin) 0; /* hero end (336) -> 601 */
  /* height follows the reel so the gap around it is equal on all four sides */
  border-radius: 30px;
  border: 0.5px solid rgba(255, 255, 255, 0.3); /* design 0.25, +20% opacity per Elvis */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-wrap {
  position: relative;
  width: 100%; /* reel fills the stroked mat edge to edge per Elvis; mat height follows the reel */
}

/* skeleton shimmer while the reel loads — super dark gray */
.video-skeleton {
  position: absolute;
  inset: 0;
  background: #0a0a0a;
  border-radius: 30px; /* matches .media */
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.video-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 30%, #111111 50%, transparent 70%);
  animation: shimmer 1.8s ease-in-out infinite;
}

.video-wrap.ready .video-skeleton { opacity: 0; }

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .video-skeleton::after { animation: none; }
}

.reel {
  width: 100%;
  aspect-ratio: 1328 / 751;
  object-fit: cover;
  display: block;
  background: #000;
  border-radius: 30px; /* same corner radius as the stroked .media mat */
}

/* cursor-following pill over the reel (hover-capable pointers only) */
.video-cursor {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  background: rgba(160, 160, 160, 0.28);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  will-change: transform;
  z-index: 2;
}

.video-cursor .icon-on { display: none; }
.video-wrap.sound-on .video-cursor .icon-on { display: block; }
.video-wrap.sound-on .video-cursor .icon-off { display: none; }

@media (hover: hover) and (pointer: fine) {
  .video-cursor { display: flex; }
  .video-wrap { cursor: none; }
  .video-wrap.cursor-in .video-cursor { opacity: 1; }
}

/* ——— footer ——— */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* both pages fill the viewport; if the content is shorter than the screen the
   footer is pinned to the bottom, otherwise it follows the content normally */
#page-main { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
#page-main .footer { margin-top: auto; padding-top: 102px; padding-bottom: 32px; } /* media -> footer gap 102 per Figma */
.media { flex-shrink: 0; }

/* info and 404 fill the viewport; footer rides 32px above the bottom edge */
#page-info, #page-404 { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
#page-info .footer, #page-404 .footer { margin-top: auto; padding-bottom: 32px; }

.meta-line { display: block; }
.foot-left, .footer { line-height: 14px; }

.page[hidden] { display: none !important; }

/* ——— page transition ——— */

/* content animates on every page entry; the nav and the name block
   sit at identical positions on both pages, so they only animate on
   first load — switching pages keeps them still */
.page.enter .hero > .col,
.page.enter .media {
  animation: page-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page.enter-nav > .nav,
.page.enter-nav .name-block,
.page.enter-nav .footer {
  animation: page-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .page.enter .hero > .col, .page.enter .media,
  .page.enter-nav > .nav, .page.enter-nav .name-block,
  .page.enter-nav .footer { animation: none; }
}

/* on mobile the name block sits at different heights per page,
   so it joins the entry animation there */
@media (max-width: 767px) {
  .page.enter .name-block {
    animation: page-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

/* ——— tablet & small laptop (768–1199): stacked hero, proportional mat ——— */

@media (min-width: 768px) and (max-width: 1199px) {
  :root { --margin: 48px; }

  .hero { margin-top: 120px; }
  .hero .col { position: static; margin-top: 38px; }
  #page-main .hero, #page-info .hero { min-height: 0; }
  .statement, .paragraphs { max-width: 640px; }

  .media { margin-top: 120px; }
  #page-main .footer { margin-top: auto; padding-top: 80px; }
}

/* ——— mobile ——— */

@media (max-width: 767px) {
  .page {
    min-height: 100vh;
    min-height: 100svh; /* stable: no reflow when the browser's URL bar collapses */
    display: flex;
    flex-direction: column;
  }

  span.d-only { display: none; }
  span.m-only { display: block; }
  .d-br { display: none; }

  .nav { padding-top: 26px; height: 40px; }
  .nav .col-anchor, .nav .nav-right, .nav > a:first-child { top: 26px; }

  /* content block floats centered between nav and footer;
     padding keeps a minimum gap when content is taller than the screen */
  #page-main .hero, #page-info .hero, #page-404 .hero {
    margin-top: auto;    /* longhands: keep the row's side margins intact */
    margin-bottom: auto;
    min-height: 0;
    padding: 40px 0;
  }

  .hero .col { position: static; margin-top: 38px; }

  /* info on mobile: no name block (it's already the page header), paragraphs only */
  #page-info .name-block { display: none; }
  #page-info .hero .col { margin-top: 0; }

  .name-block p { width: auto; }
  .statement { max-width: none; }
  .paragraphs { max-width: none; }

  .media { display: none; }

  .footer { flex-direction: column; }
  #page-main .footer, #page-info .footer, #page-404 .footer {
    margin-top: 0; /* hero's auto margins handle spacing; footer sits at the bottom */
    padding-top: 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); /* hugs the bottom edge; clears the home indicator on notch phones */
  }

  .foot-left { display: flex; flex-direction: column; gap: 8px; }
  .m-only.meta-line { font-size: var(--meta-size); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; line-height: 22px; }
}
