/* madelabs — Design System (preto e branco, marca-mãe) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=JetBrains+Mono:wght@400;500&display=swap');

@font-face {
  font-family: 'IBrand';
  src: url('fonts/ibrand.otf') format('opentype');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  /* Mono palette — marca-mãe institucional */
  --black: #000000;
  --ink:   #0a0a0a;
  --ink-2: #141414;
  --ink-3: #1f1f1f;
  --gray-9: #2a2a2a;
  --gray-7: #4a4a4a;
  --gray-5: #6e6e6e;
  --gray-3: #a3a3a3;
  --gray-2: #cfcfcf;
  --gray-1: #ebebeb;
  --bone:  #f5f5f3;
  --paper: #fafaf8;
  --white: #ffffff;

  /* Brand accent — madelabs teal (do wordmark “labs”) */
  --brand:    #004745;
  --brand-2:  #0a6260;
  --brand-1:  #d9e6e5;

  /* Lines */
  --line-dark:  rgba(255,255,255,0.10);
  --line-light: rgba(0,0,0,0.10);

  /* Type */
  /* IBrand fica reservada APENAS para o wordmark/logo.
     Inter é a fonte de títulos e textos. */
  --font-brand:   'IBrand', 'Inter', system-ui, sans-serif;
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif:   'Newsreader', Georgia, serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Spacing scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px;

  /* Type scale */
  --t-display: clamp(48px, 8vw, 128px);
  --t-h1: clamp(40px, 6vw, 84px);
  --t-h2: clamp(32px, 4.5vw, 56px);
  --t-h3: 28px;
  --t-body: 16px;
  --t-small: 13px;
  --t-mono: 11px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-display);
  background: var(--ink);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: var(--t-body);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.mono {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray-3);
}

.serif { font-family: var(--font-serif); }

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--s-6);
}

/* === NAV === */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 40px;
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--line-light);
}
.nav-logo {
  display: inline-flex;
  align-items: center;
}
.nav-logo img {
  height: 24px;
  width: auto;
  display: block;
}
.nav-links {
  display: flex; gap: 36px;
  font-size: 14px;
  color: var(--gray-7);
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  background: var(--ink);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  border: none;
  transition: opacity 0.2s;
}
.nav-cta:hover { opacity: 0.85; }

/* === HERO === */
.hero {
  position: relative;
  padding: 140px 40px 120px;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line-dark);
  background: radial-gradient(ellipse at 50% 0%, #1a1a1a 0%, #0a0a0a 70%);
}
.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: auto;
  z-index: 0;
}
.hero-content {
  position: relative; z-index: 2;
  pointer-events: none;
}
.hero-content > * { pointer-events: auto; }
.hero::before {
  content: '';
  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;
  pointer-events: none;
  z-index: 1;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 180px;
  background: linear-gradient(to bottom, transparent, var(--ink));
  pointer-events: none;
  z-index: 1;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  margin-bottom: 32px;
}
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--white); }
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--t-display);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.95;
  max-width: 1100px;
  margin: 0 auto;
}
.hero h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--gray-2);
}
.hero-sub {
  margin: 32px auto 0;
  max-width: 600px;
  font-size: 17px;
  color: var(--gray-2);
  line-height: 1.6;
}
.hero-form {
  margin: 48px auto 0;
  max-width: 520px;
  display: flex; align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 6px 6px 6px 22px;
}
.hero-form input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--white); font-family: inherit; font-size: 15px;
  padding: 10px 0;
}
.hero-form input::placeholder { color: var(--gray-5); }
.hero-form button {
  background: var(--white); color: var(--ink);
  border: none; padding: 12px 28px; border-radius: 999px;
  font-weight: 500; font-size: 14px;
}

/* === SECTION === */
.section {
  padding: 120px 40px;
  border-bottom: 1px solid var(--line-dark);
}
.section-light {
  background: var(--white);
  color: var(--ink);
}
.section-light .mono { color: var(--gray-7); }
.section-light { border-color: var(--line-light); }

.section-head {
  max-width: 900px;
  margin-bottom: 72px;
}
.section-head .mono { display: block; margin-bottom: 16px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: var(--t-h2);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}
.section-head h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}
.section-head p {
  margin-top: 24px;
  font-size: 18px;
  color: var(--gray-3);
  max-width: 620px;
  line-height: 1.55;
}
.section-light .section-head p { color: var(--gray-7); }

