/*
 * Balamdata — main stylesheet
 * Single static page, no framework. Sections below follow the order
 * elements appear in index.html: tokens, layout primitives, nav,
 * hero, page sections, footer.
 */

:root {
  --nav-h: 88px;

  --bg: #17110B;
  --panel: #241B12;
  --panel-2: #2C2115;
  --ink-light: #F6EEE0;
  --ink-muted: #C9B9A0;
  --ink-on-light: #241A0F;
  --clay: #C17D3F;
  --umber: #8B4A24;
  --dot: #3A2216;
  --ochre: #E8B34C;
  --line: rgba(246, 238, 224, 0.14);

  --radius: 20px;
  --font-display: 'Fraunces', serif;
  --font-body: 'Work Sans', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-light);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 640px) {
  .wrap { padding: 0 22px; }
  body { font-size: 17px; }
  .cta-panel { padding: 40px 26px; }
}

/* Navigation */

nav.wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 22px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand svg {
  width: 42px;
  height: auto;
  flex-shrink: 0;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: 0.5px;
  color: var(--ink-light);
}

.navlinks {
  display: flex;
  gap: 28px;
  font-size: 17px;
  color: var(--ink-muted);
  margin-left: 16px;
}

.navlinks a {
  text-decoration: none;
}

.navlinks a:hover {
  color: var(--ink-light);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px 2px;
  font: inherit;
  font-weight: 600;
}

.lang-btn.active {
  color: var(--ochre);
}

.lang-sep {
  color: var(--line);
}

/* Duplicate lang switch rendered inside the mobile menu (see .navlinks
   below); hidden on desktop where the one in .nav-right is used instead. */
.navlinks .mobile-lang-switch {
  display: none;
}

.nav-cta {
  font-size: 16px;
  font-weight: 600;
  background: var(--ochre);
  color: var(--ink-on-light) !important;
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}

/* Mobile menu button (hidden above 1100px, see media query below) */

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-toggle span {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink-light);
  transition: background 0.2s ease;
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--ink-light);
  transition: transform 0.2s ease, top 0.2s ease;
}

.menu-toggle span::before { top: -7px; }
.menu-toggle span::after { top: 7px; }

.menu-toggle.open span { background: transparent; }
.menu-toggle.open span::before { top: 0; transform: rotate(45deg); }
.menu-toggle.open span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 1100px) {
  .menu-toggle { display: flex; }
  .nav-right { gap: 12px; }
  .nav-right .lang-switch { display: none; }
  .nav-cta { padding: 10px 18px; font-size: 14.5px; }

  /* .navlinks becomes the slide-down mobile menu, toggled by js/nav-menu.js
     via the .open class on both this element and .menu-toggle. */
  .navlinks {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    margin-left: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    padding: 0 22px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    z-index: 49;
  }

  .navlinks.open {
    max-height: 340px;
    padding: 14px 22px 22px;
  }

  .navlinks a {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    font-size: 17px;
  }

  .navlinks .mobile-lang-switch {
    display: flex;
    margin-top: 6px;
    padding-top: 4px;
    font-size: 15px;
  }
}

/* Pill-shaped section tag (e.g. "What we do", "How we work") */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 14px;
  border-radius: 999px;
  background: rgba(232, 179, 76, 0.08);
  border: 1px solid rgba(232, 179, 76, 0.32);
  color: var(--ochre);
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 22px;
}

.tag-dots {
  display: inline-flex;
  gap: 4px;
}

.tag-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ochre);
  display: block;
}

/* Hero */

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .network-card { margin: 0 auto; }
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 60px);
  line-height: 1.06;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0 0 20px;
}

h1 em {
  font-style: normal;
  color: var(--ochre);
}

.hero-lemma {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ochre);
  max-width: 44ch;
  margin: -8px 0 30px;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  font-size: 16px;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--ochre);
  color: var(--ink-on-light);
}

