/* ABG — Alvaro Barreto portfolio */
:root {
  --black: #000;
  --white: #fff;
  --grey: #b3b3b3;
  --light: #f5f5f5;
  --dark: #333;
  --pad: 80px;
  --gap: 20px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--white);
  color: var(--black);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.wrap { padding-left: var(--pad); padding-right: var(--pad); }

/* ---------- Custom cursor (desktop only) ---------- */
@media (hover: hover) and (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button,
  body.has-cursor input, body.has-cursor textarea { cursor: none; }
  .cursor {
    position: fixed; left: 0; top: 0; z-index: 1000;
    width: 26px; height: 26px; margin: -13px 0 0 -13px;
    border-radius: 50%; background: var(--white);
    mix-blend-mode: difference; pointer-events: none;
    transition: transform .35s var(--ease), opacity .2s;
    will-change: transform;
  }
  .cursor.is-link { transform: scale(1.6); }
  .cursor.is-card { transform: scale(2.8); }
  .cursor.is-hidden { opacity: 0; }
}
@media not ((hover: hover) and (pointer: fine)) { .cursor { display: none; } }

/* ---------- Header ---------- */
.site-header {
  height: 93px; padding: 0 36px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--light);
  background: var(--white);
}
.logo { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -0.06em; }
.header-right { display: flex; align-items: center; gap: 30px; }
.nav { display: flex; gap: 30px; }
.nav a { font-size: 18px; line-height: 1.1; letter-spacing: -0.06em; transition: opacity .2s; }
.nav a:hover { opacity: .5; }
.lang { display: flex; align-items: center; gap: 10px; font-size: 18px; line-height: 1.2; }
.lang a { transition: opacity .2s; }
.lang a:not(.is-active) { opacity: .35; }
.lang a:hover { opacity: 1; }

/* ---------- Type ---------- */
.label { font-size: 30px; line-height: 1.2; font-weight: 500; letter-spacing: -0.03em; }
.rich { font-size: 20px; line-height: 1.2; letter-spacing: -0.04em; text-align: justify; }
.rich strong { font-weight: 700; }
.rich p.gap { height: 1.2em; }
.rich ul { padding-left: 26px; }
.rich li { padding-left: 0; }
.rich a { text-decoration: underline; }

/* ---------- Home hero ---------- */
.hero { padding-top: 87px; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.hero-name { font-size: clamp(50px, 11.1vw, 160px); line-height: 1; font-weight: 600; letter-spacing: -0.09em; text-transform: uppercase; }
.mask { display: block; overflow: hidden; padding-right: .1em; }
.mask > span { display: block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.is-loaded .mask > span { transform: none; }
.is-loaded .mask:nth-child(2) > span { transition-delay: .08s; }
.avatar { width: 168px; height: 168px; border-radius: 50%; object-fit: cover; flex: none; }
.hero-bottom { margin-top: 100px; display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.email {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 26px; line-height: 1.3; letter-spacing: -0.06em; position: relative;
}
.email svg { width: 20px; height: 20px; flex: none; }
.email .toast {
  position: absolute; left: 0; top: 100%; margin-top: 8px;
  font-size: 14px; letter-spacing: 0; color: var(--grey);
  opacity: 0; transition: opacity .3s;
}
.email.copied .toast { opacity: 1; }
.bio { width: 643px; max-width: 100%; font-size: 40px; line-height: 1.1; letter-spacing: -0.06em; text-align: justify; }

/* ---------- Project grid ---------- */
.projects { padding-top: 250px; padding-bottom: 112px; }
.projects .label, .explore .label { margin-bottom: 84px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.card { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--light); }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.35), rgba(0,0,0,0) 45%);
  opacity: 0; transition: opacity .5s var(--ease);
}
.card h4 {
  position: absolute; left: 50px; right: 50px; bottom: 50px; z-index: 1;
  color: var(--white); font-size: 48px; line-height: 1.2; font-weight: 500; letter-spacing: -0.05em;
  opacity: 0; transform: translateY(12px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.card:hover h4, .card:focus-visible h4 { opacity: 1; transform: none; }
.card:hover::after, .card:focus-visible::after { opacity: 1; }
.card:hover img { transform: scale(1.03); }

/* ---------- About (home) ---------- */
.about { border-top: 1px solid var(--light); padding-top: 160px; padding-bottom: 160px; }
.about .label { margin-bottom: 110px; }
.about-lead { width: 728px; max-width: 100%; font-size: 50px; line-height: 1.1; letter-spacing: -0.06em; text-align: justify; }
.about-row { margin-top: 160px; display: flex; align-items: center; }
.about-row img { width: 553px; height: 400px; object-fit: cover; margin-left: 213px; flex: none; }
.about-row p { width: 311px; margin-left: 76px; font-size: 20px; line-height: 1.2; letter-spacing: -0.04em; text-align: justify; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--black); color: var(--white);
  min-height: 100vh; min-height: 100svh;
  padding: 60px var(--pad) 60px;
  display: flex; flex-direction: column;
}
.footer-links { display: flex; justify-content: flex-end; gap: 27px; font-size: 16px; line-height: 1.2; letter-spacing: -0.04em; }
.footer-links a, .footer-bottom a { transition: opacity .2s; }
.footer-links a:hover, .footer-bottom a:hover { opacity: .6; }
.footer-cta { margin: auto 0; padding: 80px 0; }
.footer-cta h4 { max-width: 1100px; font-size: 48px; line-height: 1.2; font-weight: 500; letter-spacing: -0.05em; }
.cta-row { margin-top: 40px; display: flex; align-items: center; gap: 27px; }
.btn-white {
  display: inline-flex; align-items: center; justify-content: center;
  height: 59px; padding: 0 36px; background: var(--white); color: var(--black);
  font-size: 16px; line-height: 1.2; letter-spacing: -0.04em;
  transition: background .25s, color .25s;
}
.btn-white:hover { background: var(--light); }
.status { display: flex; align-items: center; gap: 5px; font-size: 16px; line-height: 1.6; font-weight: 400; }
.dot { position: relative; width: 34px; height: 34px; display: grid; place-items: center; }
.dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--white); }
.dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--white);
  opacity: .25; animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse { 0% { transform: scale(.3); opacity: .5; } 100% { transform: scale(1); opacity: 0; } }
