/* isat.pt. Black on white, the colours of the brand. Calm type, plenty of room; the only colour on the page is the
   one a visitor picks for their own company in the system sketch. Mobile first.
   scripts/check-contrast.mjs checks the colour pairs used here. */

@font-face {
  font-family: 'Bricolage';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url('fonts/bricolage-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url('fonts/bricolage-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------------------------------------------ tokens */

:root {
  /* The brand: black and white. */
  --ink: #121212;
  --paper: #ededed;
  --white: #ffffff;
  /* Softer text, on white and on the paper bands. */
  --muted: #595959;
  /* Softer text on black. */
  --muted-on-ink: #b8b8b8;
  --line: rgb(18 18 18 / 0.16);
  --edge: #767676;
  --pad: clamp(20px, 5vw, 48px);
  --gap: clamp(64px, 11vw, 128px);
  --radius: 10px;
  --font: 'Bricolage', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

/* ------------------------------------------------------------------------------------------------ base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
  background: var(--white);
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 400;
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
legend { padding: 0; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }

:focus { outline: none; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
::selection { background: var(--ink); color: var(--white); }

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Controls that only work with the script (boot.js sets "js" on <html>). */
html:not(.js) .js-only { display: none !important; }

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  background: var(--ink);
  color: var(--white);
  padding: 12px 16px;
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--pad); }

.label { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.sec-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 6vw, 56px); }
.sec-title { font-size: clamp(1.9rem, 6.2vw, 3.25rem); font-weight: 700; line-height: 1.06; letter-spacing: -0.03em; text-wrap: balance; max-width: 20ch; }
.sec-text { max-width: 48ch; font-size: 1.1875rem; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.btn .ic { width: 20px; height: 20px; flex: none; transition: transform 0.25s var(--ease); }
.btn-solid { background: var(--ink); color: var(--white); }
.btn:active { transform: scale(0.98); }
@media (hover: hover) {
  .btn:hover .ic { transform: translateX(4px); }
  .btn:hover { background: var(--ink); color: var(--white); }
  .btn-solid:hover { background: var(--white); color: var(--ink); }
}

/* ------------------------------------------------------------------------------------------------ header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1200px;
  height: 68px;
  margin-inline: auto;
  padding-inline: var(--pad);
}
.top-logo { display: flex; align-items: center; min-height: 44px; }
.logo { height: 26px; width: auto; }
.top-nav { display: none; }
.top-lang { display: flex; align-items: center; font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.04em; }
.top-lang > * { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; text-decoration: none; }
.top-lang [aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.top-lang a { color: var(--muted); }
@media (hover: hover) { .top-lang a:hover, .top-nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; } }

/* ------------------------------------------------------------------------------------------------ hero */

.hero { padding: clamp(40px, 9vw, 104px) 0 clamp(48px, 9vw, 96px); }
.hero-title {
  max-width: 17ch;
  margin-bottom: clamp(20px, 3.4vw, 30px);
  font-size: clamp(2.35rem, 8.8vw, 5.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero-second { display: block; color: var(--muted); }
.hero-lead { max-width: 44ch; margin-bottom: clamp(26px, 4vw, 36px); font-size: clamp(1.125rem, 2.4vw, 1.375rem); line-height: 1.45; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* ------------------------------------------------------------------------------------------------ the system sketch */

.build { padding: var(--gap) 0; background: var(--paper); }
.build-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'head' 'view' 'form' 'send'; gap: 28px; }
.build-head { grid-area: head; display: grid; gap: 14px; }
.view { grid-area: view; display: grid; gap: 12px; }
.cfg { grid-area: form; display: grid; gap: 22px; }
.build-send { grid-area: send; }

.cfg-row { display: flex; gap: 12px; align-items: end; }
.field { display: grid; gap: 8px; }
.field:first-child { flex: 1; min-width: 0; }
.field > span, .cfg-parts legend { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.cfg-parts legend { margin-bottom: 10px; }
.field input[type='text'] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: var(--white);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius);
  font-size: 1.0625rem;
  font-weight: 600;
}
.field input[type='text']::placeholder { color: var(--muted); opacity: 1; font-weight: 400; }
.field input[type='text']:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.field input[type='color'] {
  width: 52px;
  height: 52px;
  padding: 5px;
  background: var(--white);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius);
  cursor: pointer;
}
.field input[type='color']::-webkit-color-swatch-wrapper { padding: 0; }
.field input[type='color']::-webkit-color-swatch { border: 0; border-radius: 5px; }
.field input[type='color']::-moz-color-swatch { border: 0; border-radius: 5px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  background: var(--white);
  border: 1.5px solid var(--edge);
  border-radius: 999px;
  font-weight: 600;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}
.chip .ic { width: 0; height: 18px; margin-right: 0; opacity: 0; transition: width 0.18s var(--ease), margin 0.18s var(--ease), opacity 0.18s; }
.chip input:checked + span { background: var(--ink); color: var(--white); border-color: var(--ink); }
.chip input:checked + span .ic { width: 18px; margin-right: 6px; opacity: 1; }
.chip input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }

