/* Portfólio como um relatório em modo design: faixas de seção, régua, grade de pontos. */

:root {
  --paper: #eef1f4;
  --sheet: #f9fbfc;
  --band: #dde4ea;
  --ink: #11243a;
  --muted: #55677b;
  --rule: rgba(17, 36, 58, 0.2);
  --rule-soft: rgba(17, 36, 58, 0.1);
  --dot: rgba(17, 36, 58, 0.16);
  --accent: #e4541b;
  --accent-ink: #b23f0e;

  --display: "Bahnschrift", "DIN Alternate", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b141d;
    --sheet: #111e2b;
    --band: #172533;
    --ink: #dfe8f1;
    --muted: #8fa1b4;
    --rule: rgba(223, 232, 241, 0.22);
    --rule-soft: rgba(223, 232, 241, 0.1);
    --dot: rgba(223, 232, 241, 0.13);
    --accent: #ff7a47;
    --accent-ink: #ff8d61;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0b141d;
  --sheet: #111e2b;
  --band: #172533;
  --ink: #dfe8f1;
  --muted: #8fa1b4;
  --rule: rgba(223, 232, 241, 0.22);
  --rule-soft: rgba(223, 232, 241, 0.1);
  --dot: rgba(223, 232, 241, 0.13);
  --accent: #ff7a47;
  --accent-ink: #ff8d61;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 16px 16px;
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover { color: var(--accent-ink); }

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

::selection { background: var(--accent); color: #fff; }

.wrap {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
}
.skip:focus { top: 12px; }

/* --- PH: cabeçalho da página ------------------------------------------------ */

.ph {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
}

.ph__bar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 52px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 0.84rem var(--mono);
  text-decoration: none;
}
.brand:hover { color: inherit; }
.brand b { color: var(--accent-ink); font-weight: 600; }
.brand__top { fill: var(--accent); }

.ph__nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 0.95rem;
}
.ph__nav a { text-decoration: none; }
.ph__nav a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

.ph__tools { display: flex; gap: 6px; }

.tool {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font: 600 0.72rem var(--mono);
  cursor: pointer;
}
.tool:hover { border-color: var(--ink); }

/* Régua do designer: traço fino a cada 8px, médio a cada 40px, forte a cada 80px. */
.ruler {
  height: 14px;
  border-block: 1px solid var(--rule);
  background-color: var(--sheet);
  background-image:
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(90deg, var(--muted) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 8px);
  background-size: 100% 100%, 100% 8px, 100% 4px;
  background-position: 0 0, 0 100%, 0 100%;
  background-repeat: no-repeat;
}

/* --- Faixas de seção, como no designer de relatórios --------------------------- */

.band {
  background: var(--band);
  border-block: 1px solid var(--rule);
  font: 400 0.76rem var(--mono);
  color: var(--muted);
}
.band__in {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}
.band__code {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 18px;
  padding: 0 5px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}
.band--thin { background: transparent; border-top-style: dashed; }
.band--thin .band__code {
  background: transparent;
  color: var(--ink);
  outline: 1px solid var(--rule);
  outline-offset: -1px;
}

/* --- RH: abertura ------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px;
  align-items: center;
  padding-block: clamp(36px, 6vh, 72px);
}

h1, h2, h3 {
  font-family: var(--display);
  font-stretch: 82%;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.9rem, 6.6vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: -0.012em;
  text-transform: uppercase;
}

/* O nome como um objeto selecionado no designer: moldura e oito alças. */
.selected {
  position: relative;
  display: inline-block;
  padding: 0.16em 0.2em 0.08em;
  border: 1px solid var(--accent);
}
.selected::after {
  content: "";
  position: absolute;
  inset: -4px;
  pointer-events: none;
  --h: linear-gradient(var(--accent), var(--accent));
  background:
    var(--h) 0 0, var(--h) 50% 0, var(--h) 100% 0,
    var(--h) 0 50%, var(--h) 100% 50%,
    var(--h) 0 100%, var(--h) 50% 100%, var(--h) 100% 100%;
  background-size: 7px 7px;
  background-repeat: no-repeat;
}

.lead {
  margin-top: 30px;
  max-width: 30ch;
  font-size: clamp(1.15rem, 1.6vw, 1.38rem);
  line-height: 1.45;
}

/* --- Figura 3D ---------------------------------------------------------------- */

.stage { position: relative; min-width: 0; }

.stage__view {
  position: relative;
  height: clamp(440px, 68vh, 640px);
}
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: grab;
}
.stage canvas.is-dragging { cursor: grabbing; }

.stage__leaders {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
}
.stage__leaders path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  opacity: 0.55;
}
.stage__leaders circle { fill: var(--ink); }
.stage__leaders .is-hot { stroke: var(--accent); opacity: 1; }
.stage__leaders circle.is-hot { fill: var(--accent); stroke: none; }

.layers {
  display: grid;
  border-top: 1px solid var(--rule);
}
.layers li {
  display: grid;
  grid-template-columns: 30px 1fr;
  column-gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}
