/* =========================================
   CRYSTIAN LEÃO — Portfolio
   Brutalist Swiss · mono · heavy motion
   ========================================= */

:root {
  --cream: #f5f1e8;
  --cream-2: #ebe6d6;
  --ink: #0a0a0a;
  --ink-2: #1a1a1a;
  --accent: #ec3a5e;     /* coral do logo */
  --rule: 2px;

  --font-mono: 'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --space-1: clamp(8px, 1vw, 12px);
  --space-2: clamp(14px, 2vw, 20px);
  --space-3: clamp(24px, 4vw, 40px);
  --space-4: clamp(40px, 6vw, 80px);
  --space-5: clamp(60px, 10vw, 140px);

  --pad-x: clamp(18px, 5vw, 80px);
}

* { box-sizing: border-box; }

html {
  background: var(--cream);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(15px, 1vw, 16px);
  line-height: 1.55;
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
  cursor: none; /* JS re-enables on touch */
}

body.is-touch { cursor: auto; }

::selection { background: var(--ink); color: var(--cream); }

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

p { margin: 0 0 1em; }

img, svg { display: block; max-width: 100%; }

/* =========================================
   GRAIN OVERLAY
   ========================================= */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: .35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* =========================================
   CUSTOM CURSOR
   ========================================= */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 36px; height: 36px;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;
  mix-blend-mode: difference;
  transition: width .25s ease, height .25s ease;
  display: none; /* JS shows on non-touch */
}
.cursor.is-active { display: block; }
.cursor.is-hover { width: 84px; height: 84px; }

.cursor-cross {
  position: absolute;
  inset: 0;
}
.cursor-cross::before,
.cursor-cross::after {
  content: "";
  position: absolute;
  background: var(--cream);
}
.cursor-cross::before {
  top: 50%; left: 0; right: 0;
  height: 2px;
  transform: translateY(-50%);
}
.cursor-cross::after {
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  transform: translateX(-50%);
}

.cursor-label {
  position: absolute;
  top: 100%; left: 50%;
  transform: translate(-50%, 8px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cream);
  white-space: nowrap;
  background: var(--ink);
  padding: 4px 8px;
  opacity: 0;
  transition: opacity .15s ease;
}
.cursor.is-hover .cursor-label { opacity: 1; }

/* =========================================
   SCROLL PROGRESS BAR (vertical right)
   ========================================= */
.scroll-progress {
  position: fixed;
  top: 0; right: 0;
  width: 3px;
  height: 0%;
  background: var(--ink);
  z-index: 900;
  pointer-events: none;
}

/* =========================================
   COMMON
   ========================================= */
.label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 700;
  opacity: .85;
}
.label--inverse { color: var(--cream); opacity: .9; }

.blink {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.4s steps(2, end) infinite;
}
@keyframes blink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0; }
}

/* =========================================
   NAV
   ========================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 800;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: 14px var(--pad-x);
  background: rgba(245, 241, 232, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: var(--rule) solid var(--ink);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: transform .25s ease;
}
.nav-logo:hover { transform: translateX(2px); }
.nav-logo img {
  height: clamp(28px, 3.4vw, 38px);
  width: auto;
  display: block;
}
.nav-logo-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  opacity: .5;
  border-left: 1.5px solid var(--ink);
  padding-left: 8px;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2.4vw, 32px);
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 700;
}
.nav-links a {
  position: relative;
  padding: 4px 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--ink);
  transition: right .35s cubic-bezier(.7,0,.2,1);
}
.nav-links a:hover::after { right: 0; }

.nav-meta {
  font-size: 11px;
  letter-spacing: 2px;
  text-align: right;
}

@media (max-width: 640px) {
  .nav { grid-template-columns: auto auto; }
  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 16px;
    padding-top: 4px;
    border-top: 1px solid rgba(10,10,10,.15);
    margin-top: 4px;
  }
}

/* =========================================
   HERO
   ========================================= */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(140px, 18vh, 220px) var(--pad-x) var(--space-4);
  position: relative;
  display: flex;
  align-items: flex-end;
  border-bottom: var(--rule) solid var(--ink);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 119px,
      rgba(10,10,10,.05) 119px,
      rgba(10,10,10,.05) 120px
    ),
    var(--cream);
}

