/* =========================================================
   Giulia Silveira | giuliasilveira.com.br
   Pink surfaces, slate-blue accent, plum-tinted ink. Vanilla CSS, no build step.
   ========================================================= */

/* === 1. TOKENS === */
:root {
  /* Tonal system, after Radix Colors (step roles) and Material 3 (surface tiers).
     Pink = signature (hero and alternate bands), warm near-white = page, white = cards,
     slate blue = action and wayfinding, plum-tinted ink = text.
     All text pairs below are >= 4.5:1 (WCAG AA); card edges >= 3:1 against the page. */

  /* Surfaces */
  --bg-primary:     #FFF8FA;   /* page: warm near-white */
  --bg-hero:        #FCE8EE;   /* top of hero, fades into the page */
  --bg-band:        #F8DCE6;   /* alternate sections: the pink signature */
  --bg-secondary:   #FFFFFF;   /* cards, raised surfaces */
  --bg-high:        #F2C9D7;   /* image placeholders, pressed */

  /* Slate blue scale (accent) */
  --accent-tint:    #E3EBF3;   /* chips, selected nav */
  --accent-tint-2:  #D3E0EC;   /* hover on tint */
  --accent:         #3F5A74;   /* solid: buttons, links, marks */
  --accent-hover:   #2F4458;   /* hover, pressed, strong text */
  --accent-dim:     rgba(63, 90, 116, 0.09);

  /* Text */
  --text-primary:   #2A2530;
  --text-secondary: #54495B;
  --text-muted:     #6B6272;

  /* Lines */
  --border:         #EFC9D6;   /* hairlines on pink */
  --border-strong:  #BD7894;   /* card edges, dividers that must read: 3.2:1 on page, 3.35:1 on cards */
  --ring:           #2F4458;

  --mono:     'Geist Mono', ui-monospace, monospace;
  --sans:     'DM Sans', system-ui, sans-serif;
  --headline: 'Sora', system-ui, sans-serif;

  --fs-xs:   0.8125rem; /* 13px: smallest label size */
  --fs-sm:   0.875rem;
  --fs-base: 1.0625rem;
  --fs-lg:   1.25rem;
  --fs-h3:   1.125rem;
  --fs-h2:   clamp(1.75rem, 3.6vw, 2.5rem);
  --fs-h1:   clamp(2.5rem, 8vw, 5rem);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 5rem;

  --radius:   12px;
  --header-h: 64px;
  --measure:  68ch;
}

/* === 2. RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}
/* Smooth scroll starts only after the page has loaded (site.js adds .smooth-scroll). Set on html
   from the start, it made Chrome drop the jump to an anchor when arriving from another page (/#experience). */
@media (prefers-reduced-motion: no-preference) {
  html.smooth-scroll { scroll-behavior: smooth; }
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body.nav-open { overflow: hidden; }

ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--headline);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: 4px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.85);
}

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

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  z-index: 500;
  background: var(--accent);
  color: var(--bg-secondary);
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 8px;
}
.skip-link:focus { top: var(--space-2); }

/* === 3. HEADER & NAV === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 6px 18px -12px rgba(63, 90, 116, 0.35);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--headline);
  font-weight: 700;
  font-size: 1rem;
}

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

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  display: block;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease, background 0.15s ease;
}

.site-nav a:hover { color: var(--accent-hover); background: var(--accent-dim); }
.site-nav a[aria-current="true"] {
  color: var(--accent-hover);
  background: var(--accent-tint);
  font-weight: 600;
}

.site-nav .nav-cta {
  color: var(--bg-secondary);
  background: var(--accent);
  font-weight: 600;
  margin-left: 0.5rem;
}
.site-nav .nav-cta:hover,
.site-nav .nav-cta[aria-current="true"] { background: var(--accent-hover); color: var(--bg-secondary); }

/* Mobile drawer */
.nav-hamburger, .nav-drawer-close {
  appearance: none;
  background: none;
  font: inherit;
  color: inherit;
}

