/* ==========================================================================
   Carvalho Prototyping and Fabrication — design system
   Direction: shop-floor / technical-drawing. Every page reads like a
   spec sheet: drawing-sheet border, zone lettering instead of 01/02/03,
   title block bottom right, monospace for anything that is a measurement
   or a spec.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root{
  --graphite: #14181d;
  --graphite-2: #1b2129;
  --steel: #3a4550;
  --steel-soft: #5b6773;
  --paper: #edeae4;
  --paper-2: #e2ded4;
  --paper-line: #cfc9bb;
  --amber: #e8a33d;
  --amber-deep: #c17f22;
  --blueprint: #3f6d99;
  --blueprint-deep: #274a6b;
  --ink: #1c2128;
  --ink-soft: #545f68;
  --white: #f6f4ef;

  --display: 'Oswald', sans-serif;
  --body: 'Inter', sans-serif;
  --mono: 'IBM Plex Mono', monospace;

  --frame: 26px;
  --frame-mobile: 14px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display:block; }
a{ color: inherit; }

h1,h2,h3,h4{
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 0.5em;
  color: var(--graphite);
  font-weight: 600;
}

p{ margin: 0 0 1em; color: var(--ink-soft); max-width: 62ch; }

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

:focus-visible{
  outline: 2px solid var(--blueprint);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------------------------------------------------------------
   Drawing-sheet frame: fixed ruler border with zone letters/numbers,
   like the margin of an engineering drawing sheet. Purely decorative,
   injected by js/main.js so every page shares it without duplication.
   --------------------------------------------------------------------- */
.sheet-frame{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  padding: var(--frame);
}
.sheet-frame::before{
  content:"";
  position:absolute;
  inset: var(--frame);
  border: 1.5px solid var(--graphite);
}
.sheet-ruler{
  position:absolute;
  display:flex;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--steel-soft);
}
.sheet-ruler.top{ top: 6px; left: var(--frame); right: var(--frame); justify-content: space-between; padding: 0 6px; }
.sheet-ruler.bottom{ bottom: 6px; left: var(--frame); right: var(--frame); justify-content: space-between; padding: 0 6px; }
.sheet-ruler.left{ top: var(--frame); bottom: var(--frame); left: 6px; flex-direction: column; justify-content: space-between; align-items:center; width: 14px; }
.sheet-ruler.right{ top: var(--frame); bottom: var(--frame); right: 6px; flex-direction: column; justify-content: space-between; align-items:center; width: 14px; }

.title-block{
  position:absolute;
  right: var(--frame);
  bottom: var(--frame);
  transform: translate(0, 0);
  background: var(--paper);
  border: 1.5px solid var(--graphite);
  border-right: none;
  border-bottom: none;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--graphite);
  pointer-events: auto;
}
.title-block table{ border-collapse: collapse; }
.title-block td{
  padding: 4px 8px;
  border-top: 1px solid var(--paper-line);
  border-left: 1px solid var(--paper-line);
  white-space: nowrap;
}
.title-block td.label{ color: var(--ink-soft); font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; padding-bottom: 1px;}
.title-block .tb-name{ font-family: var(--display); font-size: 13px; letter-spacing: 0.03em; text-transform: uppercase; }

@media (max-width: 720px){
  :root{ --frame: 12px; }
  .sheet-ruler{ display: none; }
  .title-block{ display: none; }
}

/* ---------------------------------------------------------------------
   Layout shell
   --------------------------------------------------------------------- */
.page{
  margin: 0 auto;
  max-width: 1180px;
  padding: calc(var(--frame) + 30px) 40px calc(var(--frame) + 70px);
  position: relative;
  z-index: 2;
}
@media (max-width: 720px){
  .page{ padding: calc(var(--frame) + 20px) 20px calc(var(--frame) + 90px); }
}

/* ---------------------------------------------------------------------
   Nav
   --------------------------------------------------------------------- */
.site-nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--paper-line);
  margin-bottom: 40px;
}
.brand{
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.brand small{
  display:block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--steel-soft);
  text-transform: uppercase;
}
.nav-links{
  display:flex;
  gap: 28px;
  list-style:none;
  margin:0; padding:0;
}
.nav-links a{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration:none;
  color: var(--ink);
  position: relative;
  padding-bottom: 3px;
}
.nav-links a[aria-current="page"]{ color: var(--blueprint-deep); }
.nav-links a[aria-current="page"]::after{
  content:"";
  position:absolute; left:0; right:0; bottom:0;
  height:2px; background: var(--amber);
}
.nav-links a:hover{ color: var(--blueprint-deep); }
.nav-toggle{ display:none; }

