/* ============================================================
   RAMOS DEV — Blueprint / Engineering identity
   Palette + type from brand guide. Custom CSS, no framework.
   ============================================================ */

:root {
  --obsidian: #0a0a0a;
  --obsidian-2: #0e0e10;
  --off-white: #f4f4f5;
  --cobalt: #2563eb;
  --cobalt-deep: #1d4ed8;
  --white: #ffffff;
  --ash: #a1a1aa;
  --near-black: #09090b;
  --zinc: #52525b;

  --grid-line: rgba(255, 255, 255, 0.12);
  --blueprint: rgba(37, 99, 235, 0.22);
  --card: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.14);

  --display: "Space Grotesk", ui-monospace, monospace;
  --body: "Inter", system-ui, -apple-system, sans-serif;

  --pad: clamp(1.25rem, 5vw, 6rem);
  --maxw: 1240px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--white);
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--cobalt); color: var(--white); }

/* Focus visibility — accessibility floor */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--white);
  color: var(--near-black);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ── Ambient blueprint mesh ─────────────────────────── */
.blueprint-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--blueprint) 1px, transparent 1px),
    linear-gradient(90deg, var(--blueprint) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 70%);
  opacity: 0.5;
}

main, .nav, .footer { position: relative; z-index: 1; }

/* ── Nav ────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--white);
}
.wordmark .dot { color: var(--cobalt); }
.wordmark.small { font-size: 1.1rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
  font-size: 0.9rem;
  color: var(--ash);
}
.nav-links a { transition: color 0.2s ease; }
.nav-links a:not(.nav-cta):hover { color: var(--white); }

.nav-cta {
  border: 1px solid var(--card-border);
  color: var(--white);
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.nav-cta:hover { background: var(--cobalt); border-color: var(--cobalt); }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: 50px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }

.btn-primary {
  background: var(--white);
  color: var(--near-black);
  border: 1px solid var(--white);
}
.btn-primary:hover {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--card-border);
}
.btn-outline:hover { border-color: var(--white); transform: translateY(-2px); }

/* ── Hero / blueprint draft ─────────────────────────── */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 1vw, 5rem) var(--pad) clamp(3rem, 8vw, 6rem);
}

.draft {
  position: relative;
  border: 1px solid var(--grid-line);
  padding: clamp(2rem, 4vw, 5.5rem) clamp(1.5rem, 5vw, 5rem);
  margin: 0;
}

/* registration ticks at each corner */
.tick {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid var(--cobalt);
}
.tick.tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.tick.tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.tick.bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.tick.br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

/* dimension lines */
.dim-top {
  position: absolute;
  top: -0.7em;
  left: clamp(1.5rem, 5vw, 5rem);
  right: clamp(1.5rem, 5vw, 5rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.dim-rule {
  flex: 1;
  height: 1px;
  background: var(--grid-line);
  transform-origin: left;
}
.dim-label {
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--cobalt);
  background: var(--obsidian);
  padding: 0 0.5rem;
  white-space: nowrap;
}

.dim-side {
  position: absolute;
  right: -0.7em;
  top: clamp(2rem, 6vw, 5.5rem);
  bottom: clamp(2rem, 6vw, 5.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.dim-rule-v { flex: 1; width: 1px; background: var(--grid-line); }
.dim-label-v {
  font-family: var(--display);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--ash);
  background: var(--obsidian);
  writing-mode: vertical-rl;
  padding: 0.5rem 0;
}

.hero-body { max-width: 46rem; }

.eyebrow {
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.6rem, 8vw, 6rem);
  line-height: 0.98;
  margin-bottom: 1.75rem;
}
.hero-title .accent { color: var(--cobalt); }

.hero-sub {
  font-weight: 300;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--ash);
  max-width: 34rem;
  margin-bottom: 2.5rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* running spec strip */
.spec-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.75rem;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--zinc);
  text-transform: uppercase;
}
.spec-sep { color: var(--cobalt); }

/* ── Section heads ──────────────────────────────────── */
.section-head { max-width: 40rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.ref {
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: var(--cobalt);
  margin-bottom: 0.8rem;
}
.ref.light { color: var(--cobalt); }
.section-title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1;
  color: var(--near-black);
  margin-bottom: 1rem;
}
.section-title.on-dark { color: var(--white); }
.section-lead {
  font-weight: 300;
  color: var(--zinc);
  font-size: 1.05rem;
}
.section-lead.on-dark { color: var(--ash); }

/* ── Abordagem (light break) ────────────────────────── */
.approach {
  background: var(--off-white);
  color: var(--near-black);
  padding: clamp(4rem, 9vw, 7rem) var(--pad);
}
.approach > .section-head,
.approach > .phases { margin-left: auto; margin-right: auto; }

