/* =========================================================
   henriquearaujo.work
   Source of truth: Figma file "portfolio" (f8kadwC7CitbkyoU3ZsMEh)
   Grid: 1440 page · 12 cols × 84 · gutter 24 · margin 84
   Content: 1056 fixed, centered (cols 2–11)
   Header/footer: full width, side margin scales with viewport (84/1440)
   ========================================================= */

/* ---------- Tokens (Figma variables) ---------- */
:root {
  /* Color */
  --color-text-primary: #292A2C;
  --color-text-secondary: #666666;
  --color-text-inverse: #FFFFFF;
  --color-text-inverse-secondary: #A1A1A6;
  --color-bg-page: #FFFFFF;
  --color-bg-inverse: #292A2C;
  --color-border-default: #E5E5E5;
  --color-border-strong: #D2D2D7;
  --color-status-success: #1E9E23;
  --color-action-primary: #292A2C;
  --color-action-primary-hover: #121314;
  --color-relocation: #15803D;
  --color-status-error: #C2261C;

  /* Radius */
  --radius-sm: 8px;
  --radius-full: 999px;

  /* Effects */
  --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.08);

  /* Layout */
  --content-width: 1056px;
  /* Header/footer side margin: proportional up to 1440 (84px), then the content stops growing
     and stays centred at 1272px wide; backgrounds keep the full width */
  --edge: max(calc(84 / 1440 * 100vw), calc((100vw - 1440px) / 2 + 84px));
  --section-gap: 128px;
  --header-height: 88px;

  /* Interaction feedback */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 200ms;
  --ease-sweep: cubic-bezier(0.16, 1, 0.3, 1); /* link underline sweep */
  --duration-sweep: 450ms;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-height) + var(--section-gap)); /* anchors land 128px below the header */ scroll-behavior: smooth; }

/* Smooth scroll (Lenis): it drives the scroll itself, so native smoothing is turned off while it runs.
   Without JS or with reduced motion, the native rules above still apply. */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

body {
  margin: 0;
  background: var(--color-bg-page);
  color: var(--color-text-primary);
  font-family: var(--font);
  font-size: 16px;
  line-height: 27px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
img { display: block; max-width: 100%; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--16 { width: 16px; height: 16px; }

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

:focus-visible { outline: 2px solid var(--color-action-primary); outline-offset: 2px; }
.case-card :focus-visible,
.site-footer :focus-visible { outline-color: var(--color-text-inverse); }

/* ---------- Text styles (Figma) ---------- */
.t-section  { font-size: 18px; line-height: 22px; font-weight: 700; }   /* Heading/Section */
.t-overline { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.72px; text-transform: uppercase; } /* UI/Overline */
.t-cta      { font-size: 32px; line-height: 40px; font-weight: 800; }   /* Heading/CTA */

/* ---------- Layout ---------- */
.container {
  width: min(var(--content-width), calc(100% - 2 * var(--edge)));
  margin-inline: auto;
}

main { padding-top: var(--section-gap); }
main > * + * { margin-top: var(--section-gap); }

/* Two-column section: label on col 2, content (840) from col 4 */
.section-row { display: flex; justify-content: space-between; align-items: flex-start; }
.section-row__content { width: 840px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-inline: var(--edge);
  background: var(--color-bg-page);
  border-bottom: 1px solid transparent;
}
/* State=Scrolled: 90% surface + blur 20 + 1px bottom border */
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom-color: var(--color-border-default);
}

.logo { font-size: 14px; line-height: 1; font-weight: 800; justify-self: start; }

.nav { display: flex; gap: 48px; align-items: center; }
.nav-link {
  display: flex; flex-direction: column; gap: 4px; padding-top: 5px;
  font-size: 14px; line-height: normal; color: var(--color-text-secondary);
  transition: color var(--duration-sweep) var(--ease-sweep);
}
/* Underline sweep: draws in from the left on hover, leaves through the right.
   Weight never changes, so the words keep their width. */
.nav-link::after {
  content: ""; height: 2px; width: 100%;
  border-radius: var(--radius-full);
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--duration-sweep) var(--ease-sweep);
}
.nav-link:hover,
.nav-link:focus-visible { color: var(--color-action-primary-hover); }
.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); transform-origin: left center; }

