/* BarmaLab — design tokens */
:root {
  --bg: #090c0b;
  --bg-elevated: #0f1412;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(86, 168, 137, 0.22);
  --text: #eef2f0;
  --text-muted: #9baba3;
  --text-dim: #6a7872;
  --accent: #3a8770;
  --accent-2: #56a889;
  --accent-deep: #1e4a3a;
  --accent-glow: rgba(58, 135, 112, 0.28);
  --gradient: linear-gradient(135deg, #1e4a3a 0%, #3a8770 48%, #56a889 100%);
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --header-h: 72px;
  --max-w: 1120px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

/* Ambient background */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
}

.orb-a {
  width: 520px;
  height: 520px;
  background: #3a8770;
  top: -180px;
  right: -120px;
  animation: drift 18s ease-in-out infinite;
}

.orb-b {
  width: 400px;
  height: 400px;
  background: #1e4a3a;
  bottom: 10%;
  left: -100px;
  animation: drift 22s ease-in-out infinite reverse;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent);
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(30px, 20px);
  }
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease-out), border-color 0.3s;
}

.site-header.scrolled {
  background: rgba(6, 10, 8, 0.88);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.logo-text em {
  font-style: normal;
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* Main layout */
main {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* Hero */
.hero {
  padding-top: calc(var(--header-h) + 5rem);
  padding-bottom: 3rem;
  text-align: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 1.5rem 0 1.25rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  display: block;
  margin-top: 0.5rem;
  font-size: clamp(1.5rem, 4.2vw, 2.35rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  word-spacing: normal;
}

.shimmer {
  background-size: 200% auto;
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

.hero-lead {
  max-width: 540px;
  margin: 0 auto 2rem;
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 3.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  background: var(--gradient);
  color: #052e16;
  box-shadow: 0 4px 24px var(--accent-glow);
  transition:
    transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
}

.btn:hover {
  box-shadow: 0 8px 36px rgba(86, 168, 137, 0.35);
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.98) translateY(0);
}

.text-link {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 0.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s var(--ease-out);
}

.text-link:hover {
  color: var(--accent-2);
  transform: translateX(3px);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem 2rem;
  padding: 1.5rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  animation: statsFloat 5s ease-in-out infinite;
}

@keyframes statsFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.2rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Sections */
.section {
  padding: 5rem 0;
}

.section-head {
  max-width: 560px;
  margin-bottom: 3rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-head p {
  color: var(--text-muted);
  line-height: 1.7;
}

/* Feature grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.feature-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition:
    border-color 0.3s,
    transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out);
}

.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.feature-icon {
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 1rem;
  transition: transform 0.35s var(--ease-out);
}

.feature-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.feature-card:hover .feature-icon {
  transform: scale(1.15) rotate(-6deg);
}

.feature-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Process */
.process-steps {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  gap: 1rem 0.375rem;
  align-items: stretch;
}

.process-step {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  position: relative;
  transition:
    border-color 0.3s,
    transform 0.35s var(--ease-out);
}

.process-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  color: var(--accent-2);
  opacity: 0.55;
  animation: connectorPulse 3s ease-in-out infinite;
}

.process-connector-line {
  display: block;
  line-height: 0;
}

.process-connector-line--h svg {
  width: clamp(1.5rem, 3vw, 2.5rem);
  height: auto;
}

.process-connector-line--v {
  display: none;
}

.process-connector-line--v svg {
  width: auto;
  height: clamp(1.5rem, 3vw, 2.5rem);
}

@keyframes connectorPulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.85;
  }
}

.process-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  margin-bottom: 0.75rem;
  opacity: 0.85;
}

.process-step:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.process-step h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.process-step p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Contact */
.contact-section {
  padding-bottom: 6rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: start;
}

.contact-intro {
  position: relative;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
}

.contact-intro h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.contact-intro > p:not(.contact-tagline) {
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 36ch;
}

.contact-tagline {
  margin-top: 2rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  font-style: italic;
  color: var(--accent-2);
  letter-spacing: -0.01em;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.contact-row {
  --contact-value-size: 0.8125rem;
  --contact-value-line-height: 1.5;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.125rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.25s,
    background 0.25s,
    transform 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.contact-row:first-child {
  grid-column: 1 / -1;
  padding: 1.25rem 1.5rem;
  background:
    radial-gradient(ellipse 70% 80% at 0% 50%, rgba(58, 135, 112, 0.08), transparent),
    rgba(255, 255, 255, 0.025);
}

.contact-row:hover {
  border-color: var(--border-hover);
  background: rgba(58, 135, 112, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(58, 135, 112, 0.12);
}

.contact-row:first-child:hover {
  background:
    radial-gradient(ellipse 70% 80% at 0% 50%, rgba(58, 135, 112, 0.12), transparent),
    rgba(58, 135, 112, 0.06);
}

.contact-row:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.contact-row.copied {
  border-color: var(--border-hover);
  background: rgba(58, 135, 112, 0.1);
}

.contact-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: calc(var(--contact-value-size) * var(--contact-value-line-height) * 2);
  height: calc(var(--contact-value-size) * var(--contact-value-line-height) * 2);
  border-radius: 10px;
  background: rgba(58, 135, 112, 0.12);
  color: var(--accent-2);
}

.contact-row-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.contact-row-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.contact-row-value {
  font-family: var(--font-mono);
  font-size: var(--contact-value-size);
  line-height: var(--contact-value-line-height);
  color: var(--text-muted);
  text-align: left;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.contact-row-feedback {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent-2);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(58, 135, 112, 0.15);
  opacity: 0;
  transition: opacity 0.2s;
}

.contact-row.copied .contact-row-feedback {
  opacity: 1;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand img {
  border-radius: 8px;
  object-fit: contain;
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 2rem clamp(1.25rem, 4vw, 2.5rem);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* Floating back-to-top */
.scroll-top {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--bg-elevated);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition:
    opacity 0.3s var(--ease-out),
    visibility 0.3s var(--ease-out),
    transform 0.3s var(--ease-out),
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-icon {
  width: 1.125rem;
  height: 1.125rem;
}

.scroll-top:hover {
  color: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.scroll-top:active {
  transform: translateY(0) scale(0.95);
}

.scroll-top.is-visible:active {
  transform: translateY(0) scale(0.95);
}

.scroll-top:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.75s var(--ease-out),
    transform 0.75s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile */
@media (max-width: 1024px) {
  .process-steps {
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
      "s1 c1 s2"
      ".  c2 ."
      "s3 c3 s4";
    gap: 0.75rem 0.375rem;
  }

  .process-step:nth-child(1) {
    grid-area: s1;
  }

  .process-connector:nth-child(2) {
    grid-area: c1;
  }

  .process-step:nth-child(3) {
    grid-area: s2;
  }

  .process-connector:nth-child(4) {
    grid-area: c2;
  }

  .process-step:nth-child(5) {
    grid-area: s3;
  }

  .process-connector:nth-child(6) {
    grid-area: c3;
  }

  .process-step:nth-child(7) {
    grid-area: s4;
  }

  .process-connector:nth-child(4) .process-connector-line--h {
    display: none;
  }

  .process-connector:nth-child(4) .process-connector-line--v {
    display: block;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    background: rgba(6, 6, 8, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
  }

  .nav.open {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-tagline {
    font-size: clamp(1.35rem, 5.5vw, 1.85rem);
  }

  .process-steps {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    gap: 0.5rem 0;
  }

  .process-step:nth-child(n) {
    grid-area: auto;
  }

  .process-connector:nth-child(n) {
    grid-area: auto;
    padding: 0.375rem 0;
  }

  .process-connector-line--h {
    display: none;
  }

  .process-connector-line--v {
    display: block;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-stats {
    animation: none;
  }

  .shimmer {
    animation: none;
  }

  .process-connector {
    animation: none;
    opacity: 0.6;
  }

  .scroll-top {
    transform: none;
    transition: opacity 0.15s, visibility 0.15s;
  }

  .scroll-top.is-visible {
    transform: none;
  }
}
