/* ==========================================================================
   Fibonacci Tecnologia — shared site stylesheet (site.css)

   TOKEN SYSTEM (all on :root, below the @font-face block)
   - Palette ......... --paper, --paper-2, --paper-3, --paper-4 (hover of paper-3),
                       --ink, --ink-60 (secondary text, AA on paper), --ink-45
                       (decorative / non-text only — fails AA as text),
                       --teal-900, --teal-700, --teal-500, --teal-tint,
                       --gold, --gold-soft, --gold-ink (gold-on-paper text),
                       --line, --line-2, and on-dark: --on-dark, --on-dark-82,
                       --on-dark-70, --on-dark-60, --on-dark-06, --on-dark-line.
   - Fonts ........... --sans (Inter Tight), --serif (EB Garamond), --mono (JetBrains Mono).
   - Type ramp ....... --fs-<px> where <px> is the desktop size. Sizes >= 19 are fluid
                       (clamp, scaling down to ~360px viewports); <= 15 are fixed.
                       Each page maps its approved scale onto ROLE tokens --t1..--t5 on
                       its body class, e.g. .page-home { --t1: var(--fs-88); ... }.
   - Spacing ......... --sp-<px> (4, 6, 8, 10, 12, 14, 16, 18, 20, 24, 28, 32, 40, 48, 56, 64, 72, 96, 120) fixed steps; --section-space (fluid vertical
                       rhythm between sections); --gutter (fluid side padding, 16px min).
   - Radius .......... --r-xs 4 · --r-sm 8 · --r-md 12 · --r-frame 16 · --r-lg 24 ·
                       --r-panel 28 · --r-pill 999px. Components read overridable
                       hooks: --btn-radius (default pill) and --frame-radius (default 16).
   - Layout .......... --container (1184px content width), --container-narrow (760px).
   - Motion .......... --ease, --dur. All motion is disabled under prefers-reduced-motion.

   PAGE CSS CONVENTION
   - Every page links /assets/css/site.css then /assets/css/<page>.css
     (home.css, plataforma.css, sob-medida.css, engenharia.css).
   - <body class="page-<page>"> scopes page rules; the page file starts by
     mapping --t1..--t5 (and, if approved, --btn-radius / --frame-radius).
   - Pages never hardcode a color, font stack, font size, space step or radius
     that a token here provides — reference the token instead.
   - Shared components defined here (do not restyle per page beyond token hooks):
     .skip-link · .wrap / .wrap--narrow · .section · .site-header / .site-nav /
     .logo / .nav-toggle / .nav-menu / .nav-links · .btn (+ --ink, --gold, --soft,
     --on-dark, --lg, --sm) · .wa-glyph · .screen (+ __bar, __dots, __label, __img,
     --phone, --bare) · .site-footer · .on-dark · .mono · .visually-hidden.
   ========================================================================== */