/* The sketch itself: a small window that takes the company's name and colour. */
.sys {
  --brand: #121212;
  --brand-on: #ffffff;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 60px -30px rgb(18 18 18 / 0.4), 0 2px 6px rgb(18 18 18 / 0.06);
}
.sys-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 48px;
  padding: 0 16px;
  background: var(--brand);
  color: var(--brand-on);
  transition: background-color 0.25s, color 0.25s;
}
.sys-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sys-user { flex: none; width: 24px; height: 24px; border-radius: 50%; background: currentColor; opacity: 0.35; }
.sys-body { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 292px; }
.sys-nav { display: none; }
.sys-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 10px; padding: 12px; }
.tile, .sys-nav li { display: none; }
.tile { gap: 10px; padding: 10px 10px 12px; border: 1px solid var(--line); border-radius: 10px; animation: pop 0.35s var(--ease); }
.tile-name { font-size: 0.8125rem; font-weight: 700; line-height: 1.2; }
.tile-art { width: 100%; height: auto; }
.tile-art .l { fill: rgb(18 18 18 / 0.1); }
.tile-art .b { fill: var(--brand); transition: fill 0.25s; }
.sys-empty { display: none; grid-column: 1 / -1; padding: 96px 12px; text-align: center; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: scale(0.94); } }
.view-note { font-size: 0.875rem; color: var(--muted); }