.layers i {
  grid-row: span 2;
  font: 400 0.72rem/1.9 var(--mono);
  color: var(--muted);
}
.layers b {
  font: 700 1.05rem/1.25 var(--display);
  font-stretch: 86%;
}
.layers span {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

/* Em telas largas a lista vira as chamadas da vista explodida, posicionadas pelo script. */
.stage--callouts .stage__leaders { display: block; }
.stage--callouts .layers {
  position: absolute;
  inset: 0;
  display: block;
  border: 0;
  pointer-events: none;
}
.stage--callouts .layers li {
  position: absolute;
  left: 0;
  top: 0;
  width: 34%;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: auto;
  cursor: default;
  will-change: transform;
}
.stage--callouts .layers li.is-hot b,
.stage--callouts .layers li.is-hot i { color: var(--accent-ink); }

.stage--off .stage__view { display: none; }

/* --- Títulos de seção --------------------------------------------------------- */

h2 {
  padding-block: clamp(40px, 7vh, 72px) clamp(22px, 3.4vh, 36px);
  font-size: clamp(2.1rem, 4.4vw, 3.3rem);
  line-height: 0.95;
  text-transform: uppercase;
}

/* --- D: projetos, um registro por linha ---------------------------------------- */

.details { padding-bottom: 28px; }

.detail {
  display: grid;
  grid-template-columns: 52px minmax(0, 4fr) minmax(0, 7fr);
  gap: 28px;
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
}

.detail__code {
  align-self: start;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 24px;
  border: 1px solid var(--rule);
  background: var(--sheet);
  font: 600 0.74rem var(--mono);
}

.detail h3 {
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  line-height: 1;
}
.kind {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.4;
}

.detail__body > p:first-child { font-size: 1.1rem; line-height: 1.5; }
.detail__body ul { margin-top: 14px; }
.detail__body li {
  position: relative;
  padding: 6px 0 6px 20px;
  line-height: 1.5;
  color: var(--muted);
}
.detail__body li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.1em;
  width: 8px;
  height: 1px;
  background: var(--ink);
}
.stack {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  font-size: 0.9rem;
  color: var(--muted);
}

/* Os demais projetos, numa tabela de relatório. */
.others {
  width: 100%;
  margin-top: 40px;
  border-collapse: collapse;
  background: var(--sheet);
  border: 1px solid var(--rule);
}
.others caption {
  padding-bottom: 14px;
  text-align: left;
  font: 700 1.5rem/1 var(--display);
  font-stretch: 86%;
}
.others th, .others td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule-soft);
}
.others tr:last-child > * { border-bottom: 0; }
.others th { width: 17%; font-weight: 600; white-space: nowrap; }
.others td { color: var(--muted); }
.others td:last-child { width: 24%; font-size: 0.9rem; }

/* --- GF1: o total do grupo, como num rodapé de relatório ------------------------ */

.total {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 18px;
  padding-block: 18px 56px;
  color: var(--muted);
}
.total b {
  min-width: 3ch;
  padding: 2px 8px;
  border-top: 1px solid var(--ink);
  border-bottom: 3px double var(--ink);
  text-align: right;
  font: 700 1.5rem/1.2 var(--display);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* --- GH2: como trabalho -------------------------------------------------------- */

.method {
  counter-reset: passo;
  max-width: 50rem;
  padding-bottom: clamp(44px, 8vh, 80px);
}
.method li {
  counter-increment: passo;
  display: grid;
  grid-template-columns: 52px 1fr;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  line-height: 1.5;
  color: var(--muted);
}
.method li::before {
  content: counter(passo);
  grid-row: span 2;
  font: 700 1.5rem/1.1 var(--display);
  color: var(--accent-ink);
}
.method b { font-weight: 600; color: var(--ink); }
.method span { grid-column: 2; }

/* --- RF: contato --------------------------------------------------------------- */

.contact { padding-bottom: clamp(48px, 9vh, 96px); }
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  font-size: 1.3rem;
}

/* --- PF: rodapé da página ------------------------------------------------------ */

.pf__in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  padding-block: 16px 26px;
  font-size: 0.86rem;
  color: var(--muted);
}

/* --- Telas menores ------------------------------------------------------------- */

@media (max-width: 1179px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

@media (max-width: 899px) {
  .stage__view { height: clamp(340px, 52vh, 460px); }
}

@media (max-width: 680px) {
  .wrap { width: min(1180px, 100% - 32px); }
  .ph__nav { display: none; }
  .ph__tools { margin-left: auto; }
  .detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 26px 0;
  }
  .method li { grid-template-columns: 38px 1fr; }
  .others tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); }
  .others tr:last-child { border-bottom: 0; }
  .others th, .others td { display: block; width: auto !important; padding: 2px 0; border: 0; white-space: normal; }
}

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

@media print {
  .ph, .stage__view { display: none; }
  body { background: #fff; }
}
