/* =====================================================
   BLACKCODELABS — SHARED STYLES
   Mobile-first · Dark luxury · Soft red accent
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=DM+Sans:wght@300;400;500&family=DM+Mono:wght@400;500&display=swap');

/* ── TOKENS ── */
:root {
  --bg:       #050505;
  --bg2:      #0d0d0d;
  --bg3:      #131313;
  --border:   rgba(255,255,255,0.07);
  --accent:   #c0392b;
  --accent-h: #e74c3c;
  --accent-g: rgba(192,57,43,0.13);
  --text:     #f4f1ed;
  --text2:    #9a9590;
  --text3:    #4a4540;
  --white:    #ffffff;
  --font-d:   'Playfair Display', Georgia, serif;
  --font-b:   'DM Sans', sans-serif;
  --font-m:   'DM Mono', monospace;
  --ease:     cubic-bezier(0.16,1,0.3,1);
  --r:        6px;
  --nav-h:    64px;
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-weight: 300;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ── PAGE TRANSITION VEIL ── */
#page-veil {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9000;
  pointer-events: none;
  transform: scaleY(0);
  transform-origin: bottom;
}
body.leaving  #page-veil { animation: veilIn  0.42s var(--ease) forwards; }
body.entering #page-veil { animation: veilOut 0.42s var(--ease) 0.05s forwards; }
@keyframes veilIn  { from{transform:scaleY(0)} to{transform:scaleY(1)} }
@keyframes veilOut { from{transform:scaleY(1)} to{transform:scaleY(0)} }

/* ── CURSOR (desktop only) ── */
#cursor, #cursor-ring { display: none; }
@media (hover:hover) and (pointer:fine) {
  #cursor {
    width: 10px; height: 10px;
    background: var(--accent);
    border-radius: 50%;
    position: fixed; top: 0; left: 0;
    pointer-events: none; z-index: 9999;
    transition: transform 0.1s var(--ease);
  }
  #cursor-ring {
    width: 34px; height: 34px;
    border: 1px solid rgba(192,57,43,0.5);
    border-radius: 50%;
    position: fixed; top: 0; left: 0;
    pointer-events: none; z-index: 9998;
    transition: transform 0.3s var(--ease);
    display: block;
  }
  #cursor { display: block; }
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 800;
  height: var(--nav-h);
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(5,5,5,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.nav-logo {
  font-family: var(--font-d);
  font-size: clamp(1.05rem, 3.5vw, 1.3rem);
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.nav-logo em { color: var(--accent); font-style: normal; }

.nav-links {
  display: none;
  list-style: none;
  gap: 2.2rem;
}
.nav-links a {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text2);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.3s;
  white-space: nowrap;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.nav-actions .btn-outline { display: none; }

/* HAMBURGER */
.hamburger {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  transition: border-color 0.3s;
  flex-shrink: 0;
}
.hamburger:hover { border-color: rgba(192,57,43,0.4); }
.hamburger span {
  width: 18px; height: 1px;
  background: var(--text);
  display: block;
  transition: all 0.35s var(--ease);
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px,4px); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px,-4px); }