/* ---------- self-hosted fonts (latin subset, from Google Fonts) ---------- */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-italic-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/inter-tight-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light;

  /* palette */
  --paper: #f3efe7;
  --paper-2: #ebe6db;
  --paper-3: #e2dccf;
  --paper-4: #d8d1c2;
  --ink: #0a0f10;
  --ink-60: rgba(10, 15, 16, 0.62);
  --ink-45: rgba(10, 15, 16, 0.45);
  --teal-900: #0c2424;
  --teal-700: #143a3a;
  --teal-500: #226060;
  --teal-tint: rgba(34, 96, 96, 0.11);
  --gold: #b78a3e;
  --gold-soft: #d9b06a;
  --gold-ink: #6e4f1c;
  --gold-tint: rgba(183, 138, 62, 0.18);
  --line: rgba(10, 15, 16, 0.14);
  --line-2: rgba(10, 15, 16, 0.07);
  --on-dark: #f3efe7;
  --on-dark-82: rgba(243, 239, 231, 0.82);
  --on-dark-70: rgba(243, 239, 231, 0.72);
  --on-dark-60: rgba(243, 239, 231, 0.62);
  --on-dark-06: rgba(243, 239, 231, 0.06);
  --on-dark-line: rgba(243, 239, 231, 0.12);
  --focus: var(--teal-500);
  --focus-on-dark: var(--gold-soft);

  /* font stacks */
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* type ramp: named by desktop px; fluid from ~360px to 1280px viewports */
  --fs-96: clamp(2.875rem, 1.652rem + 5.435vw, 6rem);
  --fs-88: clamp(2.75rem, 1.674rem + 4.783vw, 5.5rem);
  --fs-80: clamp(2.625rem, 1.696rem + 4.13vw, 5rem);
  --fs-48: clamp(2.125rem, 1.783rem + 1.522vw, 3rem);
  --fs-40: clamp(1.875rem, 1.63rem + 1.087vw, 2.5rem);
  --fs-34: clamp(1.6875rem, 1.516rem + 0.761vw, 2.125rem);
  --fs-32: clamp(1.625rem, 1.478rem + 0.652vw, 2rem);
  --fs-22: clamp(1.1875rem, 1.114rem + 0.326vw, 1.375rem);
  --fs-21: clamp(1.125rem, 1.052rem + 0.326vw, 1.3125rem);
  --fs-20: clamp(1.09375rem, 1.0325rem + 0.272vw, 1.25rem);
  --fs-19: clamp(1.0625rem, 1.014rem + 0.217vw, 1.1875rem);
  --fs-15: 0.9375rem;
  --fs-14: 0.875rem;
  --fs-13: 0.8125rem;
  --fs-12: 0.75rem;
  --fs-11: 0.6875rem;

  /* default role scale (pages remap on their body class) */
  --t1: var(--fs-88);
  --t2: var(--fs-40);
  --t3: var(--fs-21);
  --t4: var(--fs-15);
  --t5: var(--fs-13);

  /* spacing steps */
  --sp-4: 4px;
  --sp-6: 6px;
  --sp-8: 8px;
  --sp-10: 10px;
  --sp-12: 12px;
  --sp-14: 14px;
  --sp-16: 16px;
  --sp-18: 18px;
  --sp-20: 20px;
  --sp-24: 24px;
  --sp-28: 28px;
  --sp-32: 32px;
  --sp-40: 40px;
  --sp-48: 48px;
  --sp-56: 56px;
  --sp-64: 64px;
  --sp-72: 72px;
  --sp-96: 96px;
  --sp-120: 120px;
  --section-space: clamp(72px, 4.5rem + 4vw, 120px);
  --gutter: clamp(16px, 4vw, 48px);

  /* radius steps */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-frame: 16px;
  --r-lg: 24px;
  --r-panel: 28px;
  --r-pill: 999px;
  --btn-radius: var(--r-pill);
  --frame-radius: var(--r-frame);

  /* layout */
  --container: 1184px;
  --container-narrow: 760px;
  --nav-height: 88px;
  --logo-size: 28px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 0.18s;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--sp-24); }
body { margin: 0; }
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

/* ---------- typography base ---------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t4);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }
strong, b { font-weight: 500; }
.mono { font-family: var(--mono); font-size: var(--t5); }
.serif { font-family: var(--serif); }

/* ---------- focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
.on-dark :focus-visible { outline-color: var(--focus-on-dark); }

/* ---------- utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--sp-16); top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: var(--sp-12) var(--sp-20); border-radius: var(--r-pill);
  font-size: var(--fs-15); font-weight: 500;
}
.skip-link:focus { top: var(--sp-16); }

/* containers and section rhythm */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.wrap--narrow { width: min(100% - 2 * var(--gutter), var(--container-narrow)); }
.section { padding-bottom: var(--section-space); }

/* dark surface helper: text + logo + focus switch to on-dark values */
.on-dark { background: var(--teal-900); color: var(--on-dark); }