.header-actions { display: flex; gap: 32px; align-items: center; justify-self: end; }


/* ---------- Button (pill) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px 12px 24px;
  border: 1px solid var(--color-action-primary);
  border-radius: var(--radius-full);
  font-size: 14px; line-height: 20px; font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.btn--primary { background: var(--color-action-primary); color: var(--color-text-inverse); }
.btn--primary:hover { background: var(--color-action-primary-hover); border-color: var(--color-action-primary-hover); }
/* Icon hidden at rest, grows in on hover (inspired by sakib.design). Applies to every button.
   The text slides 12px left while the icon slot opens; padding gives back the same space,
   so each button keeps its exact width and nothing around it moves. */
.btn {
  gap: 0; padding-left: 36px; padding-right: 36px;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), padding 300ms var(--ease-out);
}
.btn__reveal {
  display: inline-flex; overflow: hidden;
  width: 0; margin-left: 0;
  transition: width 300ms var(--ease-out), margin 300ms var(--ease-out);
}
.btn__reveal .icon { opacity: 0; transition: opacity 200ms var(--ease-out); }
.btn:hover,
.btn:focus-visible { padding-left: 24px; padding-right: 20px; }
.btn:hover .btn__reveal,
.btn:focus-visible .btn__reveal { width: 20px; margin-left: 8px; }
.btn:hover .btn__reveal .icon,
.btn:focus-visible .btn__reveal .icon { opacity: 1; transition-delay: 80ms; }
.btn--secondary { background: transparent; color: var(--color-text-primary); }
.btn--secondary:hover { background: var(--color-action-primary); color: var(--color-text-inverse); }

/* ---------- Link (text + trailing icon, 44px touch height) ---------- */
.link {
  display: inline-flex; align-items: center;
  padding: 12px 0;
  font-size: 14px; line-height: 20px; font-weight: 600;
  white-space: nowrap;
}
.link__label { text-decoration: underline transparent; text-underline-offset: 4px; text-decoration-thickness: 1px; }
/* Hover: underline + icon moves 4px (padding keeps the width, nothing around moves) */
.link:hover .link__label,
.case-card:hover .link__label { text-decoration-color: currentColor; }
.link--dark { color: var(--color-text-inverse); }

/* Footer links: same underline sweep as the menu, under the label only */
.link--sweep { color: rgba(255, 255, 255, 0.8); transition: color var(--duration-sweep) var(--ease-sweep); }
.link--sweep .link__label { position: relative; text-decoration: none; }
.link--sweep .link__label::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 2px;
  border-radius: var(--radius-full);
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--duration-sweep) var(--ease-sweep);
}
.link--sweep:hover,
.link--sweep:focus-visible { color: var(--color-text-inverse); }
.link--sweep:hover .link__label::after,
.link--sweep:focus-visible .link__label::after,
.case-card:hover .link--sweep .link__label::after { transform: scaleX(1); transform-origin: left center; }
/* Read case study is the card's main action: stays at full white, the whole card triggers the sweep */
.case-card .link--sweep { color: var(--color-text-inverse); }

/* ---------- Status tag ---------- */
.tag {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px;
  background: var(--color-bg-page);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-elevated);
  font-size: 12px; line-height: 16px; font-weight: 600;
  white-space: nowrap;
}
.tag__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-status-success); flex: none; }
.tag--relocation { background: var(--color-relocation); color: var(--color-text-inverse); }

/* ---------- Hero ---------- */
.hero { position: relative; }
.hero__title {
  position: relative;
  width: 624px;
  font-size: 48px;
  line-height: 58px;
  font-weight: 400;
  white-space: nowrap; /* line breaks come from Figma */
}
.hero__title strong { font-weight: 700; }
.hero__emoji-slot { display: inline-block; width: 56px; } /* room for the memoji */
.hero__memoji { position: absolute; left: 0; top: -9px; width: 54px; height: 63px; }

