/* =============================================================
   João Paulo Drago · CV
   HTML5 + CSS3 puro, sem dependências de runtime.
   Tokens via CSS variables · base clara · acento de marca.
   WCAG 2.2 AA - contraste validado · bilíngue EN/PT.
   ============================================================= */

:root {
  /* Cores - contraste validado sobre #FFFFFF (WCAG 1.4.3) */
  --ink-primary:   #1A1A1A; /* 17.40:1 vs #FFF - AAA */
  --ink-secondary: #4A4A4A; /* 8.86:1 vs #FFF - AAA */
  --ink-tertiary:  #6B6B6B; /* 5.33:1 vs #FFF - AA, meta-info */

  /* Acento de marca: mint escurecido p/ passar AA em texto/links.
     O mint puro (#00FF66) fica reservado p/ DECORAÇÃO (sem texto). */
  --accent:        #0C7A40; /* green · ~5:1 vs #FFF - AA texto normal */
  --accent-bright: #00FF66; /* mint neon · só decoração (1.4.11 isento) */

  --bg:            #FFFFFF;
  --bg-subtle:     #F7F8F7;
  --border:        #DADEDB; /* divisores decorativos */
  --border-strong: #8A908C; /* 3.2:1 - bordas de componentes (1.4.11 AA) */

  /* Tipografia - marca Drago Studio */
  --font-display: 'Darker Grotesque', 'Arial Narrow', sans-serif;
  --font-sans:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'DM Mono', 'IBM Plex Mono', Consolas, monospace;

  /* Tamanhos */
  --text-xs:   0.75rem;   /* 12 */
  --text-sm:   0.875rem;  /* 14 */
  --text-base: 1rem;      /* 16 */
  --text-lg:   1.125rem;  /* 18 */
  --text-xl:   1.5rem;    /* 24 */
  --text-2xl:  1.75rem;   /* 28 */
  --text-3xl:  3rem;      /* 48 - nome em Darker Grotesque */

  /* Espaçamento - baseline 8pt */
  --space-1:  0.5rem;
  --space-2:  1rem;
  --space-3:  1.5rem;
  --space-4:  2rem;
  --space-5:  2.5rem;
  --space-6:  3rem;

  /* Bordas */
  --radius-sm: 4px;
  --radius-md: 8px;

  /* Layout */
  --container-max: 1024px;
  --sidebar-ratio: 32%;
  --gap: var(--space-4);
}

/* Reset enxuto ============================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

.job__meta, .muted, .tagline__highlights, .focus__meta {
  font-variant-numeric: tabular-nums;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

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

/* Foco visível ============================================= */
:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Utilidades ================================================ */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.muted { color: var(--ink-tertiary); }

/* Skip link ================================================= */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-2);
  background: var(--accent);
  color: #FFFFFF;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  z-index: 1000;
  transition: top 0.15s ease-in;
}
.skip-link:focus {
  top: var(--space-1);
  outline: 3px solid var(--ink-primary);
  outline-offset: 2px;
}

/* Barra de ações (idioma + PDF + compartilhar) ============= */
.page-actions {
  position: fixed;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.lang-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
}
.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.12s ease, color 0.12s ease;
}
.lang-btn:hover { color: var(--accent); }
.lang-btn.is-active {
  background: var(--accent);
  color: #FFFFFF;
}
.lang-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--bg);
  color: var(--ink-primary);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.action-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06), 0 8px 20px rgba(0,0,0,0.08);
}
.action-btn:active { transform: translateY(0); }
.action-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.action-btn .icon { color: var(--accent); flex-shrink: 0; }

.action-feedback {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  white-space: nowrap;
  background: var(--ink-primary);
  color: #FFFFFF;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.action-feedback.is-visible { opacity: 1; transform: translateY(0); }

/* Container ================================================= */
.page {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
}

/* Header ==================================================== */
.header {
  position: relative;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
/* Microdecoração: acento mint sobre a borda (decorativo) */
.header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 56px;
  height: 4px;
  background: var(--accent-bright);
  border-radius: 4px;
}

.header__name {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 0.92;
  margin: 0 0 var(--space-2);
  color: var(--ink-primary);
  text-transform: uppercase;
}
.header__nickname {
  font-weight: 600;
  color: var(--ink-tertiary);
  margin-left: 0.3em;
  font-size: 0.5em;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: 0.15em;
}

.header__headline {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--ink-secondary);
  margin: 0 0 var(--space-1);
  max-width: 62ch;
  text-wrap: balance;
}

