/* BuonaLabs — lab.buonalabs.com portfolio */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 300 1000;
  font-display: swap;
  src: url(/fonts/dmsans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 300 1000;
  font-display: swap;
  src: url(/fonts/dmsans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --accent: #3b04ee;
  --accent-soft: #6b46ff;
  --bg: #f5f4f0;
  --bg-raise: #ffffff;
  --ink: #0a0a0a;
  --ink-2: rgba(10, 10, 10, 0.62);
  --line: rgba(10, 10, 10, 0.12);
  --card-shadow: 0 1px 2px rgba(10, 10, 10, 0.06), 0 12px 32px -12px rgba(10, 10, 10, 0.18);
  --header-bg: rgba(245, 244, 240, 0.82);
  color-scheme: light;
}
html.dark {
  --bg: #070707;
  --bg-raise: #111113;
  --ink: #f4f4f5;
  --ink-2: rgba(244, 244, 245, 0.6);
  --line: rgba(244, 244, 245, 0.14);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 16px 40px -14px rgba(0, 0, 0, 0.7);
  --header-bg: rgba(7, 7, 7, 0.78);
  --accent-soft: #8f7bff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-optical-sizing: auto;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 18px;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: 0.06em; font-size: 15px; white-space: nowrap; }
@media (max-width: 1000px) { .brand .brand-text, .brand .tm { display: none; } }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
@media (max-width: 1000px) {
  .brand img { width: 42px; height: 42px; border-radius: 11px; }
}
.brand .tm { font-size: 9px; vertical-align: super; opacity: 0.6; }
.main-nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  text-decoration: none; font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  padding: 7px 12px; border-radius: 999px; color: var(--ink-2); white-space: nowrap;
  transition: color 0.2s, background-color 0.2s;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a.active { color: #fff; background: var(--accent); }
html.dark .main-nav a.active { background: var(--accent); }

.theme-toggle {
  flex: none; margin-left: 6px; width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  cursor: pointer; display: grid; place-items: center;
  transition: border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { border-color: var(--ink-2); transform: rotate(15deg); }
.theme-toggle svg { width: 17px; height: 17px; }
html.dark .theme-toggle .sun { display: block; }
html.dark .theme-toggle .moon { display: none; }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }

/* ---------- hero ---------- */
.hero { padding: clamp(60px, 10vw, 130px) 0 clamp(40px, 6vw, 80px); }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-2);
}
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--accent); }
.hero h1 {
  margin: 18px 0 0;
  font-size: clamp(44px, 9vw, 118px);
  line-height: 0.95; letter-spacing: -0.03em; font-weight: 800;
  text-transform: uppercase;
}
.hero h1 .accent { color: var(--accent); }
html.dark .hero h1 .accent { color: var(--accent-soft); }
.hero p.lede { max-width: 560px; margin: 26px 0 0; font-size: clamp(15px, 1.6vw, 18px); color: var(--ink-2); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.chip {
  text-decoration: none; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s, transform 0.2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
html.dark .chip:hover { color: var(--accent-soft); border-color: var(--accent-soft); }
.chip .n { opacity: 0.55; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 14px 0; user-select: none; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 36s linear infinite; }
.marquee span { font-size: 13px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.marquee span::after { content: "·"; margin-left: 48px; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- sections ---------- */
.section { padding: clamp(56px, 8vw, 110px) 0 0; scroll-margin-top: 72px; }
.section-head { max-width: 720px; }
.section-head h2 {
  margin: 14px 0 0; font-size: clamp(30px, 5vw, 56px);
  line-height: 1.02; letter-spacing: -0.025em; font-weight: 800; text-transform: uppercase;
}
.section-head p { margin: 16px 0 0; color: var(--ink-2); font-size: 16px; }

/* ---------- project ---------- */
.project { margin-top: clamp(40px, 6vw, 72px); }
.project-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; max-width: 860px; }
.project-head h3 { margin: 0; font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -0.02em; }
.project-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: 4px 11px;
}
html.dark .project-tag { color: var(--accent-soft); }
.project-copy { max-width: 760px; margin: 12px 0 0; color: var(--ink-2); font-size: 15px; }

.gallery { margin-top: 26px; columns: 3; column-gap: 14px; }
@media (max-width: 980px) { .gallery { columns: 2; } }
@media (max-width: 560px) { .gallery { columns: 2; column-gap: 10px; } }

/* video-heavy galleries: neat side-by-side rows instead of masonry */
.gallery-videos {
  columns: unset;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 14px;
}
@media (max-width: 980px) { .gallery-videos { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .gallery-videos { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.gallery-videos .tile { margin: 0; aspect-ratio: 9 / 16; }
.gallery-videos .tile.landscape { grid-column: span 2; aspect-ratio: auto; align-self: center; }
.gallery-videos .tile video, .gallery-videos .tile .poster-overlay { height: 100%; width: 100%; object-fit: cover; }
.gallery-videos .tile.landscape video, .gallery-videos .tile.landscape .poster-overlay { height: auto; }

/* collapsed items behind "show all" */
.gallery .tile.extra { display: none; }
.gallery.expanded .tile.extra { display: block; }

.show-more {
  margin-top: 4px; cursor: pointer;
  font: 600 13.5px/1 "DM Sans", sans-serif; letter-spacing: 0.04em;
  color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 11px 22px;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.show-more:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
html.dark .show-more:hover { border-color: var(--accent-soft); color: var(--accent-soft); }

.tile {
  display: block; position: relative; overflow: hidden; border-radius: 14px;
  margin: 0 0 14px; break-inside: avoid; background: var(--bg-raise);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--line);
}
.tile img, .tile video { width: 100%; height: auto; transition: transform 0.5s cubic-bezier(0.2, 0.6, 0.2, 1); }
.tile:hover img, .tile:hover video { transform: scale(1.03); }
.tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 0 var(--accent); transition: box-shadow 0.25s;
  pointer-events: none;
}
.tile:hover::after { box-shadow: inset 0 0 0 2px var(--accent); }
.tile .poster-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none;
  transition: opacity 0.45s ease;
}
.tile.playing .poster-overlay { opacity: 0; }
.tile .badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0, 0, 0, 0.55); color: #fff; backdrop-filter: blur(6px);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  border-radius: 999px; padding: 5px 10px; pointer-events: none;
}
.badge svg { width: 10px; height: 10px; }

/* feature card (promo video) */
.feature { margin-top: 26px; display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } }
.feature .tile { max-width: 420px; margin: 0; }
.feature-info { padding-top: 6px; }
.feature-info .facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.fact { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; color: var(--ink-2); }

