/*
  Gami Development — concept design system (shared by every prototype in /concept).
  Load fonts in the page <head>:
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geologica:slnt,wght,CRSV,SHRP@-12..0,100..900,0..1,0..100&family=Martian+Mono:wdth,wght@75..112.5,100..800&family=Science+Gothic:wdth,wght@50..200,100..900&display=swap">
  Colour values are sampled from assets/brand/brand-texture.jpg (provisional until official values arrive).
*/

:root {
  /* Surfaces: the room */
  --ink: #0B0D10;
  --ink-2: #111317;
  --bezel: #16181D;
  --edge: rgba(250, 239, 239, .10);
  --edge-2: rgba(250, 239, 239, .18);

  /* Text */
  --text: #F5F0EE;
  --text-2: #ADA3A2;
  --text-3: #857B7B;

  /* Paper */
  --paper: #FAEFEF;
  --paper-2: #F0DCDE;
  --paper-ink: #1A1714;
  --paper-ink-2: #5E5150;

  /* Light (from the brand texture) */
  --gold: #FF9AA0;
  --amber: #FF9A8C;
  --orange: #FF8A7A;
  --crimson: #E0457E;
  --red: #FF6F96;
  --plum: #52183F;
  --deep-blue: #034772;

  /* Accents */
  --signal: #FF5277;
  --spill: 255 110 140;          /* runtime: colour sampled from client footage, as "r g b" */
  --focus: #FF8FA8;

  /* Type */
  --f-display: "Geologica", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-label: "Science Gothic", "Geologica", ui-sans-serif, system-ui, sans-serif;
  --f-mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --t-h1: clamp(2.75rem, 1rem + 5.2vw, 5.75rem);
  --t-h2: clamp(2.1rem, 1rem + 3.2vw, 4rem);
  --t-h3: 1.5rem;
  --t-stat: clamp(3rem, 1.5rem + 5vw, 6.5rem);
  --t-lede: 1.25rem;
  --t-body: 1.0625rem;
  --t-small: .875rem;
  --t-label: .71875rem;   /* 11.5px */
  --t-mono: .78rem;       /* ~12.5px */

  /* Geometry: radius 0 everywhere; one 45° chamfer at the top-right, like the texture's folded corner */
  --ch-btn: 8px;
  --ch-chip: 14px;
  --ch-frame: 24px;

  /* Layout */
  --gutter: 24px;
  --margin: clamp(16px, 3.4vw, 48px);
  --maxw: 1440px;
  --header-h: 64px;

  /* Motion */
  --ease-fold: cubic-bezier(.65, 0, .35, 1);   /* DOBRA: paper resists, then gives */
  --ease-out: cubic-bezier(.22, 1, .36, 1);    /* UI: ease-out-quint */
  --d-fold: 560ms;
  --d-crease: 600ms;
  --d-ui: 200ms;
  --d-corner: 240ms;

  --grain-url: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='256' height='256'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 1.2 -.1'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text-2);
  font-family: var(--f-display);
  font-size: var(--t-body);
  font-weight: 380;
  line-height: 1.6;
  font-variation-settings: "SHRP" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
}
img, video, canvas, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--signal); color: var(--paper); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.on-paper :focus-visible { outline-color: var(--signal); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Light + grain ---------- */
/* Static CSS version of the brand light (also the first paint before the WebGL light boots). */
.g-light {
  background:
    radial-gradient(ellipse 58% 48% at 12% 104%, rgba(255,132,118,.38), rgba(255,88,140,.24) 38%, rgba(222,50,126,.12) 62%, transparent 78%),
    radial-gradient(ellipse 46% 36% at 48% 96%, rgba(255,140,182,.18), transparent 72%),
    radial-gradient(ellipse 70% 55% at 30% 90%, rgba(70,16,58,.34), transparent 76%),
    radial-gradient(ellipse 42% 40% at 92% -4%, rgba(3,71,114,.46), transparent 72%),
    var(--ink);
}
.g-light-fixed { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
.g-grain::after, .g-grain-layer {
  content: "";
  position: fixed; inset: -50%;
  z-index: 50;
  pointer-events: none;
  background-image: var(--grain-url);
  background-size: 256px 256px;
  opacity: .07;
  mix-blend-mode: overlay;
}
.g-grain-local { position: relative; isolation: isolate; }
.g-grain-local::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--grain-url); background-size: 256px 256px;
  opacity: .10; mix-blend-mode: multiply;
}

