/* =========================================================
   PÁGINAS DE PROJETO — pasta ferramentas/
   (sites-sistemas.html, ferramentas/ControlID.html)
   Abertura animada, projeto em destaque com ilustração,
   etapas, blocos de detalhes e chamada para contato.
   ========================================================= */

.ss-page { max-width: 1180px; margin: 0 auto; padding: 8.5rem 2rem 5rem; }

/* ---------- abertura ---------- */
.ss-hero { position: relative; padding: 2rem 0 4rem; overflow: hidden; }
.ss-hero-grid {
  position: absolute; inset: -40px -10% 0; z-index: -1; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 39px, color-mix(in srgb, var(--gray) 12%, transparent) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, color-mix(in srgb, var(--gray) 12%, transparent) 39px 40px);
  mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 70%);
  animation: ss-grid-in .6s ease both;
}
.ss-hero h1 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; line-height: 1;
  font-size: clamp(3rem, 9vw, 7rem); margin: .5rem 0 1.25rem;
}
.ss-hero h1 .ss-line { display: block; overflow: hidden; }
.ss-hero h1 .ss-line > span { display: inline-block; animation: ss-rise .5s var(--ease-out) both; }
.ss-hero h1 .ss-line:nth-child(2) > span { animation-delay: .06s; }
.ss-hero .ss-intro { color: var(--gray); font-size: 1.05rem; line-height: 1.75; max-width: 560px; animation: ss-fade .4s var(--ease-out) .12s both; }
.ss-hero .section-label { animation: ss-fade .4s var(--ease-out) both; }

@keyframes ss-rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes ss-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ss-grid-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }

/* ---------- projeto em destaque ---------- */
.ss-project {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: center;
  background: var(--mid); border: 1px solid var(--border); border-radius: 1.75rem;
  padding: 2.5rem; position: relative; overflow: hidden;
  animation: ss-fade .4s var(--ease-out) .18s both;
}
.ss-project-art {
  border-radius: 1.25rem; border: 1px solid var(--border); overflow: hidden;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), #0b0c0f;
  aspect-ratio: 4 / 3; color: #e5a963;
}
.ss-project-art svg { width: 100%; height: 100%; display: block; }

.ss-status {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: .4rem .85rem; border-radius: 2rem;
}
.ss-status::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow); animation: ss-ping 1.8s ease-out infinite;
}
@keyframes ss-ping { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.75); } }

.ss-project h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin: 1rem 0 .75rem; }
.ss-project p { color: var(--gray); line-height: 1.75; font-size: .97rem; }
.ss-features { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1.25rem; margin: 1.5rem 0; }
.ss-features li { font-size: .88rem; color: var(--cream); display: flex; gap: .55rem; align-items: baseline; }
.ss-features li::before { content: '—'; color: var(--accent); }

/* etapas */
.ss-steps { list-style: none; display: flex; flex-wrap: wrap; gap: .9rem .5rem; margin: 1.75rem 0 .5rem; }
.ss-steps li { flex: 1 1 auto; min-width: max-content; } /* cada etapa tem pelo menos a largura do nome */
.ss-steps li i { display: block; height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; position: relative; }
.ss-steps li.done i { background: var(--accent); }
.ss-steps li.now i::after {
  content: ''; position: absolute; inset: 0; width: 45%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: ss-progress 1.6s ease-in-out infinite;
}
@keyframes ss-progress { from { transform: translateX(-100%); } to { transform: translateX(230%); } }
.ss-steps li span { display: block; margin-top: .55rem; font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gray); }
.ss-steps li.now span { color: var(--accent); }

/* ---------- blocos de detalhes (Problema, Solução, Próximos passos) ---------- */
.ss-blocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.5rem; padding: 0; } /* padding: 0 anula o espaçamento padrão de <section> */
.ss-block {
  background: var(--mid); border: 1px solid var(--border); border-radius: 1.5rem; padding: 2rem;
  animation: ss-fade .4s var(--ease-out) both;
}
.ss-block:nth-child(1) { animation-delay: .6s; }
.ss-block:nth-child(2) { animation-delay: .7s; }
.ss-block:nth-child(3) { animation-delay: .8s; }
.ss-block span { font-family: var(--mono); font-size: .72rem; color: var(--accent); letter-spacing: .1em; }
.ss-block h3 { font-size: 1.15rem; font-weight: 700; margin: .6rem 0 .75rem; }
.ss-block p, .ss-block li { color: var(--gray); line-height: 1.7; font-size: .92rem; }
.ss-block ul { list-style: none; margin-top: .75rem; display: grid; gap: .5rem; }
.ss-block li { display: flex; gap: .55rem; }
.ss-block li::before { content: '—'; color: var(--accent); }
body.light-theme .ss-block { box-shadow: 0 1px 2px rgba(30, 50, 45, 0.04), 0 8px 24px rgba(30, 50, 45, 0.06); }

