/* ── Tokens: change these to restyle the whole site ─────────── */
:root {
  /* Colours taken from the original benfrey.ca */
  --bg: #0f171e;              /* darkmode-900 */
  --bg-raised: #233348;       /* darkmode-400: hover fills, quote boxes */
  --menu-bg: #16212b;         /* dropdown menu */
  --text: #f0f4ef;            /* neutral-50 */
  --text-muted: #a3adb9;
  --hover: #7e8a9a;           /* neutral-500: link hover colour */
  --line: rgba(240, 244, 239, 0.9);
  --line-soft: rgba(240, 244, 239, 0.16);

  --font-display: "Signika", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --wrap: 1180px;
  --prose: 720px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.2; margin: 0; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.wide { max-width: 1320px; }

/* ── Header ─────────────────────────────────────────────────── */
#site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand img { height: 50px; width: auto; }
.brand { font-family: var(--font-display); font-size: 1.4rem; text-decoration: none; }
#site-nav > ul { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; align-items: center; }
/* Matches the original .uui-navbar-link */
.nav-link {
  text-decoration: none; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase;
  padding: 28px 2rem; display: inline-block; color: var(--text);
}
.nav-link:hover { color: var(--text); }
.has-sub > .nav-link::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 12px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.has-sub { position: relative; }
.has-sub .sub {
  position: absolute; top: calc(100% - 16px); left: 1rem; min-width: 200px;
  list-style: none; margin: 0; padding: 8px;
  background: var(--menu-bg); border: 1px solid var(--line-soft); border-radius: 6px;
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: .15s;
}
.has-sub:hover .sub, .has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: none; }
.sub a { display: block; padding: 8px 10px; text-decoration: none; font-size: 0.92rem; border-radius: 4px; }
.sub a:hover { background: rgba(255, 255, 255, .06); color: var(--hover); }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle {
    display: block; background: none; color: var(--text); border: 0; padding: 6px 0;
    font: inherit; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; cursor: pointer;
  }
  #site-nav { display: none; position: absolute; top: 76px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line-soft); }
  .open #site-nav { display: block; }
  #site-nav > ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px; }
  .nav-link { padding: 12px 0; }
  .has-sub .sub { position: static; opacity: 1; visibility: visible; background: none; padding: 0 0 8px 12px; }
}

/* ── Links: matches the original .uui-text-link ─────────────── */
.text-link {
  color: var(--text); font-size: 14px; font-weight: 300; letter-spacing: 0.5px;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
a:hover, .text-link:hover { color: var(--hover); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { padding: clamp(48px, 9vw, 110px) 0 clamp(40px, 7vw, 90px); }
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.eyebrow { color: var(--text-muted); margin: 0 0 24px; max-width: 30em; }
.statement { font-family: var(--font-display); font-size: clamp(1.5rem, 2.8vw, 2.1rem); line-height: 1.35; margin: 0 0 20px; max-width: 22em; }
.hero-actions { display: flex; gap: 50px; align-items: center; margin-top: 48px; flex-wrap: wrap; }
.hero-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo { max-width: 420px; aspect-ratio: 1; }
}

/* ── Sections ───────────────────────────────────────────────── */
.section { padding: clamp(48px, 8vw, 90px) 0; }
/* Centred Signika heading over a rule with a centre tick, as on the original */
.section-title {
  font-size: 32px; letter-spacing: 1.5px; text-align: center;
  margin-bottom: clamp(36px, 6vw, 64px); padding-bottom: 28px; position: relative;
  border-bottom: 1px solid var(--line);
}
.section-title::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 24px; background: var(--line);
}

/* Projects */
.projects { display: grid; gap: clamp(56px, 9vw, 110px); }
.project-card { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.project-card:nth-child(even) .project-thumb { order: 2; }
.project-thumb { display: block; overflow: hidden; border-radius: var(--radius); background: var(--bg-raised); }
.project-thumb img, .project-thumb video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform .5s ease; }
.project-thumb:hover img, .project-thumb:hover video { transform: scale(1.03); }
.project-thumb video { aspect-ratio: auto; }  /* show videos uncropped */
.project-info h3 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 16px; }
.project-info h3 a { text-decoration: none; }
.project-meta, .case-meta { display: flex; gap: 48px; margin: 24px 0 28px; flex-wrap: wrap; }
.project-meta h4, .case-meta h4 {
  font-family: var(--font-body); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 500; margin-bottom: 8px;
}
.project-meta ul, .case-meta ul { list-style: none; margin: 0; padding: 0; font-size: .92rem; line-height: 1.8; }
.links a { color: var(--text); text-decoration: none; font-size: 14px; }
@media (max-width: 760px) {
  .project-card { grid-template-columns: 1fr; }
  .project-card:nth-child(even) .project-thumb { order: 0; }
}

