/*
 * bobvaniersel.com
 * Rebuilt from the Cargo site. Values mirror Cargo's computed styles.
 * Mobile is the default; desktop rules live in the min-width: 768px block.
 */

/* size-adjust makes Source Serif 4 take the same width as Freight Text (measured), so lines wrap like the original */
@font-face { font-family: "Source Serif 4"; src: url(fonts/source-serif-4-latin-400-normal.woff2) format("woff2"); size-adjust: 86.5%; font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url(fonts/source-serif-4-latin-400-italic.woff2) format("woff2"); size-adjust: 86.5%; font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url(fonts/source-serif-4-latin-700-normal.woff2) format("woff2"); size-adjust: 89.5%; font-weight: 700; font-style: normal; font-display: swap; }
/* Phones have no Lucida Grande; they get Fira Sans (similar humanist sans). Only downloaded when actually used. */
@font-face { font-family: "Fira Sans"; src: url(fonts/fira-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url(fonts/source-serif-4-latin-700-italic.woff2) format("woff2"); size-adjust: 89.5%; font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --serif: "Source Serif 4", Georgia, serif;          /* replaces Freight Text */
  --sans: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "Fira Sans", Geneva, Verdana, sans-serif; /* Cargo stack + Fira Sans for phones */
  --text: #222;
  --pad: 1rem;
}

/* Cargo scales everything with the root font size: 11.4px on phones, ~0.9vw on desktop */
html { font-size: 11.4px; -webkit-text-size-adjust: 100%; }

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

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}

