
  :root{
    --bg: #f7f5f0;
    --bg-elevated: #ffffff;
    --text: #171715;
    --text-muted: #8a8680;
    --border: #e3e0d7;
    --accent: #171715;
    /* terceira cor: laranja queimado, usado só em pequenos detalhes */
    --pop: #d9541e;
    --serif: 'Space Grotesk', -apple-system, sans-serif;
    --sans: 'Inter', -apple-system, sans-serif;
  }

  [data-theme="dark"]{
    --bg: #121212;
    --bg-elevated: #1a1a1a;
    --text: #eeece7;
    --text-muted: #8f8b83;
    --border: #2b2b28;
    --accent: #eeece7;
    --pop: #ff7a3d;
  }

  *{ margin:0; padding:0; box-sizing:border-box; }

  ::selection{ background: var(--pop); color: #fff; }
  :focus-visible{ outline: 2px solid var(--pop); outline-offset: 3px; }

  html{ scroll-behavior: smooth; }

  body{
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    transition: background .3s ease, color .3s ease;
    /* .hero usa um truque de 100vw para sair do .wrap; isto evita a barra
       de scroll horizontal que isso cria (100vw inclui a scrollbar) */
    overflow-x: hidden;
    /* no telemóvel só se pode arrastar na vertical (nunca para os lados) */
    touch-action: pan-y pinch-zoom;
  }

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

  .wrap{
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 40px;
  }

  /* ---------- HEADER ---------- */
  header{
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
  }

  header .wrap{
    display:flex;
    align-items:center;
    justify-content:space-between;
    height: 84px;
  }
  .logo{ font-size: 15px; letter-spacing: .01em; }
  .logo .role{ color: var(--text-muted); font-weight: 300; }
  .header-actions{ display:flex; align-items:center; gap: 40px; }
  nav{ display:flex; gap: 40px; }
  nav a{
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
    transition: color .2s ease;
  }
  nav a:hover{ color: var(--pop); }

  .theme-toggle{
    width: 36px; height: 36px;
    display:flex; align-items:center; justify-content:center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: border-color .2s ease;
  }
  .theme-toggle:hover, .menu-toggle:hover, .lang-toggle:hover{ border-color: var(--pop); }

  /* Botão de idioma PT/EN, antes do botão de tema */
  .lang-toggle{
    width: 36px; height: 36px;
    display:flex; align-items:center; justify-content:center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font: 600 11px/1 var(--sans);
    letter-spacing: .06em;
    cursor: pointer;
    transition: border-color .2s ease;
    margin-right: -28px; /* aproxima-o do botão de tema (o gap do header é 40px) */
  }
  .theme-toggle svg{ width:16px; height:16px; }

  /* Botão de menu mobile (hamburger que se transforma em X) */
  .menu-toggle{
    display:none;
    width: 36px; height: 36px;
    flex-direction: column;
    align-items:center; justify-content:center;
    gap: 4px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
  }
  .menu-toggle span{
    display:block;
    width: 16px; height: 1.5px;
    background: var(--text);
    transition: transform .25s ease, opacity .25s ease;
  }
  .menu-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(5.5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-5.5px) rotate(-45deg); }

  /* Menu mobile (dropdown com Projetos / Sobre / Contacto) */
  .mobile-nav{ display:none; }

  /* ---------- HERO ---------- */
  /* Imagem a ocupar a secção toda, de ponta a ponta; o texto fica sobreposto por cima. */
  .hero{
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    height: 92vh;
    min-height: 620px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    color: #fff;
  }
  .hero-media{
    position: absolute;
    inset: 0;
    z-index: 0;
  }
  .hero-media img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* mesma posição/zoom de sempre — a pessoa mantém-se no mesmo sítio */
    object-position: 40% 30%;
    transform: scale(1.35);
    transform-origin: 40% 30%;
  }
  .hero::after{
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(0,0,0,.8) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,0) 72%);
  }
  .hero-content{
    position: relative;
    z-index: 2;
    width: 100%;
    padding-top: 60px;
    padding-bottom: 64px;
  }
  .eyebrow{
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 28px;
  }
  /* dentro do hero o texto fica sempre sobre a foto — override para branco,
     independente do tema claro/escuro */
  .hero-content .eyebrow{ color: rgba(255,255,255,.7); margin: 32px 0 0; }
  .hero h1{
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(48px, 6.2vw, 84px);
    line-height: 1.02;
    letter-spacing: -0.01em;
    color: #fff;
  }
  .hero p.lede{
    margin-top: 28px;
    max-width: 420px;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255,255,255,.85);
    font-weight: 300;
  }
  .hero-links{
    margin-top: 28px;
    display:flex;
    align-items:center;
    gap: 32px;
  }
  .btn-underline{
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 500;
    border-bottom: 1px solid var(--pop);
    padding-bottom: 4px;
  }
  .hero-content .btn-underline{ color: #fff; }
  /* pequeno traço laranja antes do eyebrow do hero */
  .hero-content .eyebrow::before{
    content: "";
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--pop);
    vertical-align: middle;
    margin-right: 12px;
  }
  .link-muted{
    font-size: 15px;
    color: rgba(255,255,255,.75);
    font-family: var(--serif);
    font-style: italic;
  }
  .link-muted:hover{ color: var(--pop); }

  /* placeholder image blocks */
  .ph{
    width:100%; height:100%;
    background:
      repeating-linear-gradient(135deg, color-mix(in srgb, var(--text) 4%, transparent) 0 2px, transparent 2px 14px),
      color-mix(in srgb, var(--text-muted) 12%, var(--bg-elevated));
    border: 1px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 20px;
    overflow: hidden;
  }
  .ph:has(img){ padding: 0; }
  .ph img{
    width:100%;
    height:100%;
    object-fit: cover;
    display:block;
  }
  .ph.contain img{ object-fit: contain; }
  .ph.pos-top img{ object-position: 50% 15%; }

  /* ---------- SECTION LABEL ---------- */
  .section-head{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    padding: 130px 0 40px;
    border-top: 1px solid var(--border);
    margin-top: 90px;
  }
  .section-head .eyebrow{ margin-bottom:0; }
  /* pontinho laranja antes do título de cada secção */
  .section-head .eyebrow::before{
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pop);
    vertical-align: middle;
    margin-right: 10px;
    position: relative;
    top: -1px;
  }
  .section-head .count{
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: .1em;
  }

  /* Fade in ao fazer scroll (secção Sobre): foto entra da esquerda, texto da direita.
     Só esconde se o JS estiver ativo (classe .js), para nunca ficar invisível sem JS. */
  .js .reveal{
    opacity: 0;
    transition: opacity 1s cubic-bezier(.22,.61,.36,1), transform 1s cubic-bezier(.22,.61,.36,1);
  }
  .js .reveal-left{ transform: translateX(-48px); }
  .js .reveal-right{ transform: translateX(48px); transition-delay: .15s; }
  /* corta o que sai do ecrã enquanto o elemento ainda está deslocado */
  .about-grid{ overflow-x: clip; }
  @media (max-width: 900px){
    /* em ecrãs pequenos a entrada é só na vertical, para nunca alargar a página */
    .js .reveal-left, .js .reveal-right{ transform: translateY(28px); }
  }
  .js .reveal.in-view{ opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce){
    .js .reveal{ opacity: 1; transform: none; transition: none; }
  }

  /* ---------- PROJECTS GRID ---------- */
  .projects-grid{
    display:flex;
    gap: 60px;
    align-items: flex-start;
  }
  .projects-col{
    flex: 1 1 0;
    min-width: 0;
  }
  .projects-col.offset{ margin-top: 90px; }
  /* Nota: usamos margin em vez de display:flex+gap aqui de propósito — combinar
     flex-direction:column com um filho de aspect-ratio (a imagem) faz alguns
     motores de layout calcularem mal a altura do card e "cortar" o título. */
  .project-card{ display:block; margin-bottom: 90px; }
  .project-card:last-child{ margin-bottom: 0; }
  .project-card .ph{ aspect-ratio: 4/3; }

  /* Hover nos cards clicáveis: a imagem aproxima-se (zoom para dentro) e escurece */
  a.project-card .ph{ position: relative; }
  a.project-card .ph img{ transition: transform .7s cubic-bezier(.22,.61,.36,1); }
  a.project-card .ph::after{
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.32);
    opacity: 0;
    transition: opacity .5s ease;
    pointer-events: none;
  }
  @media (hover: hover){
    a.project-card:hover .ph img{ transform: scale(1.06); }
    a.project-card:hover .ph::after{ opacity: 1; }
    a.project-card:hover h3{ color: var(--pop); }
  }
  a.project-card h3{ transition: color .3s ease; }

  /* Entrada do texto do hero: fade in suave, com pequeno atraso entre linhas */
  @keyframes heroIn{
    from{ opacity: 0; transform: translateY(18px); }
    to{ opacity: 1; transform: none; }
  }
  .hero-content > *{ animation: heroIn 1s cubic-bezier(.22,.61,.36,1) both; }
  .hero-content > :nth-child(1){ animation-delay: .15s; }
  .hero-content > :nth-child(2){ animation-delay: .3s; }
  .hero-content > :nth-child(3){ animation-delay: .45s; }
  .hero-content > :nth-child(4){ animation-delay: .6s; }

  @media (prefers-reduced-motion: reduce){
    .hero-content > *{ animation: none; }
    a.project-card .ph img, a.project-card .ph::after{ transition: none; }
  }
  .project-card.locked{ cursor: default; }
  .project-card.locked .ph{ position: relative; overflow: hidden; color: color-mix(in srgb, var(--text-muted) 60%, transparent); }
  .project-card.locked .ph .locked-bg{
    position: absolute;
    inset: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    object-fit: cover;
    filter: blur(28px);
    opacity: .5;
  }
  .project-card.locked .lock-icon{ position: relative; z-index: 1; opacity: .5; }
  .project-card.locked h3{ color: var(--text-muted); }
  .project-meta{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    margin-top: 24px;
    padding-bottom: 28px;
    border-bottom: 1px solid transparent;
  }
  .project-meta h3{
    font-family: var(--serif);
    font-weight: 500;
    font-size: 26px;
  }
  .project-meta span{
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 20px;
  }

  /* ---------- ABOUT ---------- */
  .about-grid{
    display:grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 80px;
    padding-bottom: 40px;
  }
  .about-grid .ph{ aspect-ratio: 3/4; }
  .about-grid .ph img{ object-position: 65% 50%; }
  .about-text p{
    font-size: 18px;
    line-height: 1.7;
    font-weight: 300;
    color: var(--text);
    margin-bottom: 24px;
    max-width: 560px;
  }
  .about-text p:first-child{
    font-family: var(--serif);
    font-size: 26px;
    font-style: italic;
    color: var(--text);
    line-height: 1.4;
  }
  .facts{
    margin-top: 48px;
    display:grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    max-width: 560px;
  }
  .facts .fact-label{
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
  }
  .facts .fact-value{ font-size: 15px; }

  /* ---------- CTA ---------- */
  .cta{
    text-align:center;
    padding: 160px 0 140px;
    border-top: 1px solid var(--border);
    margin-top: 90px;
  }
  .cta .eyebrow{ justify-content:center; display:flex; margin-bottom: 24px; }
  .cta h2{
    font-family: var(--serif);
    font-weight: 500;
    font-style: italic;
    font-size: clamp(36px, 5vw, 60px);
    letter-spacing: -0.01em;
  }
  .cta .btn-underline{
    display:inline-block;
    margin-top: 36px;
  }

  /* ---------- FOOTER ---------- */
  footer{
    border-top: 1px solid var(--border);
    padding: 56px 0;
  }
  .footer-grid{
    display:flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 32px;
  }
  .footer-left .eyebrow{ margin-bottom: 14px; }
  .footer-email{
    font-family: var(--serif);
    font-size: clamp(24px, 3.4vw, 34px);
  }
  .footer-right{ text-align: right; font-size: 14px; color: var(--text-muted); }
  .footer-right a{ margin-left: 16px; color: var(--text); }
  .footer-right a:hover{ color: var(--pop); }
  .footer-copy{ margin-top: 14px; font-size: 12px; }

  /* ---------- PROJECT DETAIL PAGE ---------- */
  .project-hero{
    padding-top: 56px;
  }
  .back-link{
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .back-link:hover{ color: var(--pop); }

  .project-title{
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(44px, 7vw, 96px);
    line-height: 1.02;
    letter-spacing: -0.01em;
    margin-top: 28px;
  }

  .project-meta-row{
    display:grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 56px;
    padding-top: 28px;
    padding-bottom: 28px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .project-meta-row .fact-label{
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
  }
  .project-meta-row .fact-value{
    font-size: 15px;
    line-height: 1.5;
  }

  .project-image{
    margin-top: 16px;
  }
  .project-image:first-of-type{
    margin-top: 64px;
  }
  .project-image .ph{ aspect-ratio: 16/10; }

  .project-image-grid{
    margin-top: 16px;
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .project-image-grid .ph{ aspect-ratio: 4/3; }

  .project-cta-link{
    margin-top: 32px;
    padding: 48px 0;
    text-align: center;
    border-top: 1px solid var(--border);
  }
  .project-cta-link .btn-underline{ display:inline-block; }

  .project-nav{
    display:flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 90px;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .project-nav a{ max-width: 45%; }
  .project-nav .dir{
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    display:block;
  }
  .project-nav .next-wrap{ text-align: right; }
  .project-nav .next-wrap .dir{ text-align: right; }
  .project-nav h4{
    font-family: var(--serif);
    font-weight: 500;
    font-size: 24px;
  }
  .project-nav a:hover h4{ color: var(--pop); }

  /* ---------- RESPONSIVE ---------- */
  /* Menu hambúrguer em todos os tamanhos de ecrã */
  @media all{
    .header-actions{ gap: 12px; }
    .lang-toggle{ margin-right: 0; }
    nav{ display:none; }
    .menu-toggle{ display:flex; }
    /* O menu abre por cima do site (não o empurra): fade in, fundo translúcido */
    header .wrap{ position: relative; z-index: 2; }
    .mobile-nav{
      display: flex;
      flex-direction: column;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 100vh;
      padding: 110px max(40px, calc(50vw - 620px)) 0;
      background: color-mix(in srgb, var(--bg) 82%, transparent);
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity .35s ease, visibility .35s ease;
      z-index: 1;
    }
    .mobile-nav.is-open{
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }
    .mobile-nav a{
      padding: 14px 0;
      font-size: 28px;
      font-family: var(--serif);
      color: var(--text);
      border-bottom: 1px solid var(--border);
    }
    .mobile-nav a:last-child{ border-bottom: none; }
  }
  @media (prefers-reduced-motion: reduce){
    .mobile-nav{ transition: none; }
  }
  @media (max-width: 900px){
    .wrap{ padding: 0 24px; }
    header .wrap{ height: 72px; }
    .mobile-nav{ padding: 96px 24px 0; }
    .hero{ height: 88vh; min-height: 580px; }
    .hero-content{ padding-top: 32px; padding-bottom: 40px; }
    /* Em ecrãs pequenos o texto ocupa a parte de baixo: sobe a foto para o rosto
       ficar acima do texto em vez de tapado por ele */
    .hero-media img{
      object-position: 47% 30%;
      transform: translateY(-14%) scale(1.3);
      transform-origin: 47% 30%;
    }
    .about-grid{ grid-template-columns: 1fr; }
    /* uma só coluna; as duas colunas "dissolvem-se" para os cards poderem ser
       reordenados: Santa Marta, Villas Monte, Mondegus, Profiling Areal, e por fim
       os dois projetos em desenvolvimento */
    .projects-grid{ display: grid; grid-template-columns: 1fr; gap: 56px; }
    .projects-col, .projects-col.offset{ display: contents; margin-top: 0; }
    .project-card, .project-card:last-child{ margin-bottom: 0; }
    .projects-col:not(.offset) .project-card:nth-child(1){ order: 1; }
    .projects-col:not(.offset) .project-card:nth-child(2){ order: 2; }
    .projects-col.offset .project-card:nth-child(2){ order: 3; }
    .projects-col.offset .project-card:nth-child(1){ order: 4; }
    .projects-col:not(.offset) .project-card:nth-child(3){ order: 5; }
    .projects-col.offset .project-card:nth-child(3){ order: 6; }
    /* Em mobile, os cards bloqueados mostram só "Brevemente" */
    .project-card.locked h3{ display: none; }
    .section-head{ padding-top: 90px; }
    .footer-grid{ flex-direction: column; align-items: flex-start; }
    .footer-right{ text-align: left; }
    .footer-right a{ margin-left: 0; margin-right: 16px; }
    .project-meta-row{ grid-template-columns: 1fr 1fr; }
    .project-image-grid{ grid-template-columns: 1fr; }
    .project-nav a{ max-width: 100%; }
  }

  /* ---------- TELEMÓVEL: ritmo vertical mais equilibrado ---------- */
  @media (max-width: 900px){
    .section-head{ margin-top: 56px; padding: 56px 0 28px; }
    .projects-grid{ gap: 44px; }
    .project-meta{ margin-top: 18px; padding-bottom: 0; }
    .about-grid{ gap: 36px; padding-bottom: 0; }
    .cta{ padding: 88px 0 80px; margin-top: 56px; }
    .cta h2{ font-size: clamp(30px, 8vw, 44px); }
    footer{ padding-top: 56px; }
    .footer-grid{ gap: 32px; }
  }
  @media (max-width: 520px){
    .logo{ font-size: 13px; }
    .header-actions{ gap: 8px; }
    header .wrap{ gap: 10px; }
  }