.header__location {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  margin: 0;
}
.header__location .icon { color: var(--accent); }

/* Layout 2 colunas ========================================= */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-ratio) 1fr;
  gap: var(--gap);
  align-items: start;
}

/* Sidebar =================================================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.profile {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 var(--space-1);
  flex-shrink: 0;
}
.profile__initials {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  line-height: 1;
  user-select: none;
}
.profile__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.block { margin: 0; }
.block__title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-secondary);
  margin: 0 0 var(--space-2);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--border);
}

/* Contact list ============================================= */
.contact-list { display: flex; flex-direction: column; gap: var(--space-1); }
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: var(--text-sm);
  color: var(--ink-primary);
  text-decoration: none;
  padding: 4px 0;
  word-break: break-word;
}
.contact-link .icon { color: var(--accent); flex-shrink: 0; }
.contact-link:hover span, .contact-link:focus span {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Focus card (posicionamento) ============================== */
.focus {
  position: relative;
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-subtle) 100%);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(12, 122, 64, 0.04);
}
.focus::before {
  content: "";
  position: absolute;
  left: 0; top: var(--space-2); bottom: var(--space-2);
  width: 3px;
  background: var(--accent-bright);
  border-radius: 0 3px 3px 0;
}
.focus__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 var(--space-1);
}
.focus__headline {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 0.98;
  color: var(--ink-primary);
  margin: 0 0 var(--space-1);
  text-wrap: balance;
}
.focus__meta {
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--ink-secondary);
  margin: 0;
}

/* Skills / Languages (dl) ================================== */
.skills { margin: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.skills dt {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--space-1);
}
.skills dt:first-child { margin-top: 0; }
.skills dd {
  margin: 2px 0 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--ink-primary);
}

/* Plain list (formação) ==================================== */
.plain-list { display: flex; flex-direction: column; gap: var(--space-1); }
.plain-list li { font-size: var(--text-sm); line-height: 1.45; color: var(--ink-primary); }
.plain-list .muted { display: block; font-size: var(--text-xs); margin-top: 2px; }

/* Main ===================================================== */
.main { display: flex; flex-direction: column; gap: var(--space-4); }
.main:focus { outline: none; }

.tagline {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink-secondary);
  padding: 0 0 var(--space-2);
  border-bottom: 1px solid var(--border);
}
.tagline p { margin: 0; text-wrap: pretty; }

.tagline__highlights {
  font-size: var(--text-xs);
  font-weight: 500;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.5;
  margin-top: var(--space-3);
}
.tagline__highlights > span:not(.tagline__sep) {
  display: inline-flex;
  align-items: center;
  padding: 0.3em 0.6em;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-primary);
  font-weight: 500;
  white-space: nowrap;
}
.tagline__sep { display: none; }

.section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-secondary);
  margin: 0 0 var(--space-2);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--border);
}

/* Experience =============================================== */
.experience { display: flex; flex-direction: column; }
.job { margin-bottom: var(--space-3); }
.job:last-child { margin-bottom: 0; }
.job__header { margin-bottom: var(--space-1); }
.job__title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--ink-primary);
  margin: 0 0 2px;
  line-height: 1.3;
}
.job__meta { font-size: var(--text-sm); color: var(--accent); margin: 0; font-family: var(--font-mono); }
.job__bullets { list-style: disc; padding-left: 1.2em; margin: var(--space-1) 0; }
.job__bullets li {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--ink-primary);
  margin-bottom: 4px;
}
.job__bullets li::marker { color: var(--accent); }
.job__stack {
  font-size: var(--text-xs);
  color: var(--ink-secondary);
  margin: var(--space-1) 0 0;
  font-family: var(--font-mono);
  line-height: 1.5;
}
.job__stack-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-right: 4px;
}

/* Projects ================================================= */
.project { margin-bottom: var(--space-3); }
.project:last-child { margin-bottom: 0; }
.project__title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--ink-primary);
  margin: 0 0 2px;
  line-height: 1.3;
}
.project__title a {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--accent);
}
.project__role {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-tertiary);
  margin: 0 0 4px;
}
.project p:not(.project__role) {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--ink-primary);
  margin: 4px 0 0;
}

/* Earlier ================================================== */
.earlier__list { display: flex; flex-direction: column; gap: 4px; }
.earlier__list li { font-size: var(--text-sm); line-height: 1.4; color: var(--ink-primary); }

/* Footer =================================================== */
.footer {
  margin-top: var(--space-6);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--ink-secondary);
}
.footer p { margin: 0; }

