/* ==========================================================================
   nickflory.com — single stylesheet
   Vanilla CSS, no build step. Edit directly.

   Design tokens below were mined from the old WordPress/Elementor site
   (see _brief/design_tokens.md). Change a token here and it changes
   everywhere.
   ========================================================================== */

/* ---- Design tokens -------------------------------------------------------- */
:root {
  /* colors */
  --color-heading: #000F2B;      /* h1-h6 */
  --color-body: #625F5F;         /* base text */
  --color-muted: #7A7A7A;        /* secondary text, default links */
  --color-accent: #1A6C7A;       /* teal — hovers, buttons */
  --color-rule: #000000;         /* 1px divider lines */
  --color-page: #FFFFFF;         /* page background */
  --header-bg: rgba(0, 0, 0, 0.13); /* translucent header bar */

  /* type */
  --font-sans: "Roboto", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --heading-tracking: 2.5px;     /* letter-spacing on h2/h3 */

  /* layout */
  --container-max: 1140px;       /* old site's boxed width */
  --gap: 30px;                   /* grid gutter */
}

/* ---- Self-hosted font (copied from the old site's own files) -------------- */
/* Variable font: one file covers weights 100-900. Latin subset only. */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/roboto-variable-latin.woff2") format("woff2");
}

/* ---- Reset-lite ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--color-page);
  color: var(--color-body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
}
img, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  color: var(--color-heading);
  font-weight: 400;
  line-height: 1.5;
  margin: 0 0 0.5em;
}
h1 { font-size: 40px; font-weight: 500; letter-spacing: var(--heading-tracking); }
h2 { font-size: 28px; letter-spacing: var(--heading-tracking); }
h3 { font-size: 22px; letter-spacing: var(--heading-tracking); }

a { color: var(--color-muted); }
a:hover, a:focus { color: var(--color-accent); }

/* ---- Page container -------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Header ---------------------------------------------------------------- */
.site-header {
  background: var(--header-bg);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 56px;
}
.site-title {
  color: #000000;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 3px;
  text-decoration: none;
  margin: 0;
}
.site-title:hover, .site-title:focus { color: #000000; }
.site-nav a {
  color: #000000;
  text-decoration: none;
  padding: 6px 18px;
  letter-spacing: 1px;
}
.site-nav a:hover,
.site-nav a:focus,
.site-nav a[aria-current="page"] {
  background: #3a3a3a;
  color: #ffffff;
}

/* ---- Footer ---------------------------------------------------------------- */
.site-footer {
  margin-top: 80px;
  padding: 30px 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 14px;
}

/* ---- Front page: portfolio grid -------------------------------------------- */
.portfolio-intro { margin: 40px 0 10px; }
.portfolio-intro p { margin-top: 0; }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin: 30px 0 60px;
}
.portfolio-grid a {
  display: block;
  aspect-ratio: 4 / 5;       /* uniform cells, matches the 1080x1350 assets */
  overflow: hidden;
}
.portfolio-grid img,
.portfolio-grid video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Detail page ----------------------------------------------------------- */
.detail-title { margin: 40px 0 10px; }

.section-heading {
  margin: 50px 0 0;
}
.section-heading::after {       /* 1px rule under section headings, like old site */
  content: "";
  display: block;
  border-bottom: 1px solid var(--color-rule);
  margin: 15px 0;
}

/* Two columns: process carousel left, info text right */
.process-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: start;
}

.info-text p { margin: 0 0 1.4em; }

.back-link {
  display: inline-block;
  margin-top: 50px;
  text-decoration: none;
  letter-spacing: 1px;
}

/* Featured motion video (motion projects) */
.motion-video video { width: 100%; }

/* Video-vs-video comparison (Fenty, Ciaté) — two players side by side.
   A drag divider can't keep two videos frame-synced without real work,
   so these projects get an honest two-up instead. */
.video-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.video-compare figure { margin: 0; }
.video-compare video { width: 100%; }

/* ---- Before/after slider (js/slider.js) ------------------------------------ */
.ba-slider {
  position: relative;
  overflow: hidden;
  touch-action: none;         /* we handle horizontal drags ourselves */
  user-select: none;
  -webkit-user-select: none;
}
.ba-slider img {
  width: 100%;
  display: block;
  pointer-events: none;
}
.ba-before {                  /* the BEFORE layer, clipped to the left of the handle */
  position: absolute;
  inset: 0;
}
.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  transform: translateX(-1px);
}
.ba-handle {                  /* circular grab handle, matches old slider's look */
  position: absolute;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  letter-spacing: 2px;
  cursor: ew-resize;
}
.ba-handle:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---- Process carousel (js/carousel.js) -------------------------------------- */
.carousel { position: relative; }
.carousel-caption {           /* caption on TOP of the image — deliberate change */
  text-align: center;
  color: var(--color-heading);
  letter-spacing: var(--heading-tracking);
  font-size: 18px;
  padding: 8px 0;
}
.carousel-viewport { position: relative; }
.carousel-slide { display: none; margin: 0; }
.carousel-slide.is-active { display: block; }
.carousel-slide img,
.carousel-slide video { width: 100%; }

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #ffffff;
  font-size: 45px;
  line-height: 1;
  padding: 10px 14px;
  cursor: pointer;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.carousel-btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}
.carousel-btn.prev { left: 0; }
.carousel-btn.next { right: 0; }

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}
.carousel-dots button[aria-current="true"] { background: #ffffff; }

/* ---- Responsive ------------------------------------------------------------- */
/* Breakpoints are the old site's own: 1024px and 767px. */
@media (max-width: 1024px) {
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .process-info { gap: 40px; }
}

@media (max-width: 767px) {
  h1 { font-size: 26px; }
  h2 { font-size: 22px; }
  h3 { font-size: 19px; }
  .site-header .container { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .portfolio-grid { grid-template-columns: 1fr; gap: 20px; }
  .process-info { grid-template-columns: 1fr; gap: 30px; }
  .video-compare { grid-template-columns: 1fr; gap: 20px; }
  .section-heading { margin-top: 35px; }
}
