/* ==========================================================================
   Miguel Liberato — Portfolio
   Design system extracted 1:1 from the original Framer project.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts (self-hosted Inter variable — latin + latin-ext, roman + italic)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/inter-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/inter-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* colour */
  --c-black: #000;
  --c-ink: #333;
  --c-muted: rgba(0, 0, 0, 0.55);
  --c-muted-soft: rgba(0, 0, 0, 0.45);
  --c-label: #7f7f7f;
  --c-panel: #f9f9f9;
  --c-white: #fff;
  --c-hairline: rgba(0, 0, 0, 0.09);
  --c-caption: #666;
  --c-chip-bg: rgba(255, 255, 255, 0.62);
  --c-chip-text: rgba(0, 0, 0, 0.62);

  /* metrics */
  --page-pad: 24px;
  --shell-pad: 40px;
  --max: 1280px;
  --gutter: 64px;
  --case-gutter: 40px;

  /* radii */
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --r-pill: 999px;

  /* Elevation — every image except the ones in the About section.
     Layered and low-alpha so it reads the same whether the image ends light or
     dark; the hairline ring defines the edge on screenshots with white borders,
     which is what made the old single-layer shadow look uneven. */
  --shadow-img:
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 2px 6px -2px rgba(0, 0, 0, 0.06),
    0 16px 32px -14px rgba(0, 0, 0, 0.14),
    0 34px 60px -30px rgba(0, 0, 0, 0.18);
  --shadow-img-hover:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 4px 10px -3px rgba(0, 0, 0, 0.07),
    0 22px 42px -16px rgba(0, 0, 0, 0.18),
    0 44px 76px -34px rgba(0, 0, 0, 0.22);
  --shadow-img-sm:
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 2px 5px -2px rgba(0, 0, 0, 0.08),
    0 10px 20px -8px rgba(0, 0, 0, 0.16);

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --hdr-h: 119px;
}

/* --------------------------------------------------------------------------
   3. Reset / base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hdr-h) + 16px);
}

body {
  margin: 0;
  background: var(--c-white);
  color: var(--c-black);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

img, svg { display: block; max-width: 100%; }
img { height: auto; border: 0; }

/* <picture> only carries the AVIF source + WebP fallback — it must not
   participate in layout, so the <img> stays a direct child of its container. */
picture { display: contents; }

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

strong, b { font-weight: 700; }

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

::selection { background: var(--c-black); color: var(--c-white); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 200;
  transform: translateY(-160%);
  background: var(--c-black);
  color: var(--c-white);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.2s var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(0); }

/* --------------------------------------------------------------------------
   3b. Scroll reveal
   The hidden state is scoped to `.js` (set by an inline snippet in <head>), so
   without JavaScript every block simply renders — nothing is ever unreadable.
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transition: opacity 0.7s var(--ease-out), transform 0.75s var(--ease-out);
}
.js [data-reveal='left'] { transform: translate3d(-40px, 0, 0); }
.js [data-reveal='right'] { transform: translate3d(40px, 0, 0); }
.js [data-reveal='up'] { transform: translate3d(0, 28px, 0); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   4. Shell / layout
   -------------------------------------------------------------------------- */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--page-pad);
  background: var(--c-white);
  overflow-x: clip;
}

/* <main> must stretch so that full-bleed sections can reach the page edges */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* max-width 1280 sections (everything except header & footer) */
.section {
  width: 100%;
  max-width: var(--max);
}

/* full-bleed section (hero banner) */
.section--bleed { width: 100%; max-width: none; }

/* --------------------------------------------------------------------------
   5. Typography scale
   -------------------------------------------------------------------------- */