/* MOBILE MENU DRAWER */
.mobile-drawer {
  position: fixed;
  top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 700;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 5vw;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease);
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer a {
  font-family: var(--font-d);
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  color: var(--text);
  text-decoration: none;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.3s;
  font-weight: 700;
}
.mobile-drawer a:hover { color: var(--accent); }
.mobile-drawer a:last-of-type { border-bottom: none; }
.drawer-actions {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-b);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border-radius: var(--r);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  border: none;
  white-space: nowrap;
}
.btn-sm { padding: 0.5rem 1.1rem; font-size: 0.78rem; }
.btn-lg { padding: 0.9rem 2rem; font-size: 0.9rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover { border-color: rgba(192,57,43,0.45); color: var(--accent-h); }
.btn-red {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
}
.btn-red:hover {
  background: var(--accent-h);
  box-shadow: 0 0 20px rgba(192,57,43,0.35);
  transform: translateY(-1px);
}
.btn-ghost-red {
  border: 1px solid rgba(192,57,43,0.3);
  color: var(--accent);
  background: transparent;
}
.btn-ghost-red:hover { background: var(--accent-g); }

/* ── SECTION COMMON ── */
section { padding: clamp(3.5rem, 8vw, 7rem) 5vw; }
.container { max-width: 1200px; margin: 0 auto; }

.s-label {
  display: block;
  font-family: var(--font-m);
  font-size: 0.67rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.s-title {
  font-family: var(--font-d);
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.s-title em { font-style: italic; color: var(--accent); }
.s-div { width: 32px; height: 1px; background: var(--accent); margin: 1.5rem 0; opacity: 0.6; }

/* ── REVEAL ANIMATIONS ── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* On large screens allow horizontal reveals */
@media (min-width: 768px) {
  .reveal-left  { transform: translateX(-40px) translateY(0); }
  .reveal-right { transform: translateX(40px) translateY(0); }
  .reveal-left.visible, .reveal-right.visible { transform: translateX(0); }
}

/* ── CARDS / PANELS ── */
.panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.panel-head {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.panel-head h3 { font-family: var(--font-d); font-size: 0.9rem; font-weight: 700; }
.panel-head a  { font-size: 0.72rem; color: var(--accent); text-decoration: none; font-family: var(--font-m); transition: opacity 0.2s; }
.panel-head a:hover { opacity: 0.7; }
.panel-body { padding: 1.5rem; }

/* ── FORM ELEMENTS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}
.form-group label {
  font-family: var(--font-m);
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
}
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.82rem 1rem;
  color: var(--text);
  font-family: var(--font-b);
  font-size: 0.88rem;
  border-radius: var(--r);
  outline: none;
  width: 100%;
  transition: border-color 0.3s, box-shadow 0.3s;
  -webkit-appearance: none;
  appearance: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(192,57,43,0.5);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.07);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text3); }
.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a4540' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.form-group select option { background: var(--bg2); color: var(--text); }
.form-group textarea { min-height: 110px; resize: vertical; line-height: 1.6; }

/* ── FOOTER ── */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: clamp(2.5rem, 6vw, 5rem) 5vw 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.footer-brand { grid-column: 1 / -1; }
.footer-brand p { font-size: 0.83rem; color: var(--text2); line-height: 1.7; margin-top: 0.8rem; max-width: 280px; }
.footer-socials { display: flex; gap: 0.7rem; margin-top: 1.3rem; }
.footer-socials a {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: all 0.25s;
}
.footer-socials a:hover { border-color: rgba(192,57,43,0.45); color: var(--accent-h); background: var(--accent-g); }
.footer-col h5 { font-family: var(--font-d); font-size: 0.9rem; font-weight: 700; margin-bottom: 1rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col ul a { font-size: 0.8rem; color: var(--text2); text-decoration: none; transition: color 0.3s; }
.footer-col ul a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-bottom p { font-size: 0.72rem; color: var(--text3); font-family: var(--font-m); }
.footer-bottom em { color: var(--accent); font-style: normal; }

/* ── TICKER ── */
.ticker-wrap {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  background: var(--bg2);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: tickerMove 30s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 0 2.5rem;
  font-family: var(--font-m);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
  white-space: nowrap;
}
.ticker-dot { color: var(--accent); font-size: 0.4rem; }
@keyframes tickerMove { from{transform:translateX(0)} to{transform:translateX(-50%)} }

/* ── MEDIUM SCREENS (≥640px) ── */
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / 2; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

/* ── LARGE SCREENS (≥1024px) ── */
@media (min-width: 1024px) {
  :root { --nav-h: 68px; }
  .nav-links { display: flex; }
  .nav-actions .btn-outline { display: inline-flex; }
  .hamburger { display: none; }
  .footer-grid { grid-template-columns: 1.8fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}
/* Laptop widths: eight nav links + two buttons need tighter spacing */
@media (min-width: 1024px) and (max-width: 1279px) {
  .nav-links { gap: 1.15rem; }
  .nav-links a { font-size: 0.72rem; letter-spacing: 0.04em; }
  .nav-actions { gap: 0.5rem; }
  .nav-actions .btn-sm { padding: 0.45rem 0.8rem; font-size: 0.74rem; }
}
/* ===========================================================================
   FLOATING WHATSAPP BUTTON
   =========================================================================== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #0d0d0d;
  color: var(--accent-h, #e74c3c);
  border: 1px solid rgba(192, 57, 43, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  animation: wa-pulse 3s ease-in-out infinite;
}
.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  transform: scale(1.06);
  background: var(--accent, #c0392b);
  border-color: var(--accent, #c0392b);
  color: #fff;
}
.whatsapp-float:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(192, 57, 43, 0.25); }
  50% { box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55), 0 0 0 7px rgba(192, 57, 43, 0); }
}
@media (prefers-reduced-motion: reduce) { .whatsapp-float { animation: none; } }
@media (max-width: 640px) {
  .whatsapp-float { bottom: 18px; right: 18px; width: 52px; height: 52px; }
}

/* ===========================================================================
   MOBILE FILTER SHEET (blog, portfolio): one "Filter" button opens a bottom sheet.
   Markup: .bf-bar > .bf-open, .bf-backdrop, #bf-sheet.bf-sheet; JS: assets/js/filter-sheet.js
   =========================================================================== */
.bf-bar{max-width:1200px;margin:0 auto;padding:0 5vw}
.bf-open,.bf-head,.bf-backdrop,.bf-only{display:none}
.bf-only{font-family:var(--font-m);font-size:.65rem;letter-spacing:.12em;text-transform:uppercase;color:var(--text2)}
@media(max-width:759px){
  .bf-bar{padding-bottom:1.4rem}
  .bf-open{display:flex;align-items:center;gap:.6rem;width:100%;padding:.85rem 1rem;border-radius:12px;border:1px solid rgba(192,57,43,.4);background:var(--bg2);color:var(--text);font:inherit;font-size:.92rem;font-weight:600;cursor:pointer}
  .bf-open svg{width:18px;height:18px;color:var(--accent-h)}
  .bf-cur{margin-left:auto;font-family:var(--font-m);font-size:.62rem;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-h);font-weight:400;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .bf-backdrop{display:block;position:fixed;inset:0;z-index:2000;background:rgba(0,0,0,.6);opacity:0;visibility:hidden;transition:opacity .25s,visibility .25s}
  .bf-sheet{position:fixed;left:0;right:0;bottom:0;z-index:2001;max-height:82vh;overflow-y:auto;overscroll-behavior:contain;background:var(--bg2,#111);border-top:1px solid rgba(192,57,43,.4);border-radius:18px 18px 0 0;padding-bottom:calc(1.2rem + env(safe-area-inset-bottom));transform:translateY(100%);visibility:hidden;transition:transform .3s var(--ease,ease),visibility .3s}
  .bf-open-state .bf-backdrop{opacity:1;visibility:visible}
  .bf-open-state .bf-sheet{transform:none;visibility:visible}
  .bf-head{display:flex;align-items:center;position:sticky;top:0;z-index:1;padding:1.2rem 1.2rem .8rem;background:var(--bg2,#111)}
  .bf-head b{font-family:var(--font-d);font-size:1.25rem}
  .bf-grab{position:absolute;top:.5rem;left:50%;width:40px;height:4px;margin-left:-20px;border-radius:4px;background:rgba(255,255,255,.2)}
  .bf-x{margin-left:auto;width:36px;height:36px;border-radius:50%;border:1px solid var(--border);background:none;color:var(--text);font-size:1.3rem;line-height:1;cursor:pointer}
  .bf-only{display:block;flex-basis:100%;margin-top:.4rem}
  .bf-sheet .filter-row{padding:0 1.2rem 1rem;justify-content:flex-start}
}
@media(max-width:759px) and (prefers-reduced-motion:reduce){.bf-sheet,.bf-backdrop{transition:none}}

/* Quote lives in the hamburger menu on small screens */
.nav-actions [data-bcl-quote] { display: none; }
@media (min-width: 1024px) { .nav-actions [data-bcl-quote] { display: inline-flex; } }