/* Gallery teasers on the homepage */
.gallery-teasers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }
.gallery-teaser { text-decoration: none; display: block; }
.teaser-images { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; aspect-ratio: 3 / 2; margin-bottom: 16px; }
.teaser-images img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.teaser-images img:first-child { grid-row: span 2; }
.gallery-teaser h3 { font-size: 1.5rem; }
.gallery-teaser:hover h3 { color: var(--hover); }
.gallery-teaser p { color: var(--text-muted); margin: 6px 0 0; }

/* Timeline (experience + ventures) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item {
  display: grid; grid-template-columns: 120px 1fr 230px; gap: 32px;
  padding: 28px 0; border-bottom: 1px solid var(--line-soft); align-items: start;
}
.timeline-item:first-child { padding-top: 0; }
.timeline-logo img { max-height: 36px; max-width: 120px; width: auto; }
.timeline-body h3 { font-size: 1.35rem; }
.timeline-body h3 a { text-decoration: none; }
.timeline-role { margin: 4px 0 8px; color: var(--text); }
/* Ventures are linked cards: hover matches the original .uui-entreprenurial-container */
#ventures .timeline-item { border: 1.5px solid var(--bg); padding: 24px; margin-bottom: 8px; transition: .2s; }
#ventures .timeline-item:has(a):hover { border-color: var(--hover); background: var(--bg-raised); }
.timeline-summary { margin: 0; color: var(--text-muted); max-width: 40em; }
.timeline-dates { text-align: right; font-size: .9rem; color: var(--text-muted); }
.timeline-dates span { display: block; font-size: .8rem; opacity: .8; }
@media (max-width: 900px) {
  .timeline-item { grid-template-columns: 1fr; gap: 10px; }
  .timeline-dates { text-align: left; order: -1; }
  .timeline-logo:empty { display: none; }
}

/* ── Case study page ────────────────────────────────────────── */
.case-hero { padding: clamp(32px, 6vw, 72px) 0 0; }
.case-hero h1 { font-size: clamp(calc(2.6rem - 10px), calc(7vw - 10px), calc(5rem - 10px)); margin: 20px 0 16px; }
.lede { font-size: clamp(16px, calc(2vw - 5px), calc(1.35rem - 5px)); color: var(--text-muted); max-width: 38em; margin: 0 0 clamp(32px, 5vw, 56px); }
.case-cover { display: block; width: 100%; border-radius: var(--radius); background: var(--bg-raised); }
.case-meta { padding-top: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); margin-top: 32px; }

/* Long-form text from Markdown */
.prose { font-size: 1.05rem; }
.prose.small { font-size: .98rem; color: var(--text-muted); }
.prose.small p { margin: 0 0 12px; }
.case-body { max-width: calc(var(--prose) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--gutter) 40px; }
.case-body h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 2.4em 0 .6em; }
.case-body h2:first-child { margin-top: 0; }
.case-body h3 { font-size: 1.3rem; margin: 2em 0 .5em; }
.case-body p, .case-body li { color: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.case-body strong { color: var(--text); font-weight: 600; }
.case-body a { color: var(--text); text-underline-offset: 3px; }
.case-body a:hover { color: var(--hover); }
.case-body ol, .case-body ul { padding-left: 1.3em; }
.case-body li { margin-bottom: .5em; }
.case-body hr { border: 0; border-top: 1px solid var(--line); margin: 3em 0; }

/* Images break out wider than the text column */
.media { margin: 2.5em calc(-1 * min(18vw, 240px)); }
.media img, .media video, .media figure img, .media figure video { width: 100%; border-radius: var(--radius); background: var(--bg-raised); }
.media figure { margin: 0; }
.media figcaption { font-size: .85rem; color: var(--text-muted); margin-top: 8px; }
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); align-items: start; }
.gallery.count-3 { grid-template-columns: repeat(3, 1fr); }
.gallery.count-4, .gallery.many { grid-template-columns: repeat(4, 1fr); }
.gallery.many { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .media { margin-left: 0; margin-right: 0; } }
@media (max-width: 760px) {
  .gallery.count-3, .gallery.count-4 { grid-template-columns: repeat(2, 1fr); }
  .gallery.many { grid-template-columns: repeat(3, 1fr); }
}

/* Testimonials: Markdown "> quote" */
.case-body blockquote {
  margin: 1.6em 0; padding: 24px 28px; background: var(--bg-raised);
  border-left: 2px solid var(--hover); border-radius: 0 var(--radius) var(--radius) 0;
}
.case-body blockquote p { margin: 0 0 12px; font-size: 1.05rem; }
.case-body blockquote p:last-child { margin: 0; font-size: .9rem; color: var(--text-muted); }