/* Hero — 56px desktop / 32px mobile, ls -0.02em, lh 1.1 */
.t-hero {
  font-size: clamp(2rem, 4.375vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.t-hero--bold { font-weight: 700; }
.t-hero--regular { font-weight: 400; }
.t-hero--case { font-weight: 600; }

/* Section title — 36px / 28px, centred */
.t-section {
  font-size: clamp(1.75rem, 2.8125vw, 2.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: center;
}

/* About / case section heading — 36px / 28px, left */
.t-about-title {
  font-size: clamp(1.75rem, 2.8125vw, 2.25rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0;
}
.t-case-title {
  font-size: clamp(1.75rem, 2.8125vw, 2.25rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

/* CTA title — 48px / 36px */
.t-cta {
  font-size: clamp(2.25rem, 3.75vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
}

/* Card title — 24px / 20px */
.t-card {
  font-size: clamp(1.25rem, 1.875vw, 1.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Uppercase label — 13px, ls 2.5px */
.t-label {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--c-muted);
}


/* --------------------------------------------------------------------------
   6. Buttons & links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease-out),
    transform 0.2s var(--ease-out), opacity 0.2s var(--ease-out);
}
.btn--solid {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--c-black);
  color: var(--c-white);
}
.btn svg { width: 16px; height: 16px; flex: 0 0 16px; }
.btn--solid:hover { background: #1a1a1a; transform: translateY(-1px); }

.btn--hero {
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--c-black);
  color: var(--c-white);
}
.btn--hero:hover { background: #1a1a1a; transform: translateY(-1px); }

.btn--ghost {
  padding: 8px 12px;
  border-radius: var(--r-md);
  color: var(--c-black);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.btn--ghost:hover { opacity: 0.6; }

/* --------------------------------------------------------------------------
   7. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--c-white);
  transition: transform 0.5s var(--ease-out), opacity 0.4s var(--ease-out);
  will-change: transform, opacity;
}
/* Fades while it slides out, so it never leaves a hard edge over the hero. */
.site-header.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px var(--shell-pad);
  background: var(--c-white);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 16px 0;
}

.brand {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.02em;
  transition: opacity 0.2s var(--ease-out);
}
.brand:hover { opacity: 0.65; }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav__link {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  transition: opacity 0.2s var(--ease-out);
}
.nav__link:hover { opacity: 0.55; }
.nav__link[aria-current='page'] {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1.5px;
}

/* Reading progress — a 2px rule under the header on long case pages. */
.progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--c-black);
  will-change: transform;
}

/* Language switcher */
.lang {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 0;
}
.lang__flag {
  display: block;
  width: 31px;
  height: 21px;
  border-radius: 3px;
  overflow: hidden;
  opacity: 0.45;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.lang__flag svg { width: 100%; height: 100%; }
.lang__flag:hover { opacity: 0.85; transform: translateY(-1px); }
.lang__flag[aria-current='true'] {
  opacity: 1;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.28);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
}
.nav-toggle__box {
  position: relative;
  display: block;
  width: 22px;
  height: 14px;
}
.nav-toggle__box span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--c-black);
  transition: transform 0.3s var(--ease-out), opacity 0.2s linear;
}
.nav-toggle__box span:nth-child(1) { top: 0; }
.nav-toggle__box span:nth-child(2) { top: 6px; }
.nav-toggle__box span:nth-child(3) { top: 12px; }
.nav-toggle[aria-expanded='true'] .nav-toggle__box span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded='true'] .nav-toggle__box span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded='true'] .nav-toggle__box span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   8. Hero (home)
   -------------------------------------------------------------------------- */
.hero {
  display: flex;
  justify-content: center;
  width: 100%;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--c-panel) 0%, var(--c-white) 100%);
}
.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  width: 100%;
  max-width: var(--max);
  padding: 80px var(--gutter) 120px;
}
.hero__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 80px;
  width: 100%;
}
.hero__text { max-width: 916px; }
.hero__eyebrow { display: block; }

