/* ====================================================================
   PROJECTS GALLERY · projects.html
   Bento grid · 3 columns · variable spans · per-tile cursor tilt
   ==================================================================== */

.projects-page { background: var(--bg); color: var(--fg); }

/* ---------- Sub-nav (mirrors .hero-nav) ---------- */
.sub-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 40px;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--fg-08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.sub-nav .brand {
  justify-self: start;
  padding-left: 8px;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--fg);
  text-decoration: none;
}
.sub-nav-links {
  justify-self: center;
  display: flex;
  gap: 8px;
}
.sub-nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  color: var(--fg);
  opacity: 0.7;
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s, background 0.2s;
}
.sub-nav-links a:hover { opacity: 1; background: var(--fg-08); }
.sub-nav .nav-cta { justify-self: end; }

@media (max-width: 760px) {
  .sub-nav { padding: 14px 20px; grid-template-columns: 1fr auto; }
  .sub-nav-links { display: none; }
}

/* ---------- Intro ---------- */
.gallery-intro {
  padding: 120px 40px 80px;
  max-width: 1280px;
  margin: 0 auto;
}
.gi-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--fg-08);
  margin-bottom: 40px;
}
.gi-kicker { color: var(--fg); }
.gi-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(48px, 8.5vw, 112px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 0;
  text-transform: uppercase;
  color: #fafafa;
}
.gi-title .accent { color: var(--accent); }
.gi-lead {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: rgba(245, 241, 234, 0.7);
  max-width: 60ch;
  margin: 28px 0 0;
}

@media (max-width: 760px) {
  .gallery-intro { padding: 80px 20px 56px; }
  .gi-meta { flex-direction: column; gap: 4px; }
}

/* ---------- Bento gallery ---------- */
.gallery {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 40px 120px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 300px;
  gap: 14px;
  perspective: 1800px;
}

@media (max-width: 1000px) {
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 280px; }
}
@media (max-width: 640px) {
  .gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 260px;
    padding: 24px 20px 80px;
  }
}

/* ---------- Bento Tile ---------- */
.bt {
  --tone: var(--accent);
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: block;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in oklab, var(--tone) 14%, transparent), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--fg-08);
  overflow: hidden;
  text-decoration: none;
  color: var(--fg);
  isolation: isolate;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1),
              border-color 0.22s ease,
              background 0.22s ease;
  cursor: pointer;
}
.bt.bt-static { cursor: default; }

/* Span variants */
.bt-hero { grid-column: span 2; }
.bt-wide { grid-column: span 2; }
.bt-tall { grid-row: span 2; }
.bt-full { grid-column: span 3; }

@media (max-width: 1000px) {
  .bt-hero, .bt-wide, .bt-full { grid-column: span 2; grid-row: auto; }
}
@media (max-width: 640px) {
  .bt-hero, .bt-wide, .bt-full {
    grid-column: span 1;
    grid-row: auto;
  }
}

.bt:hover { border-color: var(--fg-22); }

/* Grid texture overlay */
.bt::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.bt-spotlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(280px 200px at var(--mx) var(--my),
              color-mix(in oklab, var(--tone) 32%, transparent),
              transparent 65%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 1;
}
.bt:hover .bt-spotlight,
.bt:focus-within .bt-spotlight { opacity: 1; }

/* ---------- Art area (logo) ---------- */
.bt-art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 36px 36px 110px;
  z-index: 2;
  pointer-events: none;
}
.bt-tile {
  width: 130px;
  height: 130px;
  border-radius: 26px;
  background: color-mix(in oklab, var(--tone) 16%, #0a0a0a);
  display: grid;
  place-items: center;
  color: #fafafa;
  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--tone) 40%, transparent),
    0 30px 60px -20px color-mix(in oklab, var(--tone) 50%, transparent);
  transform: translateZ(40px);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bt:hover .bt-tile { transform: translateZ(65px) scale(1.05); }
.bt-tile img { width: 60%; height: 60%; object-fit: contain; }

