/* =========================================================================
   FluxusOne — "Em breve"
   Concept: "O fluxo da inteligência." Monochrome (variações de preto);
   light + motion are the only color. Signature = a living flow field.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Variations of black → near-white */
  --void:     #060607;
  --ink:      #0a0a0c;
  --graphite: #141417;
  --smoke:    #5a5a63;
  --mist:     #9a9aa6;
  --silver:   #c9c9d2;
  --bone:     #f2f2f0;

  /* Hairlines (low-alpha white composites correctly over the flow layer) */
  --line:        rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --glass:       rgba(255, 255, 255, 0.025);

  --font-display: "Sora", "Geist", system-ui, sans-serif;
  --font-body:    "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "Geist Mono", "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --container: 1240px;
  --pad-x: clamp(1.5rem, 5vw, 5rem);
  --section-y: clamp(5.5rem, 12vh, 10rem);

  --focus: 0 0 0 2px var(--void), 0 0 0 4px rgba(242, 242, 240, 0.85);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--bone);
  background: var(--void);
  line-height: 1.55;
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; padding: 0; }

::selection { background: var(--bone); color: var(--void); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
:focus:not(:focus-visible) { outline: none; }

.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;
}

.skip-link {
  position: fixed; top: 0.75rem; left: 50%; translate: -50% -150%;
  z-index: 100; padding: 0.6rem 1rem; border-radius: 999px;
  background: var(--bone); color: var(--void);
  font: 500 0.8rem var(--font-mono); transition: translate 0.25s var(--ease);
}
.skip-link:focus { translate: -50% 0; }

/* ---------- Background layers ---------- */
#flowfield {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0; transition: opacity 2.2s ease;
}
html.is-loaded #flowfield { opacity: 1; }

/* Legibility scrim: soft vignette + floor + ceiling darkening */
.scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(135% 105% at 50% 0%, transparent 0%, rgba(6, 6, 7, 0.16) 55%, rgba(6, 6, 7, 0.5) 100%),
    linear-gradient(180deg, rgba(6, 6, 7, 0.42) 0%, transparent 26% 64%, rgba(6, 6, 7, 0.78) 100%);
}

/* Film grain (static SVG turbulence — premium tactile finish) */
.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Custom cursor (fine pointer only) ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 30px; height: 30px; border: 1px solid var(--bone); border-radius: 50%;
  pointer-events: none; mix-blend-mode: difference;
  transform: translate(-50%, -50%); opacity: 0;
  transition: width 0.25s var(--ease), height 0.25s var(--ease), opacity 0.3s ease;
}
.cursor.is-active { opacity: 1; }
.cursor.is-hover { width: 54px; height: 54px; }

/* ---------- Shared content layer ---------- */
.nav, main, .footer { position: relative; z-index: 3; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font: 500 0.72rem/1 var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--mist);
}
.eyebrow__tick {
  width: 1.4rem; height: 1px; background: var(--line-strong);
  display: inline-block;
}
.eyebrow--center { justify-content: center; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(1rem, 2.5vw, 1.6rem) var(--pad-x);
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(6, 6, 7, 0.6); backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav__brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.glyph { color: var(--bone); }
.glyph path { stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.nav__brand-name {
  font: 600 1.02rem/1 var(--font-display); letter-spacing: -0.01em; color: var(--bone);
}
.nav__status {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0.85rem 0.4rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px);
  font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--silver);
}

