/* =========================================================
   galak.me — style.css
   Paleta: grafite-índigo + âmbar de fósforo (terminal P3)
   ========================================================= */

:root {
  --bg: #13151d;
  --surface: #1a1d28;
  --surface-2: #212534;
  --line: #2c3142;
  --text: #e7e2d8;
  --muted: #9298ab;
  --amber: #f5a524;
  --amber-soft: rgba(245, 165, 36, 0.12);
  --amber-line: rgba(245, 165, 36, 0.45);

  --font-display: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* escala tipográfica (razão ~1.25) */
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.5625rem;
  --fs-xl: clamp(2.1rem, 6.5vw, 3.9rem);

  --wrap: 68rem;
  --measure: 66ch;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --header-h: 4.25rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

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

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  background: var(--amber);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}
.skip:focus { top: 1rem; }

/* ---------------- Header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(19, 21, 29, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
}

.nav {
  display: flex;
  gap: 0.25rem;
}

.lang { justify-self: end; }

.nav a {
  position: relative;
  padding: 0.45rem 0.75rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: -0.1rem;
  height: 2px;
  background: var(--amber);
}

.lang {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.lang button {
  min-width: 2.5rem;
  padding: 0.3rem 0.55rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] {
  background: var(--amber);
  color: var(--bg);
}

/* ---------------- Main / views ---------------- */

main { flex: 1; outline: none; }

.view { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(3rem, 8vw, 6rem); }
.view[hidden] { display: none; }

h2 {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 1.25rem;
}

.block + .block { margin-top: clamp(3rem, 7vw, 4.5rem); }

/* ---------------- Hero ---------------- */

.hero {
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--line);
}

.prompt {
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 2.2vw, 0.95rem);
  color: var(--muted);
  margin-bottom: 1rem;
  white-space: nowrap;
}
.prompt-host { color: var(--amber); }
.prompt-cmd { color: var(--text); }

.caret {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 0.15em;
  vertical-align: -0.2em;
  background: var(--amber);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-name {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.045em;
  max-width: 14ch;
}

.hero-alias {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.hero-alias strong { color: var(--amber); font-weight: 500; }

/* Animação de abertura (só quando JS ativa .is-typing) */
.hero.is-typing .hero-name,
.hero.is-typing .hero-alias { opacity: 0; transform: translateY(6px); }
.hero.is-revealed .hero-name,
.hero.is-revealed .hero-alias {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.hero.is-revealed .hero-alias { transition-delay: 0.12s; }

/* ---------------- Sobre ---------------- */

.about p {
  max-width: var(--measure);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--text);
}
.about p + p { margin-top: 1rem; color: var(--muted); font-size: var(--fs-base); line-height: 1.65; }

/* ---------------- Intigriti ---------------- */

.intigriti {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--amber-line);
  border-left: 6px solid var(--amber);
  border-radius: 10px;
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(245, 165, 36, 0.035) 14px 28px),
    var(--surface);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.intigriti:hover { border-color: var(--amber); }
.intigriti:hover .intigriti-cta { background: var(--text); }

.intigriti-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber);
}
.intigriti-icon svg { width: 1.6rem; height: 1.6rem; fill: currentColor; }

.intigriti-body { display: grid; gap: 0.3rem; min-width: 0; }
.intigriti-title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.intigriti-text { color: var(--muted); max-width: 56ch; }
.intigriti-handle {
  font-size: var(--fs-sm);
  color: var(--amber);
  overflow-wrap: anywhere;
}

.intigriti-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.15rem;
  border-radius: 4px;
  background: var(--amber);
  color: var(--bg);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}
.intigriti-cta svg { width: 0.9rem; height: 0.9rem; fill: currentColor; }

/* ---------------- Certificações ---------------- */

.certs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.cert {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.25rem;
  background: var(--surface);
}

.cert-cisco { grid-column: 1 / -1; }

.badge { width: 3rem; height: auto; overflow: visible; }
.badge use { fill: var(--amber-soft); stroke: var(--amber); stroke-width: 2; }
.badge text {
  fill: var(--amber);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-anchor: middle;
  letter-spacing: -0.5px;
}
.badge text.small { font-size: 11px; }

.cert-name { font-weight: 600; line-height: 1.35; }
.cert-issuer { margin-top: 0.25rem; font-size: var(--fs-sm); color: var(--muted); }

.cert-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-top: 0.5rem;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.cert-sub li { position: relative; padding-left: 0.9rem; }
.cert-sub li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  background: var(--amber);
}

/* ---------------- Skills ---------------- */

.skills { display: grid; }