/* Location chips: positions and rotations from Figma (centre point + angle) */
.hero__location { position: absolute; inset: 0; pointer-events: none; }
.hero__location > * { position: absolute; transform: translate(-50%, -50%) rotate(calc(var(--r) + var(--swing))); }

/* Hover swing: the plates hang from the pin. The whole cluster swings around the pin point,
   and each plate adds a small sway of its own, slightly out of step, then everything settles. */
@property --swing { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.hero__location { transform-origin: 922px 50px; } /* the pin's needle */
.hero__location .tag { pointer-events: auto; cursor: default; }
.hero__location.is-swinging { animation: plates-swing 1400ms cubic-bezier(0.25, 0.1, 0.25, 1); }
.hero__location.is-swinging .tag { animation: plate-sway 1200ms ease-out; }
.hero__location.is-swinging .tag:nth-of-type(2) { animation-delay: 60ms; }
.hero__location.is-swinging .tag:nth-of-type(3) { animation-delay: 120ms; }
@keyframes plates-swing {
  0%   { rotate: 0deg; }
  18%  { rotate: 5deg; }
  40%  { rotate: -3.5deg; }
  60%  { rotate: 2deg; }
  78%  { rotate: -0.8deg; }
  100% { rotate: 0deg; }
}
@keyframes plate-sway {
  0%   { --swing: 0deg; }
  25%  { --swing: -3deg; }
  50%  { --swing: 2deg; }
  75%  { --swing: -0.8deg; }
  100% { --swing: 0deg; }
}
.hero__pin { font-size: 29px; line-height: 40px; }

/* ---------- About ---------- */
.about { position: relative; margin-top: var(--section-gap); }
/* The photo frame does not clip, so the "Open to work" pill can sit across its edge; the image clips itself */
.about__photo { position: relative; width: 310.7px; height: 404px; }
.about__photo img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); background: #111; }
.about__text { width: 395px; display: flex; flex-direction: column; gap: 40px; align-items: flex-start; }
.about__text p { color: var(--color-text-secondary); }
.about__text p + p { margin-top: 27px; }
.about__text b { font-weight: 700; color: var(--color-text-primary); }
.about__status { position: absolute; left: 0; top: 185px; transform: translateX(-50%); } /* pill centred on the photo's left edge */
/* Gentle float: 6px up and down, slow enough to read as "alive", not as a button */
.about__status { animation: status-float 2s ease-in-out infinite alternate; }
@keyframes status-float {
  from { transform: translate(-50%, 0); }
  to   { transform: translate(-50%, -6px); }
}

/* ---------- Selected work ---------- */
.work__label { margin-bottom: 32px; }

.case-card {
  position: relative;
  display: block;
  height: 560px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #343538;
  background-clip: padding-box; /* keeps the dark fill from bleeding through the light border at the rounded corners */
  color: var(--color-text-inverse);
}
.case-card__media {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.case-card__body {
  position: absolute; left: 467px; top: 78px; width: 516px; /* Figma 468/79 minus the 1px border */
  display: flex; flex-direction: column; gap: 24px; align-items: flex-start;
}
.case-card__heading { display: flex; flex-direction: column; gap: 24px; }
.case-card__overline { color: var(--color-text-inverse-secondary); }
.case-card__summary { opacity: 0.8; text-wrap: pretty; }
.case-card__actions { display: flex; gap: 24px; align-items: center; }
.case-card__lock { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--color-text-inverse-secondary); }
.case-card__link::after { content: ""; position: absolute; inset: 0; } /* whole card is the click target */
.case-card + .case-card { margin-top: 48px; } /* cases stack, one below the other */
/* "Em construção" note under the cases */
.work__note {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px; padding: 20px 24px;
  border: 1px dashed var(--color-border-strong); border-radius: var(--radius-sm);
  font-size: 14px; line-height: 22px; color: var(--color-text-secondary);
}
.work__note strong { font-weight: 600; color: var(--color-text-primary); }
.work__note-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: var(--radius-full); background: #F3F3F2; color: var(--color-text-primary); }


