/* =========================================================
   Felipe Pelaquim — Portfolio
   Dark, editorial, minimal. Edit the tokens below to restyle.
   ========================================================= */

:root {
  --bg: #0f0f0f;
  --fg: #ffffff;
  --soft: #d4d4d4;
  --muted: #858585;
  --line: #2b2b2b;
  --accent: #ffba08;

  --f-display: "General Sans", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Geist", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 3.4vw, 40px);
  --ease: cubic-bezier(.22, .8, .2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.container { padding-inline: var(--gutter); }
.mono { font-family: var(--f-mono); font-size: 13px; letter-spacing: .02em; }
.label { display: block; font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; color: var(--soft); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.rule { width: 104px; height: 1px; border: 0; background: var(--soft); margin: 0 0 24px; }

.h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 1.05;
  letter-spacing: -.01em;
  margin-top: 16px;
}
.h2--xl { font-size: clamp(44px, 7vw, 110px); line-height: .98; }

.link-arrow {
  display: inline-flex; gap: 8px; align-items: center;
  font-family: var(--f-body); font-size: 13px; font-weight: 500; letter-spacing: .02em;
}
.link-arrow span { transition: transform .4s var(--ease); }
.link-arrow:hover span { transform: translateX(5px); }

/* ---------------- Header ---------------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: grid; grid-template-columns: 1fr 1fr 1fr auto auto; align-items: center; gap: 32px;
  padding: 20px var(--gutter);
  background: linear-gradient(var(--bg) 40%, transparent);
}
.logo { font-family: var(--f-display); font-weight: 600; font-size: 15px; line-height: 1; letter-spacing: .01em; }
.header__coords, .header__clock { color: var(--muted); }
.header__cta { font-size: 15px; letter-spacing: .02em; }
.header__cta:hover { color: var(--muted); }

.menu-btn { width: 26px; height: 26px; display: grid; place-content: center; gap: 6px; z-index: 60; }
.menu-btn span { display: block; width: 20px; height: 1.5px; background: var(--fg); transition: transform .4s var(--ease); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 40; background: var(--bg);
  display: flex; align-items: flex-end; padding: 0 var(--gutter) 8vh;
  clip-path: inset(0 0 100% 0); transition: clip-path .7s var(--ease);
}
.menu.is-open { clip-path: inset(0 0 0 0); }
.menu a {
  display: block; font-family: var(--f-display); font-weight: 500;
  font-size: clamp(48px, 10vw, 140px); line-height: 1; color: var(--muted);
  transition: color .3s;
}
.menu a:hover { color: var(--fg); }

/* ---------------- Marquee (shared) ---------------- */
.marquee { overflow: hidden; white-space: nowrap; }
.marquee__track {
  display: inline-flex; align-items: center; width: max-content;
  animation: marquee var(--speed, 40s) linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------- Hero ---------------- */
.hero { padding-top: 96px; }
.marquee--hero { --speed: 32s; }
.marquee--hero span,
.marquee--hero i {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(96px, 20vw, 240px); line-height: 1.1; letter-spacing: -.02em;
  padding-inline: .14em; font-style: normal;
}
.marquee--hero i { font-size: clamp(48px, 10vw, 120px); }

/* ---------------- Work grid ---------------- */
.work { padding: 72px var(--gutter) 40px; }
.work__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 96px 24px; }

.card { grid-column: span 5; cursor: pointer; }
.card--wide { grid-column: span 7; }
.card__media {
  position: relative; overflow: hidden; background: #1a1a1a;
  aspect-ratio: 4 / 5;
}
.card--wide .card__media { aspect-ratio: 4 / 3; }
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.card:hover .card__media img { transform: scale(1.04); }
.card__info { display: flex; justify-content: space-between; gap: 24px; margin-top: 16px; }
.card__title { font-family: var(--f-display); font-weight: 500; font-size: 20px; line-height: 1.2; }
.card__desc { color: var(--soft); font-size: 14px; max-width: 34ch; margin-top: 6px; }
.card__year { font-family: var(--f-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.card:focus-visible { outline: 1px solid var(--fg); outline-offset: 6px; }

/* Pixel transition overlay */
.pixels {
  position: absolute; inset: 0; pointer-events: none;
  display: grid; grid-template-columns: repeat(var(--cols, 10), 1fr);
}
.pixels i { background: var(--pixel, var(--accent)); opacity: 0; }
.pixels.is-running i { animation: pixel .7s steps(1, end) both; animation-delay: var(--d); }
@keyframes pixel {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------------- Intro ---------------- */
.intro {
  display: grid; grid-template-columns: 3fr 9fr; gap: 24px;
  padding-block: 18vh 14vh;
}
.intro__text {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(30px, 4.4vw, 64px); line-height: 1.12; letter-spacing: -.01em;
}
.intro__text .w { color: #3a3a3a; transition: color .25s; }
.intro__text .w.on { color: var(--fg); }
.intro__text > span .w.on { color: var(--muted); }

/* ---------------- Section heads ---------------- */
.section-head { margin-bottom: 64px; }
.section-head--split { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.section-head__aside { max-width: 320px; display: grid; gap: 16px; }

/* ---------------- Figures ---------------- */
.figures { padding-block: 10vh; }
.figures__grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.figure { padding: 32px 24px 40px 0; border-right: 1px solid var(--line); }
.figure + .figure { padding-left: 24px; }
.figure:last-child { border-right: 0; }
.figure__num {
  display: block; font-family: var(--f-display); font-weight: 500;
  font-size: clamp(64px, 8vw, 120px); line-height: 1; letter-spacing: -.03em;
}
.figure__title { font-family: var(--f-mono); font-weight: 400; font-size: 12px; text-transform: uppercase; color: var(--soft); margin: 28px 0 10px; }
.figure p { color: var(--muted); font-size: 14px; }
.figure em, .figure strong { color: var(--fg); }

/* ---------------- Capabilities ---------------- */
.capabilities {
  display: grid; grid-template-columns: 3fr 9fr; gap: 24px;
  padding-block: 14vh;
}
.capabilities .label-col p { margin-top: 12px; max-width: 26ch; }
.cap-list li {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(48px, 8.4vw, 120px); line-height: 1.08; letter-spacing: -.02em;
  color: #3a3a3a; transition: color .5s var(--ease);
}
.cap-list li.on, .cap-list li:hover { color: var(--fg); }

/* ---------------- Gallery ---------------- */
.gallery { padding-block: 10vh; }
.marquee--gallery { --speed: 60s; }
.marquee--gallery .marquee__track { gap: 16px; padding-right: 16px; }
.marquee--gallery img {
  height: clamp(220px, 32vw, 420px); width: auto; object-fit: cover;
  aspect-ratio: var(--ar, 4 / 5);
}

/* ---------------- Experience ---------------- */
.experience { padding-block: 14vh 10vh; }
.exp-list { border-top: 1px solid var(--line); }
.exp {
  display: grid; grid-template-columns: 3fr 4fr 5fr; gap: 24px;
  padding: 28px 0; border-bottom: 1px solid var(--line);
}
.exp__period { font-family: var(--f-mono); font-size: 12px; color: var(--muted); text-transform: uppercase; padding-top: 6px; }
.exp__role { font-family: var(--f-display); font-weight: 500; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.15; }
.exp__role small { display: block; font-family: var(--f-body); font-weight: 400; font-size: 14px; color: var(--muted); margin-top: 6px; }
.exp__text { color: var(--soft); font-size: 14px; max-width: 52ch; }

/* ---------------- Clients ---------------- */
.clients { padding-block: 6vh 10vh; }
.clients .label { margin-bottom: 24px; }
.marquee--clients { --speed: 36s; }
.marquee--clients span, .marquee--clients i {
  font-family: var(--f-display); font-weight: 500; font-style: normal;
  font-size: clamp(40px, 6vw, 88px); line-height: 1.1; padding-inline: .3em; color: var(--soft);
}
.marquee--clients i { color: var(--muted); }

/* ---------------- Contact ---------------- */
.contact {
  display: grid; grid-template-columns: 3fr 9fr; gap: 24px;
  padding-block: 14vh;
}
.contact__body { display: grid; gap: 28px; justify-items: start; }
.contact__links { display: flex; flex-wrap: wrap; gap: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border: 1px solid var(--fg); border-radius: 999px;
  font-size: 13px; font-weight: 500; letter-spacing: .02em;
  transition: background .3s, color .3s;
}
.pill:hover { background: var(--fg); color: var(--bg); }

/* ---------------- Footer ---------------- */
.footer { padding-top: 6vh; }
.footer__top { display: flex; justify-content: space-between; align-items: flex-start; }
.footer__cols { display: flex; gap: 64px; }
.footer__cols .label { margin-bottom: 14px; }
.footer__cols li a { font-size: 13px; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; line-height: 2; }
.footer__cols li a:hover { color: var(--muted); }
.to-top {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--fg); border-radius: 50%; transition: background .3s, color .3s;
}
.to-top:hover { background: var(--fg); color: var(--bg); }

.marquee--social { --speed: 30s; margin-block: 6vh 4vh; }
.marquee--social a, .marquee--social i {
  font-family: var(--f-display); font-weight: 500; font-style: normal;
  font-size: clamp(64px, 11vw, 160px); line-height: 1.1; padding-inline: .25em; color: var(--soft);
  transition: color .3s;
}
.marquee--social a:hover { color: var(--accent); }
.marquee--social i { color: var(--muted); }

.footer__bottom {
  display: flex; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line); padding-block: 20px 28px;
  font-size: 11px; text-transform: uppercase; color: var(--muted);
}

/* ---------------- Project overlay ---------------- */
.project {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  overflow-y: auto; overscroll-behavior: contain;
  animation: project-in .6s var(--ease);
}
.project[hidden] { display: none; }
@keyframes project-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
.project__close {
  position: fixed; top: 20px; right: var(--gutter); z-index: 2;
  font-family: var(--f-mono); font-size: 13px; padding: 8px 14px;
  border: 1px solid var(--fg); border-radius: 999px; background: var(--bg);
}
.project__close:hover { background: var(--fg); color: var(--bg); }
.project__head { padding-top: 120px; padding-bottom: 64px; display: grid; gap: 28px; max-width: 1200px; }
.project__meta { display: flex; flex-wrap: wrap; gap: 48px; margin: 0; }
.project__meta div { display: grid; gap: 4px; }
.project__meta dt { font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; color: var(--muted); }
.project__meta dd { margin: 0; font-size: 15px; }
.project__desc { color: var(--soft); font-size: 18px; max-width: 56ch; }
.project__images { display: grid; gap: 16px; padding-bottom: 12vh; }
.project__images img { width: 100%; height: auto; background: #1a1a1a; }

/* ---------------- Reveal on scroll ---------------- */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .header { grid-template-columns: 1fr auto auto; gap: 20px; }
  .header__coords, .header__clock { display: none; }

  .work__grid { gap: 56px 0; }
  .card, .card--wide { grid-column: 1 / -1; }
  .card--wide .card__media { aspect-ratio: 4 / 5; }

  .intro, .capabilities, .contact { grid-template-columns: 1fr; gap: 32px; }
  .figures__grid { grid-template-columns: 1fr 1fr; }
  .figure { border-bottom: 1px solid var(--line); }
  .figure:nth-child(2n) { border-right: 0; }
  .figure:nth-child(2n + 1) { padding-left: 0; }

  .section-head--split { flex-direction: column; align-items: flex-start; }
  .exp { grid-template-columns: 1fr; gap: 10px; }
  .footer__top { gap: 24px; }
}

@media (max-width: 520px) {
  .figures__grid { grid-template-columns: 1fr; }
  .figure { border-right: 0; padding-left: 0 !important; }
  .footer__cols { gap: 32px; }
  .footer__bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .pixels { display: none; }
  .project { animation: none; }
}