/* ---------- logo (wordmark + gold dot) ---------- */
.logo {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--serif);
  font-size: var(--logo-size);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
}
.logo-dot {
  display: inline-block;
  width: 0.2em;
  height: 0.2em;
  margin-left: 0.12em;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
}
.on-dark .logo { color: var(--on-dark); }
.on-dark .logo-dot { background: var(--gold-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: var(--sp-14) var(--sp-24);
  border: 0;
  border-radius: var(--btn-radius);
  font-family: var(--sans);
  font-size: var(--fs-15);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
.btn--sm { padding: var(--sp-10) var(--sp-20); }
.btn--lg { padding: var(--sp-18) var(--sp-32); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--teal-900); }
.btn--gold { background: var(--gold); color: var(--ink); font-weight: 600; }
.btn--gold:hover { background: var(--gold-soft); }
.btn--soft { background: var(--paper-3); color: var(--ink); font-weight: 400; }
.btn--soft:hover { background: var(--paper-4); }
.btn--on-dark { background: var(--on-dark-06); color: var(--on-dark); font-weight: 400; }
.btn--on-dark:hover { background: var(--on-dark-line); }
.wa-glyph { width: 16px; height: 16px; flex: none; }

/* text link with arrow, used for "see more" style links */
.link-arrow {
  display: inline-flex; align-items: center; gap: var(--sp-8);
  color: var(--teal-700); font-weight: 500;
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}
.link-arrow:hover { color: var(--ink); }
.on-dark .link-arrow { color: var(--on-dark); }

/* ---------- header / nav ---------- */
.site-header { position: relative; z-index: 20; background: var(--paper); }
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-24);
  min-height: var(--nav-height);
}
.nav-menu { display: flex; align-items: center; gap: var(--sp-32); }
.nav-links { display: flex; align-items: center; gap: var(--sp-32); font-size: var(--fs-15); color: var(--ink-60); }
.nav-links a { padding-block: var(--sp-4); }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current] { color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.nav-toggle {
  display: none;
  align-items: center;
  gap: var(--sp-8);
  background: var(--paper-3);
  border: 0;
  border-radius: var(--r-pill);
  padding: var(--sp-10) var(--sp-16);
  font-size: var(--fs-15);
  cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before {
  display: block; width: 16px; height: 1.5px; background: currentColor; position: relative;
  transition: transform var(--dur) ease;
}
.nav-toggle__bars { margin-top: -5px; }
.nav-toggle__bars::before { content: ""; position: absolute; left: 0; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(-6px) rotate(-90deg); }

@media (max-width: 880px) {
  :root { --nav-height: 72px; --logo-size: 26px; }
  /* without JS the menu simply wraps under the logo */
  .site-nav { flex-wrap: wrap; padding-block: var(--sp-12); }
  .nav-menu { flex-wrap: wrap; gap: var(--sp-16) var(--sp-24); }
  .nav-links { flex-wrap: wrap; gap: var(--sp-8) var(--sp-24); }

  /* with JS: toggle + dropdown panel */
  .js .site-nav { flex-wrap: nowrap; padding-block: 0; }
  .js .nav-toggle { display: inline-flex; }
  .js .nav-menu {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: var(--sp-24);
    background: var(--paper);
    padding: var(--sp-8) var(--gutter) var(--sp-32);
    box-shadow: 0 1px 0 var(--line);
  }
  .js .nav-menu.is-open { display: flex; }
  .js .nav-links { flex-direction: column; align-items: stretch; gap: 0; font-size: var(--fs-21); color: var(--ink); }
  .js .nav-links a { display: block; padding-block: var(--sp-12); box-shadow: 0 1px 0 var(--line-2); }
  .js .nav-links a[aria-current] { box-shadow: 0 1px 0 var(--line-2); color: var(--teal-700); }
  .js .nav-menu .btn { align-self: flex-start; padding: var(--sp-14) var(--sp-24); }
}

/* ---------- screen frame (real product screenshots) ---------- */
/* <figure class="screen"><div class="screen__bar">…</div><img class="screen__img" …></figure> */
.screen {
  border-radius: var(--frame-radius);
  background: var(--paper-3);
  overflow: hidden;
  color: var(--ink);
}
.screen__bar {
  display: flex; align-items: center; gap: var(--sp-12);
  padding: var(--sp-10) var(--sp-16);
  background: var(--paper-3);
  font-size: var(--fs-12);
  color: var(--ink-60);
  min-height: 36px;
}
.screen__dots { display: flex; gap: var(--sp-6); flex: none; }
.screen__dots i { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.screen__label { font-family: var(--mono); font-size: var(--fs-12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen__img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 1440 / 900;
  object-fit: cover; object-position: top left;
  background: var(--paper-2);
}
.screen--bare .screen__bar { display: none; }
/* slot-sized crops (assets/screens/*-w|s|c|l.webp) keep their own ratio from width/height */
.screen picture { display: block; }
.screen__img--crop { aspect-ratio: auto; }
/* phone: ink bezel around a 390x844 capture */
.screen--phone {
  background: var(--ink);
  padding: 8px;
  border-radius: 36px;
  max-width: 280px;
}
.screen--phone .screen__img { aspect-ratio: 390 / 844; border-radius: 28px; }
.screen__caption { font-size: var(--fs-13); color: var(--ink-60); margin-top: var(--sp-12); }
.on-dark .screen__caption { color: var(--on-dark-60); }

/* ---------- footer ---------- */
.site-footer { background: var(--paper-2); padding: var(--sp-56) 0 var(--sp-40); font-size: var(--fs-15); }
.footer-grid { display: grid; grid-template-columns: 4fr 2fr 2fr 2fr 2fr; gap: var(--sp-32); }
.footer-brand .logo { font-size: var(--logo-size); }
.footer-tagline { font-family: var(--serif); font-style: italic; font-size: var(--fs-21); line-height: 1.35; color: var(--teal-700); margin-top: var(--sp-16); max-width: 22ch; }
.footer-title { font-size: var(--fs-13); font-weight: 500; color: var(--ink-60); margin-bottom: var(--sp-12); }
.footer-col li { color: var(--ink-60); }
/* 3px block padding replaces the 6px item gap: same rhythm, 24px+ touch targets */
.footer-col a { display: inline-block; padding-block: 3px; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  margin-top: var(--sp-48);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-8) var(--sp-24);
  font-size: var(--fs-13); color: var(--ink-60);
}
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-40) var(--sp-24); }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