.hero-grid {
  width: 100%;
  position: relative;
}

.label-corner {
  position: absolute;
  top: -60px;
  left: 0;
}
.label-corner-right {
  position: absolute;
  top: -60px;
  right: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 700;
  opacity: .85;
}

.hero-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: end;
  margin-bottom: var(--space-3);
}
.hero-photo {
  margin: 0;
  border: var(--rule) solid var(--ink);
  background: var(--cream-2);
  position: relative;
  width: clamp(110px, 14vw, 180px);
  align-self: end;
  transform: rotate(-2deg);
  transition: transform .4s cubic-bezier(.7,0,.2,1);
  will-change: transform;
}
.hero-photo:hover { transform: rotate(0); }
.hero-photo::before {
  content: "";
  position: absolute;
  inset: 6px -6px -6px 6px;
  background: var(--accent);
  z-index: -1;
  transition: inset .35s cubic-bezier(.7,0,.2,1);
}
.hero-photo:hover::before { inset: 3px -3px -3px 3px; }
.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 769 / 1132;
  object-fit: cover;
  filter: grayscale(.2) contrast(1.05);
  transition: filter .4s ease;
}
.hero-photo:hover img { filter: grayscale(0) contrast(1); }
.hero-photo figcaption {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 700;
  padding: 5px 8px;
  border-top: var(--rule) solid var(--ink);
  background: var(--cream);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.hero-photo figcaption::after {
  content: "●";
  color: var(--accent);
  animation: blink 1.4s steps(2, end) infinite;
}

.hero-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(56px, 15vw, 200px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0;
  text-transform: uppercase;
  min-width: 0;
}
.hero-line {
  display: block;
  overflow: hidden;
  padding-top: 0.18em; /* espaço pro acento (Ã) sem cortar */
  margin-top: -0.18em;
}
.hero-word {
  display: inline-block;
  transform: translateY(115%);
  will-change: transform;
}
.hero-star {
  font-size: .35em;
  vertical-align: super;
  color: var(--accent);
  margin-left: .08em;
  display: inline-block;
  transform-origin: center;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-4);
}
.tag {
  border: var(--rule) solid var(--ink);
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  background: var(--cream);
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.tag:hover {
  background: var(--ink);
  color: var(--cream);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.hero-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: end;
  border-top: var(--rule) solid var(--ink);
  padding-top: var(--space-2);
}
.hero-foot-l p {
  font-size: clamp(15px, 1.4vw, 18px);
  max-width: 52ch;
  margin: 6px 0 0;
}
.hero-foot-r {
  text-align: right;
}
.scroll-hint {
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.arrow-down {
  display: inline-block;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@media (max-width: 640px) {
  .label-corner, .label-corner-right {
    position: static;
    display: block;
    margin-bottom: 8px;
  }
  .hero-foot { grid-template-columns: 1fr; }
  .hero-foot-r { text-align: left; }
  .hero-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .hero-photo {
    width: 110px;
    justify-self: end;
    order: -1;
  }
}

/* =========================================
   MARQUEE
   ========================================= */
.marquee {
  background: var(--ink);
  color: var(--cream);
  padding: 14px 0;
  overflow: hidden;
  border-bottom: var(--rule) solid var(--ink);
}
.marquee-track {
  display: inline-flex;
  gap: 56px;
  white-space: nowrap;
  font-size: clamp(13px, 1.4vw, 17px);
  letter-spacing: 4px;
  font-weight: 700;
  animation: marquee 90s linear infinite;
  will-change: transform;
}
.marquee-track span:nth-child(odd) { color: var(--accent); }
.marquee-track span { display: inline-block; }
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* =========================================
   ABOUT
   ========================================= */
.about {
  padding: var(--space-5) var(--pad-x);
  border-bottom: var(--rule) solid var(--ink);
}
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-3);
  align-items: start;
}
.about-headline {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(24px, 3.6vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}
.about-headline em {
  font-style: italic;
  background: var(--ink);
  color: var(--cream);
  padding: 0 .15em;
}
.about-body {
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.7;
  max-width: 44ch;
}
.about-sig {
  font-style: italic;
  opacity: .7;
  margin-top: 1.5em;
}

.link-inline {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1px;
  transition: background .2s ease, color .2s ease;
}
.link-inline:hover {
  background: var(--ink);
  color: var(--cream);
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* =========================================
   WORK
   ========================================= */
.work {
  padding: var(--space-5) var(--pad-x);
  border-bottom: var(--rule) solid var(--ink);
}
.work-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  align-items: end;
  margin-bottom: var(--space-3);
}
.work-count {
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 700;
  opacity: .75;
}

/* slider shell (compartilhado work + stuff) */
.slider {
  position: relative;
  margin-top: var(--space-2);
}
.slider-track {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 0 var(--space-2);
  cursor: grab;
}
.slider-track::-webkit-scrollbar { display: none; }
.slider-track.is-grabbing { cursor: grabbing; scroll-behavior: auto; }
.slider-track > * { scroll-snap-align: start; flex: 0 0 auto; }

.slider-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
}
.slider-arrows { display: flex; gap: 8px; }
.slider-btn {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--cream);
  color: var(--ink);
  border: var(--rule) solid var(--ink);
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, color .2s ease, transform .2s ease;
  padding: 0;
}
.slider-btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--cream);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}
.slider-btn:disabled { opacity: .35; cursor: default; }
.slider-progress {
  flex: 1;
  height: 2px;
  background: rgba(10,10,10,.15);
  position: relative;
  margin: 0 var(--space-2);
}
.slider-progress::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: var(--p, 25%);
  background: var(--ink);
  transition: width .25s ease;
}
.slider-count { white-space: nowrap; }

