/* ═══════════════════════════════════════════════════════
   Majoto Labs, Shared Styles
   Canonical brand tokens, shared components, layout
   Page-specific styles live inline in each page's <style>
═══════════════════════════════════════════════════════ */

/* ─── Brand Tokens ─── */
:root {
  --bg-base:        #0A0F0E;
  --bg-mid:         #111916;
  --bg-accent:      #182820;
  --primary:        #6FE3D3;
  --teal-soft:      #96EDE5;
  --teal-dim:       #2BA89A;
  --text-1:         #F4F1EA;
  --text-2:         #8A938E;
  --text-3:         #5C6862;
  --ease:           0.3s ease;
  --ease-out-expo:  cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-display:   'Playfair Display', Georgia, serif;
  --font-body:      'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-1);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }

/* ─── Focus ─── */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* ─── Layout ─── */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 2rem; }

/* ─── Eyebrow ─── */
.eyebrow {
  display: flex; align-items: center; justify-content: center;
  gap: 0.75rem;
  font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.25rem;
}
.eyebrow.left { justify-content: flex-start; }

/* ─── Section Heading ─── */
.sh {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.8vw, 2.85rem);
  line-height: 1.2;
  color: var(--text-1);
  text-align: center;
  margin-bottom: 3rem;
}
.sh em { font-style: italic; color: var(--primary); }

/* ─── Buttons ─── */
.btn-p {
  display: inline-block;
  background: var(--primary); color: var(--bg-base);
  font-family: var(--font-body);
  font-size: 0.8rem; font-weight: 600;
  padding: 0.9rem 2rem; border-radius: 2px;
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: background var(--ease), transform var(--ease);
}
.btn-p:hover { background: var(--teal-soft); transform: translateY(-1px); }

.btn-g {
  display: inline-block;
  background: transparent; color: var(--text-2);
  font-family: var(--font-body);
  font-size: 0.8rem; font-weight: 500;
  padding: 0.9rem 2rem; border-radius: 2px;
  border: 1px solid var(--teal-dim);
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: border-color var(--ease), color var(--ease), transform var(--ease);
}
.btn-g:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

/* ─── Scroll-fade ─── */
.fade {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade.in { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: 0.08s; }
.d2 { transition-delay: 0.16s; }
.d3 { transition-delay: 0.24s; }
.d4 { transition-delay: 0.32s; }
.d5 { transition-delay: 0.40s; }

/* ─── Stat Row (About + Case Studies) ─── */
.stat-row {
  display: flex; gap: 3rem;
  margin-top: 2.25rem; padding-top: 1.75rem;
  border-top: 1px solid rgba(43,168,154,0.25);
}
.stat h4 {
  font-family: var(--font-display);
  font-size: 2.4rem; font-weight: 400;
  color: var(--primary); line-height: 1; margin-bottom: 0.2rem;
}
.stat p {
  font-size: 0.7rem !important;
  color: var(--text-3) !important;
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 0 !important; font-weight: 500 !important;
}

/* ════════════════════════════════════════
   NAV
════════════════════════════════════════ */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.2rem 0;
  border-bottom: 1px solid transparent;
  transition: background var(--ease), backdrop-filter var(--ease), border-color var(--ease);
}
#nav.scrolled {
  background: rgba(10,15,14,0.93);
  backdrop-filter: blur(18px);
  border-bottom-color: rgba(43,168,154,0.4);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: baseline; gap: 0.05rem; flex-shrink: 0; }
.logo-word {
  font-family: var(--font-display);
  font-weight: 400; font-size: 1.6rem;
  color: var(--text-1); letter-spacing: -0.01em;
}
.logo-ai {
  font-family: var(--font-display);
  font-style: italic; font-weight: 400; font-size: 0.58rem;
  color: var(--primary); letter-spacing: 0.02em;
  position: relative; top: -0.65rem;
}
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a {
  font-size: 0.73rem; font-weight: 400;
  color: var(--text-2); letter-spacing: 0.05em;
  transition: color var(--ease);
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text-1); }
.nav-cta {
  font-size: 0.7rem !important; font-weight: 500 !important;
  color: var(--primary) !important;
  border: 1px solid var(--primary) !important;
  padding: 0.5rem 1.1rem; border-radius: 2px;
  letter-spacing: 0.06em !important; text-transform: uppercase;
  transition: background var(--ease), color var(--ease) !important;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--primary) !important; color: var(--bg-base) !important; }