/* Pulsing dot: the ring expands, not the dot (compositor-cheap) */
.pulse {
  position: relative; width: 7px; height: 7px; border-radius: 50%;
  background: var(--bone); box-shadow: 0 0 10px rgba(242, 242, 240, 0.5); flex: none;
}
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--bone); animation: ring 2.4s var(--ease) infinite;
}
.pulse--sm { width: 6px; height: 6px; }
@keyframes ring {
  0%   { opacity: 0.7; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(3.2); }
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--container); margin-inline: auto;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: clamp(1.1rem, 2.2vh, 1.6rem);
  padding: clamp(7rem, 16vh, 11rem) var(--pad-x) clamp(4rem, 9vh, 7rem);
}
.hero__wordmark {
  width: clamp(232px, 44vw, 480px); height: auto;
  filter: drop-shadow(0 8px 40px rgba(0, 0, 0, 0.55));
}
.hero__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.6rem, 1rem + 7.4vw, 6.6rem);
  line-height: 0.98; letter-spacing: -0.04em; color: var(--bone);
  max-width: 16ch;
}
.flui {
  /* inline-block + padding guarantees a paint box tall/wide enough that the
     italic glyph edges are never clipped to transparent by background-clip:text.
     Negative margins cancel the padding so layout/position is unchanged. The
     trailing "." lives inside the span, so it can never orphan onto its own line. */
  display: inline-block;
  padding: 0.1em 0.16em 0.3em;
  margin: -0.1em -0.16em -0.3em;
  background: linear-gradient(100deg, var(--bone) 0%, #8d8d97 45%, var(--bone) 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  font-style: italic;
  animation: sheen 7s linear infinite;
}
@keyframes sheen { to { background-position: -220% 0; } }

.hero__lede {
  font-weight: 300; font-size: clamp(1.02rem, 0.94rem + 0.5vw, 1.28rem);
  line-height: 1.6; color: var(--mist); max-width: 54ch;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 0.4rem; }

.hero__meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.6rem clamp(1rem, 3vw, 2.2rem); margin-top: clamp(0.6rem, 2vh, 1.4rem);
  font: 400 0.78rem/1 var(--font-mono); letter-spacing: 0.04em; color: var(--smoke);
}
.hero__meta li { display: inline-flex; align-items: center; gap: 0.5rem; }

/* ---------- Buttons ---------- */
.btn {
  --pad: 0.85rem 1.4rem;
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: var(--pad); border-radius: 999px;
  font: 500 0.92rem/1 var(--font-body); letter-spacing: 0.005em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.3s ease, color 0.3s ease,
              border-color 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}
.btn svg { transition: transform 0.3s var(--ease); }
.btn--primary {
  background: var(--bone); color: var(--void);
  box-shadow: 0 10px 30px -12px rgba(242, 242, 240, 0.4);
}
.btn--primary:hover { box-shadow: 0 16px 44px -12px rgba(242, 242, 240, 0.55); }
.btn--ghost {
  background: var(--glass); color: var(--silver); border-color: var(--line-strong);
  font-family: var(--font-mono); font-size: 0.84rem; backdrop-filter: blur(8px);
}
.btn--ghost:hover { color: var(--bone); border-color: var(--bone); background: rgba(255, 255, 255, 0.05); }
.btn--ghost:hover svg { transform: translateX(3px); }
.btn--ghost svg path { stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--lg { --pad: 1.05rem 1.8rem; font-size: 1rem; }
.btn--lg.btn--ghost { font-size: 0.9rem; }

/* ---------- "O que estamos construindo" ---------- */
.build {
  max-width: var(--container); margin-inline: auto;
  padding: var(--section-y) var(--pad-x);
  display: flex; flex-direction: column; align-items: center; gap: clamp(2.5rem, 6vh, 4rem);
  border-top: 1px solid var(--line);
}
.build__list {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; width: 100%;
  background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.capab {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent);
  padding: clamp(1.8rem, 3.5vw, 2.8rem);
  display: flex; flex-direction: column; gap: 0.8rem;
  transition: background 0.4s ease;
}
.capab:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent); }
.capab__glyph { color: var(--silver); margin-bottom: 0.4rem; }
.capab__glyph svg path,
.capab__glyph svg circle { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.capab__title { font: 600 1.16rem/1.2 var(--font-display); letter-spacing: -0.01em; color: var(--bone); }
.capab__text { font-weight: 300; font-size: 0.96rem; color: var(--mist); line-height: 1.55; }

/* ---------- Contact ---------- */
.contact {
  padding: var(--section-y) var(--pad-x);
  border-top: 1px solid var(--line);
}
.contact__inner {
  max-width: var(--container); margin-inline: auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 1.1rem;
}
.contact__title {
  font: 700 clamp(2rem, 1rem + 4.6vw, 4.2rem)/1.02 var(--font-display);
  letter-spacing: -0.035em; color: var(--bone); max-width: 18ch;
}
.contact__lede { color: var(--mist); font-weight: 300; font-size: clamp(1rem, 0.95rem + 0.4vw, 1.2rem); max-width: 44ch; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.85rem; margin-top: 0.8rem; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(10, 10, 12, 0.7));
  padding: clamp(3rem, 7vh, 5rem) var(--pad-x) clamp(2rem, 4vh, 3rem);
}
.footer__top {
  max-width: var(--container); margin: 0 auto clamp(2.5rem, 5vh, 3.5rem);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.2rem;
}
.footer__wordmark { width: clamp(150px, 22vw, 200px); height: auto; opacity: 0.95; }
.footer__tagline { font: 400 0.85rem/1 var(--font-mono); letter-spacing: 0.08em; color: var(--smoke); text-transform: uppercase; }

