/* =========================================================
   DTI – Departamento de Tecnologia da Informação
   Prefeitura Municipal de Soledade/RS
   ========================================================= */

:root {
  --bg: #0a0f1c;
  --bg-2: #0f1626;
  --surface: #131c2f;
  --surface-2: #18233a;
  --border: #22304d;
  --border-strong: #2f4166;
  --text: #e6ecf5;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #22d3a6;
  --accent-2: #38bdf8;
  --accent-soft: rgba(34, 211, 166, .12);
  --accent-2-soft: rgba(56, 189, 248, .12);
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, .6);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --header-h: 68px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .2s;
}

a:hover {
  color: var(--accent-2);
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.accent {
  color: var(--accent);
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(10, 15, 28, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}

.header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 15, 28, .92);
}

.header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 36px;
  height: 36px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: .02em;
}

.brand-text strong .cursor {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

.brand-text small {
  font-size: 12px;
  color: var(--text-muted);
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  background: var(--surface);
}

.nav a.active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.nav a.nav-cta {
  color: var(--bg);
  background: var(--accent);
  font-weight: 600;
  margin-left: 8px;
}

.nav a.nav-cta:hover {
  background: var(--accent-2);
  color: var(--bg);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 991px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 20px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: all .2s;
  }

  .nav.open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav ul {
    flex-direction: column;
    align-items: stretch;
  }

  .nav a {
    padding: 12px;
  }

  .nav a.nav-cta {
    margin: 8px 0 0;
    justify-content: center;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 48px) 0 64px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .35;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%);
}

.hero::after {
  content: "";
  position: absolute;
  width: 700px;
  height: 700px;
  top: -200px;
  right: -200px;
  background: radial-gradient(circle, rgba(34, 211, 166, .18), transparent 60%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(34, 211, 166, .6);
  animation: pulse 2s infinite;
}

.hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  font-weight: 800;
  margin: 22px 0 18px;
}

.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.typed-line {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-muted);
  min-height: 1.6em;
  margin-bottom: 18px;
}

.typed-line .prompt {
  color: var(--accent);
}

.typed-line .caret {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}

.hero p.lead {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 560px;
  margin: 0 0 32px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform .15s, background .2s, border-color .2s, color .2s;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-2);
  color: var(--bg);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(19, 28, 47, .6);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Terminal */