/* ---------- Info card (Experience + Education) ---------- */
.info-card {
  display: flex; align-items: center; gap: 4px;
  width: 100%;
  padding: 16px 24px;
  background: var(--color-bg-page);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  font-size: 14px; line-height: 27px;
}
.info-card__text { flex: 1 1 0; min-width: 1px; display: flex; flex-direction: column; }
.info-card__overline,
.info-card__meta { color: var(--color-text-secondary); }
.info-card__title { font-weight: 600; }

/* Experience Card (interactive): first card only. Hover = 2px lift + shadow + dark plus */
.experience__item { list-style: none; }
.info-card--action {
  width: 100%;
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.info-card--action:hover,
.info-card--action:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-elevated); border-color: transparent; }
.info-card__plus {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-bg-page);
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
/* Plus spins half a turn on hover, fast start and slow finish. It only animates on the way in:
   leaving snaps back to 0deg, which looks identical to 180deg for a plus sign, so there is no reverse spin. */
.info-card__plus .icon { transition: none; }
.info-card--action:hover .info-card__plus .icon,
.info-card--action:focus-visible .info-card__plus .icon {
  transform: rotate(180deg);
  transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}
.info-card--action:hover .info-card__plus,
.info-card--action:focus-visible .info-card__plus { background: var(--color-action-primary); border-color: var(--color-action-primary); color: var(--color-text-inverse); }

/* ---------- Experience ---------- */
.experience__inner { display: flex; justify-content: space-between; align-items: flex-start; }
.experience__intro { width: 340px; color: var(--color-text-secondary); }
.experience__intro p + p { margin-top: 27px; }
.experience__list { width: 408px; display: flex; flex-direction: column; gap: 24px; }