/* Tilting photo: 5deg rest → -5deg + a touch larger on hover / press */
.hero__photo {
  flex: 0 0 auto;
  width: 100px;
  height: 100px;
  border-radius: 12.8px;
  overflow: hidden;
  box-shadow: var(--shadow-img-sm);
  transform: rotate(5deg);
  transition: transform 0.55s var(--ease-out), box-shadow 0.55s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.hero__photo.is-active {
  transform: rotate(-5deg) scale(1.09);
  box-shadow: var(--shadow-img);
}
@media (hover: hover) and (pointer: fine) {
  .hero__photo:hover { transform: rotate(-5deg) scale(1.09); box-shadow: var(--shadow-img); }
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --------------------------------------------------------------------------
   9. Projects
   -------------------------------------------------------------------------- */
.projects {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 40px var(--gutter) 80px;
}
.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  width: 100%;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  border-radius: var(--r-sm);
}
.card__media {
  width: 100%;
  aspect-ratio: 388 / 517;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-panel);
  box-shadow: var(--shadow-img);
  transition: box-shadow 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}
.card__desc {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--c-muted);
}
.card__cta {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--c-black);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a.card:hover .card__media { transform: translateY(-4px); box-shadow: var(--shadow-img-hover); }
a.card:hover .card__media img { transform: scale(1.035); }
a.card:hover .card__cta { opacity: 0.65; }
.card--soon { opacity: 0.85; }

/* --------------------------------------------------------------------------
   10. About
   -------------------------------------------------------------------------- */
.about {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 78px;
  padding: 80px var(--gutter) 120px;
  background: var(--c-panel);
  border-radius: var(--r-lg);
}
.about__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
  max-width: 616px;
}
.about__head {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.about__label {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 2.5px;
  color: var(--c-label);
}
.about__body { color: var(--c-ink); }
.about__body p { font-size: 17px; font-weight: 400; line-height: 28px; }
.about__body p + p { margin-top: 28px; }

.about__brands { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.about__brands-label {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--c-ink);
}
.brands {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  width: 100%;
}
.brands li { display: flex; align-items: center; height: 40px; }
/* width/height attributes in the markup carry the intended display size
   (sources are @2x); height:auto keeps the ratio exact. */
.brands img {
  opacity: 0.55;
  height: auto;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.brands li:hover img { opacity: 0.95; transform: scale(1.09); }

.about__photo {
  flex: 0 0 auto;
  width: 425px;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.about__photo img { width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   11. Contact CTA
   -------------------------------------------------------------------------- */
.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 120px var(--gutter);
  text-align: center;
}
.cta--case { padding: 80px var(--gutter); }
.cta__head { width: 100%; }
.cta__body {
  max-width: 1000px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--c-muted-soft);
}
.social {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.social a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  color: var(--c-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s var(--ease-out);
}
.social a:hover { color: var(--c-black); }
.social svg { width: 16px; height: 16px; flex: 0 0 16px; }

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  width: 100%;
  border-top: 1px solid var(--c-hairline);
}
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 64px var(--shell-pad);
}
.site-footer__brand {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  transition: opacity 0.2s var(--ease-out);
}
.site-footer__brand:hover { opacity: 0.65; }
.site-footer__meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--c-muted);
}

/* --------------------------------------------------------------------------
   13. Case pages
   -------------------------------------------------------------------------- */
.case-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding: 40px var(--case-gutter) 80px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--c-panel) 0%, var(--c-white) 100%);
}
.case-header__top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  max-width: 900px;
}
.case-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  width: 100%;
}
.case-meta > div { display: flex; flex-direction: column; gap: 8px; }
.case-meta dt {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--c-muted);
}
.case-meta dd {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.02em;
}
.case-header__lede {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--c-muted);
}
.case-header__lede strong { color: var(--c-muted); }

.case-header__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  flex-wrap: wrap;
}
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
/* The header gradient is almost white where the tags sit, so a translucent
   white fill disappeared — the pill needs its own outline to read. */
.tags li {
  padding: 5px 13px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.72px;
  text-transform: uppercase;
  color: var(--c-chip-text);
}
.back-link {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--c-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  white-space: nowrap;
  transition: color 0.2s var(--ease-out);
}
.back-link:hover { color: var(--c-black); }

.case-hero-media {
  width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-img);
}
.case-hero-media img { width: 100%; height: auto; }