/* ---------- Type ---------- */
.g-display, .g-h1, .g-h2, .g-h3, .g-stat {
  font-family: var(--f-display);
  font-weight: 620;
  color: var(--text);
  font-variation-settings: "SHRP" 100;
  text-wrap: balance;
  margin: 0;
}
.g-h1 { font-size: var(--t-h1); line-height: .94; letter-spacing: -.04em; max-width: 16ch; }
.g-h2 { font-size: var(--t-h2); line-height: .98; letter-spacing: -.032em; max-width: 18ch; }
.g-h3 { font-size: var(--t-h3); line-height: 1.15; letter-spacing: -.015em; }
.g-stat { font-size: var(--t-stat); line-height: .9; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.g-lede { font-size: var(--t-lede); line-height: 1.45; color: var(--text-2); max-width: 46ch; margin: 0; text-wrap: pretty; }
.g-body { max-width: 62ch; text-wrap: pretty; }
.g-eyebrow, .g-label {
  font-family: var(--f-label);
  font-stretch: 150%;
  font-weight: 500;
  font-size: var(--t-label);
  letter-spacing: .32em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--text-3);
  margin: 0;
}
.g-eyebrow { color: var(--text-2); }
.g-mono {
  font-family: var(--f-mono);
  font-stretch: 87.5%;
  font-size: var(--t-mono);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.on-paper { color: var(--paper-ink-2); }
.on-paper .g-h1, .on-paper .g-h2, .on-paper .g-h3, .on-paper .g-display { color: var(--paper-ink); }
.on-paper .g-eyebrow, .on-paper .g-label, .on-paper .g-mono { color: var(--paper-ink-2); }

/* Pending / placeholder marker — honesty is part of the polish */
.g-pending {
  font-family: var(--f-mono); font-stretch: 87.5%;
  font-size: .72em; font-weight: 500; letter-spacing: 0;
  color: var(--gold);
  border: 1px dashed rgba(255,163,168,.45);
  padding: .05em .45em; white-space: nowrap; vertical-align: .1em;
}
.on-paper .g-pending { color: #B3263E; border-color: rgba(179,38,62,.45); }

/* Tally dot (the "na tela" signal) */
.g-tally { display: inline-block; width: 7px; height: 7px; background: var(--signal); vertical-align: .08em; }

/* ---------- Chamfer (45°, top-right) ---------- */
.g-chamfer { clip-path: polygon(0 0, calc(100% - var(--ch, 14px)) 0, 100% var(--ch, 14px), 100% 100%, 0 100%); }

/* ---------- Buttons ---------- */
.g-btn {
  --ch: var(--ch-btn);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 48px; padding: 0 22px;
  font-family: var(--f-label); font-stretch: 130%; font-weight: 600;
  font-size: .75rem; letter-spacing: .2em; text-transform: uppercase;
  border: 0; cursor: pointer; background: none; white-space: nowrap;
  color: var(--text);
  clip-path: polygon(0 0, calc(100% - var(--ch)) 0, 100% var(--ch), 100% 100%, 0 100%);
  transition: transform 120ms var(--ease-out), color var(--d-ui) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.g-btn::before { /* 1px edge drawn by the parent fill, face inset by 1px */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: var(--edge-2);
}
.g-btn::after {
  content: ""; position: absolute; inset: 1px; z-index: -1;
  background: var(--ink);
  clip-path: polygon(0 0, calc(100% - var(--ch) + .4px) 0, 100% calc(var(--ch) - .4px), 100% 100%, 0 100%);
  transition: background var(--d-ui) var(--ease-out);
}
.g-btn:hover::after { background: #17191E; }
.g-btn:active { transform: scale(.98); }
.g-btn--primary { color: var(--paper-ink); }
.g-btn--primary::before { background: var(--signal); }            /* the corner reads signal red */
.g-btn--primary::after { background: var(--paper); clip-path: polygon(0 0, calc(100% - var(--ch) - 5px) 0, 100% calc(var(--ch) + 5px), 100% 100%, 0 100%); inset: 0; }
.g-btn--primary:hover::after { background: #FFF8EA; }
.g-btn .g-arrow { font-family: var(--f-display); letter-spacing: 0; font-size: 1.1em; transition: transform var(--d-ui) var(--ease-out); }
.g-btn:hover .g-arrow { transform: translateX(3px); }

/* ---------- Screen frame (client work lives here) ---------- */
.g-frame-wrap { position: relative; filter: drop-shadow(0 0 60px rgb(var(--spill) / .35)); transition: filter 400ms linear; }
.g-frame {
  --ch: var(--ch-frame);
  position: relative;
  background: var(--bezel);
  padding: 8px;
  clip-path: polygon(0 0, calc(100% - var(--ch)) 0, 100% var(--ch), 100% 100%, 0 100%);
}
.g-frame::before { /* gold→red top hairline: the only place warm light touches a surface */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; z-index: 2;
  background: linear-gradient(90deg, rgba(255,163,168,.0), var(--gold) 18%, var(--red) 82%, rgba(255,111,150,0));
}
.g-frame::after { /* inner top highlight of paper at 8% */
  content: ""; position: absolute; inset: 8px 8px auto 8px; height: 1px; background: rgba(250,239,239,.08); z-index: 2;
}
.g-frame > video, .g-frame > img, .g-frame > canvas { width: 100%; height: 100%; object-fit: cover; background: #000; }

/* ---------- Chip / sheet ---------- */
.g-chip {
  --ch: var(--ch-chip);
  display: grid; place-items: center;
  background: var(--ink-2);
  outline: 1px solid var(--edge);
  outline-offset: -1px;
  clip-path: polygon(0 0, calc(100% - var(--ch)) 0, 100% var(--ch), 100% 100%, 0 100%);
}
.g-chip--paper { background: var(--paper); }

/* Corner fold on hover/focus: put .g-fold on a positioned element; content of the cream back goes in .g-fold__back */
.g-fold { --fold: 72px; position: relative; }
.g-fold__flap {
  position: absolute; top: 0; right: 0; width: var(--fold); height: var(--fold); z-index: 3;
  pointer-events: none;
  background: linear-gradient(225deg, transparent 50%, var(--paper-2) 50%, var(--paper) 78%);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  transform-origin: 0 100%;
  transform: scale(0);
  transition: transform var(--d-corner) var(--ease-out);
  filter: drop-shadow(-6px 6px 10px rgba(0,0,0,.45));
}
.g-fold:hover .g-fold__flap, .g-fold:focus-visible .g-fold__flap, .g-fold:focus-within .g-fold__flap { transform: scale(1); }

/* ---------- Header ---------- */
.g-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--margin);
  background: linear-gradient(to bottom, rgba(11,13,16,.92), rgba(11,13,16,.72));
  -webkit-backdrop-filter: saturate(1.2); backdrop-filter: saturate(1.2);
  border-bottom: 1px solid var(--edge);
}
.g-header__logo img { width: 132px; height: auto; }
.g-header__nav { display: flex; gap: 28px; }
.g-header__nav a { font-family: var(--f-label); font-stretch: 150%; font-weight: 500; font-size: var(--t-label); letter-spacing: .32em; text-transform: uppercase; color: var(--text-2); transition: color var(--d-ui) var(--ease-out); }
.g-header__nav a:hover { color: var(--text); }
@media (max-width: 1023px) { .g-header__nav { display: none; } }

/* ---------- Layout ---------- */
.g-wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--margin); }
.g-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); }
.g-section { padding-block: clamp(80px, 12vw, 176px); position: relative; }
.g-stack > * + * { margin-top: var(--s, 24px); }