.nav-hamburger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  background: var(--bg-secondary);
}
.nav-hamburger:hover { background: var(--accent-tint); }
.nav-hamburger span { display: block; height: 2px; background: var(--accent-hover); }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(38, 43, 51, 0.45);
  z-index: 150;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(280px, 80vw);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-strong);
  box-shadow: -16px 0 40px -20px rgba(42, 37, 48, 0.4);
  z-index: 200;
  transform: translateX(100%);
  visibility: hidden;
  /* Hide only after the slide-out finishes; show instantly on open. */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
  padding: 5rem 2rem 2rem;
}

.nav-drawer-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1rem;
}
.nav-drawer-close:hover { color: var(--accent); background: var(--accent-dim); }

.nav-drawer-links { display: flex; flex-direction: column; gap: 1.5rem; }
.nav-drawer-links a {
  font-family: var(--headline);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  padding-left: 0.9rem;
  border-left: 3px solid transparent;
}
.nav-drawer-links a:hover { color: var(--accent); }
.nav-drawer-links a[aria-current="true"] { color: var(--accent); border-left-color: var(--accent); }

.nav-open .nav-overlay { display: block; }
.nav-open .nav-drawer {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

/* === 4. SECTIONS === */
section { padding: var(--space-6) 0; }
section + section { border-top: 1px solid var(--border); }
/* Home: alternating bands show where a section ends; the last one is the closing call to action. */
main > section:nth-of-type(even) { background: var(--bg-band); border-top-color: transparent; }
main > section:nth-of-type(odd) + section { border-top-color: transparent; }

.section-head { margin-bottom: var(--space-4); }

.section-index {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.section-head h2,
.contact h2 { font-size: var(--fs-h2); }

.section-lede {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  max-width: 52ch;
}

.subhead {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-3);
}

/* === 5. HERO === */
.hero {
  padding: clamp(4rem, 10vh, 7rem) 0 var(--space-6);
  background: linear-gradient(180deg, var(--bg-hero) 0%, var(--bg-hero) 45%, var(--bg-primary) 100%);
}

.hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: var(--space-5);
  align-items: center;
}

.hero-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 60px rgba(63, 90, 116, 0.22);
  background: var(--bg-secondary);
}

.eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.hero-name {
  font-size: var(--fs-h1);
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: 0.75rem;
}

.hero-tagline {
  font-family: var(--headline);
  font-size: clamp(1.25rem, 2.8vw, 1.9rem);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
  text-wrap: balance;
}

.hero-bio {
  max-width: 58ch;
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: var(--space-4);
}

.hero-ctas { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.glance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.glance li {
  padding: var(--space-3) var(--space-3) 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.glance li + li { padding-left: var(--space-3); border-left: 1px solid var(--border); }

.glance-value {
  font-family: var(--headline);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.glance-label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

.glance-example {
  margin-top: 0.4rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--accent);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  line-height: 1.55;
}

/* === 6. BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary { background: var(--accent); color: var(--bg-secondary); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 8px 24px rgba(63, 90, 116, 0.28); }

.btn-secondary { border: 1.5px solid var(--accent); color: var(--accent-hover); background: transparent; }
.btn-secondary:hover { background: var(--accent-tint); color: var(--accent-hover); }

.btn-ghost { border: 1.5px solid var(--border-strong); color: var(--text-primary); background: var(--bg-secondary); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-hover); }

.print-only { display: none; }

/* === 7. SELECTED WORK === */
.cases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.case {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
}

.case::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
}

.case-kicker {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  letter-spacing: 0.04em;
}

.case h3 { font-size: 1.2rem; }

/* Featured case: full width, photo beside the text */
.case--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  padding: 0;
  gap: 0;
}

.case-photo {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  object-position: 45% 30%;
  display: block;
  background: var(--bg-high);
}