/* Alguns cases têm capturas de app em resolução menor que a largura do bloco.
   Cada limite abaixo é o tamanho nativo da imagem correspondente (ou muito
   perto dele): imagem esticada perde nitidez. */
.case-hero-media--app { max-width: 660px; margin-inline: auto; }
.figure--cap .figure__media { max-width: 780px; margin-inline: auto; }
.figure--cap-sm .figure__media { max-width: 660px; margin-inline: auto; }
.figure--inset .figure__media { max-width: 420px; margin-inline: auto; }
.media-pair--cap { max-width: 900px; margin-inline: auto; }
/* variante retrato + paisagem (o --auto padrão é paisagem + retrato) */
.media-pair--auto-alt { align-items: stretch; }
.media-pair--auto-alt > *:first-child { flex: 750 1 0; }
.media-pair--auto-alt > *:last-child { flex: 2069 1 0; }
.media-pair--auto-alt > * > img { height: 100%; object-fit: cover; }

/* Galeria de telas: uma imagem larga no topo ocupando as duas colunas, o
   restante em duas colunas. Usada nas telas finais de um case. */
.screens-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  align-items: start;
}
.screens-grid__wide { grid-column: 1 / -1; }

/* Case content blocks */
.case-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
  padding: 40px var(--case-gutter);
}
.case-block--lead { padding-top: 80px; }
.case-block--wide { padding: 40px var(--gutter); align-items: center; }

.prose { width: 100%; font-size: 17px; font-weight: 400; line-height: 1.4; }
.prose p + p,
.prose ul + p,
.prose p + ul { margin-top: 24px; }
.prose ul { display: flex; flex-direction: column; gap: 0; }
.prose li {
  position: relative;
  padding-left: 22px;
}
.prose li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s var(--ease-out);
}
.prose a:hover { opacity: 0.6; }

/* Two-column block: text + figure */
.case-split {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 40px var(--case-gutter);
}
.case-split__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  flex: 1 1 0;
  min-width: 0;
}
.case-split__text .prose { max-width: 560px; }
.case-split__figure { flex: 1 1 0; min-width: 0; }

/* Figures — every media box keeps the image's natural ratio, so nothing is
   ever cropped; width/height on the <img> reserves the space (no CLS). */
.figure { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.figure__media,
.media-plain {
  width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-panel);
  box-shadow: var(--shadow-img);
}
.figure__media img,
.media-plain img { width: 100%; height: auto; display: block; }
.figure figcaption {
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  line-height: 1.4;
  color: var(--c-caption);
  text-align: center;
}

.media-pair { display: flex; align-items: flex-start; gap: 32px; width: 100%; }
.media-pair > * { flex: 1 1 0; min-width: 0; }

/* Automation pair: one landscape + one portrait. The flex-grow values are the
   images' widths at a shared height (1278/825 and 515/885), so both columns
   end up exactly the same height with no cropping. */
.media-pair--auto { align-items: flex-start; }
.media-pair--auto > *:first-child { flex: 1549 1 0; }
.media-pair--auto > *:last-child { flex: 582 1 0; }

/* Long full-page screenshot showcase */
.showcase { width: 100%; display: flex; justify-content: center; }
/* A 973x4096 screenshot is ~4 megapixels — by far the heaviest asset on the
   site. aspect-ratio keeps the box exact at any width, so content-visibility
   can skip rendering it until it is near the viewport without ever shifting
   the scroll position. */
.showcase__frame {
  width: min(794px, 100%);
  aspect-ratio: 973 / 4096;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-img);
  content-visibility: auto;
  contain-intrinsic-size: auto 3342px;
}
.showcase__frame img { width: 100%; height: 100%; object-fit: cover; }

/* Three-column definition group */
.group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  width: 100%;
}
.group-grid h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 2px;
}
.group-grid p { font-size: 17px; font-weight: 400; line-height: 1.4; }

/* Case pagination */
.case-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px var(--case-gutter);
}
.case-nav a {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.45;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity 0.2s var(--ease-out);
}
.case-nav a:hover { opacity: 0.6; }
.case-nav__next { text-align: right; margin-left: auto; }