.terminal {
  background: #0b1222;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px rgba(34, 211, 166, .05), 0 30px 80px -30px rgba(34, 211, 166, .25);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13.5px;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.term-bar .d {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.term-bar .d:nth-child(1) { background: #ff5f57; }
.term-bar .d:nth-child(2) { background: #febc2e; }
.term-bar .d:nth-child(3) { background: #28c840; }

.term-bar .title {
  margin-left: auto;
  margin-right: auto;
  color: var(--text-dim);
  font-size: 12px;
  padding-right: 52px;
}

.term-body {
  padding: 18px 20px 22px;
  line-height: 1.85;
  min-height: 300px;
}

.term-body .ln {
  white-space: pre-wrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s, transform .3s;
}

.term-body .ln.show {
  opacity: 1;
  transform: none;
}

.term-body .cmd { color: var(--text); }
.term-body .cmd::before { content: "dti@soledade:~$ "; color: var(--accent); }
.term-body .ok { color: var(--text-muted); }
.term-body .ok b { color: var(--accent); font-weight: 500; }
.term-body .info { color: var(--accent-2); }
.term-body .muted { color: var(--text-dim); }

/* Hero stats */
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px dashed var(--border);
}

.hero-meta div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

.hero-meta i {
  font-size: 20px;
  color: var(--accent);
}

@media (max-width: 991px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero {
    min-height: auto;
  }
}

/* ---------- Sections ---------- */
section {
  padding: 96px 0;
  position: relative;
}

.section-alt {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  margin-bottom: 48px;
  max-width: 720px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-tag {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 13px;
  letter-spacing: .04em;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 8px 0 12px;
}

.section-head p {
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Sobre ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 48px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-top: 0;
}

.about-text p strong {
  color: var(--text);
}

.location-card {
  margin-top: 28px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.location-card i {
  font-size: 26px;
  color: var(--accent);
}

.location-card p {
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 500;
}

.duty-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.duty {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .2s, transform .2s;
}

.duty:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.duty .ico {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}

.duty:nth-child(even) .ico {
  background: var(--accent-2-soft);
  color: var(--accent-2);
}

.duty h3 {
  font-size: 16px;
  margin: 0 0 6px;
}

.duty p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

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

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

/* ---------- Acesso rápido ---------- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(34, 211, 166, .10), transparent 45%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}

.app-card:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.app-card:hover::before {
  opacity: 1;
}

.app-card .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.app-card .ico {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--accent);
}

.app-card .go {
  color: var(--text-dim);
  font-size: 18px;
  transition: transform .2s, color .2s;
}

.app-card:hover .go {
  color: var(--accent);
  transform: translate(3px, -3px);
}

.app-card h3 {
  font-size: 17px;
  margin: 0 0 6px;
}

.app-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 16px;
  flex: 1;
}

.app-card .path {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- Portfólio ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.browser {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.browser:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.browser-bar .d {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.browser-bar .url {
  flex: 1;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-shot {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg);
}

.browser-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform .5s;
}

.browser:hover .browser-shot img {
  transform: scale(1.04);
}

.browser-shot .zoom {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 15, 28, .55);
  color: var(--text);
  font-size: 30px;
  opacity: 0;
  transition: opacity .25s;
}

.browser-shot:hover .zoom {
  opacity: 1;
}

.browser-info {
  padding: 18px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.browser-info h3 {
  font-size: 16px;
  margin: 0 0 2px;
}

.browser-info span {
  font-size: 13px;
  color: var(--text-muted);
}

.icon-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 18px;
  transition: all .2s;
}

.icon-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

@media (max-width: 991px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ---------- Equipe ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.member {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}

.member:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.member .photo {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-2);
}

.member .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(.35) contrast(1.05);
  transition: filter .3s, transform .4s;
}

.member:hover .photo img {
  filter: none;
  transform: scale(1.04);
}

.member .info {
  padding: 16px 18px 18px;
}

.member h3 {
  font-size: 15.5px;
  margin: 0 0 8px;
  line-height: 1.3;
}

.role {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 166, .25);
}

.role.r-dev {
  background: var(--accent-2-soft);
  color: var(--accent-2);
  border-color: rgba(56, 189, 248, .25);
}

.role.r-adm {
  background: rgba(251, 191, 36, .1);
  color: var(--warn);
  border-color: rgba(251, 191, 36, .25);
}

/* ---------- Contato ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.contact-card {
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-card i {
  font-size: 26px;
  color: var(--accent);
  margin-bottom: 6px;
}

.contact-card h3 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0;
}

.contact-card p {
  margin: 0;
  font-size: 16px;
}

.contact-card .link-sm {
  margin-top: auto;
  padding-top: 10px;
  font-size: 14px;
  font-weight: 600;
}

.phone-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.phone-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}

.phone-list li:last-child {
  border-bottom: 0;
}

.phone-list a,
.phone-list .num {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  white-space: nowrap;
}

.phone-list .num {
  font-weight: 500;
  color: var(--text);
}

.contact-card .phone-list i {
  font-size: 15px;
  margin: 0;
}

.phone-list span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

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

/* ---------- Footer ---------- */
.footer {
  background: #070b15;
  border-top: 1px solid var(--border);
  padding: 64px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}

.footer .brand {
  margin-bottom: 16px;
}

.footer h4 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 16px;
}

.footer h4::before {
  content: "// ";
  color: var(--accent);
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer li {
  margin-bottom: 10px;
}

.footer li a {
  color: var(--text-muted);
}

.footer li a:hover {
  color: var(--accent);
}

.footer address {
  font-style: normal;
  line-height: 1.8;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-bottom .mono {
  color: var(--text-dim);
}

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

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--bg);
  font-size: 24px;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all .25s;
}

.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  background: var(--accent-2);
  color: var(--bg);
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Keyframes ---------- */
@keyframes blink {
  50% { opacity: 0; }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 166, .55); }
  70% { box-shadow: 0 0 0 8px rgba(34, 211, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 166, 0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal, .term-body .ln { opacity: 1; transform: none; }
}
