/* ==========================================================================
   phms.com.br — design tokens
   ========================================================================== */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f6;
  --text: #0b0b0f;
  --muted: #5d5d69;
  --subtle: #8a8a95;
  --border: #e6e6ea;
  --border-strong: #d6d6dc;

  --accent: #5b4cf5;
  --accent-2: #0ea5e9;
  --accent-soft: rgba(91, 76, 245, 0.08);
  --accent-ring: rgba(91, 76, 245, 0.35);
  --grad: linear-gradient(120deg, #5b4cf5 0%, #8b5cf6 45%, #0ea5e9 100%);
  --ok: #16a34a;

  --term-bg: #0d0d12;
  --term-text: #e4e4ea;
  --term-muted: #7c7c8a;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 16, 24, 0.04), 0 12px 32px -18px rgba(16, 16, 24, 0.18);
  --shadow-hover: 0 1px 2px rgba(16, 16, 24, 0.05), 0 22px 48px -22px rgba(60, 50, 160, 0.35);

  --maxw: 1140px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --surface: #111115;
    --surface-2: #16161b;
    --text: #ededf1;
    --muted: #a3a3ae;
    --subtle: #73737e;
    --border: #222229;
    --border-strong: #30303a;

    --accent: #8f82ff;
    --accent-2: #38bdf8;
    --accent-soft: rgba(143, 130, 255, 0.12);
    --accent-ring: rgba(143, 130, 255, 0.45);
    --grad: linear-gradient(120deg, #8f82ff 0%, #b08cff 45%, #38bdf8 100%);
    --ok: #4ade80;

    --term-bg: #0b0b0f;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 16px 40px -20px rgba(0, 0, 0, 0.8);
    --shadow-hover: 0 1px 2px rgba(0, 0, 0, 0.5), 0 24px 56px -24px rgba(120, 100, 255, 0.35);
  }
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Dot grid + glow behind the hero */
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 900px;
  z-index: -1;
  background:
    radial-gradient(600px 320px at 78% 18%, var(--accent-soft), transparent 70%),
    radial-gradient(520px 300px at 12% 8%, rgba(14, 165, 233, 0.07), transparent 70%),
    radial-gradient(circle at 1px 1px, var(--border-strong) 1px, transparent 0) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  padding: 8px 14px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-weight: 500;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font: 500 15px/1 var(--font);
  transition: transform .15s ease, background-color .2s, border-color .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { box-shadow: 0 8px 24px -10px var(--accent-ring); background: var(--accent); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn .i { width: 18px; height: 18px; stroke: none; }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  font-size: 14.5px; color: var(--muted); transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13.5px; color: var(--muted); box-shadow: var(--shadow);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }

h1 {
  margin-top: 22px;
  font-size: clamp(40px, 5.6vw, 66px);
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 650;
}
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { margin-top: 22px; max-width: 34em; font-size: 18.5px; color: var(--muted); }
.lede strong { color: var(--text); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Terminal card */
.terminal {
  position: relative;
  border-radius: var(--radius);
  background: var(--term-bg);
  color: var(--term-text);
  border: 1px solid #23232b;
  box-shadow: 0 30px 80px -30px rgba(70, 50, 200, 0.45), 0 2px 6px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.terminal::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(143, 130, 255, .55), transparent 40%, transparent 60%, rgba(56, 189, 248, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.terminal-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid #1f1f27;
  font: 500 12.5px/1 var(--mono); color: var(--term-muted);
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #2c2c36; }
.terminal-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 7px; color: #86efac; }
.status .dot { width: 7px; height: 7px; background: #4ade80; box-shadow: none; animation: pulse 1.8s ease-in-out infinite; }

.terminal-body { padding: 20px 20px 22px; font: 400 13.5px/1.9 var(--mono); }
.t-line { white-space: pre; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(4px); animation: line-in .45s ease forwards; }
.t-line:nth-child(1) { animation-delay: .25s; }
.t-line:nth-child(2) { animation-delay: .75s; }
.t-line:nth-child(3) { animation-delay: 1.15s; }
.t-line:nth-child(4) { animation-delay: 1.55s; }
.t-line:nth-child(5) { animation-delay: 1.95s; }
.t-line:nth-child(6) { animation-delay: 2.45s; }
.t-line:nth-child(7) { animation-delay: 2.85s; }
.t-muted { color: var(--term-muted); }
.t-accent { color: #b5abff; }
.t-step { color: #7dd3fc; display: inline-block; min-width: 9ch; }
.t-ok { color: #86efac; display: inline-block; min-width: 9ch; }
.cursor { display: inline-block; width: 8px; height: 15px; vertical-align: -2px; background: #b5abff; animation: blink 1s steps(1) infinite; }

@keyframes line-in { to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 64px 0 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
}
.stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; padding: 22px 24px; }
.stats > div + div { border-left: 1px solid var(--border); }
.stats dd { margin: 0; font-size: 34px; font-weight: 650; letter-spacing: -0.03em; line-height: 1; }
.stats dt { font-size: 13.5px; color: var(--muted); line-height: 1.4; }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: 112px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.eyebrow { font: 500 13px/1 var(--mono); letter-spacing: .02em; color: var(--accent); margin-bottom: 16px; }
h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.03em; }
.section-sub { margin-top: 16px; font-size: 17px; color: var(--muted); }

/* Cards */
.card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.section.alt .card { background: var(--bg); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }

.project-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.meta { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--subtle); }
.badge {
  padding: 4px 10px; border-radius: 999px;
  font: 500 12px/1.2 var(--mono); color: var(--accent);
  background: var(--accent-soft);
}
time { font: 400 12.5px/1 var(--mono); color: var(--subtle); }

.icon-tile {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.icon-tile svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-tile.sm { width: 36px; height: 36px; border-radius: 10px; }
.icon-tile.sm svg { width: 19px; height: 19px; }

.project h3 { font-size: 24px; }
.h-sub { display: block; margin-top: 6px; font-size: 15.5px; font-weight: 500; letter-spacing: -0.01em; color: var(--muted); }
.project p { margin-top: 14px; color: var(--muted); font-size: 15.5px; }
.project p em { color: var(--text); font-style: normal; }

.flow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 20px; padding: 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  font: 400 12.5px/1 var(--mono);
}
.flow span { padding: 7px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.flow span.hl { background: var(--grad); color: #fff; border-color: transparent; }
.flow i { font-style: normal; color: var(--subtle); }

.checks { display: grid; gap: 6px; margin-top: 18px; font-size: 14.5px; }
.checks li { position: relative; padding-left: 24px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .45em;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c6cff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 10px no-repeat;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.tags li {
  padding: 5px 10px; border-radius: 8px;
  font: 400 12.5px/1.2 var(--mono); color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
}

.foot {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: auto; padding-top: 22px;
  font-size: 13px; color: var(--subtle);
}
.project p.foot { margin-top: auto; font-size: 13px; color: var(--subtle); }
.foot.link { color: var(--accent); font-weight: 500; }
.foot.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot .i { width: 14px; height: 14px; }

.subhead { margin: 64px 0 20px; font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.mini { padding: 24px; }
.mini .project-top { margin-bottom: 16px; }
.mini h4 { font-size: 18px; }
.mini p { margin-top: 10px; font-size: 14.5px; color: var(--muted); }
.mini .tags { margin-top: 16px; }
.mini .foot { padding-top: 16px; }

/* Capabilities */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cap {
  padding: 26px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
}
.cap h3 { margin-top: 20px; font-size: 18px; }
.cap p { margin-top: 10px; font-size: 14.5px; color: var(--muted); }

/* Approach */
.approach { display: grid; grid-template-columns: 1fr 1.25fr; gap: 64px; align-items: start; }
.approach .section-head { position: sticky; top: 112px; margin-bottom: 0; }
.principles { counter-reset: p; display: grid; gap: 0; border-top: 1px solid var(--border); }
.principles li { counter-increment: p; position: relative; padding: 28px 0 28px 64px; border-bottom: 1px solid var(--border); }
.principles li::before {
  content: counter(p, decimal-leading-zero);
  position: absolute; left: 0; top: 30px;
  font: 500 13px/1 var(--mono); color: var(--accent);
  padding: 7px 9px; border-radius: 8px; background: var(--accent-soft);
}
.principles h3 { font-size: 20px; }
.principles p { margin-top: 8px; color: var(--muted); font-size: 15.5px; }

/* Stack */
.stack { display: grid; gap: 0; border-top: 1px solid var(--border); }
.stack-row { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--border); }
.stack-row h3 { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 8px 14px; border-radius: 999px;
  font-size: 14px; background: var(--bg); border: 1px solid var(--border);
  transition: border-color .2s, color .2s;
}
.chips li:hover { border-color: var(--accent-ring); color: var(--accent); }

/* CTA */
.cta-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.4fr auto; gap: 40px; align-items: end;
  padding: 56px; border-radius: 28px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.cta-card::before {
  content: ""; position: absolute; inset: auto -20% -60% auto; width: 520px; height: 520px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
  pointer-events: none;
}
.cta-card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad);
}
.cta-copy p:last-child { margin-top: 18px; max-width: 38em; color: var(--muted); font-size: 16.5px; }
.cta-actions { position: relative; display: flex; flex-direction: column; gap: 12px; }

/* Footer */
.footer { padding: 32px 0 48px; font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.muted { color: var(--subtle); }

/* ==========================================================================
   Reveal on scroll (only when JS is on and motion is allowed)
   ========================================================================== */
.js-reveal .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.js-reveal .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .t-line { opacity: 1; transform: none; animation: none; }
  .cursor, .status .dot { animation: none; }
  .card, .btn { transition: none; }
  .card:hover { transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .terminal { max-width: 620px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .approach { grid-template-columns: 1fr; gap: 32px; }
  .approach .section-head { position: static; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .bento { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4 { grid-column: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .cta-card { grid-template-columns: 1fr; padding: 40px 32px; }
  .cta-actions { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .hero { padding-top: 44px; }
  .lede { font-size: 17px; }
  .section { padding: 80px 0; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .stack-row { grid-template-columns: 1fr; gap: 12px; }
  .principles li { padding-left: 56px; }
  .card { padding: 22px; }
  .cta-card { padding: 32px 22px; border-radius: 22px; }
  .terminal-body { font-size: 12px; padding: 16px; }
  .t-line { white-space: normal; padding-left: 9ch; text-indent: -9ch; }
  .t-step, .t-ok { text-indent: 0; }
  .stats > div { padding: 18px; }
  .stats dd { font-size: 28px; }
}
