/* =======================================================================
   STUDIO ALTO DA GLÓRIA — MAIN SITE STYLES
   Layout, header, navigation, hero, sections, reveal animations,
   and intro overlay fade-out handling.
======================================================================= */

/* RESET + BASE -------------------------------------------------------- */

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  height: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  margin: 0 auto;
  padding-inline: var(--page-padding-x);
  padding-block: var(--page-padding-y);
  max-width: var(--max-width);
}

/* Page content is visible by default (prevents black pages) */
.page-content {
  position: relative;
  z-index: 1; /* Ensure content sits above accent lines */
  opacity: 1;
  transition: opacity 0.45s ease-out;
}

/* Only the homepage uses the fade-in gate */
.page--home .page-content {
  opacity: 0;
}

.page--home .page-content.is-visible {
  opacity: 1;
}

.page--home .section--work {
  padding-top: var(--space-4);
}

html {
  scrollbar-gutter: stable;
}

/* HEADER -------------------------------------------------------------- */

.logo-lockup {
  display: block;
  width: 320px;
  height: auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: var(--space-4);
}

.brand-nav {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-right: var(--space-3);
}

.brand-line {
  margin: 0;
  color: var(--fg-dim);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.brand-line--lockup {
  font-size: 0.84rem;
  letter-spacing: 0.008em;
  line-height: 1.26;
  margin-top: 0.20rem;
  opacity: 0.88;
  white-space: nowrap;
  transform-origin: left center;
	align-self: flex-start;
}

.brand-nav-right {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}


/* MAIN NAV ------------------------------------------------------------ */

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-link {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.875rem;
  opacity: 0.85;
  transition: opacity 0.2s ease-out;
}
.nav-link:hover {
  opacity: 1;
}

/* LANGUAGE TOGGLE ----------------------------------------------------- */

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.8;
}

.lang {
  border: none;
  background: none;
  color: var(--fg-dim);
  padding: 0;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.8;
}
.lang--current {
  opacity: 1;
  pointer-events: none;
}
.lang:hover {
  opacity: 1;
}
.lang-separator {
  opacity: 0.5;
  margin-inline: 0.12rem;
}

/* NAV FRAME — DESKTOP ONLY ------------------------------------------- */

.nav-frame-divider {
  display: none;
}

@media (min-width: 900px) {
  .brand-nav-right {
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 0.35rem 0.9rem;
    gap: var(--space-2);
  }

  .nav-frame-divider {
    display: block;
    align-self: stretch;
    width: 1px;
    background: rgba(255, 255, 255, 0.22);
    margin-inline: 0.5rem;
  }
}

/* HERO --------------------------------------------------------------- */

.hero {
  padding-block: var(--space-2) var(--space-1);
}

.hero-title {
  margin: 0;
  font-weight: 600;
  font-size: 2.6rem;
  line-height: 1.05;
  max-width: 22ch;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin-top: var(--space-2);
  color: var(--fg-dim);
  font-size: 1.25rem;
  line-height: 1.5;
  max-width: 65ch;
}

/* EXPRESSIVE HERO TITLE ---------------------------------------------- */

.hero-title--expressive {
  font-family: var(--font-display-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  word-spacing: -0.20em;
}

@media (min-width: 700px) {
  .hero-title--expressive {
    line-height: 1.12;
    max-width: 22ch;
  }
}

@media (min-width: 1100px) {
  .hero-title--expressive {
    max-width: 20ch;
  }
}

/* FULL-WIDTH HERO ---------------------------------------------------- */

.hero-full {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-block: var(--space-2) var(--space-1);
  background: var(--bg);
}

.hero-full .hero-inner {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--page-padding-x);
}

/* --------------------------------------------------
   HOMEPAGE OVERVIEW (IDENTITY / WORK / APPROACH)
-------------------------------------------------- */

.section--overview {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.overview-item {
  max-width: 26rem;
}

.overview-label {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 var(--space-1);
  opacity: 0.82;
}

.overview-text {
  margin: 0 0 var(--space-1);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--fg-dim);
}

@media (max-width: 900px) {
  .overview-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .overview-item {
    max-width: none;
  }
}

/* SECTIONS ----------------------------------------------------------- */

.section {
  padding-block: var(--space-4);
}

.section-kicker {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-title {
  margin: 0 0 var(--space-2);
  font-size: 1.6rem;
  max-width: 40ch;
}

.section-body {
  color: var(--fg-dim);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 60ch;
}

/* GLOBAL TEXT LINK STYLE --------------------------------------------- */

.section-body a,
.footer-contact a,
.footer-instagram a,
.page-main a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0.82;
  transition: opacity 0.2s ease-out, border-color 0.2s ease-out;
}

.section-body a:hover,
.footer-contact a:hover,
.footer-instagram a:hover,
.page-main a:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.42);
}

/* ACCESSIBLE FOCUS (quiet, consistent) ------------------------------- */

.menu-toggle:focus-visible,
.mobile-menu__link:focus-visible,
.nav-link:focus-visible,
.lang:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 3px;
}