@media (max-width: 780px){
  .nav-links{
    position: fixed;
    top: 0; right: 0; bottom:0;
    width: 78%; max-width: 320px;
    background: var(--graphite);
    flex-direction: column;
    gap: 0;
    padding: 90px 30px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 900;
  }
  .nav-links.open{ transform: translateX(0); }
  .nav-links a{ color: var(--paper); padding: 14px 0; border-bottom: 1px solid var(--steel); }
  .nav-links a[aria-current="page"]{ color: var(--amber); }
  .nav-toggle{
    display:flex; flex-direction:column; justify-content:center; align-items:center; gap:5px;
    width: 44px; height: 44px; padding: 0; background:none; border:none; cursor:pointer;
    z-index: 950; position: relative;
  }
  .nav-toggle span{ display:block; width: 26px; height:2px; background: var(--graphite); }
}

/* ---------------------------------------------------------------------
   Zone label — replaces generic 01/02/03 numbering with drawing-sheet
   zone references (a letter for the section, matching the side ruler).
   --------------------------------------------------------------------- */
.zone{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blueprint-deep);
  margin-bottom: 14px;
}
.zone::before{
  content:"";
  width: 18px; height: 18px;
  border: 1.5px solid var(--blueprint-deep);
  display:inline-flex;
  align-items:center; justify-content:center;
}
.zone-letter::before{ content: attr(data-zone); font-family: var(--mono); font-size:10px; display:flex; align-items:center; justify-content:center; }

/* Simpler concrete implementation used across pages */
.zone-tag{
  display:inline-flex;
  align-items:center;
  flex-wrap: wrap;
  gap:8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blueprint-deep);
  margin-bottom: 14px;
  max-width: 100%;
  row-gap: 6px;
}
.zone-tag .box{
  width: 20px; height: 20px;
  border: 1.5px solid var(--blueprint-deep);
  display:flex; align-items:center; justify-content:center;
  font-size: 11px;
}

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero{
  display:grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 50px;
  align-items:center;
  padding: 20px 0 60px;
}
.hero h1{
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  line-height: 1.05;
  margin-bottom: 20px;
}
.hero h1 em{
  font-style: normal;
  color: var(--blueprint-deep);
}
.hero .lede{ font-size: 1.08rem; color: var(--ink-soft); max-width: 46ch; }
.hero-actions{ display:flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.meta-line{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 22px;
}

@media (max-width: 900px){
  .hero{ grid-template-columns: 1fr; }
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration:none;
  padding: 14px 22px;
  border: 1.5px solid var(--graphite);
  color: var(--graphite);
  transition: background .15s ease, color .15s ease;
}
.btn:hover{ background: var(--graphite); color: var(--paper); }
.btn-primary{ background: var(--graphite); color: var(--paper); }
.btn-primary:hover{ background: var(--blueprint-deep); border-color: var(--blueprint-deep); color: var(--white); }

/* ---------------------------------------------------------------------
   Hero illustration — FEA-style stress-contour part rendering.
   Purely schematic: ties the hero to the Design & FEA service without
   depicting owned shop-floor equipment.
   --------------------------------------------------------------------- */
.hero-art{
  border: 1.5px solid var(--graphite);
  background: var(--graphite);
  padding: 16px;
  position: relative;
}
.hero-art svg{ width:100%; height:auto; display:block; }
.hero-3d{ display:none; width:100%; aspect-ratio: 580 / 400; }
.hero-3d canvas{ display:block; width:100% !important; height:100% !important; }
.hero-3d-fallback{ display:block; }
.hero-art figcaption{
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--steel-soft);
  text-align: right;
}