.bt-tile-appicon {
  background: transparent;
  box-shadow: 0 30px 60px -20px color-mix(in oklab, var(--tone) 50%, transparent);
}
.bt-tile-appicon img { width: 100%; height: 100%; border-radius: 26px; }

/* Wider tiles use logo-left + info-right layout */
.bt-hero .bt-tile { width: 170px; height: 170px; border-radius: 32px; }
.bt-wide .bt-tile { width: 150px; height: 150px; border-radius: 28px; }
.bt-full .bt-tile { width: 140px; height: 140px; border-radius: 26px; }

.bt-hero .bt-art,
.bt-wide .bt-art,
.bt-full .bt-art {
  place-items: center start;
  padding: 36px 36px 36px 40px;
}
.bt-hero .bt-info,
.bt-wide .bt-info,
.bt-full .bt-info {
  bottom: auto;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  max-width: none;
  padding: 0;
}
.bt-hero .bt-info { left: 232px; }
.bt-wide .bt-info { left: 210px; }
.bt-full .bt-info { left: 200px; }

/* ---------- Info area (text overlay) ---------- */
.bt-info {
  position: absolute;
  bottom: 24px;
  left: 26px;
  right: 26px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.bt-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: #fafafa;
  margin: 0;
}
.bt-hero .bt-name {
  font-size: clamp(36px, 4.4vw, 64px);
  letter-spacing: -0.045em;
}
.bt-wide .bt-name,
.bt-full .bt-name {
  font-size: clamp(26px, 2.6vw, 40px);
  letter-spacing: -0.04em;
}
.bt-tag {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: rgba(245, 241, 234, 0.7);
  margin: 0;
  max-width: 42ch;
}
.bt-hero .bt-tag { font-size: 16px; max-width: 36ch; }
.bt-stack {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.bt-stack li {
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(245, 241, 234, 0.6);
  letter-spacing: -0.01em;
  position: relative;
}
.bt-stack li + li::before {
  content: "·";
  position: absolute;
  left: -9px;
  color: var(--fg-22);
}

/* ---------- Status badge (top-left) ---------- */
.bt-status {
  position: absolute;
  top: 20px;
  left: 22px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--tone) 14%, transparent);
  color: var(--tone);
}
.status-live { --tone: var(--status-live); }
.status-dev { --tone: var(--accent); }
.status-release { --tone: var(--status-release); }
.status-paused {
  background: var(--fg-08);
  color: rgba(245, 241, 234, 0.55);
}

/* ---------- Arrow (top-right, clickable tiles) ---------- */
.bt-arrow {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fg-04);
  border: 1px solid var(--fg-08);
  color: rgba(245, 241, 234, 0.55);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bt:hover .bt-arrow {
  background: #fafafa;
  color: #09090b;
  border-color: #fafafa;
  transform: translate(2px, -2px) rotate(-2deg);
}
.bt-hero .bt-arrow { width: 44px; height: 44px; }

/* ---------- "Private" marker (non-clickable tiles) ---------- */
.bt-private {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 241, 234, 0.35);
}

/* ---------- Outro ---------- */
.gallery-outro {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px 40px 120px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.go-headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin: 0;
  max-width: 18ch;
  text-transform: uppercase;
  color: #fafafa;
}
.go-headline .accent { color: var(--accent); }
.go-mail {
  font-family: var(--font-mono);
  font-size: clamp(18px, 2.4vw, 28px);
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--fg-22);
  padding-bottom: 4px;
  transition: border-color 0.18s ease;
}
.go-mail:hover { border-color: var(--fg); }
.go-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(245, 241, 234, 0.7);
  text-decoration: none;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.2s;
}
.go-back:hover {
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 760px) {
  .gallery-outro { padding: 60px 20px 80px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .bt { transform: none !important; transition: none !important; }
  .bt-tile { transform: none !important; transition: none !important; }
  .bt-spotlight { display: none; }
}