.footer__cols {
  max-width: var(--container); margin-inline: auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem;
  padding-bottom: clamp(2.5rem, 5vh, 3.5rem); border-bottom: 1px solid var(--line);
}
.footer__label {
  display: block; font: 500 0.68rem/1 var(--font-mono); letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--smoke); margin-bottom: 1rem;
}
.footer__line { font-size: 0.92rem; color: var(--silver); margin-bottom: 0.45rem; }
.footer__line a { transition: color 0.25s ease; }
.footer__line a:hover { color: var(--bone); text-decoration: underline; text-underline-offset: 3px; }
.footer__wa a { display: inline-flex; align-items: center; gap: 0.45rem; }
.footer__wa a:hover { text-decoration: none; }
.wa-ico { flex: none; }
.footer__muted { color: var(--smoke); }

.footer__bottom {
  max-width: var(--container); margin: clamp(1.6rem, 3vh, 2.2rem) auto 0;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem;
  font: 400 0.78rem/1.5 var(--font-mono); color: var(--smoke); letter-spacing: 0.03em;
}

/* ---------- Reveal (only when JS present; gated by html.is-loaded) ----------
   Slow, cinematic entrance: the blur (defocus → focus) resolves slowest. */
.js [data-reveal] { opacity: 0; transform: translateY(28px); filter: blur(13px); }
html.js.is-loaded [data-reveal] {
  opacity: 1; transform: none; filter: none;
  transition: opacity 1.3s var(--ease), transform 1.45s var(--ease), filter 1.9s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

/* In-view reveal for lower sections (same blur-led language) */
.js .capab { opacity: 0; transform: translateY(26px); filter: blur(10px); }
.capab.in-view { opacity: 1; transform: none; filter: none; transition: opacity 1.15s var(--ease), transform 1.25s var(--ease), filter 1.6s var(--ease); }
.capab.in-view:nth-child(2) { transition-delay: 0.14s; }
.capab.in-view:nth-child(3) { transition-delay: 0.28s; }
.js .contact__inner { opacity: 0; transform: translateY(26px); filter: blur(10px); }
.contact__inner.in-view { opacity: 1; transform: none; filter: none; transition: opacity 1.2s var(--ease), transform 1.3s var(--ease), filter 1.7s var(--ease); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .build__list { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: 1fr; gap: 2.2rem; }
  .hero__title { max-width: 14ch; }
}
@media (max-width: 520px) {
  .nav__brand-name { display: none; }
  .hero__actions { width: 100%; }
  .btn { width: 100%; justify-content: center; }
  .hero__actions .btn { flex: 1 1 100%; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal], .capab, .contact__inner { opacity: 1 !important; transform: none !important; filter: none !important; }
  #flowfield { opacity: 1; }
  .flui { animation: none; background-position: 0 0; }
  .cursor { display: none !important; }
}

@media (hover: none), (pointer: coarse) {
  .cursor { display: none !important; }
}