/* Small monoline icons used on service/capability cards */
.icon-tile{
  width: 44px; height: 44px;
  border: 1.5px solid var(--graphite);
  display:flex; align-items:center; justify-content:center;
  margin-bottom: 16px;
}
.icon-tile svg{ width: 24px; height: 24px; stroke: var(--blueprint-deep); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* Simple process/branching diagram (technology-fit illustration) */
/* ---------------------------------------------------------------------
   Fabrication-route flowchart (arrow-based process pipeline with
   material/process alternatives branching off the two selection stages)
   --------------------------------------------------------------------- */
.flow-diagram{
  border: 1.5px solid var(--graphite);
  background: var(--white);
  padding: 18px;
  margin-top: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.flow-diagram svg{ width: 1160px; max-width: none; height: auto; display: block; }
.fd-node{ fill: var(--paper); stroke: var(--graphite); stroke-width: 1.4; }
.fd-node-key{ stroke: var(--blueprint-deep); stroke-width: 1.8; }
.fd-node-label{ font-family: var(--mono); font-size: 8px; fill: var(--ink); letter-spacing: 0.01em; }
.fd-num{ font-family: var(--mono); font-size: 8px; fill: var(--steel-soft); }
.fd-arrow{ stroke: var(--graphite); stroke-width: 1.4; }
.fd-branch{ stroke: var(--steel-soft); stroke-width: 1; fill: none; }
.fd-alt{ fill: var(--paper); stroke: var(--steel-soft); stroke-width: 1; stroke-dasharray: 3 2; }
.fd-alt-label{ font-family: var(--mono); font-size: 7px; fill: var(--ink-soft); }
.fd-cat{ font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; fill: var(--blueprint-deep); }
.flow-hint{ display:none; }
@media (max-width: 720px){
  .flow-hint{ display:block; }
}

/* ---------------------------------------------------------------------
   Fixed watermark layer — faint, site-wide technical-drawing details.
   Sits above the plain paper background but below real content, which
   establishes its own stacking context via .page{ z-index:2 }.
   --------------------------------------------------------------------- */
.watermark{
  position: fixed;
  pointer-events: none;
  z-index: 1;
  opacity: 0.06;
}
.watermark svg{ display:block; width:100%; height:100%; }
.watermark.wm-slot-a{ left: -40px; top: 64px; width: 150px; height: 150px; }
.watermark.wm-slot-b{ left: -50px; bottom: -40px; width: 260px; height: 260px; }
.watermark.wm-slot-c{ left: 12px; top: 46%; width: 130px; height: 130px; }
@media (max-width: 720px){
  .watermark{ display:none; }
}

/* ---------------------------------------------------------------------
   Section shells
   --------------------------------------------------------------------- */
section{ padding: 56px 0; border-top: 1px solid var(--paper-line); }
section:first-of-type{ border-top: none; }
.section-head{ max-width: 66ch; margin-bottom: 36px; }
.section-head h2{ font-size: clamp(1.7rem, 3vw, 2.3rem); }

/* Card grid used for services/consultoria */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--paper-line);
  border: 1px solid var(--paper-line);
}
.card{
  background: var(--paper);
  padding: 28px 26px;
}
.card .zone-tag{ margin-bottom: 18px; }
.card h3{ font-size: 1.15rem; margin-bottom: 10px; }
.card p{ font-size: 0.94rem; }
.card ul{ margin: 12px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 0.9rem; }
.card li{ margin-bottom: 6px; }

/* Spec table (capacidades) */
.spec-table{ width:100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.88rem; }
.spec-table th{
  text-align:left;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1.5px solid var(--graphite);
  padding: 10px 14px;
}
.spec-table td{
  padding: 14px 14px;
  border-bottom: 1px solid var(--paper-line);
  vertical-align: top;
  color: var(--ink);
}
.spec-table tr:hover td{ background: var(--paper-2); }
.spec-table .eq-name{ font-family: var(--display); text-transform: uppercase; letter-spacing: 0.02em; font-size: 0.95rem; color: var(--graphite); }

/* Material tags */
.tag{
  display:inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--steel-soft);
  color: var(--steel-soft);
  margin: 0 6px 6px 0;
}
.tag.amber{ border-color: var(--amber-deep); color: var(--amber-deep); }

/* CTA band */
.cta-band{
  background: var(--graphite);
  color: var(--paper);
  padding: 50px 44px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}
.cta-band h2{ color: var(--paper); margin-bottom: 8px; font-size: 1.7rem; }
.cta-band p{ color: #c7cdd3; margin: 0; }
.cta-band .btn{ border-color: var(--paper); color: var(--paper); }
.cta-band .btn:hover{ background: var(--amber); border-color: var(--amber); color: var(--graphite); }

/* Process list (used in sobre / consultoria) */
.process{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; }
.process li{
  display:grid;
  grid-template-columns: 90px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--paper-line);
}
.process li:first-child{ border-top:none; }
.process .zref{ font-family: var(--mono); color: var(--blueprint-deep); font-size: 0.85rem; padding-top: 3px;}
.process h4{ margin: 0 0 6px; font-size: 1.02rem; }
.process p{ margin:0; font-size: 0.92rem; }

/* Footer */
.site-footer{
  margin-top: 70px;
  padding-top: 26px;
  border-top: 1px solid var(--paper-line);
  display:flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}
.site-footer a{ text-decoration: underline; text-underline-offset: 3px; }