/* Featured case visual without a photo: the same page in three languages, drawn in CSS. Decorative. */
.case-visual {
  min-height: 320px;
  background: linear-gradient(160deg, var(--bg-hero) 0%, var(--bg-secondary) 100%);
  border-right: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
  padding: var(--space-4) var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-3);
  overflow: hidden;
}
.cv-pages { position: relative; height: 190px; }
.cv-page {
  position: absolute;
  top: 22px;
  width: 50%;
  height: 160px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 14px 30px -18px rgba(63, 90, 116, 0.45);
}
.cv-page--en { left: 3%; transform: rotate(-7deg); }
.cv-page--es { right: 3%; transform: rotate(7deg); }
.cv-page--pt { left: 25%; top: 0; z-index: 2; box-shadow: 0 18px 36px -16px rgba(63, 90, 116, 0.55); }
.cv-chip {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  background: var(--accent-tint);
  color: var(--accent-hover);
  margin-bottom: 4px;
}
.cv-page--pt .cv-chip { background: var(--accent); color: var(--bg-secondary); }
.cv-page--es .cv-chip { align-self: flex-end; }
.cv-page--es .cv-line--title { align-self: flex-end; }
.cv-line { display: block; height: 6px; border-radius: 3px; background: var(--bg-high); }
.cv-line--title { height: 10px; width: 75%; background: var(--accent-tint-2); }
.cv-line--short { width: 55%; }
.cv-stat { display: flex; flex-direction: column; gap: 0.15rem; }
.cv-stat strong {
  font-family: var(--headline);
  font-size: 2rem;
  line-height: 1.1;
  color: var(--text-primary);
}
.cv-stat span { font-size: var(--fs-sm); color: var(--text-secondary); }

.case-body {
  padding: var(--space-4) var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.case--featured::before { z-index: 1; }

.case p:not(.case-kicker):not(.case-outcome) {
  color: var(--text-secondary);
  font-size: 0.975rem;
}

.case-outcome {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* === 8. EXPERIENCE === */
/* Two columns on desktop: employer on the left, roles on the right.
   The right column keeps a comfortable line length while the section
   still uses the full container width. */
.timeline { display: flex; flex-direction: column; }

.employer {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
}
.employer:first-child { border-top: none; padding-top: 0; }
.employer:last-child { padding-bottom: 0; }

.employer-body, .case-body, .hero-text { min-width: 0; }

.employer-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-self: start;
}

.employer-name { font-size: 1.35rem; }

.employer-meta {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.employer-period {
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--accent);
}

.employer-note {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: var(--space-3);
}

.role { padding-bottom: var(--space-3); }
.role + .role { padding-top: var(--space-3); border-top: 1px solid rgba(63, 90, 116, 0.14); }
.role:last-child { padding-bottom: 0; }

.role-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.role-title {
  font-family: var(--sans);
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: 0;
}

.role-period {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  white-space: nowrap;
}

.role-desc {
  color: var(--text-secondary);
  font-size: 0.975rem;
  margin-bottom: 0.85rem;
}

.bullets { display: flex; flex-direction: column; gap: 0.75rem; max-width: 64ch; }
.bullets strong { color: var(--text-primary); font-weight: 600; }

.bullets li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  font-size: 0.975rem;
}

.bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* === 9. SKILLS === */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.skill-group h3 {
  font-size: 1rem;
  margin-bottom: var(--space-2);
}

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tags li {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent-hover);
  background: var(--accent-tint);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
}

/* === 10. EDUCATION === */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.edu-grid .subhead { margin-bottom: 0.75rem; }