/* --------------------------------------------------------------------------
   13a. Lightbox — case screenshots are dense; let them be opened full size
   -------------------------------------------------------------------------- */
.zoomable { position: relative; cursor: zoom-in; }
.zoomable::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0);
  transition: background-color 0.25s var(--ease-out);
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .zoomable:hover::after { background: rgba(0, 0, 0, 0.05); }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s var(--ease-out), visibility 0.28s linear;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-img);
  transform: scale(0.98);
  transition: transform 0.28s var(--ease-out);
  cursor: zoom-out;
}
/* Very tall screenshots scroll inside the overlay instead of shrinking to dust */
.lightbox__scroll {
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
  border-radius: var(--r-md);
  -webkit-overflow-scrolling: touch;
}
.lightbox__scroll .lightbox__img { max-height: none; }
.lightbox.is-open .lightbox__img { transform: scale(1); }
.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--c-black);
  transition: background-color 0.2s var(--ease-out);
}
.lightbox__close:hover { background: rgba(0, 0, 0, 0.12); }
.lightbox__close svg { width: 18px; height: 18px; }
body.is-locked { overflow: hidden; }

/* --------------------------------------------------------------------------
   13b. Résumé page
   -------------------------------------------------------------------------- */
.resume-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding: 48px var(--case-gutter) 56px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--c-panel) 0%, var(--c-white) 100%);
}
.resume-header__id { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.resume-header__role {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--c-muted);
}
.resume-header__lede {
  max-width: 70ch;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--c-ink);
}
.resume-header__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
}

.resume-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.resume-contact a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--c-chip-bg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-ink);
  transition: background-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.resume-contact a:hover { background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22); }
.resume-contact svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--c-muted); }

.resume-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 328px;
  gap: 64px;
  padding: 56px var(--case-gutter) 24px;
}
.resume-main > .resume-section + .resume-section { margin-top: 72px; }
.resume-aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: calc(var(--hdr-h) + 24px);
  align-self: start;
}

/* The label plus a rule that fills the rest of the line — clearly separates
   Experience from Education without adding another type size. */
.resume-section__title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--c-black);
  margin-bottom: 28px;
}
.resume-section__title::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--c-hairline);
}
/* inside the aside cards the label alone is enough — no rule, no clutter */
.resume-card .resume-section__title { color: var(--c-label); }
.resume-card .resume-section__title::after { display: none; }

/* One vertical hairline with a dot per entry replaces the row of horizontal
   dividers, and it reads as the timeline it actually is. */
.resume-timeline { position: relative; padding-left: 28px; }
.resume-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--c-hairline);
}
.job { position: relative; }
.job::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c-white);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.30);
}
/* the current role gets a filled marker */
.job:first-child::before { background: var(--c-black); box-shadow: none; }
.job + .job { margin-top: 40px; }
.job__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 12px;
}
.job__role { font-size: 19px; font-weight: 600; line-height: 1.35; letter-spacing: -0.02em; }
.job__role span { font-weight: 400; color: var(--c-muted); }
.job__period {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--c-muted);
  white-space: nowrap;
}
.job ul { display: flex; flex-direction: column; gap: 8px; }
.job li {
  position: relative;
  padding-left: 20px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-ink);
}
.job li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
}
.job__note { font-size: 16px; line-height: 1.55; color: var(--c-muted); }

.resume-card {
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--c-panel);
}
.resume-card .resume-section__title { margin-bottom: 16px; }
.resume-group + .resume-group { margin-top: 18px; }
.resume-group h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}
.resume-group p { font-size: 15px; line-height: 1.55; color: var(--c-ink); }
.resume-list { display: flex; flex-direction: column; gap: 10px; }
.resume-list li { font-size: 15px; line-height: 1.5; }
.resume-list b { font-weight: 600; }
.resume-list span { color: var(--c-muted); }