/* === PRODUCT GRID === */
.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-dark);
  border: 1px solid var(--line-dark);
}
.section-light .products { background: var(--line-light); border-color: var(--line-light); }
.product {
  background: var(--white);
  padding: 56px 48px;
  display: flex; flex-direction: column; gap: 24px;
  min-height: 360px;
  position: relative;
  transition: background 0.3s, transform 0.3s;
}
.section-light .product:hover { background: var(--bone); }
.product-logo {
  height: 56px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 8px;
}
.product-logo .wm {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -1.4px;
  color: var(--ink);
  line-height: 1;
}
.product-logo .wm .tld {
  color: var(--gray-3);
  font-weight: 500;
}
.product-logo .sym {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.product-logo .sym img,
.product-logo .sym svg {
  width: 100%; height: 100%;
  object-fit: contain;
}
.product-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.product-desc {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--gray-7);
  line-height: 1.6;
  flex: 1;
}
.product-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--line-light);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-5);
}
.product-arrow {
  font-size: 20px;
  color: var(--ink);
  transition: transform 0.3s;
}
.product:hover .product-arrow { transform: translateX(6px); }

/* === STATS === */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}
.stat {
  padding: 56px 40px;
  border-right: 1px solid var(--line-dark);
}
.stat:last-child { border-right: none; }
.stat-num {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat-label {
  margin-top: 12px;
  color: var(--gray-3);
  font-size: 14px;
}

/* === FEATURE ROW === */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  padding: 48px 0;
  border-top: 1px solid var(--line-dark);
}
.section-light .feature-row { border-color: var(--line-light); }
.feature-row:last-child { border-bottom: 1px solid var(--line-dark); }
.section-light .feature-row:last-child { border-color: var(--line-light); }
.feature-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--gray-3);
}
.feature-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 12px 0 16px;
}
.feature-desc {
  color: var(--gray-3);
  line-height: 1.6;
  font-size: 16px;
}
.section-light .feature-desc { color: var(--gray-7); }
.feature-vis {
  height: 320px;
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.section-light .feature-vis { background: var(--bone); border-color: var(--line-light); }

/* === FOOTER === */
.footer {
  background: var(--ink);
  color: var(--gray-2);
  padding: 80px 40px 40px;
  border-top: 1px solid var(--line-dark);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--line-dark);
}
.footer-brand {
  display: inline-flex;
  align-items: center;
}
.footer-brand img {
  height: 36px;
  width: auto;
  display: block;
}
.footer-brand-tag {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gray-3);
  max-width: 320px;
  font-size: 18px;
  line-height: 1.4;
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-5);
  font-weight: 500;
  margin-bottom: 20px;
}
.footer-col a {
  display: block;
  color: var(--gray-2);
  font-size: 15px;
  margin-bottom: 12px;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  padding-top: 32px;
  display: flex; justify-content: space-between;
  font-size: 12px;
  color: var(--gray-5);
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* === DESIGN SYSTEM PAGE === */
.ds-section {
  padding: 64px 40px;
  border-bottom: 1px solid var(--line-light);
}
.ds-section h2 {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 600;
  letter-spacing: -1px;
  margin-bottom: 8px;
}
.ds-section .lede {
  color: var(--gray-7);
  margin-bottom: 40px;
  max-width: 600px;
}

.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.swatch {
  aspect-ratio: 1/1.1;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 16px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em;
  border: 1px solid var(--line-light);
}
.swatch-name { font-weight: 500; }
.swatch-hex { opacity: 0.7; }

.type-row {
  display: grid; grid-template-columns: 200px 1fr; gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--line-light);
  align-items: baseline;
}
.type-meta { color: var(--gray-7); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; }
.type-meta strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 16px; letter-spacing: -0.2px; margin-bottom: 4px; font-weight: 500; }

.spacing-grid { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.spacing-cell {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; color: var(--gray-7);
}
.spacing-bar { background: var(--ink); width: 32px; }

.btn-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.btn {
  font-family: var(--font-display);
  font-weight: 500; font-size: 14px;
  padding: 10px 20px; border-radius: 999px; border: none; cursor: pointer;
  transition: all 0.15s;
}
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--gray-9); }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--white); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--bone); }

@media (max-width: 900px) {
  .products { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .stat:nth-child(2n) { border-right: none; }
  .feature-row { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