.item-title { font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.item-meta { margin-top: 0.3rem; font-size: var(--fs-sm); color: var(--text-secondary); }

.lang-list { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.95rem; color: var(--text-secondary); }
.lang-list strong { color: var(--text-primary); font-weight: 600; margin-right: 0.35rem; }

/* === 11. CONTACT === */
.contact { text-align: center; }
main > section.contact {
  background: var(--accent);
  color: var(--bg-secondary);
  border-top-color: transparent;
}
.contact .section-index, .contact .contact-location { color: var(--bg-band); }
.contact .btn-primary { background: var(--bg-secondary); color: var(--accent-hover); }
.contact .btn-primary:hover { background: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.contact .btn-secondary { border-color: var(--bg-secondary); color: var(--bg-secondary); }
.contact .btn-secondary:hover { background: rgba(255, 245, 248, 0.16); color: #fff; }
.contact :focus-visible { outline-color: #fff; box-shadow: 0 0 0 6px rgba(47, 68, 88, 0.9); }
.contact h2 { max-width: 20ch; margin: 0 auto var(--space-4); }

.contact-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.contact-location {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

/* === 12. FOOTER === */
.footer {
  border-top: 1px solid var(--border-strong);
  padding: var(--space-3) 0;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.footer .container { display: flex; justify-content: space-between; gap: var(--space-2); }
.footer a { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; }
.footer a:hover { color: var(--accent); }

/* === 13. MOTION (only when the user allows it) === */
@media (prefers-reduced-motion: no-preference) {
  /* Reading-progress line under the header: where am I on the page. */
  @supports (animation-timeline: scroll()) {
    .site-header::after {
      content: '';
      position: absolute;
      left: 0; right: 0; bottom: -1px;
      height: 3px;
      background: var(--accent);
      transform-origin: 0 50%;
      animation: progress linear both;
      animation-timeline: scroll(root block);
    }
    @keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  }

  @keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Hero entrance moves content only; it never hides it, so the page
     still reads if animations are paused or never start. */
  @keyframes rise {
    from { transform: translateY(14px); }
    to   { transform: translateY(0); }
  }

  .hero-text > *, .hero-photo, .glance { animation: rise 0.6s ease both; }
  .hero-text > *:nth-child(2) { animation-delay: 0.08s; }
  .hero-text > *:nth-child(3) { animation-delay: 0.16s; }
  .hero-text > *:nth-child(4) { animation-delay: 0.24s; }
  .hero-text > *:nth-child(5) { animation-delay: 0.32s; }
  .hero-photo { animation-delay: 0.2s; }
  .glance { animation-delay: 0.4s; }

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

  @supports (animation-timeline: view()) {
    .section-head, .case, .employer, .skill-group {
      animation: fade-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }
  }
}

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

/* === 14. RESPONSIVE === */
@media (max-width: 860px) {
  .site-nav { display: none; }
  .nav-hamburger { display: flex; }
}

@media (max-width: 768px) {
  :root { --space-6: 3.5rem; }

  .container { padding: 0 var(--space-2); }

  .glance { margin-top: var(--space-5); }
  .glance li { padding: var(--space-3) 0; }
  .glance li + li { padding-left: 0; border-left: none; border-top: 1px solid var(--border); }

  .cases, .skills-grid, .edu-grid, .glance { grid-template-columns: minmax(0, 1fr); }

  .hero-main { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .hero { padding-top: 2rem; }
  .hero-photo { order: -1; width: 120px; border-radius: 16px; box-shadow: none; }

  .case--featured { grid-template-columns: minmax(0, 1fr); }
  .case-photo { min-height: 0; height: auto; aspect-ratio: 4 / 3; }
  .case-visual { min-height: 0; border-right: none; border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
  .case-body { padding: var(--space-3); }

  .employer { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }

  .role-head { flex-direction: column; gap: 0.2rem; }
}

@media (max-width: 480px) {
  .contact-links .btn { flex: 1 1 100%; }
  /* Primary CTA full width, LinkedIn and Export share the next row */
  .hero-ctas .btn-primary { flex: 1 1 100%; }
  .hero-ctas .btn-secondary, .hero-ctas .btn-ghost { flex: 1 1 calc(50% - 0.375rem); }
  .footer .container { flex-direction: column; align-items: center; }
}

/* === 15. PRINT === */
@media print {
  :root {
    --text-primary: #000;
    --text-secondary: #333;
    --bg-primary: #fff;
    --bg-hero: #fff;
    --bg-secondary: #fff;
    --border: #ddd;
    --border-strong: #ccc;
    --accent: #2F4458;
  }
  @page { margin: 1.6cm; }
  html { scroll-behavior: auto; font-size: 15px; }
  body { background: #fff; }
  a { color: inherit; }
  main > section, main > section:nth-of-type(even) { background: none; }
  .site-header::after { display: none; }
  .tags li { background: none; border: 1px solid #ccc; color: #333; }

  /* Navigation, buttons and the contact block go; the CV carries its own contact line. */
  .site-header, .nav-drawer, .nav-overlay, .skip-link, .hero-ctas, .footer,
  .section-index, .glance-example, .case-photo, .case-visual, .contact,
  .cs-figure, .cs-contact-wrap, .cs-more { display: none; }
  .print-only { display: block; }
  .hero-contact { font-family: var(--mono); font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 1rem; }

  .hero { padding: 0 0 1.25rem; }
  .hero-main { grid-template-columns: minmax(0, 1fr) 90px; gap: 1.5rem; }
  .hero-photo { width: 90px; border-radius: 10px; box-shadow: none; }
  .glance { margin-top: 1.25rem; }

  section { padding: 1.1rem 0; }
  .case, .card, .employer, .role, .glance li { break-inside: avoid; }
  .case--featured, .employer { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .case-body { padding: 0; }
  /* Case links print as the URL a reader can type. */
  .case-link::after { content: " giuliasilveira.com.br" attr(href); position: static; inset: auto; font-weight: 400; color: var(--text-secondary); }
  .cs-back::after { content: " · giuliasilveira.com.br"; }
  .hero-text > *, .hero-photo, .glance, .section-head, .case, .employer, .skill-group { animation: none; }
}

/* === 16. CASE STUDY PAGES === */
.cs-narrow { max-width: 760px; }

.cs-hero {
  padding: clamp(2.5rem, 8vh, 5rem) 0 var(--space-4);
  border-top: none;
  background: linear-gradient(180deg, var(--bg-hero) 0%, var(--bg-hero) 45%, var(--bg-primary) 100%);
}

.cs-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -12px 0 calc(var(--space-4) - 12px);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.cs-back:hover { color: var(--accent); }

.cs-title {
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: var(--space-3);
}

.cs-summary {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 60ch;
  margin-bottom: var(--space-4);
}

.cs-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2) var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.cs-meta dt {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.cs-meta dd { font-size: var(--fs-sm); color: var(--text-primary); line-height: 1.45; }

.cs-hero + .cs-body { padding-top: var(--space-2); }
.cs-figure { margin-bottom: var(--space-5); }
.cs-figure img {
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: cover;
  object-position: center 25%;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  display: block;
}
.cs-figure figcaption {
  margin-top: 0.6rem;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.cs-body section { padding: 0 0 var(--space-5); border-top: none; }
.cs-body section + section { border-top: none; }
.cs-body h2 { font-size: 1.5rem; margin-bottom: var(--space-2); }
.cs-body p { color: var(--text-secondary); max-width: var(--measure); }
.cs-body p + p { margin-top: 0.85rem; }

.cs-steps { counter-reset: step; display: flex; flex-direction: column; gap: var(--space-3); }
.cs-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
}
.cs-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.15rem;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--accent);
}
.cs-steps h3 { font-size: 1.1rem; margin-bottom: 0.4rem; letter-spacing: -0.01em; }

.cs-outcomes { display: flex; flex-direction: column; gap: 0.75rem; }
.cs-outcomes li strong {
  display: block;
  font-family: var(--headline);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.cs-outcomes li span { display: block; font-size: 1rem; color: var(--text-secondary); line-height: 1.55; }
.cs-outcomes li {
  font-size: 1.125rem;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--text-primary);
}

.cs-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  position: relative;
}
.cs-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  height: 1px;
  background: var(--border-strong);
}
.cs-timeline li { position: relative; padding-top: var(--space-3); display: flex; flex-direction: column; gap: 0.3rem; }
.cs-timeline li::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg-primary);
}
.cs-tl-when { font-family: var(--mono); font-size: var(--fs-xs); color: var(--accent); }
.cs-tl-what { font-size: var(--fs-sm); color: var(--text-primary); line-height: 1.45; }

.cs-more {
  padding-top: var(--space-4);
  padding-bottom: var(--space-6);
  border-top: 1px solid var(--border);
}
.cs-more-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.cs-more-back:hover { color: var(--accent); }
.cs-more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.cs-more-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}
.cs-more-card:hover { border-color: var(--accent); }
.cs-more-card:hover .cs-more-title { color: var(--accent); }
.cs-more-label { font-family: var(--mono); font-size: var(--fs-xs); color: var(--accent); }
.cs-more-title { font-family: var(--headline); font-weight: 600; line-height: 1.3; transition: color 0.15s ease; }

/* Context file excerpt */
.cs-code {
  margin-top: var(--space-2);
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.cs-code figcaption {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.cs-code pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-primary);
}
.cs-code .c-h { color: var(--accent); }
.cs-code .c-w { color: var(--accent-hover); }

/* Agent flow: in, agent steps, out */
.cs-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--space-2);
}
.cs-flow-col {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-2) var(--space-3);
}
.cs-flow-col--main { border-color: var(--accent); }
.cs-flow-label {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--accent) !important;
  margin-bottom: 0.6rem;
}
.cs-flow ul, .cs-flow ol { display: flex; flex-direction: column; gap: 0.45rem; }
.cs-flow li { font-size: var(--fs-sm); color: var(--text-primary); line-height: 1.4; }
.cs-flow ol { counter-reset: flow; }
.cs-flow ol li { counter-increment: flow; padding-left: 1.6rem; position: relative; }
.cs-flow ol li::before {
  content: counter(flow);
  position: absolute;
  left: 0;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  top: 0.1rem;
}
@media (max-width: 768px) {
  .cs-flow { grid-template-columns: minmax(0, 1fr); }
  .cs-code pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}