a { color: #000; text-decoration: underline; }
a:active { opacity: .7; }
a.plain { text-decoration: none; }
a.active { color: rgba(0, 0, 0, .4); }
b, strong { font-weight: 700; }

h1, h2 { font-family: var(--sans); font-weight: normal; margin: 0; padding: 0; }
h1 { font-size: 3.1rem; line-height: 1.1; color: rgba(0, 0, 0, .85); }
h1 a { color: rgba(0, 0, 0, .85); text-decoration: none; }
h2 { font-size: 1.7rem; line-height: 1.3; letter-spacing: .01em; color: #000; }
h2 a { color: rgba(0, 0, 0, .7); text-decoration: none; }

small {
  display: inline-block;
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: .03em;
  color: #a4a4a4;
}

.icon { font-family: var(--sans); }
.highlight { background-color: #ff1; }

img { display: block; width: 100%; height: auto; margin-bottom: 1rem; border: 0; }
img.zoom { cursor: zoom-in; }
.image-link { display: block; }
.image-link.active img { outline: 1px solid #06f; outline-offset: -1px; }

/* Two-column grid. Cargo keeps both columns side by side on mobile too. */
.row { display: flex; margin: 0 -.5rem; }
.col { flex: 1 1 0; min-width: 0; padding: 0 .5rem; }
.row-wide { margin: 0 -1rem; }
.row-wide > .col { padding: 0 1rem; }

/* 16:9 Vimeo embeds */
.video { position: relative; padding-top: 56.25%; margin-bottom: 1rem; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Layout: desktop (1024px and up), identical to the Cargo site ---------- */

.desktop-only { display: none; }

@media (min-width: 1024px) {
  html { font-size: clamp(11px, .9vw, 17px); }

  .mobile-only { display: none; }
  .desktop-only { display: block; }

  .left-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 15%;
    padding: var(--pad);
    z-index: 2;
  }

  .right-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 16%;
    padding: var(--pad);
    background: #fff;
    overflow-y: auto;
    z-index: 2;
  }

  .content { width: 69%; margin: 0 auto; padding: var(--pad); }
  .content-wide { width: 70%; }

  .page-nav { padding: var(--pad) 0 0; }
  .page-nav a { color: rgba(0, 0, 0, .5); text-decoration: none; }

  /* The Work overview duplicates the right column on desktop, so show it as a 2-column grid */
  .work-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
}

/* ---------- Layout: phones and tablets (below 1024px), mobile-first redesign ---------- */

@media (max-width: 1023px) {
  html { font-size: 16px; }
  body { font-size: 17px; line-height: 1.55; }

  /* Single column: stack Cargo's two-column grids */
  .row, .row-wide { display: block; margin: 0; }
  .col, .row-wide > .col { padding: 0; }
  .indent { display: none; }
  /* Cargo spaced things with <br>s; once columns stack those gaps get too big */
  .col > br:first-child, small + br, small + br + br { display: none; }
  small { margin-bottom: 16px; }

  /* About page: show the story right under the portrait, photos after it */
  .about-row { display: flex; flex-direction: column; }
  .about-row .col:last-child { order: -1; margin-bottom: 24px; }
  img { margin-bottom: 12px; border-radius: 2px; }

  .content { padding: 16px 16px 8px; }

  main h2 { font-size: 26px; line-height: 1.2; margin-top: 8px; }
  small { display: block; font-size: 17px; line-height: 1.35; letter-spacing: 0; color: #6b6b6b; margin-top: 4px; }

  /* Compact sticky top bar */
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 56px;
    padding: 0 8px 0 16px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid #eee;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
  .bar-name {
    font-family: var(--sans);
    font-size: 19px;
    color: rgba(0, 0, 0, .85);
    text-decoration: none;
    white-space: nowrap;
  }
  .bar-links { display: flex; align-items: center; }
  .bar-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 8px;
    font-size: 16px;
    color: #000;
    text-decoration: none;
    white-space: nowrap;
  }
  .bar-links a.active { color: rgba(0, 0, 0, .4); }
  .bar-links .pill {
    min-height: 36px;
    margin: 4px 0 4px 6px;
    padding: 0 14px;
    border: 1px solid #000;
    border-radius: 999px;
  }

  /* Homepage intro */
  .intro { font-size: 22px; line-height: 1.35; margin: 12px 0 28px; color: var(--text); }

  /* Titled project cards (homepage, Work page, Next project) */
  .project-card, .about-card { display: block; margin-bottom: 32px; color: inherit; text-decoration: none; }
  .project-card img, .about-card img { margin-bottom: 10px; }
  .card-title { display: block; font-family: var(--sans); font-size: 20px; line-height: 1.25; color: #000; }
  .card-sub { display: block; font-size: 16px; line-height: 1.4; color: #6b6b6b; margin-top: 2px; }
  .about-card img { aspect-ratio: 4 / 3; object-fit: cover; }

  .next-card { margin-top: 24px; padding-top: 24px; border-top: 1px solid #eee; }
  .next-label { margin: 0 0 12px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: #6b6b6b; }

  /* Contact footer */
  .mobile-footer { margin: 8px 16px 0; padding: 32px 0 48px; border-top: 1px solid #eee; }
  .footer-lead { margin: 0 0 16px; font-size: 20px; line-height: 1.35; }
  .button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border-radius: 999px;
    background: #000;
    color: #fff;
    font-family: var(--sans);
    font-size: 17px;
    text-decoration: none;
  }
  .footer-links { display: flex; gap: 24px; margin: 20px 0 0; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: #000; }

  /* Small phones (iPhone SE / small Android): tighten the bar so it never overflows */
  @media (max-width: 389px) {
    .mobile-bar { padding-left: 12px; padding-right: 8px; gap: 2px; }
    .bar-name { font-size: 17px; }
    .bar-links a { padding: 0 6px; font-size: 15px; }
    .bar-links .pill { padding: 0 11px; margin-left: 2px; }
  }

  /* Tablets: a bit more air, still one column */
  @media (min-width: 640px) {
    .content, .mobile-bar { padding-left: 32px; padding-right: 32px; }
    .content { max-width: 760px; margin: 0 auto; }
    .mobile-footer { margin-left: 32px; margin-right: 32px; }
    .project-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  }
}

/* ---------- Lightbox (replaces Cargo's "quick view") ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  background: rgba(0, 0, 0, .8);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { width: auto; height: auto; max-width: 100%; max-height: 100%; margin: 0; }
.lightbox button {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  text-shadow: 0 0 4px rgba(0, 0, 0, .6);
}
.lightbox .lb-close { top: 10px; right: 10px; }
.lightbox .lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