.nav-toggle {
  display: none; padding: 0.4rem; color: var(--text-1);
  align-items: center; justify-content: center;
}
/* ─── Nav Logo (inner pages) ─── */
.nav-logo {
  display: flex; align-items: center; gap: 0.55rem;
  text-decoration: none; color: var(--text-1); flex-shrink: 0;
}
.nav-logo-mark {
  width: 26px; height: 26px; flex-shrink: 0;
  color: var(--primary);
}
.nav-logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 400;
  color: var(--text-1); letter-spacing: -0.01em;
}
.nav-logo-text sup {
  font-style: italic; color: var(--primary);
  font-size: 0.52em;
  position: relative; top: -0.55em;
  font-weight: 400;
}

/* ─── Footer Brand (inner pages) ─── */
.footer-brand {
  display: flex; flex-direction: column; gap: 0.25rem;
}
.footer-brand .nav-logo-mark {
  width: 22px; height: 22px;
}
.footer-brand p {
  font-size: 0.7rem; color: var(--text-3);
  margin-top: 0.3rem; font-weight: 400;
}
.footer-tagline {
  font-size: 0.78rem; color: var(--text-3);
  font-style: italic; margin-top: 0.25rem;
}
.footer-nav-col h4 {
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 0.4rem;
}
.footer-bottom {
  text-align: center;
  font-size: 0.64rem; color: var(--text-3);
  letter-spacing: 0.14em; text-transform: uppercase;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(43,168,154,0.15);
  margin-top: 1rem;
}

/* Compass mark in nav, appears on scroll */
.logo-mark {
  width: 26px; height: 26px; flex-shrink: 0;
  opacity: 0; transform: scale(0.85) rotate(-8deg);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
  margin-right: 0.5rem;
}
#nav.scrolled .logo-mark { opacity: 1; transform: scale(1) rotate(0deg); }
.logo-mark .lm-ring     { fill: none; stroke: var(--primary); stroke-width: 2; opacity: 0.6; }
.logo-mark .lm-axis     { stroke: var(--primary); stroke-width: 1.5; opacity: 0.7; }
.logo-mark .lm-diagonal { stroke: var(--primary); stroke-width: 1; opacity: 0.4; }
.logo-mark .lm-spike    { fill: var(--primary); }

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
footer {
  border-top: 1px solid rgba(43,168,154,0.35);
  padding: 2.75rem 0 1.5rem;
  background: var(--bg-base);
}
.footer-inner {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 2.5rem; flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.footer-left { display: flex; flex-direction: column; gap: 0.25rem; }
.footer-cr { font-size: 0.7rem; color: var(--text-3); margin-top: 0.3rem; font-weight: 400; }
.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.footer-nav-col { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-nav-col span {
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 0.1rem;
}
.footer-nav-col a, .footer-nav a {
  font-size: 0.76rem; color: var(--text-3);
  letter-spacing: 0.05em;
  transition: color var(--ease);
}
.footer-nav-col a:hover, .footer-nav a:hover { color: var(--primary); }
.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; }
.footer-tag {
  font-family: var(--font-display);
  font-style: italic; font-size: 0.88rem; color: var(--text-3);
}
.f-bracket {
  width: 20px; height: 20px;
  border-right: 1px solid rgba(43,168,154,0.4);
  border-bottom: 1px solid rgba(43,168,154,0.4);
}
.footer-service-area {
  text-align: center;
  font-size: 0.64rem; color: var(--text-3);
  letter-spacing: 0.14em; text-transform: uppercase;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(43,168,154,0.15);
  line-height: 1.6;
}

/* ════════════════════════════════════════
   HERO, Keyframes & Animation Classes
   (shared across all pages that use hero)
════════════════════════════════════════ */
@keyframes brand-mark-in {
  from { opacity: 0; transform: scale(0.85) rotate(-8deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes brand-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes brand-fade-only {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes brand-spike-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 0.95; transform: translateY(0); }
}
@keyframes brand-letter-in {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes brand-grid-drift {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 80px 80px, 80px 80px; }
}
@keyframes brand-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(1.05); }
}
@keyframes brand-rule-grow {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}
@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(7px); }
}
@keyframes chat-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(111,227,211,0.25); }
  50%       { box-shadow: 0 4px 32px rgba(111,227,211,0.45), 0 0 0 9px rgba(111,227,211,0.07); }
}

