/* =============================================================
   portfoglio — Bruno Matos
   Vanilla CSS, no framework, no external requests.

   Palette and type are the main site's (ai/assets/css/rettro.css):
   same purples, same pixel chrome — hard offset shadows, square
   corners, monospace throughout — so the portfolio reads as part
   of brunomatos.pt rather than a bought theme.

   The two families are NOT fetched from a CDN here: this folder is
   standalone and must render on its own. VT323/JetBrains Mono are
   named first and degrade to the system monospace stack, which is
   the same shape and costs nothing.

   Mobile-first. Light and dark both ship.
   ============================================================= */

:root {
  --font-display: "VT323", ui-monospace, "Courier New", monospace;
  --font-body: "JetBrains Mono", ui-monospace, "Courier New", monospace;

  --bg: #e8e6f4;
  --paper: #eeedf8;
  --paper-bright: #ffffff;
  --ink: #3a3490;
  --ink-mid: #6860bb;
  --ink-soft: #9b94d4;
  --rule: #c0bbdf;
  --shadow-back: #b8b4dc;

  --live: #15803d;
  --warn: #b45309;

  --pop-coral: #f47b7b;
  --pop-mint: #5dd3b6;
  --pop-amber: #fbbf24;
  --pop-sky: #7cc4ff;
  --pop-teal: #2fbf8f;
  --pop-violet: #a78bfa;

  --wrap: 76rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16142a;
    --paper: #1d1a36;
    --paper-bright: #241f42;
    --ink: #ddd8f8;
    --ink-mid: #b0a8e4;
    --ink-soft: #7d76b4;
    --rule: #352f5c;
    --shadow-back: #0e0c1c;
    --live: #4ade80;
    --warn: #fbbf24;
  }
}

*,
*::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;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

a {
  color: var(--ink);
}

/* Visible focus everywhere — never removed. */
a:focus-visible,
:focus-visible {
  outline: 3px solid var(--pop-amber);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: var(--ink);
  color: var(--paper-bright);
  padding: 0.6rem 1rem;
  font-weight: 700;
}

.skip:focus {
  left: 0;
}

/* ---- Masthead ---------------------------------------------------------- */
.masthead {
  border-bottom: 2px solid var(--ink);
  padding-block: clamp(2.5rem, 8vw, 4.5rem) clamp(2rem, 6vw, 3rem);
}

.crumb {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--ink-mid);
  letter-spacing: 0.04em;
}

.crumb a {
  color: var(--ink-mid);
}

.masthead h1 {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 9vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin: 0 0 1rem;
}

.lede {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1rem, 2.4vw, 1.1rem);
  color: var(--ink-mid);
}

/* ---- Grid -------------------------------------------------------------- */
.grid {
  list-style: none;
  margin: clamp(2rem, 6vw, 3.5rem) 0 0;
  padding: 0;
  display: grid;
  gap: clamp(1.25rem, 3vw, 1.75rem);
  /* auto-fit, not breakpoints: the column count follows the real width,
     which keeps working if this ever gets embedded somewhere narrower. */
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--paper-bright);
  border: 2px solid var(--ink);
  /* The main site's stacked pixel shadow — square, hard, no blur. */
  box-shadow: 5px 5px 0 var(--shadow-back);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--shadow-back);
  }
}

/* ---- Card thumbnail ---------------------------------------------------- */
/* No screenshots: each project gets a built mark or mock in its own accent,
   so the row reads as a set and nothing depends on an image file. */
.card__shot {
  display: grid;
  place-items: center;
  height: 9.5rem;
  padding: 1.5rem;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  color: var(--accent, var(--ink-mid));
  overflow: hidden;
}

.card--teal { --accent: var(--pop-teal); }
.card--indigo { --accent: var(--ink); }
.card--coral { --accent: var(--pop-coral); }
.card--sky { --accent: var(--pop-sky); }
.card--mint { --accent: var(--pop-mint); }
.card--amber { --accent: var(--pop-amber); }
.card--violet { --accent: var(--pop-violet); }
.card--ink { --accent: var(--ink-mid); }

.shot-mark {
  width: 100%;
  max-height: 100%;
}

.shot-mark--stroke {
  width: auto;
  height: 100%;
  color: var(--accent);
}

/* Bar chart (opina) */
.mock--bars {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 100%;
  width: 100%;
}

.mock--bars span {
  flex: 1;
  height: var(--v);
  background: var(--accent);
  border: 2px solid var(--ink);
}

/* Line chart (skymetrics) */
.mock--chart {
  width: 100%;
  height: 100%;
  color: var(--accent);
}

.mock--chart svg {
  width: 100%;
  height: 100%;
}

/* Readiness ring (nis2) */
.mock--gauge {
  height: 100%;
  color: var(--accent);
}

.mock--gauge svg {
  height: 100%;
  width: auto;
}