/* coming soon */
.soon-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.soon-card {
  position: relative; overflow: hidden; border: 1px dashed var(--line); border-radius: 16px;
  padding: 26px 22px; min-height: 150px; background: var(--bg-raise);
}
.soon-card h4 { margin: 0 0 6px; font-size: 16px; font-weight: 800; }
.soon-card p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.soon-card .dot {
  position: absolute; top: 18px; right: 18px; width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent); animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; transform: scale(0.8); } }
.soon-note { margin-top: 18px; font-size: 14px; color: var(--ink-2); max-width: 640px; }

/* ---------- footer ---------- */
.site-footer { margin-top: clamp(70px, 10vw, 130px); border-top: 1px solid var(--line); background: var(--bg-raise); }
.site-footer .wrap { padding-top: 54px; padding-bottom: 44px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h5 { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); }
.site-footer p, .site-footer a { font-size: 14.5px; color: var(--ink); margin: 0 0 6px; }
.site-footer a { display: block; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
html.dark .site-footer a:hover { color: var(--accent-soft); }
.footer-cta {
  display: inline-flex !important; align-items: center; gap: 8px; margin-top: 12px;
  background: var(--accent); color: #fff !important; font-weight: 700;
  border-radius: 999px; padding: 11px 22px; transition: transform 0.2s, box-shadow 0.2s;
}
.footer-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -8px var(--accent); color: #fff !important; }
.copyright { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- glightbox theming ---------- */
.glightbox-clean .gslide-description { background: var(--bg-raise); }
.glightbox-clean .gslide-title { font-family: "DM Sans", sans-serif; color: var(--ink); font-weight: 700; }
.glightbox-clean .gdesc-inner { padding: 16px 20px; }
.goverlay { background: rgba(4, 4, 6, 0.94); }
:root { --plyr-color-main: #3b04ee; }
