/* Galeria: shared base for every page of this direction (início, perguntas, começar um projeto).
   Tokens, type scale, header, footer, buttons, reveal and the night picture swap.
   Page-specific styles go in their own file; do not redefine these tokens there. */

:root {
  --paper: #F5F3EF;      /* page ground */
  --plaster: #E7E4DE;    /* alternate bands */
  --sheet: #FBFAF8;      /* raised surfaces (cards, the letter) */
  --ink: #1B1714;
  --soft: #5C554E;       /* secondary text, passes AA on paper and plaster */
  --oxblood: #7C1E13;
  --wine: #5A1610;
  --rose: #B5847B;       /* decorative only, never for text on paper */
  --rule: rgba(27, 23, 20, .16);
  --pad: clamp(20px, 5vw, 72px);
  --max: 1320px;
  --q: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;  /* headings, UI */
  --a: "Source Serif 4", Georgia, serif;                           /* reading text */
  --ease: cubic-bezier(.23, 1, .32, 1);

  /* Type scale. Headings stay big; answers and body were too small before, so they are larger here. */
  --t-hero: clamp(2.4rem, 5.4vw, 4.6rem);
  --t-h2: clamp(2.6rem, 7vw, 6.2rem);     /* question headings */
  --t-h3: clamp(1.5rem, 2.4vw, 2.1rem);
  --t-lead: clamp(1.5rem, 2.5vw, 2.05rem); /* the one-sentence answer under a question */
  --t-body: clamp(1.2rem, 1.05rem + .45vw, 1.35rem); /* about 19px on phones, 21.6px on desktop */
  --t-small: 1rem;

  /* Surfaces: white things (cards, the letter) sit on the page with a 1px ring and a soft shadow, not a flat edge. */
  --elevacao: 0 0 0 1px rgb(0 0 0 / .05), 0 1px 3px rgb(0 0 0 / .05), 0 6px 16px -8px rgb(0 0 0 / .1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--a);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
@media (hover: hover) and (pointer: fine) { a:hover { color: var(--oxblood); } }
:focus-visible { outline: 3px solid var(--oxblood); outline-offset: 3px; border-radius: 2px; }
/* Translucent, so a selected line never hides the descenders of the line above. */
::selection { background: rgba(181, 132, 123, .35); color: inherit; }
h1, h2, h3 { font-family: var(--q); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; margin: 0; text-wrap: balance; hyphens: manual; }
p { margin: 0 0 1em; text-wrap: pretty; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
/* Skip link: off screen until a keyboard user tabs to it, then a small pill at the top centre. */
.skip { position: fixed; top: 12px; left: 50%; z-index: 50; transform: translate(-50%, -200%); padding: 10px 18px; border-radius: 999px; background: var(--paper); color: var(--ink); font-family: var(--q); font-size: 15px; font-weight: 600; text-decoration: none; box-shadow: 0 0 0 1px var(--rule), 0 6px 18px rgba(27, 23, 20, .12); }
.skip:focus-visible { transform: translate(-50%, 0); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header. On the homepage it sits over the hero picture: add .site-head--sobre to the header. */
.site-head { position: relative; z-index: 10; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.site-head .logo { display: inline-flex; align-items: center; min-height: 44px; }
.site-head .logo img { width: 92px; height: auto; }
.site-head nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); font-family: var(--q); font-size: 16px; font-weight: 500; }
.site-head .menu { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.site-head nav a { text-decoration: none; }
.site-head .menu a { padding: 10px 0; }
.site-head .menu a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
.site-head .menu .menu-so-telemovel { display: none; }
.site-head .menu-btn { display: none; }

/* Light switch (easter egg): a pull cord hanging from the top edge of the page. Drag the bead down until it clicks,
   or press it, to turn the lights on or off. corda.js handles the drag; noite.js owns the state. */
.corda { position: absolute; top: 0; right: calc(max(var(--pad), env(safe-area-inset-right)) * .4); z-index: 12; width: 44px; display: flex; flex-direction: column; align-items: center; color: var(--ink); --puxo: 0px; }
html:has(.site-head--sobre) .corda { color: #fff; }
.corda-fio { width: 1.5px; height: calc(64px + var(--puxo)); background: currentColor; opacity: .7; }
.corda-puxador { position: relative; width: 44px; height: 44px; margin-top: -14px; padding: 0; border: 0; background: none; color: inherit; cursor: grab; touch-action: none; }
.corda-puxador::before { content: ""; position: absolute; left: 50%; top: 10px; width: 9px; height: 15px; margin-left: -4.5px; border-radius: 45% 45% 50% 50% / 35% 35% 65% 65%; background: currentColor; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.corda.a-puxar .corda-puxador { cursor: grabbing; }
.corda.a-voltar .corda-fio { transition: height .35s cubic-bezier(.34, 1.56, .64, 1); }
.corda-puxador:focus-visible { outline-offset: -6px; }
/* Phones: smaller, off centre, between the logo and the menu button. */
@media (max-width: 860px) {
  .corda { right: calc(var(--pad) + 64px); opacity: .6; }
  .corda-fio { width: 1px; height: calc(30px + var(--puxo)); }
  .corda-puxador::before { width: 6px; height: 10px; margin-left: -3px; top: 13px; box-shadow: none; }
  .corda.a-puxar { opacity: 1; }
  /* The open menu covers it. */
  html.menu-aberto-html .corda { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) { .corda.a-voltar .corda-fio { transition: none; } }
.site-head--sobre { position: absolute; inset: 0 0 auto 0; color: #fff; }
.site-head--sobre .logo img { filter: brightness(0) invert(1); }
@media (hover: hover) and (pointer: fine) { .site-head--sobre nav a:hover { color: #fff; opacity: .8; } }
.site-head--sobre .btn { background: #fff; color: var(--ink); }
@media (max-width: 860px) {
  /* Phones: a hamburger opens the links full screen, right-aligned and low, within reach of the thumb. */
  .site-head .menu-btn { position: relative; z-index: 31; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
  .menu-btn-linhas { position: relative; width: 22px; height: 2px; background: currentColor; transition: background-color .15s ease-out; }
  .menu-btn-linhas::before, .menu-btn-linhas::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: currentColor; transition: transform .2s ease-out; }
  .menu-btn-linhas::before { top: -7px; } .menu-btn-linhas::after { top: 7px; }
  .menu-aberto .menu-btn { color: var(--ink); }
  .menu-aberto .menu-btn-linhas { background: transparent; }
  .menu-aberto .menu-btn-linhas::before { transform: translateY(7px) rotate(45deg); }
  .menu-aberto .menu-btn-linhas::after { transform: translateY(-7px) rotate(-45deg); }
  .site-head nav > .btn { display: none; }
  .site-head .menu { position: fixed; inset: 0; z-index: 30; display: none; flex-direction: column; justify-content: safe flex-end; align-items: flex-end; overflow-y: auto; gap: 4px; padding: 96px max(var(--pad), env(safe-area-inset-right)) calc(18vh + env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left)); background: var(--paper); color: var(--ink); text-align: right; font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; overscroll-behavior: contain; }
  .site-head.menu-aberto .menu { display: flex; animation: menu-entra .2s ease-out; }
  .site-head .menu a { padding: 8px 0; line-height: 1.15; }
  .site-head .menu .menu-so-telemovel { display: block; }
  .site-head .menu .btn.menu-so-telemovel { display: inline-flex; margin-top: 22px; padding: 0 26px; min-height: 52px; background: var(--oxblood); border-color: transparent; color: #fff; font-size: 17px; letter-spacing: 0; }
  .site-head .menu a:focus-visible { outline-color: var(--oxblood); }
  .menu-aberto .logo img { filter: none; }
  .menu-aberto .logo { position: relative; z-index: 31; color: var(--ink); }
  html.menu-aberto-html { overflow: hidden; }
  @media (max-height: 500px) { .site-head .menu { padding-top: 76px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); font-size: 1.5rem; } }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--oxblood); color: #fff; font-family: var(--q); font-size: 16px; font-weight: 600; text-decoration: none; border: 1.5px solid transparent; transition: background-color .15s ease-out, color .15s ease-out; }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--wine); color: #fff; } }
.btn--linha { background: transparent; color: var(--oxblood); border-color: var(--oxblood); }
@media (hover: hover) and (pointer: fine) { .btn--linha:hover { background: var(--oxblood); color: #fff; border-color: var(--oxblood); } }

/* Section rhythm */
.banda { padding: clamp(72px, 10vw, 140px) 0; }
.banda--gesso { background: var(--plaster); }
.rotulo { font-family: var(--q); font-size: 15px; font-weight: 600; color: var(--soft); margin: 0 0 18px; }

/* Footer */
.site-foot { background: var(--ink); color: #EDE8E1; padding: 56px 0 72px; font-family: var(--q); font-size: 15px; }
.site-foot a { color: #EDE8E1; }
.site-foot .wrap { display: grid; gap: 28px 32px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: start; }
.site-foot p { margin: 0; }
.site-foot .logo + p { margin-top: 12px; }
.site-foot small { display: block; margin-top: 12px; }
.site-foot .logo img { width: 92px; filter: brightness(0) invert(1); }
.site-foot small { color: #B8AFA5; }

/* Night pictures: a room rendered by day and by night. Markup:
   <span class="par" style="aspect-ratio: W / H"><picture class="dia">…</picture><picture class="noite">…</picture></span>
   noite.js sets html[data-noite] by default (lights on); the hero lamp or ?luz=dia turns it off. Nothing else on the page changes. */
.par { position: relative; display: block; overflow: hidden; }
.par > picture, .par > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.par > .noite { opacity: 0; }
html[data-noite] .par > .dia { opacity: 0; }
html[data-noite] .par > .noite { opacity: 1; }
/* A live change (device switched to dark mode while the page is open) fades the pictures over. */
html.luz-a-mudar .par > picture { transition: opacity .6s var(--ease); }
@media (prefers-reduced-motion: reduce) { html.luz-a-mudar .par > picture { transition: none; } }

/* Typed phrase (escreve.js): a thin caret after the changing words. */
.escreve.a-escrever .escreve-texto::after { content: ""; display: inline-block; width: .06em; height: .9em; margin-left: .04em; vertical-align: -.05em; background: var(--oxblood); animation: escreve-cursor 1s steps(1) infinite; }
@keyframes escreve-cursor { 50% { opacity: 0; } }

/* Focus stays visible on dark surfaces (footer, words over the hero picture). */
.site-foot :focus-visible, .site-head--sobre :focus-visible, .heroi :focus-visible { outline-color: #fff; }
/* Touch: no double-tap zoom delay on controls; buttons answer a press. */
a, button, input, select, textarea, label { touch-action: manipulation; }
.btn { transition: background-color .15s ease-out, color .15s ease-out, transform .1s ease-out; }
.btn:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .btn:active { transform: none; } }
/* Notched phones in landscape: keep content clear of the notch. */
.wrap { padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right)); }
/* Footer links are stacked: give each a finger-sized line. */
/* Footer links are stacked: each gets a finger-sized hit area, not just a tall line. */
.site-foot p { line-height: 1.35; }
.site-foot p a { display: inline-block; padding-block: 3px; }
/* Touch screens: a little more room per link so each one is easy to tap. */
@media (pointer: coarse) { .site-foot p a { padding-block: 12px; } }

/* Buttons are oxblood, so their focus ring sits a little further out in ink. */
.btn:focus-visible { outline-color: var(--ink); outline-offset: 3px; }
.site-head--sobre .btn:focus-visible, .heroi .btn:focus-visible, .site-foot .btn:focus-visible { outline-color: #fff; }

/* Every picture gets a 1px inset outline, pure black at 10%, so light walls never melt into the page. */
img { outline: 1px solid rgb(0 0 0 / .1); outline-offset: -1px; }
/* Logos and the portrait in the letter are not pictures of rooms. */
.logo img, .site-foot img, .heroi img { outline: none; }

/* Never fake a bold or italic the fonts do not have. */
html { font-synthesis: none; }

/* Very large screens: everything a little larger and the content column wider, so pages do not read as small islands. */
@media (min-width: 1920px) { html { font-size: 112.5%; } :root { --max: 1520px; } }
@media (min-width: 2400px) { html { font-size: 125%; } :root { --max: 1720px; } }

@keyframes menu-entra { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .site-head.menu-aberto .menu { animation: none; } .menu-btn-linhas, .menu-btn-linhas::before, .menu-btn-linhas::after { transition: none; } }

/* Touch: no grey tap flash; press feedback on icon controls; no text selection on controls that are pressed or dragged. */
html { -webkit-tap-highlight-color: transparent; }
.menu-btn:active { transform: scale(.94); }
.corda-puxador, .menu-btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (prefers-reduced-motion: reduce) { .menu-btn:active { transform: none; } }