/* Hero entrance classes */
.h-bracket { opacity: 0; animation: brand-fade-only 1.2s var(--ease-out-expo) 0.1s  forwards; }
.h-meta    { opacity: 0; animation: brand-fade-in  1.2s var(--ease-out-expo) 0.3s  forwards; }
.h-mark    { opacity: 0; animation: brand-mark-in  1.2s var(--ease-out-expo) 0.5s  forwards; }
.h-wm      { opacity: 0; animation: brand-fade-in  1.2s var(--ease-out-expo) 1.0s  forwards; }
.h-rule    { opacity: 0; animation: brand-rule-grow 1.0s var(--ease-out-expo) 1.6s forwards; transform-origin: center; }
.h-tag     { opacity: 0; animation: brand-fade-in  1.2s var(--ease-out-expo) 1.8s  forwards; }
.h-sub     { opacity: 0; animation: brand-fade-in  1.2s var(--ease-out-expo) 2.2s  forwards; }
.h-ctas    { opacity: 0; animation: brand-fade-in  1.2s var(--ease-out-expo) 2.7s  forwards; }
.h-scroll  { opacity: 0; animation: brand-fade-in  1.2s var(--ease-out-expo) 3.3s  forwards; }

/* Compass SVG sub-element animations */
.hero-mono .ring,
.hero-mono .axis,
.hero-mono .diagonal { animation: brand-fade-only 1.6s var(--ease-out-expo) 0.7s backwards; }
.hero-mono .spike    { animation: brand-spike-in  1.0s var(--ease-out-expo) 1.4s backwards; }
.hero-mono .letter   { animation: brand-letter-in 1.0s ease-out             1.6s backwards; }

/* ════════════════════════════════════════
   CHAT WIDGET
════════════════════════════════════════ */
.chat-btn {
  position: fixed; bottom: 40px; right: 40px;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--bg-mid);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; cursor: pointer; border: 2px solid rgba(244,213,138,0.9);
  animation: chat-pulse 3s ease-in-out infinite;
  transition: transform var(--ease);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0,0,0,0.45);
}
.chat-btn:hover { transform: scale(1.06); }
.chat-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

.chat-panel {
  position: fixed; bottom: 110px; right: 40px;
  width: 380px;
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  background: var(--bg-mid);
  border: 1px solid rgba(43,168,154,0.4);
  border-radius: 4px;
  display: flex; flex-direction: column;
  z-index: 998; overflow: hidden;
  transform: translateY(20px);
  opacity: 0; pointer-events: none;
  transition: transform 0.3s var(--ease-out-expo), opacity 0.3s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
}
.chat-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(43,168,154,0.2);
  flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 0.65rem; }
