/* ============================================
   Bruno Costa — Portfolio
   ============================================ */

/* --- Custom Properties --- */
:root {
  --primary: #F4E3D7;
  --secondary: #353535;
  --tertiary: #4C4C4C;
  --white: #FFFFFF;
  --accent-blue: #E3F5FF;
  --accent-peach: #FFD8CB;

  --font-heading: 'Cairo', sans-serif;
  --font-body: 'Outfit', sans-serif;

  --container: 1200px;
  --gap: 1.5rem;
  --sidebar-width: 160px;
}

/* --- Reset --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  scrollbar-color: var(--accent-peach) var(--tertiary);
  scrollbar-width: auto;
}

/* --- Global Scrollbar (Webkit) --- */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-peach);
  border-radius: 10px;
  border: 3px solid var(--tertiary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
  color: var(--secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

ul {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   Sidebar / Navigation
   ============================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1rem;
  transition: background-color 0.4s, box-shadow 0.4s;
}

/* Hero state: transparent */
.sidebar--hero {
  background: transparent;
}

/* Page state: primary */
.sidebar--page {
  background: var(--primary);
  box-shadow: 1px 0 24px rgba(0, 0, 0, 0.07);
}

/* --- Logo --- */
.sidebar__logo {
  display: block;
  flex-shrink: 0;
}

.sidebar__logo img {
  height: 100px;
  width: auto;
}

.sidebar__logo-page {
  display: none;
}

.sidebar--hero .sidebar__logo-hero {
  display: block;
}

.sidebar--hero .sidebar__logo-page {
  display: none;
}

.sidebar--page .sidebar__logo-hero {
  display: none;
}

.sidebar--page .sidebar__logo-page {
  display: block;
}

/* --- Nav --- */
.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sidebar__link {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  transition: opacity 0.3s;
}

.sidebar__link:hover {
  opacity: 0.6;
}

.sidebar--page .sidebar__link {
  color: var(--secondary);
}

.sidebar__divider {
  width: 1px;
  height: 40px;
  background: var(--primary);
  opacity: 0.25;
}

.sidebar--page .sidebar__divider {
  background: var(--secondary);
}

/* --- Social --- */
.sidebar__social {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sidebar__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: opacity 0.3s;
}

.sidebar__social-link:hover {
  opacity: 0.6;
}

.sidebar--page .sidebar__social-link {
  color: var(--secondary);
}

.sidebar__social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* --- Mobile Hamburger (hidden on desktop) --- */
.sidebar__hamburger {
  display: none;
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 200;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.sidebar__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform 0.3s, opacity 0.3s;
}

.sidebar__hamburger.is-page span {
  background: var(--secondary);
}

.sidebar__hamburger.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.sidebar__hamburger.is-active span:nth-child(2) {
  opacity: 0;
}

.sidebar__hamburger.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile Nav overlay --- */
.sidebar__mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(53, 53, 53, 0.97);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  z-index: 150;
}

.sidebar__mobile-nav.is-open {
  display: flex;
}

.sidebar__mobile-link {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  transition: color 0.3s;
}

.sidebar__mobile-link:hover {
  color: var(--primary);
}

/* --- Main content offset --- */
main,
.footer {
  margin-left: var(--sidebar-width);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  width: 100vw;
  margin-left: calc(-1 * var(--sidebar-width));
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to right, var(--secondary) 0%, var(--secondary) 25%, #64605D 100%);
  overflow: hidden;
}


.hero__content {
  position: relative;
  z-index: 3;
  text-align: center;
  width: 100%;
  max-width: 1400px;
  padding: 0 1.5rem;
  padding-left: calc(var(--sidebar-width) + 1.5rem);
}

.hero__title {
  font-size: clamp(3rem, 8vw, 5.2rem);
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.hero__title--highlight {
  color: var(--white);
  text-shadow: 0 0 20px rgba(244, 227, 215, 0.5);
}

.hero__text {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--primary);
  margin: 0 auto 2.5rem auto;
  max-width: 620px;
  line-height: 1.7;
}

.hero__cta {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.85rem 2.5rem;
  border-radius: 50px;
  transition: background-color 0.3s, color 0.3s;
}

.hero__cta:hover {
  background-color: var(--primary);
  color: var(--secondary);
}

/* ============================================
   Portfolio
   ============================================ */
.portfolio {
  padding: 6rem 6vw;
  background-color: var(--white);
}

.portfolio__heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--tertiary);
  text-align: center;
  margin-bottom: 3rem;
}