/* Responsive ================================================ */
@media (max-width: 768px) {
  .page { padding: var(--space-4) var(--space-2); }
  .header__name { font-size: var(--text-2xl); }
  .layout { grid-template-columns: 1fr; gap: var(--space-4); }
  .sidebar {
    order: -1;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
  }
  .page-actions { position: absolute; }
  /* No celular as pills voltam a quebrar linha (não cabem numa linha só) */
  .tagline__highlights { flex-wrap: wrap; }
}

/* Reduce motion ============================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* PRINT - PDF em 1 página A4 via Ctrl/Cmd+P ================= */
@media print {
  @page { size: A4; margin: 10mm 10mm 8mm 10mm; }

  .page-actions, .skip-link { display: none !important; }

  :root {
    --text-xs:   7.5pt;
    --text-sm:   8pt;
    --text-base: 8.5pt;
    --text-lg:   9.5pt;
    --text-xl:   12pt;
    --text-2xl:  15pt;
    --text-3xl:  22pt;
    --space-1: 3pt; --space-2: 5pt; --space-3: 7pt;
    --space-4: 9pt; --space-5: 10pt; --space-6: 11pt;
  }

  html, body {
    background: #FFFFFF !important;
    color: #000000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body { font-size: 8.5pt; line-height: 1.35; }

  .page { max-width: 100%; margin: 0; padding: 0; }

  .layout { grid-template-columns: 30% 1fr; gap: 12pt; }

  .job, .project, .focus, .block { break-inside: avoid; page-break-inside: avoid; }

  .header { margin-bottom: 6pt; padding-bottom: 4pt; }
  .header__name { margin: 0 0 3pt; }
  .header__headline { margin: 0 0 2pt; }
  .header::after { display: none; }

  .tagline { padding: 5pt 0; line-height: 1.4; }
  .tagline__highlights { font-size: 8pt; margin-top: 4pt; gap: 0.4em; flex-wrap: wrap; }
  .tagline__highlights > span:not(.tagline__sep) {
    padding: 0; background: transparent; border: 0; border-radius: 0;
  }
  .tagline__sep { display: inline; color: #000; }

  .profile { width: 70pt; height: 70pt; border-width: 1.2pt; margin: 0 auto 4pt; }
  .profile__initials { font-size: 26pt; }

  .focus {
    background: #F4F6F4 !important;
    box-shadow: none;
    border: 1pt solid var(--accent);
    padding: 6pt 8pt;
  }
  .focus::before { display: none; }

  .sidebar { gap: 8pt; }
  .block__title { margin: 0 0 4pt; padding-bottom: 2pt; }
  .contact-list { gap: 1pt; }
  .contact-link { padding: 1pt 0; }
  .skills { gap: 2pt; }
  .skills dt { margin-top: 3pt; }
  .skills dd { margin: 1pt 0 0; line-height: 1.3; }
  .plain-list { gap: 2pt; }
  .plain-list li { line-height: 1.3; }

  .main { gap: 7pt; }
  .job { margin-bottom: 7pt; }
  .job__header { margin-bottom: 2pt; }
  .job__bullets { margin: 3pt 0; padding-left: 14pt; }
  .job__bullets li { margin-bottom: 1pt; line-height: 1.35; }
  .job__stack { margin: 3pt 0 0; }
  .project { margin-bottom: 6pt; }
  .project p:not(.project__role) { margin: 2pt 0 0; line-height: 1.35; }
  .earlier__list { gap: 2pt; }
  .earlier__list li { line-height: 1.3; }

  .footer { margin-top: 8pt; padding-top: 4pt; font-size: 7pt; }

  a { color: #000000; text-decoration: none; }
  a[href^="http"]::after { content: ""; }
  .icon { color: var(--accent) !important; }
}

/* Alto contraste do Windows (forced-colors) ================ */
@media (forced-colors: active) {
  :root {
    --accent: CanvasText;
    --accent-bright: CanvasText;
    --ink-primary: CanvasText;
    --ink-secondary: CanvasText;
    --ink-tertiary: GrayText;
    --border: CanvasText;
    --bg: Canvas;
    --bg-subtle: Canvas;
  }
  .icon { color: CanvasText !important; }
  .action-feedback { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
  .skip-link { background: Canvas; color: CanvasText; border: 2px solid CanvasText; }
  .focus, .profile { background: Canvas; }
  .profile__initials { color: CanvasText; }
  .lang-btn.is-active { background: Highlight; color: HighlightText; }
  a { color: LinkText; }
  a:visited { color: VisitedText; }
  :focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}