.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(244,213,138,0.72);
  object-fit: cover;
  flex: 0 0 auto;
}
.chat-title  { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em; color: var(--text-1); display: block; }
.chat-sub    { font-size: 0.63rem; color: var(--text-3); display: block; margin-top: 0.1rem; }
.chat-close  {
  background: none; border: none; cursor: pointer;
  color: var(--text-2); padding: 0.3rem; line-height: 0;
  transition: color var(--ease);
}
.chat-close:hover { color: var(--primary); }
.chat-body {
  flex: 1; min-height: 0; height: min(560px, calc(100vh - 140px));
  height: min(560px, calc(100dvh - 140px));
  max-height: 560px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.chat-status {
  padding: 0.45rem 1rem; font-size: 0.68rem; color: var(--text-3);
  border-bottom: 1px solid rgba(43,168,154,0.12);
}
.chat-transcript {
  flex: 1 1 auto; min-height: 130px; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.7rem;
}
.chat-msg {
  max-width: 88%; padding: 0.7rem 0.8rem; border-radius: 10px;
  font-size: 0.86rem; line-height: 1.45;
}
.chat-msg-bot {
  align-self: flex-start; background: rgba(255,255,255,0.055);
  border: 1px solid rgba(43,168,154,0.18); color: var(--text-1);
}
.chat-msg-user {
  align-self: flex-end; background: rgba(111,227,211,0.14);
  border: 1px solid rgba(111,227,211,0.35); color: var(--text-1);
}
.chat-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0 1rem 0.75rem; }
.chat-chip {
  border: 1px solid rgba(111,227,211,0.35); background: transparent; color: var(--text-2);
  border-radius: 999px; padding: 0.38rem 0.62rem; font-size: 0.72rem; cursor: pointer;
}
.chat-chip:hover, .chat-chip:focus { color: var(--primary); border-color: var(--primary); }
.chat-map {
  background: rgba(5,10,10,0.6); border: 1px solid rgba(111,227,211,0.28);
  border-radius: 10px; padding: 0.9rem; color: var(--text-1);
}
.chat-map h3, .chat-lead h3 { margin: 0 0 0.6rem; font-size: 0.86rem; color: var(--primary); }
.chat-map dl { margin: 0; }
.chat-map dt { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-top: 0.5rem; }
.chat-map dd { margin: 0.12rem 0 0; font-size: 0.82rem; line-height: 1.4; }
.chat-copy, .chat-submit, .chat-form button {
  border: none; background: var(--primary); color: var(--bg-base); cursor: pointer;
  font-weight: 700; border-radius: 4px; padding: 0.55rem 0.75rem;
}
.chat-copy { margin-top: 0.75rem; font-size: 0.74rem; }
.chat-lead .chat-submit { position: sticky; bottom: 0; box-shadow: 0 -10px 18px rgba(5,10,10,0.75); }
.chat-form { display: flex; gap: 0.5rem; padding: 0.75rem 1rem 0.5rem; border-top: 1px solid rgba(43,168,154,0.18); flex: 0 0 auto; }
.chat-form input, .chat-lead input, .chat-lead textarea {
  width: 100%; background: rgba(255,255,255,0.06); border: 1px solid rgba(43,168,154,0.25);
  color: var(--text-1); border-radius: 4px; padding: 0.65rem 0.7rem; font: inherit;
}
.chat-form input { flex: 1; min-width: 0; }
.chat-form button { flex: 0 0 auto; }
.chat-privacy { margin: 0; padding: 0 1rem 0.75rem; color: var(--text-3); font-size: 0.68rem; line-height: 1.35; }
.chat-lead {
  margin: 0 1rem 0.75rem; padding: 0.85rem; border: 1px solid rgba(111,227,211,0.28);
  background: rgba(255,255,255,0.04); border-radius: 10px;
  flex: 0 0 auto; max-height: min(320px, 42dvh); overflow-y: auto;
}
.chat-lead p { margin: 0 0 0.65rem; color: var(--text-3); font-size: 0.76rem; line-height: 1.35; }
.chat-lead form { display: grid; gap: 0.55rem; }
.chat-lead label { color: var(--text-2); font-size: 0.72rem; display: grid; gap: 0.2rem; }
.chat-consent { grid-template-columns: auto 1fr; align-items: start; }
.chat-consent input { width: auto; margin-top: 0.12rem; }
.hp-field { position: absolute !important; left: -10000px !important; opacity: 0 !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .h-bracket, .h-meta, .h-mark, .h-wm, .h-rule,
  .h-tag, .h-sub, .h-ctas, .h-scroll,
  .hero-mono .ring, .hero-mono .axis, .hero-mono .diagonal,
  .hero-mono .spike, .hero-mono .letter {
    animation: none; opacity: 1; transform: none;
  }
  .chat-btn { animation: none; }
  .scroll-chevron { animation: none; }
  .fade { transition: none; }
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .nav-links { gap: 1.1rem; }
}
@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(10,15,14,0.97); backdrop-filter: blur(18px);
    flex-direction: column; padding: 1.75rem 2rem; gap: 1.25rem;
    border-top: 1px solid rgba(43,168,154,0.35);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-cta { align-self: flex-start; }
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
  .footer-nav, .footer-nav-col { justify-content: center; align-items: center; }
  .footer-right { align-items: center; }
  .stat-row { flex-wrap: wrap; gap: 1.5rem; }
}
@media (max-width: 480px), (max-height: 680px) {
  .chat-panel {
    right: 16px; left: auto; width: min(360px, calc(100vw - 32px)); bottom: 80px; border-radius: 4px;
    max-height: calc(100vh - 88px);
    max-height: calc(100dvh - 88px);
  }
  .chat-body {
    height: auto;
    max-height: calc(100vh - 142px);
    max-height: calc(100dvh - 142px);
  }
  .chat-btn   { right: 16px; bottom: 16px; }
}