/* project card (slide) */
.proj {
  border: var(--rule) solid var(--ink);
  background: var(--cream);
  width: clamp(280px, 78vw, 460px);
  min-height: 360px;
  position: relative;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.7,0,.2,1);
}
.proj > a,
.proj > div {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-2);
  padding: var(--space-3);
  height: 100%;
  transition: color .4s ease;
  position: relative;
  z-index: 1;
}

.proj > a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(100%);
  transition: transform .5s cubic-bezier(.7,0,.2,1);
  z-index: -1;
}
.proj > a:hover::before { transform: translateY(0); }
.proj > a:hover { color: var(--cream); }
.proj > a:hover .proj-arrow { transform: translate(10px, -4px) rotate(8deg); }
.proj > a:hover .proj-tag { border-color: var(--cream); }
.proj > a:hover .proj-year { color: var(--accent); }

.proj-num {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  letter-spacing: 2px;
  opacity: .55;
}
.proj-main {}
.proj-name {
  font-family: var(--font-mono);
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  line-height: 1.05;
  text-transform: uppercase;
}
.proj-arrow {
  display: inline-block;
  transition: transform .4s cubic-bezier(.7,0,.2,1);
  color: var(--accent);
}
.proj-desc {
  font-size: clamp(14px, 1vw, 16px);
  line-height: 1.5;
  opacity: .85;
  margin: 0;
}
.proj-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1.5px solid currentColor;
  padding-top: var(--space-1);
  margin-top: var(--space-1);
}
.proj-tag {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  padding: 3px 8px;
  border: 1.5px solid var(--ink);
  transition: border-color .25s ease, color .25s ease;
}
.proj-year {
  font-size: 11px;
  letter-spacing: 2px;
  opacity: .7;
  margin-left: auto;
  transition: color .25s ease;
}

.proj--nolink > div { cursor: default; }

/* =========================================
   STUFF / BESTEIRAS
   ========================================= */