.btn-secondary {
  border: 1.5px solid var(--line);
  color: var(--ink-light);
}

/* Hero card: the animated dot-network illustration
   (markup built by js/network-diagram.js) */

.network-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px 26px;
  max-width: 400px;
  margin-left: auto;
}

.network-label {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-light);
  margin-bottom: 4px;
}

.network-sub {
  font-size: 14px;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.network-svg {
  width: 100%;
  height: auto;
  display: block;
}

.n-line {
  stroke: var(--umber);
  stroke-width: 1.6;
  fill: none;
}

.n-flow {
  stroke: var(--ochre);
  stroke-width: 1.8;
  fill: none;
  stroke-dasharray: 5 9;
  animation: dash 3.4s linear infinite;
}

@keyframes dash {
  to { stroke-dashoffset: -140; }
}

.n-node {
  fill: var(--dot);
}

.n-node.hub {
  fill: var(--ochre);
}

@media (prefers-reduced-motion: reduce) {
  .n-flow {
    animation: none;
    stroke-dasharray: none;
  }
}

/* Page sections (hero + services + process + contact) */

.slide {
  /* First declaration is the safe fallback for browsers without dvh
     support; the second overrides it where dvh is available so mobile
     browser chrome (address bar show/hide) doesn't shift the layout. */
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100dvh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 0;
  scroll-margin-top: var(--nav-h);
}

.section-head {
  margin-bottom: 52px;
  /* No max-width: the heading and its description now stretch to the
     same width as the card grid below, instead of stopping short and
     leaving a gap on wide screens. h2's clamp() keeps line length
     readable since the font grows with the viewport too. */
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 46px);
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  font-weight: 600;
}

.section-desc {
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
}

/* Services */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 28px;
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(193, 125, 63, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  color: var(--ink-light);
}

.card p {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0;
}

/* Process */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

@media (min-width: 641px) and (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .steps { grid-template-columns: 1fr; }
}

/* Small dot counters (1 to 4 dots), styled after Maya numeral notation */
.mayadots {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
}

.mayadots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ochre);
}

.step h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--ink-light);
}

.step p {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0;
}

.maya-note {
  margin-top: 44px;
  font-size: 14.5px;
  color: var(--ink-muted);
}

.maya-note .mayadots {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 8px 0 0;
}

.maya-note .mayadots span {
  width: 6px;
  height: 6px;
}

/* Contact */

.cta-panel {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 64px 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
}

.cta-panel h2 {
  max-width: 22ch;
}

/* Footer */

footer.wrap {
  padding: 44px 40px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15.5px;
  color: var(--ink-muted);
  flex-wrap: wrap;
  gap: 14px;
}

footer a {
  text-decoration: none;
}

footer a:hover {
  color: var(--ink-light);
}

/* Privacy policy link: underlined + accent color so it reads as a
   distinct, clickable link rather than blending into the copyright text. */
footer a.footer-privacy {
  color: var(--ochre);
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer a.footer-privacy:hover {
  color: var(--ink-light);
}

/* Legal pages (privacy.html) */

.legal {
  max-width: 760px;
  padding-top: 40px;
  padding-bottom: 80px;
}

.legal h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.legal-updated {
  color: var(--ink-muted);
  font-size: 15px;
  margin: 0 0 36px;
}

.legal h2 {
  font-size: clamp(20px, 2.4vw, 26px);
  margin-top: 44px;
}

.legal h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-light);
  margin: 28px 0 10px;
}

.legal p,
.legal li {
  color: var(--ink-muted);
  font-size: 16.5px;
  line-height: 1.7;
}

.legal p {
  margin: 0 0 16px;
}

.legal ul,
.legal ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.legal li {
  margin-bottom: 8px;
}

.legal strong {
  color: var(--ink-light);
}

.legal a {
  color: var(--ochre);
}

.legal-note {
  font-style: italic;
  font-size: 14.5px;
}