/* TWO-COLUMN STUDIO -------------------------------------------------- */
/* (generic — can be reused later, not strictly “About”) */

.studio-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

@media (max-width: 900px) {
  .studio-columns {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

/* WORK LAYOUT -------------------------------------------------------- */

.work-layout {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.work-visual {
  flex: 0 0 58%;
  order: 1;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.work-copy {
  flex: 1 1 38%;
  order: 2;
}

/* Images never receive borders from CSS.
   Any framing is part of the asset itself. */

.work-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-link {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: var(--fg);
  opacity: 0.85;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.08rem;
  transition: 0.2s ease-out;
}

.work-link:hover {
  opacity: 1;
  border-color: var(--fg);
}

/* SECTION DIVIDER ---------------------------------------------------- */

.section-divider {
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  margin: calc(var(--space-1) * 0.4) 0;
}

/* TIGHTER HOMEPAGE SECTIONS ------------------------------------------ */

.section--studio {
  padding-top: 0;
  padding-bottom: calc(var(--space-3) * 1.6);
}

.section--work,
.section--contact {
  padding-top: var(--space-2);
  padding-bottom: calc(var(--space-3) * 1.6);
}

/* SCROLL REVEAL ------------------------------------------------------ */

.section--reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.section--reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* INTRO OVERLAY ------------------------------------------------------ */

.intro-logo-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 10000; /* Always above menus, etc. */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.6s ease-out;
}

/* IMPORTANT: matches motion-logo.js (logo-intro-complete) */
body.logo-intro-complete .intro-logo-overlay {
  opacity: 0;
  pointer-events: none;
}

/* INTRO SKIP SAFETY NET ---------------------------------------------- */

.intro-skip .page-content {
  opacity: 1 !important;
}

.intro-skip .intro-logo-overlay {
  display: none !important;
}

/* RESPONSIVE — BASE -------------------------------------------------- */

@media (min-width: 700px) {
  .hero:not(.hero-full) {
    padding-block: var(--space-5) var(--space-5);
  }

  .hero-title {
    font-size: 3.1rem;
    max-width: 30ch;
  }

  .hero-subtitle {
    font-size: 1.35rem;
  }
}

/* ACCENT LINES ------------------------------------------------------- */

.accent-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.accent-line {
  position: absolute;
  opacity: 0;
  will-change: transform, opacity;
  filter: blur(0.6px);
}

.accent-line--c1 { background: var(--accent-cyan); }
.accent-line--c2 { background: var(--accent-magenta); }
.accent-line--c3 { background: var(--accent-green); }
.accent-line--c4 { background: var(--accent-orange); }

.accent-line--horizontal { height: 2px; }
.accent-line--vertical { width: 2px; }

@keyframes accent-line-horizontal {
  0%   { transform: translateX(-120vw); opacity: 0; }
  10%  { opacity: 0.7; }
  80%  { opacity: 0.7; }
  100% { transform: translateX(120vw); opacity: 0; }
}

@keyframes accent-line-vertical {
  0%   { transform: translateY(-120vh); opacity: 0; }
  10%  { opacity: 0.7; }
  80%  { opacity: 0.7; }
  100% { transform: translateY(120vh); opacity: 0; }
}

/* RESPONSIVE — LARGE ------------------------------------------------- */

@media (min-width: 1100px) {
  .hero:not(.hero-full) {
    min-height: auto;
    display: block;
    padding-block: var(--space-3) var(--space-2);
  }

  .hero-title {
    font-size: 3.4rem;
    max-width: none;
  }

  .hero-subtitle {
    font-size: 1.4rem;
    max-width: none;
  }
}

/* WORK SECTION — MOBILE ---------------------------------------------- */

@media (max-width: 800px) {
  .work-layout {
    flex-direction: column;
  }

  .work-visual,
  .work-copy {
    order: initial;
  }

  .work-visual {
    width: 100%;
    margin-top: var(--space-3);
  }
}

/* NAV + LANGUAGE ALIGNMENT (DESKTOP) -------------------------------- */

@media (min-width: 900px) {
  .brand-nav-right {
    align-items: center;
  }

  .nav-link,
  .lang-toggle {
    line-height: 1;
  }
}

/* FOOTER -------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding-block: var(--space-3);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.footer-left p,
.footer-right p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--fg-dim);
}

.footer-studio {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--fg);
  margin-bottom: var(--space-1);
}

.footer-location { margin-top: 0.1rem; }
.footer-phone { margin-bottom: 0.4rem; }
.footer-contact { margin-top: var(--space-2); }
.footer-instagram { margin-top: 0.2rem; margin-bottom: var(--space-1); }
.footer-tagline { margin-top: var(--space-1); }

.footer-contact a,
.footer-instagram a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.04rem;
  opacity: 0.9;
  transition: opacity 0.2s ease-out, border-color 0.2s ease-out;
}

.footer-contact a:hover,
.footer-instagram a:hover {
  opacity: 1;
  border-color: var(--fg);
}

.footer-right { text-align: right; }

.footer-legal a {
  color: var(--fg-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.02rem;
  transition: border-color 0.2s ease-out, color 0.2s ease-out;
}

.footer-legal a:hover {
  color: var(--fg);
  border-color: var(--fg);
}

/* Safari / iOS automatic phone links -------------------------------- */

a[href^="tel"],
a[href^="sms"] {
  color: inherit;
  text-decoration: none;
}

a[x-apple-data-detectors] {
  color: inherit !important;
  text-decoration: none !important;
  font: inherit !important;
}

@media (max-width: 700px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-right {
    text-align: left;
    margin-top: var(--space-2);
  }
}


/* Safari / iOS automatic phone links -------------------------------- */

.site-footer a[x-apple-data-detectors] {
  color: inherit !important;
  text-decoration: none !important;
  font: inherit !important;
}


/* MANIFESTO TAPE (HOMEPAGE ONLY) ----------------------------------- */

.page--home .hero.hero-full {
  position: relative;
}

.page--home .manifesto-tape-link {
  position: absolute;
  top: 46%;
  transform: translateY(-50%);
  right: max(1rem, calc((100vw - var(--max-width)) / 2 - 0.5rem));
  z-index: 2;
  display: block;
  text-decoration: none;
}

.page--home .manifesto-tape-img {
  display: block;
  width: 88px;
  height: auto;
}

@media (max-width: 1100px) {
  .page--home .manifesto-tape-link {
    right: 1rem;
  }
}

@media (max-width: 700px) {
  .page--home .manifesto-tape-link {
    display: none;
  }
}

.section-footer-link {
  margin-top: var(--space-4);
}

/* =========================================
   MOBILE MENU — RIGHT-ALIGNED STRUCTURAL SHEET
   (No dimming. Header stays visible. Page remains visible behind.)
========================================= */

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.25rem;
  cursor: pointer;
}

.menu-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  margin: 4px 0;
  transition: transform 0.22s ease-out, opacity 0.18s ease-out;
}

/* Calm X state (no drama) */
.menu-toggle.is-open .menu-toggle__bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.menu-toggle.is-open .menu-toggle__bar:nth-child(2) {
  opacity: 0;
}
.menu-toggle.is-open .menu-toggle__bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile behavior: hide desktop nav + lang, show toggle */
@media (max-width: 900px) {
  .brand {
    min-width: 0;
    padding-right: 0;
  }

  .logo-lockup {
    max-width: 100%;
  }

  .brand-nav-right {
    flex-shrink: 0;
  }

  .nav,
  .nav-frame-divider,
  .lang-toggle {
    display: none;
  }

  .menu-toggle {
    display: block;
  }
}

/* Invisible backdrop catches outside taps */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: transparent;
  pointer-events: none;
}