.skill-row {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 1rem 2rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
}
.skill-row:last-child { border-bottom: 1px solid var(--line); }

.skill-row dt {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--muted);
  padding-top: 0.3rem;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--fs-sm);
  line-height: 1.4;
}

/* ---------------- Páginas internas ---------------- */

.page-head { margin-bottom: clamp(2rem, 5vw, 3rem); }

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.1;
}
.page-lede { margin-top: 0.75rem; color: var(--muted); max-width: var(--measure); }

/* ---------------- Blog ---------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filters[hidden] { display: none; }
.filters button {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.filters button:hover { color: var(--text); border-color: var(--muted); }
.filters button[aria-pressed="true"] {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--amber);
}

.posts { border-top: 1px solid var(--line); }

.post-item { border-bottom: 1px solid var(--line); }

.post-link {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.5rem 2rem;
  padding-block: 1.6rem;
  text-decoration: none;
}

.post-date {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 0.2rem;
}

.post-main { display: grid; gap: 0.5rem; min-width: 0; }

.post-item-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.35;
  transition: color 0.15s ease;
}
.post-link:hover .post-item-title { color: var(--amber); }

.post-excerpt { color: var(--muted); max-width: var(--measure); }

.post-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.25rem;
}
.post-foot .tags li { padding: 0.15rem 0.6rem; font-size: 0.8125rem; color: var(--muted); }
.post-read { font-size: 0.8125rem; color: var(--muted); }

.empty { padding-block: 2rem; color: var(--muted); }

/* ---------------- Post ---------------- */

.post { max-width: 46rem; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: var(--fs-sm);
  color: var(--muted);
  text-decoration: none;
}
.back:hover { color: var(--amber); }
.back svg { width: 0.85rem; height: 0.85rem; fill: currentColor; }

.post-head { padding-bottom: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }

.post-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.post-meta { margin-block: 0.9rem; font-size: var(--fs-sm); color: var(--muted); }

.draft-note {
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  font-size: var(--fs-sm);
}

.post-body { font-size: 1.125rem; line-height: 1.75; }
.post-body > * + * { margin-top: 1.25rem; }
.post-body h2 { margin-top: 2.5rem; margin-bottom: 0; }
.post-body pre {
  tab-size: 4;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 0.85rem;
  line-height: 1.7;
}
.post-body code { font-family: var(--font-display); font-size: 0.82em; }
.post-body p code,
.post-body li code {
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--amber);
  overflow-wrap: anywhere;
}
.post-body ul { padding-left: 1.25rem; }
.post-body li + li { margin-top: 0.6rem; }
.post-body li::marker { color: var(--amber); }
.post-body a { color: var(--amber); text-underline-offset: 3px; }
.post-body a:hover { text-decoration-thickness: 2px; }
.post-body .callout {
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  font-size: 1rem;
}

.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.1rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--amber-line);
  border-radius: 4px;
  color: var(--amber);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.repo-link svg { width: 1rem; height: 1rem; fill: currentColor; }
.repo-link:hover { background: var(--amber); color: var(--bg); }
.repo-link[hidden] { display: none; }

/* ---------------- Contato ---------------- */

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.9rem, 3vw, 1.5rem);
}

.contact-link {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(4.25rem, 16vw, 5.5rem);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}
.contact-link svg { width: 42%; height: 42%; fill: currentColor; }

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--bg);
  background: var(--amber);
  border-color: var(--amber);
  transform: translateY(-3px);
}

/* tooltip com o nome da plataforma */
.contact-link::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 50%;
  transform: translate(-50%, -4px);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.8125rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.contact-link:hover::after,
.contact-link:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 1.75rem;
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* ---------------- Responsivo ---------------- */

@media (max-width: 760px) {
  .intigriti { grid-template-columns: auto 1fr; }
  .intigriti-cta { grid-column: 1 / -1; justify-content: center; }

  .certs { grid-template-columns: 1fr; }
  .skill-row { grid-template-columns: 1fr; gap: 0.75rem; }
  .skill-row dt { padding-top: 0; }

  .post-link { grid-template-columns: 1fr; gap: 0.4rem; }
  .post-date { padding-top: 0; }
}

@media (max-width: 560px) {
  :root { --header-h: 3.75rem; }
  .header-row { grid-template-columns: 1fr auto; }
  .header-spacer { display: none; }
  .nav { justify-self: center; gap: 0; }
  .nav a { padding-inline: 0.6rem; }
  .nav a[aria-current="page"]::after { left: 0.6rem; right: 0.6rem; }

  .intigriti { grid-template-columns: 1fr; gap: 1rem; }
  .intigriti-icon { width: 3rem; height: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .caret { animation: none; }
}