/* Team collaboration: centred heading over a full rule, two-column name list */
.team { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(48px, 7vw, 88px); }
.team-title { font-size: 32px; letter-spacing: 1.5px; text-align: center; padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.people { list-style: none; margin: 0; padding: 0 clamp(0px, 3vw, 36px); display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; row-gap: 36px; }
.person-name { display: block; font-size: 1.25rem; letter-spacing: 0.3px; }
.person-role { display: block; color: var(--text-muted); margin-top: 6px; }
@media (max-width: 560px) { .people { grid-template-columns: 1fr; row-gap: 24px; } }

/* Bottom of a case study: ← All work · Next: X → */
.pager { border-top: 1px solid var(--line-soft); }
.pager-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 40px; padding-bottom: 40px; flex-wrap: wrap; }
.pager-link { font-size: 1.1rem; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.pager-link:last-child:not(:first-child) { margin-left: auto; }

/* ── About page ─────────────────────────────────────────────── */
.about-hero { padding: clamp(48px, 8vw, 100px) 0 clamp(32px, 5vw, 60px); }
.about-hero h1 { font-size: clamp(calc(2.2rem - 10px), calc(5vw - 10px), calc(3.4rem - 10px)); margin-bottom: 28px; max-width: 14em; }
.about-hero .prose p { margin: 0 0 1.1em; color: color-mix(in srgb, var(--text) 86%, var(--bg)); max-width: 36em; }
.about-hero .hero-inner { align-items: start; }
.about-hero .hero-photo { position: sticky; top: 110px; }
.about-intro { text-align: center; color: var(--text-muted); max-width: 40em; margin: -24px auto clamp(32px, 5vw, 48px); }
.groups { list-style: none; margin: 0; padding: 0 clamp(0px, 3vw, 36px); display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px 48px; }
.groups h3 {
  font-family: var(--font-body); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 500; margin-bottom: 12px;
}
.groups ul { list-style: none; margin: 0; padding: 0; }
.groups li { margin-bottom: 6px; }
.groups li small { display: block; color: var(--text-muted); font-size: .88rem; }

/* ── Gallery page ───────────────────────────────────────────── */
.page-head { padding-top: clamp(40px, 7vw, 90px); }
.page-head h1 { font-size: clamp(calc(2.6rem - 10px), calc(7vw - 10px), calc(5rem - 10px)); margin-bottom: 16px; }
.masonry { columns: 3 300px; column-gap: 16px; padding-bottom: 80px; }
.masonry figure { margin: 0 0 16px; break-inside: avoid; }
.masonry img { width: 100%; border-radius: 4px; }
.masonry figcaption { font-size: .88rem; color: var(--text-muted); margin-top: 8px; }
.masonry figcaption strong { display: block; color: var(--text); font-weight: 500; font-size: 1rem; }
.empty { color: var(--text-muted); padding-bottom: 80px; }

/* ── Lightbox ───────────────────────────────────────────────── */
.zoomable { cursor: zoom-in; }
#lightbox {
  border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; overflow: visible;
}
#lightbox::backdrop { background: rgba(5, 9, 12, .92); }
#lightbox img { max-width: 94vw; max-height: 90vh; width: auto; border-radius: 4px; cursor: zoom-out; }
.lightbox-close {
  position: fixed; top: 16px; right: 20px; background: none; border: 0; color: #fff; font-size: 2rem; cursor: pointer;
}

/* ── Footer ─────────────────────────────────────────────────── */
#site-footer { border-top: 1px solid var(--line-soft); padding: clamp(56px, 9vw, 96px) 0 40px; text-align: center; }
.footer-logo { height: 56px; width: auto; margin: 0 auto 32px; }
.footer-line { margin: 0 0 12px; font-size: 16px; }
.social { list-style: none; padding: 0; margin: 32px 0 0; display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.social a { text-decoration: none; color: var(--text); font-size: 14px; }
.copyright { color: var(--text-muted); font-size: 12px; margin: 40px 0 0; }

.error { padding: 80px var(--gutter); }
.error code { background: var(--bg-raised); padding: 2px 6px; border-radius: 4px; }

/* Gallery items that open their own project page */
.masonry .has-project a { text-decoration: none; display: block; }
.masonry .has-project img { transition: opacity .2s; }
.masonry .has-project a:hover img { opacity: .85; }
.masonry .has-project a:hover strong { color: var(--hover); }

/* Tall single images (portrait illustrations) fit the screen instead of overflowing it */
.media:not(.gallery) > img { width: auto; max-width: 100%; max-height: 90vh; margin: 0 auto; }