/* Permission string (chmod.wtf) */
.mock--mono {
  margin: 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--ink-mid);
}

.mock--mono b {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent);
  -webkit-text-stroke: 1px var(--ink);
}

/* Data table (dashflow) */
.mock--table {
  display: grid;
  gap: 0.45rem;
  width: 100%;
}

.mock--table span {
  height: 0.85rem;
  background: var(--accent);
  border: 2px solid var(--ink);
}

.mock--table span:nth-child(1) { width: 100%; }
.mock--table span:nth-child(2) { width: 78%; }
.mock--table span:nth-child(3) { width: 91%; }
.mock--table span:nth-child(4) { width: 64%; }

/* Desktop window (brunomatos.pt) */
.mock--window {
  width: 100%;
  border: 2px solid var(--ink);
  background: var(--paper-bright);
  padding-bottom: 0.7rem;
}

.mock__chrome {
  display: block;
  height: 1.1rem;
  background: var(--accent);
  border-bottom: 2px solid var(--ink);
  margin-bottom: 0.7rem;
}

.mock__line {
  display: block;
  height: 0.4rem;
  width: var(--w);
  margin: 0.4rem 0.7rem;
  background: var(--ink-soft);
}

/* ---- Card body --------------------------------------------------------- */
.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.35rem 1.5rem;
}

.card__meta {
  margin: 0 0 0.6rem;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border: 2px solid var(--ink);
  background: var(--paper);
}

/* Colour is paired with a word, never carrying meaning alone. */
.badge--live { color: var(--live); }
.badge--soon { color: var(--ink); background: var(--pop-amber); }
.badge--wip { color: var(--warn); }

.card__body h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  margin: 0 0 0.7rem;
  letter-spacing: 0.01em;
}

.card__what {
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
  color: var(--ink-mid);
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
  padding: 0;
}

.tags li {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-mid);
  border: 1px solid var(--rule);
  padding: 0.15rem 0.45rem;
}

/* Pushes the link to the bottom so every card's CTA lines up. */
.card__links {
  margin: auto 0 0;
}

.go {
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1px;
}

.go::after {
  content: " \2192";
}

.go:hover,
.go:focus-visible {
  background: var(--pop-amber);
  color: var(--ink);
}

/* ---- Closing ----------------------------------------------------------- */
.closing {
  margin: clamp(3rem, 9vw, 5rem) 0 clamp(2rem, 6vw, 3rem);
  padding: clamp(1.75rem, 5vw, 2.5rem);
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--shadow-back);
}

.closing h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1;
  margin: 0 0 0.75rem;
}

.closing p {
  margin: 0;
  max-width: 52ch;
  color: var(--ink-mid);
}

.closing__contact {
  margin-top: 1.25rem !important;
}

.go--big {
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
}

/* ---- Yard (wandering pixel cats) --------------------------------------- */
/* Decorative strip in the same chrome as the cards: hard border, square
   shadow, a band of ground. cats.js drives the walking; CSS does the legs. */
.yard {
  position: relative;
  margin-top: clamp(3rem, 8vw, 4.5rem);
  height: 8.5rem;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--shadow-back);
  overflow: hidden;
}

.yard::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 0.7rem;
  background: var(--ink-soft);
  border-top: 2px solid var(--ink);
}

.yard__label {
  position: absolute;
  top: 0.55rem;
  left: 0.8rem;
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cat {
  position: absolute;
  left: 0;
  bottom: 0.7rem;
  width: 4.5rem;
  height: 2.8rem;
  color: var(--accent);
  filter: drop-shadow(2px 2px 0 var(--shadow-back));
  will-change: transform;
}

.cat svg {
  display: block;
  width: 100%;
  height: 100%;
  shape-rendering: crispEdges;
}

.cat__eye {
  fill: var(--ink);
}

.cat--coral { --accent: var(--pop-coral); }
.cat--amber { --accent: var(--pop-amber); }
.cat--sky { --accent: var(--pop-sky); }

/* Two leg frames; walking toggles them with a stepped animation. */
.cat__legs--b {
  opacity: 0;
}

.cat.is-walking .cat__legs--a {
  animation: cat-step 0.4s steps(1) infinite;
}

.cat.is-walking .cat__legs--b {
  animation: cat-step 0.4s steps(1) infinite;
  animation-delay: -0.2s;
}

@keyframes cat-step {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cat.is-walking .cat__legs--a,
  .cat.is-walking .cat__legs--b {
    animation: none;
  }
}

/* ---- Footer ------------------------------------------------------------ */
.foot {
  border-top: 2px solid var(--ink);
  padding-block: 1.5rem;
  font-size: 0.85rem;
  color: var(--ink-mid);
}

.foot p {
  margin: 0;
}

.foot a {
  color: var(--ink-mid);
}