/* Form */
.form-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 720px; }
.form-grid .full{ grid-column: 1 / -1; }
label{
  display:block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
input, textarea, select{
  width: 100%;
  border: 1.5px solid var(--graphite);
  background: var(--paper);
  padding: 12px 14px;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--ink);
}
textarea{ resize: vertical; min-height: 120px; }
input:focus, textarea:focus, select:focus{ outline: 2px solid var(--blueprint); outline-offset: 1px; }
@media (max-width: 620px){ .form-grid{ grid-template-columns: 1fr; } }

/* Contact info blocks */
.contact-meta{ display:grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 24px; margin: 30px 0 46px; }
.contact-meta .item .label{ font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber-deep); display:block; margin-bottom:6px; }
.contact-meta .item p{ margin:0; font-size: 0.98rem; color: var(--ink); }

/* ---------------------------------------------------------------------
   "Seu Castor" agent widget — discreet fixed launcher, top-right,
   expands into a chat panel. Flat/bordered, no shadows, matching the
   rest of the drawing-sheet system.
   --------------------------------------------------------------------- */
.beaver-widget{
  position: fixed;
  top: 96px;
  right: max(18px, var(--frame));
  z-index: 800;
  font-family: var(--body);
}
.beaver-fab{
  width: 138px; height: 138px;
  border: 1.5px solid var(--graphite);
  background: var(--graphite);
  color: var(--paper);
  display:flex; align-items:center; justify-content:center;
  cursor: pointer;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.beaver-fab-3d{ display:none; width:100%; height:100%; }
.beaver-fab-3d canvas{ display:block; width:100% !important; height:100% !important; }
.beaver-fab-flat{ width: 72px; height: 72px; stroke: var(--paper); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.beaver-fab-flat circle.eye{ fill: var(--paper); stroke: none; }
.beaver-fab-flat rect.tooth{ fill: var(--paper); stroke: none; }
.beaver-ai-badge{
  position: absolute;
  left: -1.5px; bottom: -1.5px;
  background: var(--amber-deep);
  color: var(--graphite);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border: 1.5px solid var(--graphite);
  pointer-events: none;
}

.beaver-panel{
  display:none;
  position: absolute;
  top: 148px;
  right: 0;
  width: min(320px, calc(100vw - 48px));
  max-height: min(64vh, 520px);
  border: 1.5px solid var(--graphite);
  background: var(--paper);
  flex-direction: column;
}
.beaver-widget.open .beaver-panel{ display:flex; }

.beaver-head{
  background: var(--graphite);
  color: var(--paper);
  padding: 12px 14px;
  display:flex; align-items:center; justify-content:space-between;
  flex-shrink: 0;
}
.beaver-head .who{ font-family: var(--display); text-transform: uppercase; font-size: 13px; letter-spacing: 0.03em; }
.beaver-head .tag{ display:block; font-family: var(--mono); font-size: 9px; color: var(--steel-soft); letter-spacing: 0.06em; text-transform:none; }
.beaver-close{ background:none; border:none; color: var(--paper); font-size:16px; cursor:pointer; line-height:1; padding:4px; }

.beaver-log{
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 14px;
  display:flex; flex-direction: column; gap: 10px;
  font-size: 13px;
}
.beaver-msg{ max-width: 92%; padding: 8px 10px; border: 1px solid var(--paper-line); line-height: 1.4; }
.beaver-msg.bot{ background: var(--white); align-self: flex-start; }
.beaver-msg.user{ background: var(--graphite); color: var(--paper); align-self: flex-end; border-color: var(--graphite); }

.beaver-input-row{
  display:flex; gap:6px;
  border-top: 1px solid var(--paper-line);
  padding: 10px;
  flex-shrink: 0;
}
.beaver-input-row input[type="text"]{
  flex: 1 1 auto;
  border: 1.5px solid var(--graphite);
  padding: 8px 10px;
  font-family: var(--body);
  font-size: 13px;
  background: var(--white);
}
.beaver-icon-btn{
  width: 34px; height: 34px;
  border: 1.5px solid var(--graphite);
  background: var(--white);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; padding:0; flex-shrink:0;
}
.beaver-icon-btn svg{ width:16px; height:16px; stroke: var(--graphite); fill:none; stroke-width:1.6; }
.beaver-icon-btn.active{ background: var(--amber-deep); border-color: var(--amber-deep); }
.beaver-icon-btn.active svg{ stroke: var(--graphite); }
.beaver-icon-btn[hidden]{ display:none; }

@media (max-width: 480px){
  .beaver-widget{ top: 82px; right: 12px; }
  .beaver-fab{ width: 104px; height: 104px; }
  .beaver-fab-flat{ width: 54px; height: 54px; }
  .beaver-panel{ width: calc(100vw - 24px); top: 114px; }
}

/* Netlify Forms spam honeypot — present in the DOM for bots, hidden for people */
.hp-field{ position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