.mobile-menu-backdrop.is-open {
  pointer-events: auto;
}

/* Right-aligned sheet */
.mobile-menu {
  position: fixed;
  z-index: 1000;

  right: max(1rem, var(--page-padding-x));
  top: var(--mobile-menu-top, 72px);

  width: min(260px, calc(100vw - 4rem));
  background: var(--bg);

  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-color: rgba(255, 255, 255, 0.22);

  opacity: 0;
  transform: translateY(-14px);
  pointer-events: none;

  transition: transform 0.24s ease-out, opacity 0.18s ease-out;
}

.mobile-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-menu__nav {
  padding: var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
}

/* Same type size as desktop nav. Tap comfort via padding. */
.mobile-menu__link {
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--fg);
  padding: 1rem 0;
  opacity: 0.9;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.mobile-menu__link:hover {
  opacity: 1;
}

.mobile-menu__link:last-of-type {
  border-bottom: none;
}

/* Language block: separated, still quiet */
.mobile-menu__lang {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

body.is-menu-open {
  overflow: hidden;
}

/* Skip link: hidden until focus, no layout shift */
.skip-link{
  position:absolute;
  left:-9999px;
  top:0;
  width:1px;
  height:1px;
  overflow:hidden;
  z-index:9999;
}

.skip-link:focus,
.skip-link:focus-visible{
  left:16px;
  top:16px;
  width:auto;
  height:auto;
  overflow:visible;
  padding:.7rem .9rem;
  background:#fff;
  color:#000;
  border-radius:6px;
}

/* Short landscape screens ------------------------------------------- */

@media (max-height: 500px) and (orientation: landscape) {
  .mobile-menu {
    top: calc(var(--mobile-menu-top, 72px) - 60px);
    max-height: calc(100vh - var(--mobile-menu-top, 72px) + 8px);
    overflow-y: auto;
  }

  .mobile-menu__nav {
    padding-block: var(--space-2);
  }

  .mobile-menu__link {
    padding: 0.65rem 0;
  }

  .mobile-menu__lang {
    margin-top: var(--space-2);
    padding-top: var(--space-1);
  }
}
/* Prevent fixed header from covering #main */
:root{ --skip-offset: 96px; }
#main{ scroll-margin-top: var(--skip-offset); }