/* --------------------------------------------------------------------------
   14. Responsive
   -------------------------------------------------------------------------- */

/* Below the 1280 design width: shrink gutters progressively */
@media (max-width: 1199px) {
  :root { --gutter: 48px; --case-gutter: 32px; --shell-pad: 24px; }
  .hero__row { gap: 48px; }
  .about { gap: 48px; }
  .about__photo { width: 360px; }
  /* below the design width three cards drop under the 336px minimum */
  .projects__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tablet */
@media (max-width: 1023px) {
  :root { --gutter: 40px; --case-gutter: 28px; --hdr-h: 96px; }

  .site-header__inner { padding: 16px var(--shell-pad); }
  .site-header__bar { padding: 8px 0; }

  /* collapse nav into a panel */
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px var(--shell-pad) 24px;
    background: var(--c-white);
    border-bottom: 1px solid var(--c-hairline);
    box-shadow: 0 18px 32px -24px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out),
      visibility 0.25s linear;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav__link {
    padding: 14px 4px;
    font-size: 18px;
    border-bottom: 1px solid var(--c-hairline);
  }
  .nav .btn--solid {
    margin-top: 16px;
    align-self: flex-start;
    padding: 12px 20px;
    font-size: 17px;
  }
  /* The flags stay in the bar — switching language is a primary action here. */
  .site-header__actions { display: flex; align-items: center; gap: 4px; }
  .lang { padding: 8px 4px 8px 0; }

  .hero__inner { padding: 64px var(--gutter) 88px; }
  .hero__row { gap: 32px; }

  .projects { padding: 32px var(--gutter) 64px; }
  .projects__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }

  .about {
    flex-direction: column-reverse;
    align-items: center;
    gap: 40px;
    padding: 64px var(--gutter) 80px;
  }
  .about__text { max-width: none; width: 100%; }
  .about__photo { width: min(340px, 70%); }

  .cta { padding: 88px var(--gutter); }
  .cta--case { padding: 64px var(--gutter); }

  .site-footer__inner { padding: 48px var(--shell-pad); }

  /* case pages */
  .case-split { flex-direction: column; align-items: stretch; gap: 32px; }
  .case-split__text .prose { max-width: none; }
  .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .case-block--lead { padding-top: 56px; }

  .resume-layout { grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: 48px; }
  .resume-aside { position: static; }
}