/* ---------- Education ---------- */
.education__columns { display: flex; gap: 24px; align-items: flex-start; }
.education__column { width: 408px; display: flex; flex-direction: column; gap: 16px; }
.education__group-label { height: 32px; padding-bottom: 8px; display: flex; align-items: center; color: var(--color-text-secondary); }
.education__cards { display: flex; flex-direction: column; gap: 24px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--section-gap);
  padding: 80px var(--edge) 40px;
  display: flex; flex-direction: column; gap: 40px;
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse);
}
.footer__main { display: flex; flex-direction: column; gap: 80px; }
.footer__cta { display: flex; justify-content: space-between; align-items: center; }
.footer__title { font-size: 32px; line-height: 40px; font-weight: 800; }
.footer__subtitle { font-size: 18px; line-height: 32px; color: rgba(255, 255, 255, 0.8); }
.footer__links { display: flex; gap: 64px; align-items: center; }
.footer__brand { display: flex; flex-direction: column; gap: 8px; padding-bottom: 40px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.footer__logo { font-size: 14px; line-height: normal; font-weight: 800; }
.footer__tagline { opacity: 0.8; }
.footer__bottom { display: flex; justify-content: space-between; align-items: flex-start; font-size: 14px; white-space: nowrap; }
.footer__bottom p { opacity: 0.8; }

/* ---------- Reveal on scroll ----------
   Each item fades in and rises 16px as it reaches the viewport, one after the other, top to bottom.
   Uses the `translate` property so it never fights the tags' rotation or the status float.
   .js-reveal is set in <head> (only with JS and motion allowed), so nothing flashes before hiding.
   The hero (title + location tags) enters as one block.
   Keep this list in sync with REVEAL in index.html. */
.js-reveal :is(.hero,
  #about .t-section,
  .about__photo,
  .about__text p,
  .about__text .btn,
  .about__status,
  .work__label,
  .case-card,
  .work__note,
  #experience-title,
  .experience__intro,
  .experience__list > li,
  #education-title,
  .education__group-label,
  .education__cards > li,
  .footer__title,
  .footer__subtitle,
  .footer__links > li,
  .footer__brand):not(.reveal-done) {
  opacity: 0;
  translate: 0 var(--reveal-distance, 16px);
  transition: opacity var(--reveal-duration, 700ms) var(--reveal-ease, var(--ease-out)), translate var(--reveal-duration, 700ms) var(--reveal-ease, var(--ease-out));
  transition-delay: var(--reveal-delay, 0ms);
}
.js-reveal :is(.hero,
  #about .t-section,
  .about__photo,
  .about__text p,
  .about__text .btn,
  .about__status,
  .work__label,
  .case-card,
  .work__note,
  #experience-title,
  .experience__intro,
  .experience__list > li,
  #education-title,
  .education__group-label,
  .education__cards > li,
  .footer__title,
  .footer__subtitle,
  .footer__links > li,
  .footer__brand).is-revealed:not(.reveal-done) { opacity: 1; translate: 0 0; }
/* Hero comes down from above; everything else rises from below */
.hero { --reveal-distance: -16px; }
/* .reveal-done: animation finished, the element gets its own transitions (button hovers etc.) back */

/* ---------- Layout overrides from the Figma PT frame ---------- */

.hero__title { width: 733px; font-size: 44px; line-height: 53px; }
.case-card__body { left: 488px; top: 50%; transform: translateY(-50%); width: 472px; } /* x 489 / w 472 from Figma; centred vertically in the card */

/* Case tags: small outline labels (Figma "Tag Outline / Dark"). Not interactive. */
.case-card__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.case-card__tags li {
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  font-size: 12px; line-height: 16px; font-weight: 600;
  color: var(--color-text-inverse-secondary);
  white-space: nowrap;
}

/* ---------- Experience drawer (Icatu) ----------
   Right-side sheet over a dimmed page. Long reading content, so it scrolls on its own
   and the header (company, role, close) stays pinned. */
.drawer {
  position: fixed; inset: 0 0 0 auto;
  width: min(640px, 100vw); max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--color-text-primary);
  overflow: visible;
}
.drawer::backdrop { background: rgba(18, 19, 20, 0.4); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.drawer__panel {
  height: 100%;
  display: flex; flex-direction: column;
  background: var(--color-bg-page);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.12);
}
.drawer__header {
  flex: none;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding: 32px 48px 24px;
  border-bottom: 1px solid var(--color-border-default);
}
.drawer__overline, .drawer__meta { color: var(--color-text-secondary); }
.drawer__title { margin: 8px 0 4px; font-size: 24px; line-height: 32px; font-weight: 700; }
.drawer__meta { font-size: 14px; line-height: 22px; }
.drawer__close {
  width: 44px; height: 44px; flex: none; margin: -6px -10px 0 0;
  display: grid; place-items: center;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-full);
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.drawer__close:hover { background: var(--color-action-primary); border-color: var(--color-action-primary); color: var(--color-text-inverse); }
/* Focus ring only for keyboard users: autofocus lands here on open */
.drawer__close:focus:not(:focus-visible) { outline: none; }

.drawer__body { flex: 1 1 auto; overflow-y: auto; padding: 32px 48px 64px; overscroll-behavior: contain; }
.drawer__intro { color: var(--color-text-secondary); }
.drawer__intro p + p, .project p + p { margin-top: 16px; }
.drawer__section-label { margin-top: 48px; padding-bottom: 16px; color: var(--color-text-secondary); }

.drawer__projects { margin: 0; padding: 0; list-style: none; }
.project { padding: 32px 0; border-top: 1px solid var(--color-border-default); }
.project:last-child { padding-bottom: 0; }
.project__title { margin: 0 0 12px; font-size: 18px; line-height: 26px; font-weight: 700; }
.project__context { display: block; font-size: 14px; line-height: 22px; font-weight: 500; color: var(--color-text-secondary); }
.project p { color: var(--color-text-secondary); }

