/* denley.nz — shared design system
   Fresh, modern, consistent across every page.
   Palette carried over from the original single-page site. */

:root {
  --ink: #172024;
  --muted: #5a666b;
  --paper: rgba(255, 255, 255, 0.92);
  --paper-solid: #ffffff;
  --accent: #45606b;
  --accent-soft: rgba(69, 96, 107, 0.12);
  --accent-line: rgba(69, 96, 107, 0.32);
  --line: rgba(23, 32, 36, 0.14);
  --shadow: rgba(20, 28, 31, 0.18);
  --bg: #dfe8e8;
  --ink-bg: #142126;
  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1080px;
  --nav-h: 64px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

img { max-width: 100%; display: block; }

/* ---------- Sticky top nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav__brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.nav__brand span {
  color: var(--accent);
  font: 700 0.7rem/1 "Trebuchet MS", Verdana, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 140ms ease, color 140ms ease;
}

.nav__links a:hover,
.nav__links a:focus-visible { background: var(--accent-soft); color: var(--ink); }
.nav__links a[aria-current="page"] { background: var(--accent); color: #fff; }

/* dropdown */
.nav__group { position: relative; }
.nav__menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  display: grid;
  min-width: 200px;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-solid);
  box-shadow: 0 18px 44px var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}
.nav__group:hover .nav__menu,
.nav__group:focus-within .nav__menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Invisible bridge over the 8px gap so moving the cursor from the trigger to the
   dropdown doesn't cross a dead zone and close the menu. */
.nav__group::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}

.nav__toggle { display: none; }
.nav__burger {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}
.nav__burger span,
.nav__burger span::before,
.nav__burger span::after {
  display: block;
  position: relative;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--ink);
}
.nav__burger span::before { content: ""; position: absolute; top: -6px; }
.nav__burger span::after { content: ""; position: absolute; top: 6px; }

/* ---------- Layout ---------- */
.wrap {
  width: min(100%, var(--maxw));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 40px);
}

.section { display: grid; gap: 18px; }
section.wrap > * + * { margin-top: clamp(28px, 5vw, 56px); }
.section > .eyebrow { margin-bottom: -10px; }

.eyebrow {
  margin: 0;
  color: var(--muted);
  font: 600 0.76rem/1.2 "Trebuchet MS", Verdana, sans-serif;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 650; line-height: 1.1; }
h3 { margin: 0; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.1em; }

p { margin: 0; font-size: clamp(0.98rem, 1.3vw, 1.1rem); line-height: 1.65; }
.lead { color: var(--muted); max-width: 46rem; }
.prose { display: grid; gap: 14px; color: var(--ink); max-width: 46rem; }
.prose p { color: var(--muted); }

.card {
  padding: clamp(20px, 3.4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: 0 24px 60px var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 80ms ease;
}
.btn:hover { border-color: var(--accent-line); box-shadow: 0 10px 24px var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: #35505a; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Tile grid (home / interests / blog) ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(14px, 2.4vw, 22px);
}
.tile {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 14px 32px rgba(20, 28, 31, 0.1);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: 0 22px 48px var(--shadow);
}
.tile__kicker { color: var(--muted); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.tile strong { font-size: 1.18rem; font-weight: 650; }
.tile span { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.tile__cover { aspect-ratio: 16 / 9; border-radius: 10px; object-fit: cover; margin: -22px -22px 4px; width: calc(100% + 44px); max-width: none; }

/* ---------- Two-column profile ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: clamp(20px, 4vw, 44px);
  align-items: start;
}
.aside-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(246, 248, 248, 0.82);
}
.aside-card ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.aside-card li + li { margin-top: 8px; }

/* ---------- Video gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(16px, 2.6vw, 24px);
}
.video-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0c1417;
  box-shadow: 0 14px 32px var(--shadow);
}
.video-card video,
.video-card .plyr { width: 100%; display: block; }
.video-card figcaption {
  padding: 10px 14px;
  background: var(--paper-solid);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}
.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 14px 32px var(--shadow);
  background: #0c1417;
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.gallery__empty,
.gallery__loading {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  text-align: center;
}

/* Plyr accent */
:root { --plyr-color-main: var(--accent); }

/* ---------- Notice / fundraiser ---------- */
.notice {
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: rgba(255, 250, 246, 0.86);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  text-align: center;
}
.site-footer .wrap { padding-top: 26px; padding-bottom: 26px; display: grid; gap: 6px; }
.site-footer p { font-size: 0.9rem; }
.site-footer strong { color: var(--ink); }
.site-footer a { color: var(--muted); }
.site-footer .site-version {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-top: 4px;
}

/* ---------- Hero (home) with rotating background ---------- */
.museum { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--ink-bg); }
.slide { position: absolute; inset: 0; z-index: 0; opacity: 0; animation: museum-fade 56s infinite; }
.slide:nth-child(2) { animation-delay: 8s; }
.slide:nth-child(3) { animation-delay: 16s; }
.slide:nth-child(4) { animation-delay: 24s; }
.slide:nth-child(5) { animation-delay: 32s; }
.slide:nth-child(6) { animation-delay: 40s; }
.slide:nth-child(7) { animation-delay: 48s; }
.slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); filter: saturate(0.92) contrast(1.02); animation: museum-pan 56s infinite linear; }
.caption {
  position: absolute;
  right: clamp(16px, 4vw, 56px);
  bottom: clamp(16px, 4vw, 48px);
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(10, 18, 21, 0.68);
  color: #fff;
  font: 700 0.74rem/1.2 "Trebuchet MS", Verdana, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.brand-cloud {
  position: absolute;
  inset: -8vh -18vw;
  z-index: 1;
  opacity: 0.62;
  pointer-events: none;
  transform: rotate(-5deg);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.brand-lane {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
  width: max-content;
  will-change: transform;
}
.brand-lane--one {
  top: 17%;
  animation: brand-scroll-left 62s linear infinite;
}
.brand-lane--two {
  top: 50%;
  animation: brand-scroll-right 72s linear infinite;
}
.brand-lane--three {
  top: 77%;
  animation: brand-scroll-left 68s linear infinite;
}
.logo-tile {
  display: inline-grid;
  place-items: center;
  width: clamp(82px, 9vw, 132px);
  height: clamp(52px, 6vw, 76px);
  padding: 0;
  filter: saturate(0.78);
}
.logo-tile--wide { width: clamp(126px, 14vw, 210px); }
.logo-tile img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: contrast(0.92) drop-shadow(0 10px 16px rgba(3, 8, 10, 0.28));
  opacity: 0.72;
}
.logo-tile[data-logo-brand="apple"] img,
.logo-tile[data-logo-brand="hp"] img,
.logo-tile[data-logo-brand="intel"] img,
.logo-tile[data-logo-brand="redhat"] img { width: 60%; height: 60%; }
.logo-tile[data-logo-brand="cisco"] img,
.logo-tile[data-logo-brand="compaq"] img { width: 70%; height: 70%; }
.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(223, 232, 232, 0.96) 0%, rgba(223, 232, 232, 0.88) 39%, rgba(20, 33, 38, 0.22) 72%, rgba(20, 33, 38, 0.12) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(9, 16, 18, 0.2));
  pointer-events: none;
}
.has-hero .nav { background: rgba(255, 255, 255, 0.6); }
.has-hero .wrap,
.has-hero .nav,
.has-hero .site-footer { position: relative; z-index: 2; }
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  align-items: center;
  position: relative;
  z-index: 2;
}
.hero .content { width: min(100%, 720px); }