.phases {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: var(--maxw);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(9, 9, 11, 0.12);
  border: 1px solid rgba(9, 9, 11, 0.12);
}
.phase {
  background: var(--off-white);
  padding: clamp(1.75rem, 3vw, 2.75rem);
}
.phase-no {
  font-family: var(--display);
  font-size: 2.75rem;
  font-weight: 500;
  color: var(--cobalt);
  display: block;
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
}
.phase h3 { font-size: 1.35rem; margin-bottom: 0.6rem; color: var(--near-black); }
.phase p { color: var(--zinc); font-weight: 300; }

/* ── Serviços (bento) ───────────────────────────────── */
.services {
  background: var(--obsidian);
  padding: clamp(4rem, 9vw, 7rem) var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.cell {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
  grid-column: span 2;
}
.cell:hover {
  border-color: var(--cobalt);
  background: rgba(37, 99, 235, 0.06);
  transform: translateY(-3px);
}
.cell-lg { grid-column: span 2; grid-row: span 2; justify-content: flex-end; }
.cell-wide { grid-column: span 2; }
.cell-tag {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cobalt);
}
.cell h3 { font-size: 1.3rem; color: var(--white); }
.cell-lg h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.cell p { color: var(--ash); font-weight: 300; font-size: 0.98rem; }

/* ── Trabalhos ──────────────────────────────────────── */
.work {
  padding: clamp(4rem, 9vw, 7rem) var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.work-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--grid-line); }
.work-row {
  display: grid;
  grid-template-columns: 5rem 1fr auto 2rem;
  align-items: center;
  gap: 1rem;
  padding: clamp(1.25rem, 2.5vw, 1.9rem) 0;
  border-bottom: 1px solid var(--grid-line);
  transition: padding-left 0.25s ease, background 0.25s ease;
  cursor: default;
}
.work-row:hover { padding-left: 1rem; background: rgba(37, 99, 235, 0.05); }
.work-idx {
  font-family: var(--display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--zinc);
}
.work-name {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.25rem, 3vw, 1.9rem);
  color: var(--white);
}
.work-meta {
  color: var(--ash);
  font-weight: 300;
  font-size: 0.95rem;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.work-row:hover .work-meta { opacity: 1; transform: translateX(0); }
.work-arrow { color: var(--cobalt); font-size: 1.2rem; transition: transform 0.25s ease; }
.work-row:hover .work-arrow { transform: translateX(6px); }

/* ── Contato ────────────────────────────────────────── */
.contact {
  padding: clamp(3rem, 7vw, 6rem) var(--pad) clamp(4rem, 9vw, 7rem);
  max-width: var(--maxw);
  margin: 0 auto;
}
.draft-slim { text-align: center; padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 6vw, 5rem); }
.draft-slim .ref { text-align: center; }
.contact-title {
  font-size: clamp(1.9rem, 5vw, 3.5rem);
  line-height: 1.02;
  color: var(--white);
  margin-bottom: 1.25rem;
}
.contact-sub {
  color: var(--ash);
  font-weight: 300;
  max-width: 36rem;
  margin: 0 auto 2.25rem;
  font-size: 1.05rem;
}

/* ── Footer ─────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--grid-line);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem var(--pad);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer-brand { display: flex; flex-direction: column; gap: 0.4rem; }
.tagline {
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  color: var(--zinc);
}
.footer-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--zinc);
  font-family: var(--display);
  letter-spacing: 0.08em;
}

/* ── Load-in animation (signature) ──────────────────── */
@keyframes draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }

.js-anim .dim-top .dim-rule { animation: draw-x 0.7s ease forwards; }
.js-anim .tick { opacity: 0; animation: pop 0.4s ease forwards; }
.js-anim .tick.tl { animation-delay: 0.15s; }
.js-anim .tick.tr { animation-delay: 0.25s; }
.js-anim .tick.bl { animation-delay: 0.35s; }
.js-anim .tick.br { animation-delay: 0.45s; }
.js-anim .hero-body > * { opacity: 0; animation: rise 0.6s ease forwards; }
.js-anim .eyebrow { animation-delay: 0.3s; }
.js-anim .hero-title { animation-delay: 0.42s; }
.js-anim .hero-sub { animation-delay: 0.54s; }
.js-anim .hero-actions { animation-delay: 0.66s; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .js-anim .dim-top .dim-rule,
  .js-anim .tick,
  .js-anim .hero-body > * { animation: none; opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .cell:hover, .work-row:hover { transform: none; }
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .cell, .cell-lg, .cell-wide { grid-column: span 2; grid-row: auto; }
  .phases { grid-template-columns: 1fr; }
  .dim-side { display: none; }
}

@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .work-row { grid-template-columns: 3.5rem 1fr 1.5rem; }
  .work-meta { display: none; }
  .spec-strip { font-size: 0.65rem; }
}