.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.portfolio__item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.portfolio__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio__item:hover .portfolio__thumb {
  transform: scale(1.05);
}

.portfolio__item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(53, 53, 53, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.portfolio__item:hover .portfolio__item-overlay {
  opacity: 1;
}

.portfolio__item-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.35rem;
}

.portfolio__item-category {
  font-size: 0.85rem;
  color: var(--primary);
}

/* ============================================
   Modal (Behance-style)
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.modal.is-visible {
  display: flex;
  pointer-events: auto;
}

.modal.is-open {
  opacity: 1;
}

.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(53, 53, 53, 0.92);
  z-index: 1;
}

.modal__container {
  position: relative;
  z-index: 2;
  width: 90vw;
  max-width: 1600px;
  height: calc(100vh - 30px);
  height: calc(100svh - 30px);
  margin: 15px auto;
  background: var(--secondary);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 8px;
}

.modal__container::-webkit-scrollbar {
  width: 6px;
}

.modal__container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.modal__container::-webkit-scrollbar-thumb {
  background: rgba(244, 227, 215, 0.3);
  border-radius: 3px;
}

.modal__container::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 227, 215, 0.5);
}

.modal__close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--white);
  background: none;
  transition: opacity 0.3s, transform 0.3s;
}

.modal__close:hover {
  opacity: 0.7;
  transform: scale(1.1);
}

.modal__header {
  padding: 2.5rem 2.5rem 1.5rem;
}

.modal__title {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.modal__category {
  font-size: 0.9rem;
  color: rgba(244, 227, 215, 0.6);
}

.modal__image {
  padding: 0;
}

.modal__image img {
  width: 100%;
  display: block;
}

.modal__nav {
  padding: 3rem 2.5rem 2.5rem;
  border-top: 1px solid #eee;
  margin-top: 3rem;
}

.modal__nav {
  border-top-color: rgba(244, 227, 215, 0.15);
}

.modal__nav-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(244, 227, 215, 0.6);
  margin-bottom: 1.25rem;
}

.modal__nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.modal__nav-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  transition: opacity 0.3s;
}

.modal__nav-item:hover {
  opacity: 0.8;
}

.modal__nav-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   About
   ============================================ */
.about {
  padding: 6rem 0;
  background-color: var(--primary);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about__photo {
  position: relative;
  overflow: hidden;
}

.about__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.15);
}

.about__title {
  color: var(--secondary);
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.about__title-top {
  display: block;
  font-size: 36px;
  font-weight: 300;
  margin-bottom: 0.25rem;
  color: var(--secondary);
}

.about__title-bottom {
  display: block;
  font-size: 68px;
  font-weight: 800;
  color: var(--secondary);
}

.about__title span.about__highlight {
  color: var(--tertiary);
}

.about__text {
  color: var(--secondary);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.about__text p+p {
  margin-top: 1rem;
}

.about__social {
  display: flex;
  gap: 1.25rem;
}

.about__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--secondary);
  color: var(--secondary);
  transition: background-color 0.3s, color 0.3s;
}

.about__social-link:hover {
  background-color: var(--secondary);
  color: var(--primary);
}

.about__social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ============================================
   CTA
   ============================================ */
.cta {
  padding: 5rem 0;
  background-color: var(--secondary);
  background-image: url('../images/bg-cta-contato.jpg');
  background-size: cover;
  background-position: center;
  text-align: center;
}

.cta__title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--white);
  margin-bottom: 2rem;
}

.cta__button {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.85rem 2.5rem;
  border-radius: 50px;
  transition: background-color 0.3s, color 0.3s;
}

.cta__button:hover {
  background-color: var(--primary);
  color: var(--tertiary);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: 2rem 0;
  background-color: var(--tertiary);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.footer__text {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ============================================
   Responsive
   ============================================ */

/* Mobile */
@media (max-width: 767px) {
  .sidebar {
    display: none;
  }

  .sidebar__hamburger {
    display: flex;
  }

  main,
  .footer {
    margin-left: 0;
  }

  .hero {
    width: 100vw;
    margin-left: 0;
  }

  .hero__content {
    padding-left: 1.5rem;
  }

  .portfolio__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .modal__container {
    width: 100vw;
    max-width: 100%;
  }

  .modal__header {
    padding: 2rem 1.25rem 1rem;
  }

  .modal__image {
    padding: 0;
  }

  .modal__nav {
    padding: 2rem 1.25rem;
  }

  .modal__nav-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal__close {
    margin-right: 0.5rem;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .portfolio__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}