@keyframes museum-fade {
  0% { opacity: 0; } 3% { opacity: 1; } 13% { opacity: 1; } 18% { opacity: 0; } 100% { opacity: 0; }
}
@keyframes museum-pan {
  0% { transform: scale(1.08) translate3d(0, 0, 0); }
  100% { transform: scale(1.16) translate3d(-2.4%, -1.6%, 0); }
}
@keyframes brand-scroll-left {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
@keyframes brand-scroll-right {
  0% { transform: translate3d(-50%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* ---------- Page banner (interior pages) ---------- */
.banner { position: relative; overflow: hidden; background: var(--ink-bg); color: #fff; }
.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(20, 33, 38, 0.78), rgba(69, 96, 107, 0.42));
}
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.banner .wrap { position: relative; z-index: 2; }
.banner h1 { color: #fff; }
.banner .lead { color: rgba(255, 255, 255, 0.85); }
.banner .eyebrow { color: #c6d2d8; }

/* ---------- BTG contact bubble ---------- */
.btgb {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translate(96px, -50%);
  opacity: 0;
  z-index: 60;
  transition: transform 260ms ease, opacity 260ms ease;
}
.btgb--show { transform: translate(0, -50%); opacity: 1; }
.btgb__btn {
  display: block;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-solid);
  box-shadow: 0 12px 32px var(--shadow);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.btgb__btn img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.btgb:hover .btgb__btn,
.btgb--open .btgb__btn { transform: scale(1.06); box-shadow: 0 16px 40px var(--shadow); }
.btgb__panel {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  width: min(320px, calc(100vw - 110px));
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-solid);
  box-shadow: 0 24px 60px var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
}
.btgb:hover .btgb__panel,
.btgb:focus-within .btgb__panel,
.btgb--open .btgb__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  transition-delay: 0s;
}
.btgb__panel h3 { margin: 0 0 8px; font-size: 0.82rem; }
.btgb__panel p { font-size: 0.88rem; line-height: 1.5; color: var(--muted); margin: 0 0 12px; }
.btgb__links { display: grid; gap: 6px; }
.btgb__links a {
  display: block;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.btgb__links a:hover { border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .btgb { top: auto; bottom: 18px; transform: translate(96px, 0); }
  .btgb--show { transform: translate(0, 0); }
  .btgb__panel { top: auto; bottom: 0; transform: translateX(8px); width: min(320px, calc(100vw - 110px)); }
  .btgb:hover .btgb__panel,
  .btgb:focus-within .btgb__panel,
  .btgb--open .btgb__panel { transform: translateX(0); }
  .brand-cloud { inset: -4vh -42vw; opacity: 0.62; transform: rotate(-10deg); }
  .brand-lane--one { top: 20%; }
  .brand-lane--two { top: 58%; }
  .brand-lane--three { display: none; }
  .logo-tile { width: 86px; height: 46px; }
  .logo-tile--wide { width: 128px; }
  .logo-tile img { width: 76%; height: 76%; }
  .logo-tile[data-logo-brand="apple"] img { width: 56%; height: 56%; }
  .logo-tile[data-logo-brand="hp"] img,
  .logo-tile[data-logo-brand="intel"] img,
  .logo-tile[data-logo-brand="redhat"] img { width: 54%; height: 54%; }
  .logo-tile[data-logo-brand="cisco"] img,
  .logo-tile[data-logo-brand="compaq"] img { width: 64%; height: 64%; }
  .nav__burger { display: block; }
  .nav__links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    background: var(--paper-solid);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px var(--shadow);
    display: none;
  }
  .nav__toggle:checked ~ .nav__links { display: flex; }
  .nav__menu {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
    border: 0;
    padding: 2px 0 2px 12px;
  }
  .nav__group::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .slide, .slide img, .brand-lane { animation: none; }
  .slide:first-child { opacity: 1; }
  .brand-lane--two, .brand-lane--three { display: none; }
  html { scroll-behavior: auto; }
}