/* Mobile */
@media (max-width: 767px) {
  :root {
    --page-pad: 16px;
    --gutter: 24px;
    --case-gutter: 20px;
    --shell-pad: 16px;
    --hdr-h: 88px;
  }

  body { font-size: 16px; }

  .t-section { line-height: 1.2; }
  .t-about-title { line-height: 1.2; letter-spacing: -0.02em; }
  .t-case-title { letter-spacing: -0.02em; }

  /* Mobile hero follows the original Framer phone layout: photo on top,
     everything centred, full-width primary button, résumé as a text link. */
  .hero { border-radius: var(--r-md); }
  .hero__inner {
    align-items: center;
    text-align: center;
    padding: 40px var(--gutter) 48px;
    gap: 28px;
  }
  .hero__row { flex-direction: column-reverse; align-items: center; gap: 24px; }
  .hero__text { max-width: none; width: 100%; }
  .hero__text .t-hero { font-size: 32px; line-height: 1.15; }
  .hero__text .t-hero--regular {
    display: block;
    margin-top: 12px;
    font-size: 18px;
    line-height: 1.45;
    letter-spacing: normal;
  }
  .hero__photo { width: 92px; height: 92px; border-radius: 12px; }

  .hero__actions { flex-direction: column; align-items: stretch; width: 100%; gap: 14px; }
  .hero__actions .btn--hero { width: 100%; padding: 13px 16px; }
  .hero__actions .btn--ghost { align-self: center; padding: 0; }

  .projects { padding: 24px var(--gutter) 56px; gap: 32px; }
  .projects__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .card { gap: 20px; }

  .about { border-radius: var(--r-md); padding: 48px var(--gutter) 56px; gap: 32px; }
  .about__text { gap: 32px; }
  .about__head { gap: 16px; }
  .about__body p { font-size: 16px; line-height: 26px; }
  .about__body p + p { margin-top: 22px; }
  .about__photo { width: min(300px, 78%); }
  .brands { justify-content: flex-start; gap: 10px 22px; }
  .brands li { height: 30px; }
  .brands img { max-width: 78px; height: auto; }

  .cta { padding: 64px var(--gutter); }
  .cta--case { padding: 56px var(--gutter); }
  .cta__body { font-size: 16px; }
  .social { gap: 18px; }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 40px var(--shell-pad);
  }

  /* case pages */
  .case-header { border-radius: var(--r-md); padding: 32px var(--case-gutter) 48px; gap: 20px; }
  /* label on the left, value on the right — as in the Framer phone layout */
  .case-meta { flex-direction: column; gap: 10px; }
  .case-meta > div {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
  }
  .case-meta dd { font-size: 17px; text-align: right; }
  .case-header__lede { font-size: 16px; line-height: 1.4; }
  .case-header__foot { align-items: flex-start; gap: 20px; }

  .case-block { padding: 32px var(--case-gutter); gap: 28px; }
  .case-block--lead { padding-top: 48px; }
  .case-block--wide { padding: 32px var(--case-gutter); }
  .prose { font-size: 16px; line-height: 1.5; }
  .prose p + p, .prose ul + p, .prose p + ul { margin-top: 20px; }

  .media-pair { flex-direction: column; gap: 20px; }
  .media-pair > * { flex: 0 0 auto; width: 100%; }
  .media-pair--auto-alt > * > img { height: auto; }
  .screens-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }

  /* Wide screenshots become unreadable at phone width — hide the ones that
     add nothing there and keep the page light. */
  [data-hide-mobile] { display: none !important; }

  .group-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }

  .case-nav { padding: 32px var(--case-gutter) 8px; gap: 16px; }
  .case-nav a { font-size: 16px; }

  .resume-timeline { padding-left: 22px; }
  .job::before { left: -22px; width: 8px; height: 8px; }
  .resume-timeline::before { left: 4px; }
  .job + .job { margin-top: 32px; }
  .resume-main > .resume-section + .resume-section { margin-top: 52px; }

  .resume-header { border-radius: var(--r-md); padding: 36px var(--case-gutter) 40px; gap: 20px; }
  .resume-header__role { font-size: 18px; }
  .resume-header__lede { font-size: 16px; }
  .resume-layout { padding: 40px var(--case-gutter) 8px; gap: 40px; }
  .resume-main > .resume-section + .resume-section { margin-top: 44px; }
  .job__role { font-size: 18px; }
  .job li, .job__note { font-size: 15px; }
  .resume-card { padding: 20px; }
}

/* both pagination links no longer fit on one line */
@media (max-width: 479px) {
  .case-nav { flex-direction: column; align-items: flex-start; gap: 14px; }
  .case-nav__next { text-align: left; margin-left: 0; }
}

/* --------------------------------------------------------------------------
   15. Preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  /* never hide the header, never stage content behind an animation */
  .site-header.is-hidden { transform: none; opacity: 1; pointer-events: auto; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* The résumé page should print as a clean CV. */
@media print {
  .site-header, .nav-toggle, .lang, .case-nav, .cta, .site-footer { display: none !important; }
  .page { padding: 0; }
  a { text-decoration: underline; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }

  .resume-header {
    background: none;
    border-radius: 0;
    padding: 0 0 20px;
    border-bottom: 1px solid #ddd;
  }
  .resume-layout {
    display: block;
    padding: 20px 0 0;
  }
  .resume-aside { display: block; margin-top: 28px; }
  .resume-card { background: none; padding: 0; margin-bottom: 20px; }
  .resume-contact a { background: none; box-shadow: none; padding: 0 12px 0 0; }
  .btn { display: none !important; }
  .job { break-inside: avoid; }
  h1 { font-size: 28pt !important; }
}