.stuff {
  padding: var(--space-5) var(--pad-x);
  border-bottom: var(--rule) solid var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 59, 31, .08), transparent 40%),
    var(--cream);
}
.stuff-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.stuff-sub {
  font-size: clamp(13px, .95vw, 15px);
  opacity: .75;
  margin: 0;
  max-width: 50ch;
}

.stuff-item {
  border: var(--rule) solid var(--ink);
  background: var(--cream);
  position: relative;
  transition: transform .3s cubic-bezier(.7,0,.2,1);
  width: clamp(240px, 60vw, 320px);
  min-height: 280px;
}
.stuff-item > a,
.stuff-item > div {
  display: block;
  padding: var(--space-2);
  height: 100%;
  position: relative;
}
.stuff-item:hover {
  transform: translate(-4px, -4px) rotate(-.6deg);
  box-shadow: 8px 8px 0 var(--ink);
}
.stuff-glyph {
  font-size: 32px;
  letter-spacing: 4px;
  margin-bottom: var(--space-2);
  color: var(--accent);
}
.stuff-name {
  font-family: var(--font-mono);
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  line-height: 1.05;
}
.stuff-desc {
  font-size: clamp(13px, .95vw, 15px);
  opacity: .8;
  margin: 0 0 var(--space-2);
}
.stuff-link {
  position: absolute;
  bottom: var(--space-2);
  left: var(--space-2);
  right: var(--space-2);
  border-top: 1.5px solid var(--ink);
  padding-top: 8px;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}
.stuff-item--placeholder .stuff-link { font-style: italic; }

/* =========================================
   CONTACT (invertido)
   ========================================= */
.contact {
  background: var(--ink);
  color: var(--cream);
  padding: var(--space-5) var(--pad-x);
  border-bottom: var(--rule) solid var(--ink);
  position: relative;
  overflow: hidden;
}
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 39px,
      rgba(245, 241, 232, .04) 39px,
      rgba(245, 241, 232, .04) 40px
    );
  pointer-events: none;
}
.contact-inner { position: relative; z-index: 1; }

.contact-mega {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(60px, 14vw, 200px);
  line-height: .9;
  letter-spacing: -0.04em;
  margin: var(--space-3) 0 var(--space-4);
  text-transform: uppercase;
}
.contact-mega span {
  display: block;
  overflow: hidden;
}
[data-reveal-line] > * { display: inline-block; }

.contact-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.contact-link {
  display: block;
  border: var(--rule) solid var(--cream);
  padding: var(--space-3);
  position: relative;
  transition: background .35s ease, color .35s ease, transform .25s ease;
}
.contact-link:hover {
  background: var(--cream);
  color: var(--ink);
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--accent);
}
.contact-link-label {
  display: block;
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 700;
  opacity: .7;
  margin-bottom: var(--space-1);
}
.contact-link-handle {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}
.contact-link-arrow {
  display: inline-block;
  transition: transform .35s cubic-bezier(.7,0,.2,1);
}
.contact-link:hover .contact-link-arrow {
  transform: translate(8px, -4px);
}
.contact-link-note {
  display: block;
  font-size: 13px;
  letter-spacing: .5px;
  opacity: .8;
  margin-top: var(--space-2);
  border-top: 1px solid rgba(245,241,232,.3);
  padding-top: 10px;
}
.contact-link:hover .contact-link-note {
  border-top-color: rgba(10,10,10,.3);
}

@media (max-width: 800px) {
  .contact-links { grid-template-columns: 1fr; }
}

.contact-foot {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  font-size: 11px;
  letter-spacing: 2px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(245,241,232,.25);
  padding-top: var(--space-2);
}

/* =========================================
   FOOTER
   ========================================= */
.foot {
  padding: var(--space-2) var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 2px;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* =========================================
   ACCESSIBILITY / MOTION
   ========================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-track { animation: none; }
  .hero-word { transform: translateY(0) !important; }
}

/* focus state — keyboard users */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