.project p.project__stats-label { margin-top: 24px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.72px; text-transform: uppercase; }
.stats { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px;
  border: 1px solid var(--color-border-default); border-radius: var(--radius-sm);
}
.stat--wide { grid-column: 1 / -1; }
.stat__value { font-size: 28px; line-height: 34px; font-weight: 800; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.stat__arrow { color: var(--color-text-secondary); font-weight: 500; }
.stat__label { font-size: 14px; line-height: 20px; color: var(--color-text-secondary); }

/* Motion: panel slides in from the right, backdrop fades */
.drawer[open] .drawer__panel { animation: drawer-in 480ms var(--ease-out) both; }
.drawer[open]::backdrop { animation: drawer-fade 320ms var(--ease-out) both; }
.drawer.is-closing .drawer__panel { animation: drawer-out 280ms cubic-bezier(0.4, 0, 1, 1) both; }
.drawer.is-closing::backdrop { animation: drawer-fade 280ms ease-in reverse both; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes drawer-out { from { transform: none; } to { transform: translateX(100%); } }
@keyframes drawer-fade { from { opacity: 0; } to { opacity: 1; } }

/* Without Lenis (reduced motion / touch), keep the page from scrolling behind */
/* Page locked under a dialog: hide the scrollbar and give its width back as padding,
   so nothing behind the dialog moves (--scrollbar is measured in JS when the lock starts) */
html.has-drawer { overflow: hidden; padding-right: var(--scrollbar, 0px); }

/* ---------- Icon button (close / menu): bare icon, 44px touch area ---------- */
.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 0; /* Figma: icon only, no outline */
  color: var(--color-text-primary);
}
.menu-toggle { display: none; }

/* Button with its icon always visible (menu actions; every button on touch layouts) */
.btn--icon,
.btn--icon:hover,
.btn--icon:focus-visible { gap: 8px; padding: 12px 20px 12px 24px; }
.btn--block { width: 100%; justify-content: center; }
.link .icon { margin-left: 8px; transition: transform var(--duration-fast) var(--ease-out); }
.case-card picture { display: contents; }

/* ---------- Mobile menu (Figma: Home — Mobile 375 / Menu aberto) ---------- */
.mobile-menu {
  position: fixed; inset: 0;
  width: 100%; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--color-bg-page); color: var(--color-text-primary);
}
.mobile-menu[open] { display: flex; flex-direction: column; animation: menu-in 280ms var(--ease-out) both; }
.mobile-menu.is-closing { animation: menu-out 200ms ease-in both; }
.mobile-menu::backdrop { background: transparent; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes menu-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }
.mobile-menu__header { flex: none; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 24px; }
.mobile-menu__body { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px 24px 32px; }
.mobile-menu__nav { display: flex; flex-direction: column; gap: 16px; }
.mobile-menu__nav a {
  display: flex; align-items: center; height: 64px;
  border-bottom: 1px solid var(--color-border-default);
  font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.4px;
}
.mobile-menu__location { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.mobile-menu__pin { position: absolute; left: 3px; top: -31px; font-size: 29px; line-height: 40px; transform: rotate(-18.6deg); } /* Figma rotates counter-clockwise */
.mobile-menu__actions { display: flex; flex-direction: column; gap: 16px; }
.mobile-menu__row { display: flex; gap: 16px; }

/* ---------- Case password gate (Figma: modal) ---------- */
.gate {
  position: fixed; inset: 0;
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 16px; border: 0; background: transparent;
}
.gate[open] { display: grid; grid-template-columns: minmax(0, 516px); justify-content: center; align-content: center; }
.gate::backdrop { background: rgba(0, 0, 0, 0.75); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.gate__panel {
  width: 100%;
  display: flex; flex-direction: column; align-items: flex-start; gap: 24px;
  padding: 24px 32px 32px;
  background: var(--color-bg-page);
  border: 1px solid var(--color-border-default); border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
}
.gate[open] .gate__panel { animation: gate-in 320ms var(--ease-out) both; }
.gate[open]::backdrop { animation: drawer-fade 240ms var(--ease-out) both; }
.gate.is-closing .gate__panel { animation: gate-out 180ms ease-in both; }
.gate.is-closing::backdrop { animation: drawer-fade 180ms ease-in reverse both; }
@keyframes gate-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes gate-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }
.gate__heading { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.gate__title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gate__title { font-size: 16px; line-height: 22px; font-weight: 700; text-wrap: balance; }
.gate__helper { font-size: 14px; line-height: 20px; color: var(--color-text-secondary); }
.gate__field { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.gate__label { font-size: 14px; line-height: 27px; font-weight: 600; }
.gate__input {
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 8px 0 16px;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  background: var(--color-bg-page);
}
.gate__input:focus-within { border-color: var(--color-action-primary); box-shadow: 0 0 0 1px var(--color-action-primary); }
.gate__input.is-invalid { border-color: var(--color-status-error); box-shadow: 0 0 0 1px var(--color-status-error); }
.gate__input input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; line-height: 27px; color: var(--color-text-primary); }
.gate__input input::placeholder { color: var(--color-text-secondary); }
.gate__toggle { min-height: 44px; padding: 0 8px; font-size: 14px; font-weight: 600; }
/* Error line: the ghost and the live message share one grid cell, so its height is always reserved */
.gate__error { display: grid; font-size: 13px; line-height: 18px; color: var(--color-status-error); }
.gate__error > span { grid-area: 1 / 1; display: flex; align-items: flex-start; gap: 6px; }
.gate__error .icon { margin-top: 1px; }
.gate__error-ghost { visibility: hidden; }
.gate__request { font-size: 14px; line-height: 21px; color: var(--color-text-secondary); }
.gate__request a { margin-left: 2px; font-weight: 600; color: var(--color-text-primary); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Mobile + tablet (< 1100px). Figma: home-mobile (375) ----------
   One column, label above content. Tablets get the same layout, capped at 640px wide. */
@media (max-width: 1099px) {
  :root { --section-gap: 48px; --header-height: 64px; }
  html { scroll-padding-top: calc(var(--header-height) + 24px); }
  .container { width: min(640px, calc(100% - 48px)); }
  main { padding-top: 40px; }

  /* Header: logo + menu button */
  .site-header { display: flex; justify-content: space-between; padding: 0 8px 0 24px; border-bottom-color: var(--color-border-default); }
  .site-header .nav,
  .header-actions > .btn { display: none; }
  .header-actions { gap: 8px; }
  .menu-toggle { display: grid; }

  /* Touch: buttons show their icon at rest (no hover to reveal it) */
  .btn, .btn:hover, .btn:focus-visible { padding: 12px 20px 12px 24px; }
  .btn .btn__reveal { width: 20px; margin-left: 8px; }
  .btn .btn__reveal .icon { opacity: 1; }

  /* Sections: label on top */
  .section-row { flex-direction: column; gap: 24px; }
  .section-row__content { width: 100%; }

  /* Hero: memoji inline, no line breaks, location tags move to the menu */
  /* Fluid size: 27px at 375 wide, growing in step with the screen to 44px (desktop) at 1100.
     Memoji and its slot are in em, so they scale with the text. */
  .hero__title { width: auto; white-space: normal; font-size: clamp(27px, calc(18.21px + 2.345vw), 44px); line-height: 1.2; }
  .hero__title br { display: none; }
  .hero__memoji { width: 1.2em; height: auto; top: -0.2em; }
  .hero__emoji-slot { width: 1.45em; }
  .hero__location { display: none; } /* tablet + mobile: plates live in the menu (Figma) */

  /* About: photo full width, "Open to work" pinned inside its bottom-left corner */
  .about { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: var(--section-gap); }
  /* Same portrait ratio as the photo itself (1020×1326): full width, nothing cropped */
  .about__photo { width: 100%; height: auto; aspect-ratio: 1020 / 1326; }
  .about__photo img { object-position: 50% 20%; }
  .about__status { left: 16px; top: auto; bottom: 16px; transform: none; animation: none; }
  .about__text { width: auto; gap: 24px; align-items: stretch; }
  .about__text p + p { margin-top: 16px; }
  .about__text .btn { justify-content: center; }

  /* Cases: image on top, text below. Placeholder cases stay off mobile (Figma shows one) */
  .work__label { margin-bottom: 24px; }
  .case-card[data-placeholder] { display: none; }
  .case-card { height: auto; display: flex; flex-direction: column; border: 0; background: var(--color-bg-inverse); }
  .case-card__media { position: static; height: 240px; }
  .case-card__body { position: static; left: auto; top: auto; width: auto; transform: none; gap: 16px; align-items: stretch; padding: 24px 24px 16px; }
  .case-card__heading { gap: 16px; }
  .case-card .t-cta { font-size: 24px; line-height: 30px; }
  .case-card__overline { color: rgba(255, 255, 255, 0.6); }
  .case-card__summary { opacity: 1; font-size: 14px; line-height: 21px; color: rgba(255, 255, 255, 0.6); }
  .case-card__actions { justify-content: space-between; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.2); }
  .case-card__lock { font-size: 12px; line-height: 16px; font-weight: 600; gap: 4px; }
  .case-card__lock .icon { width: 16px; height: 16px; }
  .case-card + .case-card { margin-top: 24px; }
  .work__note { align-items: flex-start; padding: 16px; gap: 12px; }

  /* Experience: Icatu card drawn without the "+" (Figma uses the static card) */
  .experience__inner { flex-direction: column; gap: 24px; }
  .experience__intro { width: auto; }
  .experience__intro p + p { margin-top: 16px; }
  .experience__list { width: 100%; gap: 16px; }
  .experience__list .info-card__plus { display: none; }
  .info-card--action:hover, .info-card--action:focus-visible { transform: none; box-shadow: none; border-color: var(--color-border-default); }

  /* Education: the two groups stack */
  .education__columns { flex-direction: column; gap: 24px; }
  .education__column { width: 100%; }
  .education__group-label { height: auto; padding-bottom: 0; }
  .education__cards { gap: 16px; }

  /* Footer */
  .site-footer { margin-top: var(--section-gap); padding: 40px 24px 24px; gap: 40px; }
  .footer__main { gap: 40px; }
  .footer__cta { flex-direction: column; align-items: stretch; gap: 40px; }
  .footer__subtitle { color: var(--color-text-inverse-secondary); }
  .footer__links { flex-direction: column; align-items: stretch; gap: 8px; }
  .footer__links li { border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
  .footer__brand { padding-bottom: 0; border-bottom: 0; }
  .footer__tagline { font-size: 14px; line-height: 21px; color: var(--color-text-inverse-secondary); opacity: 1; }
  .footer__bottom { flex-direction: column; gap: 4px; white-space: normal; font-size: 14px; line-height: 20px; }
  .footer__bottom p { opacity: 1; color: var(--color-text-inverse-secondary); }
  .footer__bottom b { color: var(--color-text-inverse); }

  /* The experience drawer becomes full width */
  .drawer__header { padding: 24px 24px 20px; }
  .drawer__body { padding: 24px 24px 48px; }
  .stats { grid-template-columns: minmax(0, 1fr); }

  .gate__panel { padding: 24px; }
}


/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .about__status { animation: none; }
  .info-card--action:hover, .info-card--action:focus-visible { transform: none; }
  .info-card--action:hover .info-card__plus .icon,
  .info-card--action:focus-visible .info-card__plus .icon { transform: none; }
  .hero__location.is-swinging,
  .hero__location.is-swinging .tag { animation: none; }
  .mobile-menu[open], .mobile-menu.is-closing, .gate[open] .gate__panel, .gate[open]::backdrop, .gate.is-closing .gate__panel, .gate.is-closing::backdrop,
  .drawer[open] .drawer__panel, .drawer[open]::backdrop, .drawer.is-closing .drawer__panel, .drawer.is-closing::backdrop { animation: none; }
}
