/* ==========================================================
   BLACKMOORE — shared styles
   Dark (pure black) is the default. Light (pure white) is set
   by data-theme="light" on <html> (see assets/js/site.js).
   ========================================================== */

:root {
  --accent: #40AEDD;
  --accent-text: #40AEDD;
  --bg: #000000;
  --text: #f2f2f2;
  --text-muted: #8c8c8c;
  --faint: #1a1a1a;            /* thumbnail placeholder only */
  --header-bg: rgba(0, 0, 0, 0.82);
  --spectrum: linear-gradient(90deg, #40AEDD 0%, #7d7bff 30%, #d66fe0 55%, #40AEDD 80%, #7d7bff 100%);

  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: dark;
}
:root[data-theme="light"] {
  --accent-text: #1b7aa6;      /* darker blue keeps text readable on white */
  --bg: #ffffff;
  --text: #0a0a0a;
  --text-muted: #6b6b6b;
  --faint: #ededed;
  --header-bg: rgba(255, 255, 255, 0.86);
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-weight: 300; font-size: 15px; line-height: 1.7;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 1px dashed var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: #000; }
p { margin: 0 0 1em; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: #000; padding: 6px 12px; }
.skip-link:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* micro mono text */
.micro {
  font-family: var(--mono); font-size: 11px; font-weight: 400;
  letter-spacing: .14em; text-transform: uppercase; line-height: 1.5;
}
.muted { color: var(--text-muted); }

/* blinking block cursor */
.cursor::after {
  content: ""; display: inline-block; width: .6em; height: 1.05em;
  margin-left: .35em; vertical-align: -.15em; background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* spectrum labels (page + section titles) */
.spectrum {
  display: inline-block; margin: 0;
  font-family: var(--mono); font-size: 12px; font-weight: 400;
  letter-spacing: .22em; text-transform: uppercase; line-height: 1.5;
  background: var(--spectrum); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: spectrum 7s linear infinite;
}
.spectrum::before { content: "// "; }
@keyframes spectrum { to { background-position: -250% 0; } }

/* ---------- underline links (all buttons and tags) ---------- */
.ulink {
  position: relative; display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--mono); font-size: 11px; font-weight: 400;
  letter-spacing: .14em; text-transform: uppercase; line-height: 1.5;
  color: var(--text-muted); padding: 4px 0;
  transition: color .2s;
}
.ulink::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: right center;
  transition: transform .35s var(--ease);
}
.ulink:hover, .ulink:focus-visible { color: var(--text); }
.ulink:hover::after, .ulink:focus-visible::after { transform: scaleX(1); transform-origin: left center; }
.ulink[aria-current="page"], .ulink[aria-pressed="true"] { color: var(--text); }
.ulink[aria-current="page"]::after, .ulink[aria-pressed="true"]::after { transform: scaleX(1); }
.ulink[aria-pressed="true"]::before { content: "›"; color: var(--accent); margin-right: -.2em; }
.ulink--accent { color: var(--accent-text); }
.ulink .count { color: var(--text-muted); opacity: .7; font-size: 10px; }
.ulink .arrow { transition: transform .25s var(--ease); }
.ulink:hover .arrow { transform: translateX(3px); }
.ulink:disabled { opacity: .3; cursor: default; }
.ulink:disabled::after { display: none; }

/* ---------- logo (swaps with theme) ---------- */
.logo { display: inline-block; line-height: 0; }
.logo img { height: 100%; width: auto; }
.logo .logo--light { display: none; }
:root[data-theme="light"] .logo .logo--dark { display: none; }
:root[data-theme="light"] .logo .logo--light { display: block; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background-color .35s var(--ease);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.site-header .logo { height: 15px; }
.nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 30px); }

/* home: header transparent over video until scrolled */
.site-header--overlay:not(.is-solid) { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.site-header--overlay:not(.is-solid) .ulink { color: rgba(255,255,255,.72); }
.site-header--overlay:not(.is-solid) .ulink:hover { color: #fff; }
.site-header--overlay .logo { transition: opacity .35s var(--ease); }
.site-header--overlay:not(.is-solid) .logo { opacity: 0; pointer-events: none; }

/* ---------- hero (home) ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 480px;
  overflow: hidden; background: #000; color: #fff;
  display: grid; place-items: center;
}
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,.1) 0%, rgba(0,0,0,.55) 78%),
    linear-gradient(to bottom, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 72%, rgba(0,0,0,.75) 100%);
}
/* subtle scanlines over the video */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.hero__content { position: relative; z-index: 2; text-align: center; width: min(78vw, 600px); }
.hero__logo { width: 100%; height: auto; margin: 0 auto; filter: drop-shadow(0 2px 20px rgba(0,0,0,.5)); }
.hero__tagline { margin: clamp(16px, 2.6vw, 26px) 0 0; color: rgba(255,255,255,.85); }
.hero__tagline b { font-weight: 400; color: var(--accent); }
.hero__controls {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 18px;
  display: flex; justify-content: space-between; align-items: center;
}
.hero__controls .ulink { color: rgba(255,255,255,.7); }
.hero__controls .ulink:hover { color: #fff; }
.video-toggle .when-paused { display: none; }
.video-toggle.is-paused .when-paused { display: inline; }
.video-toggle.is-paused .when-playing { display: none; }

/* ---------- home sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0 0; }
.section:last-of-type { padding-bottom: clamp(64px, 9vw, 120px); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }

.intro { max-width: 62ch; }
.intro p { font-size: clamp(15px, 1.5vw, 17px); }
.intro p:first-of-type { color: var(--text); }
.intro p + p { color: var(--text-muted); }
.intro em { font-style: normal; color: var(--accent-text); }
.explore { display: inline-block; margin-top: 10px; color: var(--text-muted); }
.explore:hover { color: var(--accent-text); }

/* featured project */
.feature { display: grid; grid-template-columns: 1fr; gap: clamp(20px, 3vw, 48px); align-items: center; }
.feature__media { display: block; position: relative; }
.feature__title { font-size: clamp(18px, 2vw, 22px); font-weight: 400; line-height: 1.25; margin: 10px 0 2px; }
.feature__sub { margin: 0 0 16px; }
.feature__text { color: var(--text-muted); margin: 0 0 18px; max-width: 52ch; }
@media (min-width: 900px) { .feature { grid-template-columns: 1.4fr 1fr; } }

/* ---------- media thumbnails + tech hover ---------- */
.thumb {
  position: relative; overflow: hidden; width: 100%;
  aspect-ratio: 16 / 9; background: var(--faint);
}
.thumb > img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .4s; }
/* glitch slice layer (uses the same image via --img) */
.thumb::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: var(--img); background-size: cover; background-position: center;
  opacity: 0; mix-blend-mode: screen;
}
/* scanlines */
.thumb::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.28) 0 1px, transparent 1px 3px);
  opacity: 0; transition: opacity .3s;
}
.hoverable:hover .thumb > img, .hoverable:focus-visible .thumb > img { transform: scale(1.035); filter: contrast(1.08) saturate(1.15); }
.hoverable:hover .thumb::after, .hoverable:focus-visible .thumb::after { opacity: 1; }
.hoverable:hover .thumb::before { animation: slices .55s steps(1) 1; }
@keyframes slices {
  0%   { opacity: .9; clip-path: inset(12% 0 70% 0); transform: translateX(-10px); filter: hue-rotate(80deg); }
  20%  { opacity: .9; clip-path: inset(55% 0 25% 0); transform: translateX(8px);  filter: hue-rotate(-60deg); }
  40%  { opacity: .9; clip-path: inset(30% 0 52% 0); transform: translateX(-5px); }
  60%  { opacity: .9; clip-path: inset(78% 0 6% 0);  transform: translateX(12px); filter: hue-rotate(140deg); }
  80%  { opacity: .8; clip-path: inset(4% 0 88% 0);  transform: translateX(-6px); }
  100% { opacity: 0; }
}
/* corner readouts */
.thumb__tag {
  position: absolute; z-index: 2; left: 10px; bottom: 8px;
  color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.8);
  opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s var(--ease);
}
.thumb__id { left: auto; right: 10px; color: rgba(255,255,255,.75); }
.hoverable:hover .thumb__tag, .hoverable:focus-visible .thumb__tag { opacity: 1; transform: none; }
.thumb__tag--always { opacity: 1; transform: none; }