/* Ticket funnel: narrowing bars, no figures */
.cs-funnel { display: flex; flex-direction: column; gap: 0.6rem; }
.cs-funnel li {
  width: var(--w);
  min-width: 220px;
  max-width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}
.cs-funnel li:last-child { border-color: var(--accent); }
.cs-funnel-label { font-size: var(--fs-sm); color: var(--text-primary); }
@media (max-width: 480px) {
  .cs-funnel li { min-width: 0; width: calc(60% + var(--w) * 0.4); }
}

/* Launch chart: categories live (unit chart) + pages per month (bars). One hue, values as text. */
.cs-launch { margin-bottom: var(--space-5); }
.cs-launch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2);
}
.cs-launch-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-launch-grid--3 .cs-launch-panel { gap: 0.6rem; }
.cs-launch-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.cs-launch-title {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.cs-launch-stat { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.3; }
.cs-launch-stat strong {
  display: block;
  font-family: var(--headline);
  font-size: 2.25rem;
  line-height: 1.1;
  color: var(--text-primary);
}
.cs-launch-units {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
}
.cs-launch-units li {
  aspect-ratio: 1;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-secondary);
}
.cs-launch-units li.is-live { background: var(--accent); border-color: var(--accent); }
.cs-launch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.cs-launch-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.cs-launch-legend span::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-secondary);
}
.cs-launch-legend .is-live::before { background: var(--accent); border-color: var(--accent); }
.cs-launch-bars { display: flex; flex-direction: column; gap: var(--space-2); margin-top: auto; }
.cs-launch-bars div { display: flex; flex-direction: column; gap: 0.35rem; }
.cs-launch-bars dt { font-size: var(--fs-sm); color: var(--text-secondary); }
.cs-launch-bars dd { display: flex; align-items: center; gap: 0.6rem; }
.cs-launch-bar {
  height: 14px;
  width: calc(var(--v) / 117 * (100% - 3.5rem));
  min-width: 6px;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
}
.cs-launch-val { font-family: var(--headline); font-weight: 700; font-size: var(--fs-lg); color: var(--text-primary); line-height: 1; }
.cs-launch figcaption,
.cs-launch-caption { margin-top: var(--space-2); font-size: var(--fs-sm); color: var(--text-secondary); }
@media (max-width: 640px) {
  .cs-launch-grid, .cs-launch-grid--3 { grid-template-columns: minmax(0, 1fr); }
}
/* Adoption diagram: where a workflow started -> where it was adopted. */
.cs-adopt { margin-top: var(--space-4); }
.cs-adopt-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7rem, auto) minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-2);
}
.cs-adopt-node {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cs-adopt-node--origin { border: 1.5px solid var(--accent); }
.cs-adopt-tag {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: var(--accent);
}
.cs-adopt-name {
  font-family: var(--headline);
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
.cs-adopt-meta { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.45; }
.cs-adopt-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: var(--fs-xs);
  font-family: var(--mono);
  color: var(--text-secondary);
  text-align: center;
}
.cs-adopt-arrow::after {
  content: "";
  width: 100%;
  height: 12px;
  background:
    linear-gradient(var(--accent), var(--accent)) left center / calc(100% - 10px) 2px no-repeat,
    conic-gradient(from 225deg at 100% 50%, var(--accent) 0 90deg, transparent 0) right center / 12px 12px no-repeat;
}
@media (max-width: 640px) {
  .cs-adopt-flow { grid-template-columns: minmax(0, 1fr); }
  .cs-adopt-arrow { flex-direction: row; justify-content: flex-start; padding-left: var(--space-3); }
  .cs-adopt-arrow::after {
    order: -1;
    width: 12px;
    height: 2.5rem;
    background:
      linear-gradient(var(--accent), var(--accent)) center top / 2px calc(100% - 10px) no-repeat,
      conic-gradient(from 315deg at 50% 100%, var(--accent) 0 90deg, transparent 0) center bottom / 12px 12px no-repeat;
  }
}

@media (forced-colors: active) {
  .cs-adopt-arrow::after { content: "→"; background: none; width: auto; height: auto; font-size: 1.5rem; color: CanvasText; }
  .cs-launch-units li.is-live, .cs-launch-legend .is-live::before, .cs-launch-bar { background: CanvasText; forced-color-adjust: none; }
}

/* In-text links on the home page */
.glance-link, .bullets a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.glance-link { white-space: nowrap; font-weight: 600; }
.glance-link:hover, .bullets a:hover { color: var(--accent-hover); }
.case--linked:hover h3 { color: var(--accent); }
.case--linked h3 { transition: color 0.15s ease; }

.cs-note { margin-top: 0.6rem; font-size: var(--fs-xs); font-family: var(--mono); }
.cs-quote {
  margin-top: 0.6rem;
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--accent);
  background: var(--bg-secondary);
  border-radius: 0 8px 8px 0;
  font-family: var(--headline);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--text-primary);
}