/* A part is in the sketch when its box is ticked. */
.build:has(#mod-reservas:checked) .tile[data-mod='reservas'],
.build:has(#mod-clientes:checked) .tile[data-mod='clientes'],
.build:has(#mod-tarefas:checked) .tile[data-mod='tarefas'],
.build:has(#mod-aprovacoes:checked) .tile[data-mod='aprovacoes'],
.build:has(#mod-pagamentos:checked) .tile[data-mod='pagamentos'],
.build:has(#mod-relatorios:checked) .tile[data-mod='relatorios'],
.build:has(#mod-documentos:checked) .tile[data-mod='documentos'],
.build:has(#mod-assistente:checked) .tile[data-mod='assistente'] { display: grid; }
.build:has(#mod-reservas:checked) .sys-nav [data-mod='reservas'],
.build:has(#mod-clientes:checked) .sys-nav [data-mod='clientes'],
.build:has(#mod-tarefas:checked) .sys-nav [data-mod='tarefas'],
.build:has(#mod-aprovacoes:checked) .sys-nav [data-mod='aprovacoes'],
.build:has(#mod-pagamentos:checked) .sys-nav [data-mod='pagamentos'],
.build:has(#mod-relatorios:checked) .sys-nav [data-mod='relatorios'],
.build:has(#mod-documentos:checked) .sys-nav [data-mod='documentos'],
.build:has(#mod-assistente:checked) .sys-nav [data-mod='assistente'] { display: block; }
.build:not(:has(input[name='part']:checked)) .sys-empty { display: block; }

.ways { display: grid; gap: 22px; margin-top: var(--gap); }
.ways li { display: grid; gap: 4px; padding-top: 16px; border-top: 1.5px solid var(--ink); }
.ways h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.ways p { color: var(--muted); }

/* ------------------------------------------------------------------------------------------------ communication */

.comms { padding: var(--gap) 0; }
.comms-list { display: grid; gap: 22px; }
.comms-list li { display: grid; gap: 4px; padding-top: 16px; border-top: 1.5px solid var(--ink); }
.comms-n { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); }
.comms-list h3 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.comms-list p { color: var(--muted); }

/* ------------------------------------------------------------------------------------------------ projects, as references */

.refs { padding-bottom: var(--gap); }
.refs-in { padding-top: var(--gap); border-top: 1px solid var(--line); }
.refs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
.ref-link { display: block; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ref-img { aspect-ratio: 16 / 10; overflow: hidden; margin-bottom: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.ref-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: transform 0.5s var(--ease); }
.ref-img.is-drawn, .pj-cover.is-drawn { background: var(--pa, var(--ink)); border-color: transparent; }
.drawn { width: 100%; height: 100%; }
.drawn-a, .drawn-b { fill: var(--pa-on, var(--white)); }
.drawn-b { opacity: 0.35; }
.ref-name { display: block; font-weight: 700; line-height: 1.25; }
@media (hover: hover) {
  .ref-link:hover .ref-img img { transform: scale(1.04); }
  .ref-link:hover .ref-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
}

/* ------------------------------------------------------------------------------------------------ contact and legal */

.contact { padding: var(--gap) 0 32px; background: var(--ink); color: var(--white); }
.contact .label { color: var(--muted-on-ink); }
.contact-title { margin: 14px 0 22px; font-size: clamp(1.9rem, 6.2vw, 3.25rem); font-weight: 700; line-height: 1.06; letter-spacing: -0.03em; }
.contact-ways { display: grid; gap: 10px; justify-items: start; }
.contact-mail {
  font-size: clamp(1.75rem, 8.4vw, 4.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}
.contact-phone { display: inline-flex; align-items: center; min-height: 44px; font-size: 1.25rem; font-weight: 700; text-underline-offset: 5px; }
.legal { display: grid; gap: 8px; max-width: 100ch; margin-top: var(--gap); padding-top: 24px; border-top: 1px solid rgb(255 255 255 / 0.22); font-size: 0.8125rem; line-height: 1.5; color: var(--muted-on-ink); }
.legal-logo { margin-bottom: 8px; color: var(--white); }
.legal a { text-underline-offset: 3px; }

/* ------------------------------------------------------------------------------------------------ project page */

.pj-draft { padding: 12px var(--pad); background: var(--ink); color: var(--white); font-weight: 700; text-align: center; }
.pj-head { display: grid; gap: 18px; padding-top: clamp(20px, 5vw, 56px); padding-bottom: clamp(28px, 5vw, 48px); }
.pj-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; justify-self: start; font-weight: 700; text-decoration: none; color: var(--muted); }
.pj-back .ic { width: 20px; height: 20px; }
.pj-title { font-size: clamp(2.2rem, 8.4vw, 4.75rem); font-weight: 700; line-height: 1.02; letter-spacing: -0.035em; overflow-wrap: anywhere; text-wrap: balance; }
.pj-sum { max-width: 46ch; font-size: 1.25rem; color: var(--muted); }
.pj-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 36px; }
.pj-meta { display: flex; flex-wrap: wrap; gap: 8px 36px; }
.pj-meta dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.pj-meta dd { font-weight: 700; }
.pj-visit { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 5px; overflow-wrap: anywhere; }
.pj-visit .ic { width: 20px; height: 20px; flex: none; }
.pj-cover { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.pj-cover img { width: 100%; height: auto; }
.pj-cover.is-drawn { aspect-ratio: 16 / 9; }
.pj-body { display: grid; gap: 1.1em; max-width: 68ch; margin-top: clamp(32px, 6vw, 56px); font-size: 1.1875rem; line-height: 1.55; }
.pj-gallery { display: grid; gap: 14px; margin-top: clamp(32px, 6vw, 56px); }
.pj-shot { overflow: hidden; background: var(--paper); border-radius: 14px; }
.pj-shot img, .pj-shot video { width: 100%; height: auto; }
/* Tall images (phone screens) and video keep a sensible size instead of filling the column. */
.pj-shot.is-tall { padding: 24px; }
.pj-shot.is-tall img { width: auto; max-width: min(100%, 360px); max-height: 80svh; margin-inline: auto; border-radius: 12px; box-shadow: 0 20px 44px -20px rgb(18 18 18 / 0.45); }
.pj-shot video { max-height: 86svh; background: #000; }
.pj-next {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2px 16px;
  margin: var(--gap) 0;
  padding: 22px 0;
  border-block: 1.5px solid var(--ink);
  text-decoration: none;
}
.pj-next-label { grid-column: 1 / -1; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.pj-next-name { font-size: clamp(1.7rem, 6vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; overflow-wrap: anywhere; }
.pj-next .ic { width: 30px; height: 30px; margin-bottom: 6px; transition: transform 0.3s var(--ease); }
@media (hover: hover) { .pj-next:hover .ic { transform: translateX(8px); } }
.is-project main > .pj:last-child { padding-bottom: var(--gap); }

.nf { display: grid; gap: 20px; justify-items: start; padding-top: clamp(56px, 12vw, 140px); padding-bottom: var(--gap); }

/* ------------------------------------------------------------------------------------------------ a quiet entrance */

html.app [data-armed] { opacity: 0; transform: translateY(18px); }
html.app [data-armed].is-in { opacity: 1; transform: none; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }

/* ------------------------------------------------------------------------------------------------ larger screens */

@media (min-width: 620px) {
  .sys-body { grid-template-columns: 168px minmax(0, 1fr); }
  .sys-nav { display: block; padding: 14px 10px; border-right: 1px solid var(--line); }
  .sys-nav li { padding: 8px 10px; border-radius: 7px; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
  .sys-nav li:first-child { color: var(--ink); }
  .ways { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
  .comms-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 28px; }
  .refs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 24px; }
  .pj-gallery { grid-template-columns: 1fr 1fr; }
  .pj-shot:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .top { height: 84px; }
  .logo { height: 30px; }
  .top-nav { display: flex; gap: 6px; margin-left: auto; }
  .top-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 0.9375rem; font-weight: 600; color: var(--muted); text-decoration: none; }
  .build-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); grid-template-areas: 'head view' 'form view' 'send view'; column-gap: clamp(40px, 6vw, 88px); row-gap: 28px; align-items: start; }
  .view { position: sticky; top: 28px; grid-row: 1 / span 3; }
  .sys-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px; }
  .sys-body { min-height: 360px; }
  .comms-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------------------------------------ preferences */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.app [data-armed] { opacity: 1; transform: none; }
}

@media (forced-colors: active) {
  .btn, .chip span, .sys, .tile { border: 2px solid CanvasText; }
}

@media print {
  .top-nav, .top-lang, .cfg, .build-send { display: none !important; }
  .contact { background: #fff; color: #000; }
}