/* vertical (9:16) videos */
.vert-bg {
  position: absolute; inset: -10%; width: 120%; height: 120%; max-width: none;
  object-fit: cover; filter: blur(24px) brightness(.45);
}
.thumb .vert-fg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  height: 100%; width: auto; aspect-ratio: 9 / 16; object-fit: cover;
}

/* ---------- cards ---------- */
.card-grid {
  display: grid; gap: clamp(22px, 3vw, 36px) clamp(16px, 2.4vw, 28px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.card { display: block; width: 100%; text-align: left; }
.card__meta { padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.card__line { display: flex; gap: 10px; color: var(--text-muted); }
.card__line .idx { color: var(--accent-text); }
.card__title { font-size: 15px; font-weight: 400; margin: 0; line-height: 1.35; transition: color .2s; }
.card:hover .card__title { color: var(--accent-text); }

/* ---------- work page ---------- */
.page-head { padding-top: calc(56px + clamp(44px, 7vw, 88px)); }
.work-intro {
  display: grid; gap: 26px 40px; margin-top: 26px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.work-intro__lead { grid-column: 1 / -1; max-width: 64ch; font-size: clamp(15px, 1.5vw, 17px); margin: 0; }
.work-intro h2 { margin: 0 0 8px; color: var(--accent-text); }
.work-intro h2 span { color: var(--text-muted); margin-right: 8px; }
.work-intro p { color: var(--text-muted); margin: 0; font-size: 14px; }

.toolbar {
  position: sticky; top: 56px; z-index: 20; margin-top: clamp(40px, 6vw, 64px);
  background: var(--header-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.toolbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 10px; padding-bottom: 10px; }
.filters, .view-switch { display: flex; gap: clamp(14px, 2.4vw, 26px); }
.filters { overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.filters::-webkit-scrollbar { display: none; }
.filters .ulink { flex: 0 0 auto; }

.filter-note { max-width: 70ch; margin: 24px 0 0; color: var(--text-muted); font-size: 14px; }
.filter-note p:first-child::before { content: "> "; color: var(--accent-text); font-family: var(--mono); }

.works { padding: 26px 0 clamp(64px, 9vw, 110px); scroll-margin-top: 96px; }
.works[data-view="grid"] .slideshow { display: none; }
.works[data-view="slides"] .card-grid { display: none; }

/* ---------- slideshow ---------- */
.slides {
  display: flex; align-items: flex-start; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; padding: 0 2px; }
.slide__inner, .slide-nav { max-width: min(1000px, calc((100vh - 300px) * 1.778)); margin: 0 auto; }
@media (max-width: 700px) { .slide__inner, .slide-nav { max-width: none; } }

.player { position: relative; aspect-ratio: 16 / 9; width: 100%; overflow: hidden; background: #000; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player--vertical { aspect-ratio: 9 / 16; width: auto; max-width: 100%; height: min(70vh, 720px); height: min(70svh, 720px); margin: 0 auto; }
.player__facade { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.player__facade .thumb { position: absolute; inset: 0; aspect-ratio: auto; }
.player__facade .play-label {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: #fff; text-shadow: 0 1px 10px rgba(0,0,0,.9); font-size: 12px; padding: 6px 2px;
}
.player__facade .play-label::after { transform: scaleX(.35); transform-origin: left center; }
.player__facade:hover .play-label::after { transform: scaleX(1); }

.slide__info { display: grid; gap: 6px 36px; grid-template-columns: 1fr; padding-top: 16px; }
.slide__title { font-size: clamp(16px, 1.8vw, 20px); font-weight: 400; margin: 4px 0 0; line-height: 1.3; }
.slide__desc { color: var(--text-muted); margin: 0; max-width: 64ch; font-size: 14px; }
@media (min-width: 860px) { .slide__info { grid-template-columns: minmax(200px, 1fr) 2fr; } }

.slide-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 0 2px; }
.slide-nav__btns { display: flex; gap: 22px; }
.slide-nav__counter b { color: var(--text); font-weight: 400; }
.swipe-hint { color: var(--text-muted); }
@media (hover: hover) and (pointer: fine) { .swipe-hint { display: none; } }

.empty { color: var(--text-muted); padding: 40px 0; }

/* ---------- footer ---------- */
.site-footer { padding: 28px 0 40px; }
.site-footer .wrap { display: flex; gap: 16px 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.site-footer .logo { height: 13px; }
.footer-links { display: flex; gap: 8px 22px; flex-wrap: wrap; }
.copyright { width: 100%; margin: 0; color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .cursor::after { opacity: 1; }
}

@media (max-width: 480px) {
  .hide-sm { display: none; }
  .nav { gap: 16px; }
}

/* ---------- about / CV ---------- */
.about-bio { max-width: 64ch; margin-top: 22px; }
.about-bio p:first-child { font-size: clamp(15px, 1.5vw, 17px); color: var(--text); }
.about-bio p { color: var(--text-muted); }
.about-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 8px; }

.cv { margin-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(64px, 9vw, 110px); }
.cv-section {
  display: grid; grid-template-columns: 1fr; gap: 14px 40px;
  padding: 26px 0;
}
.cv-section > h2 { margin: 0; }
.cv-list { list-style: none; margin: 0; padding: 0; }
.cv-list li {
  display: grid; grid-template-columns: 92px 1fr; gap: 0 16px;
  padding: 7px 0; font-size: 14px; line-height: 1.55;
}
.cv-list .yr { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--accent-text); padding-top: 3px; }
.cv-list .what { color: var(--text); }
.cv-list .what i { font-style: normal; }
.cv-list .where { color: var(--text-muted); }
.cv-list li.highlight .what::after {
  content: "Forthcoming"; margin-left: 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text);
}
.cv-list a.what { transition: color .2s; }
.cv-list a.what:hover { color: var(--accent-text); }
@media (min-width: 860px) {
  .cv-section { grid-template-columns: 220px 1fr; }
}
@media (max-width: 480px) {
  .cv-list li { grid-template-columns: 1fr; }
  .cv-list .yr { padding-top: 0; }
}

/* ---------- stills in the slideshow ---------- */
/* width = the smaller of the column or (max height x the image's ratio);
   height then follows from the ratio, so the image can't be stretched */
.still__link {
  --max-h: min(70vh, 720px);
  position: relative; display: block; margin: 0 auto; line-height: 0;
  width: min(100%, calc(var(--max-h) * var(--r, 1)));
}
@supports (height: 1svh) { .still__link { --max-h: min(70svh, 720px); } }
.still__link img { display: block; width: 100%; height: auto; max-width: none; object-fit: contain; }
.still__link .thumb__tag { line-height: 1.5; }
.still__link:hover .thumb__tag, .still__link:focus-visible .thumb__tag { opacity: 1; transform: none; }

/* belt and braces: no thumbnail can ever distort */
.thumb img { object-fit: cover; }

/* phones: fade the scrolling filter row so it doesn't collide with Grid/Slides */
@media (max-width: 700px) {
  .toolbar .filters {
    padding-right: 28px;
    -webkit-mask-image: linear-gradient(90deg, #000 78%, transparent);
    mask-image: linear-gradient(90deg, #000 78%, transparent);
  }
}