/* Narrow phones: step number above the title, text uses the full width */
@media (max-width: 600px) {
  .cs-steps li { padding-left: 0; }
  .cs-steps li::before { position: static; display: block; margin-bottom: 0.3rem; }
}

/* Contact row at the end of each case */
.cs-contact-wrap { margin-bottom: var(--space-4); }
.cs-contact {
  padding: var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.cs-contact h2 { font-size: 1.4rem; margin-bottom: 0.5rem; text-wrap: balance; }
.cs-contact p { color: var(--text-primary); opacity: 0.85; margin-bottom: var(--space-3); }
.cs-contact-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }
@media (max-width: 480px) {
  .cs-contact { padding: var(--space-3); }
  .cs-contact-links .btn { flex: 1 1 100%; }
  .cs-funnel li { width: calc(30% + var(--w) * 0.7); }
}

/* Draft-only gap markers; must not exist when publishing */
.todo {
  padding: 0.6rem 0.9rem;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  color: var(--accent) !important;
  font-size: var(--fs-sm);
}

/* Home: case cards link to their pages */
.case-link {
  margin-top: 0.35rem;
  padding-block: 0.2rem; /* keeps the target at 24px+ (WCAG 2.5.8) */
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
}

/* Text for screen readers only (e.g. which case a "Read the case" link opens). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.case--linked { position: relative; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.case--linked:hover { border-color: var(--accent); box-shadow: 0 12px 30px -18px rgba(63, 90, 116, 0.55); }
.case--linked .case-link::after { content: ''; position: absolute; inset: 0; z-index: 2; }
.case--linked:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.case--linked .case-link:focus-visible { outline: none; }

@media (max-width: 768px) {
  .cs-timeline { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); padding-left: var(--space-3); }
  .cs-timeline::before { left: 5px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .cs-timeline li { padding-top: 0; }
  .cs-timeline li::before { left: calc(-1 * var(--space-3)); top: 0.2rem; }
  .cs-more-grid { grid-template-columns: minmax(0, 1fr); }
}