/* ---------- Demo chrome (bridgemind-style honesty bar) ---------- */
.g-demo-chrome {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  font: 12px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #B0ADA6;
  padding: 10px 2px;
}
.g-demo-chrome__left { display: flex; align-items: center; gap: 8px; }
.g-demo-chrome__left .dot { width: 6px; height: 6px; background: var(--signal); border-radius: 0; }
.g-demo-chrome__left .dim { color: var(--text-3); }
.g-demo-chrome__right { display: flex; gap: 16px; }
.g-demo-chrome button { background: none; border: 0; padding: 4px 0; cursor: pointer; color: #B0ADA6; display: inline-flex; gap: 6px; align-items: center; }
.g-demo-chrome button:hover { color: var(--text); }

/* ---------- Concept-book navigation bar (not part of the site design) ---------- */
.cb-bar {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 2px;
  font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: rgba(20,21,25,.86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px; padding: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  color: #C9C5BD;
}
.cb-bar a, .cb-bar span { padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.cb-bar a:hover { background: rgba(255,255,255,.07); color: #fff; }
.cb-bar .cb-now { color: #fff; }
.cb-bar .cb-sep { width: 1px; height: 16px; padding: 0; background: rgba(255,255,255,.12); }
.cb-bar .cb-hero { display: inline-flex; align-items: center; gap: 0; padding: 0 0 0 10px; color: #8e8a85; }
.cb-bar .cb-hero a { padding: 8px 9px; }
.cb-bar .cb-hero a[aria-current="true"] { color: #fff; background: rgba(255,82,119,.28); }
@media (max-width: 640px) {
  .cb-bar .cb-title { display: none; }
  .cb-bar { max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; font-size: 11px; }
  .cb-bar::-webkit-scrollbar { display: none; }
  .cb-bar a, .cb-bar span { padding: 8px 9px; }
}

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

/* Round 3 — less noise: "a confirmar" marks are hidden by default; the draft bar's "Pendências" toggle shows them for review. */
html:not([data-pending="on"]) .g-pending { display: none !important; }