.footer-bottom { display: flex; justify-content: space-between; align-items: flex-end; font-size: 16px; line-height: 1.6; font-weight: 400; }
.footer-bottom > div { display: flex; flex-direction: column; }

/* ---------- Project page ---------- */
.p-meta { display: flex; justify-content: flex-end; padding-top: 47px; }
.p-meta dl { display: grid; grid-template-columns: auto auto; column-gap: 9px; font-size: 16px; line-height: 1.6; font-weight: 400; }
.p-meta dt { color: var(--grey); }
.p-hero { margin-top: 49px; display: grid; grid-template-columns: 598px 598px; justify-content: space-between; align-items: center; }
.p-hero img { width: 598px; height: 475px; object-fit: cover; }
.p-title { font-weight: 600; line-height: .9; letter-spacing: -0.06em; text-align: left; }
.p-section { padding-top: 140px; }
.p-section:first-of-type { padding-top: 156px; }
.p-head { display: flex; justify-content: space-between; align-items: center; }
.pill {
  display: inline-flex; align-items: center; height: 51px; padding: 0 26px;
  background: var(--light); font-size: 16px; line-height: 1.2; letter-spacing: -0.04em;
  transition: background .25s, color .25s;
}
.pill:hover { background: var(--black); color: var(--white); }
.p-text { margin: 100px 0 0 auto; width: 759px; max-width: 100%; }
.media { margin-top: 70px; display: flex; flex-direction: column; gap: var(--gap); }
.row { display: grid; gap: var(--gap); }
.row.cols-2 { grid-template-columns: 1fr 1fr; }
.row img { width: 100%; height: 620px; object-fit: cover; }
.row.full img { height: var(--h, 620px); }
.row.videos { grid-template-columns: repeat(3, 281px); justify-content: center; column-gap: 100px; }
.vframe { position: relative; aspect-ratio: 281 / 504; background: var(--black); }
.vframe iframe, .overlay iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.overlay { position: relative; height: var(--h, 620px); }
.overlay img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.overlay .ov { position: absolute; top: 0; bottom: 0; left: 50%; width: 838px; max-width: 100%; transform: translateX(-50%); }
.explore { border-top: 1px solid var(--light); margin-top: 140px; padding-top: 130px; padding-bottom: 112px; }

