/* ===========================================================================
   rivas.pt — folha de estilos partilhada
   =========================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #0B0C0D; }
body { font-family: 'Inter', system-ui, sans-serif; color: #F3F2ED; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; margin: 0; font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; }
[id] { scroll-margin-top: 92px; }
html { scroll-behavior: smooth; }
a { color: inherit; text-decoration: none; }
button { font-family: 'Inter', sans-serif; }
img { max-width: 100%; }

:root {
  --accent-design: #2FBFA6;
  --accent-cripto: #C9A227;
  --accent: var(--accent-design);
}

.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: #9C9C96; }
.container { max-width: 1180px; margin: 0 auto; padding-inline: 40px; }
.container-narrow { max-width: 820px; margin: 0 auto; padding-inline: 40px; }
.section { padding-block: 96px; }
.hairline { border-top: 1px solid rgba(255,255,255,0.08); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 30px; font-weight: 600; font-size: 15px; cursor: pointer; border-radius: 2px; border: 1px solid transparent; transition: transform .15s ease, opacity .15s ease, background .2s ease, color .2s ease, border-color .2s ease; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-primary { background: var(--accent); color: #0B0C0D; border-color: var(--accent); }
.btn-outline { background: transparent; color: #F3F2ED; border-color: rgba(255,255,255,0.25); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-accent-outline { background: transparent; color: var(--accent); border-color: var(--accent); }

.link-underline { position: relative; font-family: 'JetBrains Mono', monospace; font-size: 13px; letter-spacing: 0.02em; color: #F3F2ED; }
.link-underline::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.link-underline:hover::after { transform: scaleX(1); }

/* Nav */
.site-nav { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(10px); background: rgba(11,12,13,0.82); border-bottom: 1px solid rgba(255,255,255,0.08); }
.site-nav .container { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 24px; }
.logo-mark { flex-shrink: 0; }
.logo-mark img { width: auto; max-width: none; display: block; }
.logo-mark .logo-icon { display: none; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-dd { position: relative; padding-bottom: 20px; margin-bottom: -20px; }
.nav-dd-menu { position: absolute; top: 100%; left: 0; margin-top: 0; background: #15161A; border: 1px solid rgba(255,255,255,0.12); padding: 8px; display: flex; flex-direction: column; min-width: 172px; opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity .15s ease, transform .15s ease; z-index: 50; }
.nav-dd:hover .nav-dd-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
.nav-dd-menu a { padding: 9px 12px; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: #C9C9C3; border-radius: 2px; text-decoration: none; }
.nav-dd-menu a:hover { background: rgba(255,255,255,0.06); color: #F3F2ED; }
.toggle-wrap { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255,255,255,0.06); gap: 2px; }
.toggle-btn { border: none; border-radius: 999px; padding: 9px 18px; font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.04em; cursor: pointer; background: transparent; color: #9C9C96; transition: background .2s ease, color .2s ease; }
.toggle-btn.is-on { background: var(--accent); color: #0B0C0D; }

/* Cards / grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08); }
.cell { background: #0F1011; padding: 32px; display: flex; flex-direction: column; gap: 14px; transition: background .2s ease, transform .06s linear; will-change: transform; }
.cell:hover { background: #131415; }
.svc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.svc-list li { color: #9C9C96; font-size: 14px; line-height: 1.55; padding-left: 18px; position: relative; }
.svc-list li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }
.door { border: 1px solid rgba(255,255,255,0.12); padding: 30px; display: flex; flex-direction: column; gap: 12px; transition: border-color .25s ease, background .25s ease, transform .25s ease; }
.door:hover { border-color: rgba(255,255,255,0.28); background: #0F1011; transform: translateY(-3px); }
.quali { border: 1px solid rgba(255,255,255,0.1); padding: 26px; display: flex; flex-direction: column; gap: 10px; transition: border-color .25s ease, transform .25s ease; }
.quali:hover { border-color: rgba(201,162,39,0.5); transform: translateY(-3px); }

.ph-image { width: 100%; background: repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 2px, transparent 2px, transparent 14px), #151617; border: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; background-size: cover; background-position: center; }
.ph-image span { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #6E6E68; }

/* Ambient canvas host */
.ambient-host { position: relative; overflow: hidden; }
.ambient-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* Contact forms */
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 72px; align-items: start; text-align: left; }
.contact-right { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 9px; }
.field > label, .fieldset-label { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 500; letter-spacing: 0.13em; text-transform: uppercase; color: #9C9C96; }
.input, .textarea { width: 100%; background: transparent; border: 1px solid rgba(255,255,255,0.18); color: #F3F2ED; padding: 14px 16px; font-family: 'Inter', sans-serif; font-size: 15px; border-radius: 2px; transition: border-color .2s ease; }
.input:focus, .textarea:focus { border-color: var(--accent); outline: none; }
.textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid rgba(255,255,255,0.18); font-size: 14px; color: #C9C9C3; cursor: pointer; border-radius: 2px; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.chip:hover { border-color: rgba(255,255,255,0.42); }
.chip-input:checked + .chip { background: var(--accent); border-color: var(--accent); color: #0B0C0D; font-weight: 600; }
.fset { border: none; padding: 0; margin: 0 0 34px; display: flex; flex-direction: column; gap: 14px; }
.fset legend { padding: 0; }
.consent { display: flex; gap: 12px; align-items: flex-start; }
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.consent label { color: #9C9C96; font-size: 13px; line-height: 1.6; }
.honey { position: absolute; left: -9999px; opacity: 0; }
.sent-box { border: 1px solid var(--accent); padding: 44px; text-align: center; }
.req { color: var(--accent); }
.form-error { display: none; border: 1px solid #C9564A; background: rgba(201,86,74,0.08); color: #E7B3AC; padding: 16px 20px; font-size: 13.5px; margin-top: 18px; }
.form-error.is-visible { display: block; }
.waitlist-input { background: transparent; border: 1px solid rgba(255,255,255,0.25); color: #F3F2ED; padding: 14px 16px; font-family: 'Inter', sans-serif; font-size: 14px; flex: 1; min-width: 0; }
.waitlist-input::placeholder { color: #6E6E68; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Testemunhos placeholder */
.testi-card { border: 1px dashed rgba(255,255,255,0.22); padding: 28px; display: flex; flex-direction: column; gap: 16px; }

/* Cookie banner */
/* Faixa de consentimento — compacta, alinhada com o .container do site */
#cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: none; background: rgba(11,12,13,0.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid rgba(255,255,255,0.08); max-height: 85vh; overflow-y: auto; }
#cookie-banner.is-visible { display: block; }
#cookie-banner [hidden] { display: none !important; }
#cookie-banner .cb-wrap { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: 14px; }
#cookie-banner .cb-text { margin: 0; font-size: 13px; line-height: 1.55; color: #9C9C96; max-width: 660px; }
#cookie-banner .cb-text a { color: #C9C9C3; font-size: 12px; margin-left: 4px; white-space: nowrap; }
#cookie-banner .cb-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
#cookie-banner .cb-btn { padding: 9px 18px; font-size: 13px; min-width: 96px; }
#cookie-banner .cb-link { -webkit-appearance: none; appearance: none; background: none; border: none; margin: 0 6px 0 0; padding: 9px 4px; cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.02em; color: #9C9C96; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255,255,255,0.25); }
#cookie-banner .cb-link:hover { color: #F3F2ED; text-decoration-color: currentColor; }
#cookie-banner .cb-panel { padding-bottom: 6px; }
#cookie-banner .cb-panel .cb-row:first-child { border-top: 1px solid rgba(255,255,255,0.08); }
#cookie-banner .cb-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06); max-width: 760px; }
#cookie-banner .cb-row:last-child { border-bottom: none; }
#cookie-banner .cb-row-title { margin: 0 0 2px; font-size: 13.5px; color: #F3F2ED; font-weight: 600; }
#cookie-banner .cb-row-title label { cursor: pointer; }
#cookie-banner .cb-row-text { margin: 0; font-size: 12.5px; color: #8A8A84; line-height: 1.5; }
#cookie-banner .cb-always { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #7FBF8F; white-space: nowrap; }
#cookie-banner .cb-switch { position: relative; flex-shrink: 0; width: 42px; height: 24px; }
#cookie-banner .cb-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
#cookie-banner .cb-switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,0.14); transition: background .2s ease; }
#cookie-banner .cb-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #F3F2ED; transition: transform .2s ease; }
#cookie-banner .cb-switch input:checked + span { background: var(--accent); }
#cookie-banner .cb-switch input:checked + span::after { transform: translateX(18px); }
#cookie-banner .cb-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* "Preferências de cookies" no rodapé — igual aos restantes links do rodapé */
.link-btn { -webkit-appearance: none; appearance: none; background: transparent; border: 0; border-radius: 0; margin: 0; padding: 0; box-shadow: none; cursor: pointer; font-family: 'Inter', system-ui, sans-serif; font-size: 13px; font-weight: 400; line-height: inherit; letter-spacing: normal; color: #6E6E68; text-align: left; }
.link-btn:hover, .bottom-row a:hover { color: #C9C9C3; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Footer */
.site-footer .footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 44px; }
.site-footer .bottom-row { padding-top: 26px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }

/* Portfolio */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 18px; }
.tab { border: 1px solid transparent; background: transparent; color: #8A8A84; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; letter-spacing: 0.06em; padding: 10px 18px; min-height: 42px; cursor: pointer; border-radius: 2px; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.tab:hover { color: #F3F2ED; border-color: rgba(255,255,255,0.2); }
.tab.is-on { background: #2FBFA6; color: #0B0C0D; font-weight: 600; border-color: #2FBFA6; }
.tab-count { opacity: 0.6; margin-left: 7px; font-size: 11px; }
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08); }
.work-item { background: #0F1011; display: flex; flex-direction: column; transition: background .2s ease; }
.work-item:hover { background: #131415; }
.shot { position: relative; width: 100%; aspect-ratio: 4/3; overflow: hidden; background: repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 2px, transparent 2px, transparent 14px), #151617; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.work-item:hover .shot img { transform: scale(1.04); }
.work-body { padding: 26px 28px 30px; display: flex; flex-direction: column; gap: 10px; }
.empty { border: 1px dashed rgba(255,255,255,0.2); padding: 56px; text-align: center; color: #6E6E68; }

/* Legal pages */
article h3 { font-size: 18px; margin-top: 44px; margin-bottom: 14px; color: #F3F2ED; }
article p, article li { color: #ABABA5; font-size: 15px; line-height: 1.75; }
article ul { padding-left: 20px; }
article strong { color: #C9C9C3; font-weight: 600; }
article a.link-underline { color: #C9C9C3; }
.note-box { border: 1px solid rgba(255,255,255,0.14); padding: 20px 24px; font-size: 13px; color: #9C9C96; margin-top: 56px; }
.warn { border: 1px solid rgba(201,162,39,0.4); background: rgba(201,162,39,0.06); padding: 22px 24px; margin-top: 12px; }
.warn p { margin: 0; color: #D8CBA0 !important; }
table.legal-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
table.legal-table th, table.legal-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 14px; color: #ABABA5; vertical-align: top; }
table.legal-table th { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #6E6E68; font-weight: 500; }

@media (max-width: 860px) {
  html { overflow-x: hidden; }
  .container, .container-narrow { padding-inline: 22px !important; }
  .grid-2, .grid-3, .grid-4, .work-grid, .contact-grid, .split-grid, .field-row, .testi-grid, .steps-grid { grid-template-columns: 1fr !important; }
  .contact-grid { gap: 44px !important; }
  .split-grid { gap: 32px !important; }
  .field-row { gap: 18px !important; }
  .nav-links { display: none !important; }
  /* Telemóvel: só o ícone RVS na nav, para caber com o seletor Design/Cripto */
  .logo-mark .logo-full { display: none; }
  .logo-mark .logo-icon { display: block; }
  .site-nav .container { gap: 12px; }
  .site-nav .btn { padding: 9px 14px !important; font-size: 12.5px !important; }
  .toggle-btn { padding: 8px 13px; }
  .hero-h1 { font-size: clamp(28px, 9vw, 40px) !important; }
  .hero-cta { flex-direction: column; align-items: stretch !important; }
  .bio-grid { grid-template-columns: 1fr !important; gap: 36px !important; }
  .doors-grid { grid-template-columns: 1fr !important; }
  .footer-cols { grid-template-columns: 1fr !important; gap: 36px !important; }

  /* Status rows (Razão) can't fit a label + wide tracked badge on one line at phone widths */
  .status-row { flex-wrap: wrap; row-gap: 6px; }
  table.legal-table th, table.legal-table td { padding: 12px 8px; font-size: 13px; overflow-wrap: break-word; }
  table.legal-table, table.legal-table tbody, table.legal-table tr, table.legal-table td { display: block; width: 100%; }
  table.legal-table tr.lt-head { display: none; }
  table.legal-table tr { border-bottom: 1px solid rgba(255,255,255,0.12); padding: 10px 0; }
  table.legal-table td { border-bottom: none; padding: 5px 0; display: grid; grid-template-columns: 112px 1fr; gap: 12px; }
  table.legal-table td::before { content: attr(data-label); font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #6E6E68; padding-top: 2px; }

  /* Boxed forms (waitlist / lead-magnet CTAs) had fixed padding + min-width that pushed
     content past the viewport edge on phones */
  .form-cta-box { padding: 26px 20px !important; }
  .form-cta-box > * { min-width: 0 !important; width: 100%; max-width: none !important; }
  .waitlist-row { flex-direction: column; align-items: stretch !important; }
  .waitlist-row .btn { width: 100%; }
  #cookie-banner .cb-wrap { flex-direction: column; align-items: stretch; gap: 12px; padding-block: 14px 16px; }
  #cookie-banner .cb-text { font-size: 12.5px; }
  #cookie-banner .cb-actions { width: 100%; gap: 8px; }
  #cookie-banner .cb-btn { flex: 1 1 0; min-width: 0; padding: 10px 8px; }
  #cookie-banner .cb-link { margin-right: 2px; }
  #cookie-banner .cb-row { gap: 16px; }
}

@media (max-width: 374px) {
  .site-nav .toggle-wrap ~ .btn { display: none; }
}

@media (max-width: 420px) {
  .hero-h1 { font-size: clamp(26px, 9.5vw, 34px) !important; }
}