.ss-acesso { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin: 1.5rem 0; }
.ss-acesso span { color: var(--gray); font-size: .88rem; line-height: 1.4; flex: 1 1 200px; }

.tm-project + .ss-project, .ss-project + .ss-project { margin-top: 1.5rem; }
.ss-portaria { display: grid; place-items: center; padding: 2rem; }
.ss-portaria svg { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- próximos projetos / chamada final ---------- */
.ss-next {
  margin-top: 1.5rem; padding: 2rem 2.5rem; border-radius: 1.75rem;
  border: 1.5px dashed var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  animation: ss-fade .4s var(--ease-out) .24s both;
}
.ss-next p { color: var(--gray); }
.ss-next strong { display: block; color: var(--cream); font-size: 1.1rem; margin-bottom: .25rem; }

/* ---------- ilustração do Control iD (leitor → servidor) ---------- */
.cid-art .scan-line { animation: cid-scan 2.6s ease-in-out infinite; }
@keyframes cid-scan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(58px); } }
.cid-art .log-line { opacity: 0; animation: cid-log 4.8s ease-in-out infinite; }
.cid-art .log-line:nth-of-type(2) { animation-delay: .8s; }
.cid-art .log-line:nth-of-type(3) { animation-delay: 1.6s; }
.cid-art .log-line:nth-of-type(4) { animation-delay: 2.4s; }
@keyframes cid-log { 0% { opacity: 0; transform: translateX(-8px); } 12%, 80% { opacity: 1; transform: none; } 95%, 100% { opacity: 0; } }

/* ---------- ilustração da fábrica ---------- */
.ss-factory .belt-box { animation: ss-belt 4s linear infinite; }
.ss-factory .belt-box.b2 { animation-delay: -1.33s; }
.ss-factory .belt-box.b3 { animation-delay: -2.66s; }
@keyframes ss-belt { from { transform: translateX(-60px); opacity: 0; } 10%, 85% { opacity: 1; } to { transform: translateX(260px); opacity: 0; } }
.ss-factory .smoke { animation: ss-smoke 3.2s ease-out infinite; transform-origin: center; }
.ss-factory .smoke.s2 { animation-delay: 1.1s; }
.ss-factory .smoke.s3 { animation-delay: 2.2s; }
@keyframes ss-smoke { 0% { transform: translate(0, 0) scale(.5); opacity: 0; } 25% { opacity: .55; } 100% { transform: translate(16px, -26px) scale(1.5); opacity: 0; } }
.ss-factory .belt-line { stroke-dasharray: 6 6; animation: ss-dash .6s linear infinite; }
@keyframes ss-dash { to { stroke-dashoffset: -12; } }
.ss-factory .draw-in { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ss-draw 1.6s cubic-bezier(.65, 0, .35, 1) var(--d, .6s) forwards; }
@keyframes ss-draw { to { stroke-dashoffset: 0; } }

@media (max-width: 900px) {
  .ss-page { padding: 7rem 1.25rem 4rem; }
  .ss-project { grid-template-columns: 1fr; padding: 1.5rem; gap: 2rem; }
  .ss-features { grid-template-columns: 1fr; }
  .ss-blocks { grid-template-columns: 1fr; }
  .ss-next { padding: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ss-page *, .ss-page *::before, .ss-page *::after { animation: none !important; }
  .ss-factory .draw-in { stroke-dashoffset: 0; }
}

/* a ilustração tem fundo sempre escuro: linhas cinzas claras nos dois temas */
.ss-project-art .ill .g { stroke: rgba(245, 240, 232, .3); opacity: 1; }

/* links diretos para um projeto (sites-sistemas.html#portaria) não ficam atrás do menu */
.ss-project { scroll-margin-top: 6rem; }