/* ---------- Contact ---------- */
.c-hero { padding-top: 94px; }
.c-title { font-size: clamp(50px, 11.1vw, 160px); line-height: 1; font-weight: 600; letter-spacing: -0.09em; }
.c-body { margin-top: 82px; padding-bottom: 160px; display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.form { width: 753px; max-width: 100%; display: flex; flex-direction: column; gap: 20px; }
.field { display: block; background: var(--light); padding: 30px; }
.field input, .field textarea {
  display: block; width: 100%; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 18px; line-height: 20px; font-weight: 400; color: var(--black); resize: none;
}
.field textarea { height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: var(--grey); }
.field:focus-within { box-shadow: inset 0 0 0 1px var(--black); }
.submit {
  height: 80px; background: var(--black); color: var(--white);
  font-size: 20px; line-height: 1.2; letter-spacing: -0.04em; transition: opacity .25s;
}
.submit:hover { opacity: .85; }
.form-note { font-size: 14px; color: var(--dark); font-weight: 400; min-height: 1em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .mask > span { opacity: 1 !important; transform: none !important; transition: none !important; }
  .dot::after { animation: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1199px) {
  :root { --pad: 40px; }
  .site-header { padding: 0 var(--pad); }
  .bio { font-size: 32px; width: 50%; }
  .about-lead { font-size: 40px; }
  .about-row img { margin-left: 0; width: 50%; height: auto; aspect-ratio: 553/400; }
  .about-row p { margin-left: 40px; }
  .card h4 { font-size: 36px; left: 30px; right: 30px; bottom: 30px; }
  .p-hero { grid-template-columns: 1fr 1fr; gap: 40px; }
  .p-hero img { width: 100%; height: auto; aspect-ratio: 598/475; }
  .p-title { font-size: min(var(--fs), 7vw) !important; }
  .p-text { width: 65%; }
  .row img { height: auto; aspect-ratio: 623/620; }
  .row.full img, .overlay { height: auto; aspect-ratio: 1265 / var(--hr, 620); }
  .row.videos { grid-template-columns: repeat(3, 1fr); column-gap: 30px; }
  .form { width: 60%; }
}

/* ---------- Mobile ---------- */
@media (max-width: 809px) {
  :root { --pad: 20px; }
  .site-header { height: 73px; padding: 0 20px; }
  .nav { display: none; }
  .hero { padding-top: 87px; }
  .hero-top { flex-direction: column-reverse; gap: 30px; }
  .hero-name { font-size: 50px; letter-spacing: -0.09em; }
  .avatar { width: 110px; height: 110px; }
  .hero-bottom { margin-top: 74px; flex-direction: column; gap: 34px; }
  .bio { width: 100%; font-size: 28px; }
  .projects { padding-top: 160px; padding-bottom: 80px; }
  .label { font-size: 19px; }
  .projects .label, .explore .label { margin-bottom: 68px; }
  .grid { grid-template-columns: 1fr; }
  .card h4 { opacity: 1; transform: none; font-size: 32px; left: 34px; right: 34px; bottom: 34px; }
  .card::after { opacity: 1; }
  .about { padding-top: 100px; padding-bottom: 100px; }
  .about .label { margin-bottom: 100px; }
  .about-lead { font-size: 28px; }
  .about-row { margin-top: 40px; flex-direction: column; align-items: stretch; gap: 32px; }
  .about-row img { width: 100%; }
  .about-row p { width: 100%; margin: 0; font-size: 16px; }
  .footer-cta h4 { font-size: 32px; }
  .cta-row { flex-direction: column-reverse; align-items: flex-start; gap: 20px; }
  .btn-white { width: 100%; }
  .status { font-size: 14px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 24px; font-size: 14px; }
  .p-top { display: flex; flex-direction: column; padding-top: 87px; }
  .p-hero { display: contents; }
  .p-title { order: 1; }
  .p-hero img { order: 2; margin-top: 40px; }
  .p-meta { order: 3; justify-content: flex-start; padding-top: 40px; }
  .p-title { font-size: min(var(--fs), 13vw) !important; }
  .p-section, .p-section:first-of-type { padding-top: 90px; }
  .pill { height: 42px; padding: 0 18px; font-size: 14px; }
  .p-text { width: 100%; margin-top: 40px; }
  .rich { font-size: 16px; }
  .media { margin-top: 40px; }
  .row.cols-2 { grid-template-columns: 1fr; }
  .row.videos { grid-template-columns: 1fr; row-gap: 20px; padding: 0 12%; }
  .overlay .ov { width: 100%; }
  .explore { margin-top: 90px; padding-top: 80px; }
  .c-hero { padding-top: 80px; }
  .c-title { font-size: 50px; }
  .c-body { flex-direction: column; margin-top: 50px; padding-bottom: 100px; }
  .form { width: 100%; }
  .email { font-size: 22px; }
}
