/* Tokens: the same dark-cinema and gold as the Portuguese portfolio and Watchfolio. */
:root {
  --bg: #0d0c0b;
  --bg-2: #141210;
  --bg-3: #1b1815;
  --ink: #efe9df;
  --mute: #a39b8f;
  --line: #24211d;
  --line-2: #34302a;
  --gold: #d9a441;
  --gold-ink: #1a1306;

  --f-display: 'Syne', ui-sans-serif, system-ui, sans-serif;
  --f-text: 'Familjen Grotesk', ui-sans-serif, system-ui, sans-serif;

  --gutter: clamp(16px, 4.5vw, 64px);
  --max: 1240px;
  --radius: 14px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --fast: 180ms;

  --t-xs: .8125rem;
  --t-sm: .9375rem;
  --t-md: 1.0625rem;
  --t-lg: clamp(1.125rem, 1rem + .4vw, 1.3125rem);
  --t-xl: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --t-hero: clamp(2.6rem, 1.2rem + 5.2vw, 5.6rem);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-md)/1.6 var(--f-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--f-display); font-weight: 400; text-wrap: balance; }
p, ul, ol, dl, dd, figure { margin: 0; }
p { text-wrap: pretty; }
em { font-style: normal; }
::selection { background: var(--gold); color: var(--gold-ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 50; background: var(--gold); color: var(--gold-ink); padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font: 500 var(--t-sm)/1 var(--f-text); text-decoration: none; white-space: nowrap;
  transition: background-color var(--fast) ease, border-color var(--fast) ease, transform 160ms var(--ease);
}
.btn--sm { min-height: 40px; padding: 0 18px; }
.btn--lg { min-height: 56px; padding: 0 26px; font-size: var(--t-md); }
.btn--gold { background: var(--gold); color: var(--gold-ink); }
.btn--gold:hover { background: #e6b65a; }
.btn--ghost { border: 1px solid #4a443b; }
.btn--ghost:hover { border-color: var(--mute); }
.btn:active { transform: scale(.97); }

/* Nav */
.nav { position: sticky; top: 0; z-index: 20; background: rgb(13 12 11 / .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav__in { max-width: var(--max); margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav__me { font: 500 1.0625rem/1 var(--f-display); text-decoration: none; }
.nav__links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); font-size: var(--t-sm); color: var(--mute); }
.nav__links a:not(.btn) { text-decoration: none; padding: 12px 0; transition: color var(--fast) ease; }
.nav__links a:not(.btn):hover { color: var(--ink); }
@media (max-width: 560px) { .nav__links a:not(.btn) { display: none; } }

main > section, .order > section { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

/* Hero */
.hero { padding-block: clamp(56px, 10vw, 128px) clamp(48px, 7vw, 96px); }
.hero__who { color: var(--mute); font-size: var(--t-sm); }
.hero__title { margin-top: 18px; max-width: 16ch; font-size: var(--t-hero); line-height: 1.02; letter-spacing: -.035em; font-weight: 500; }
.hero__title em { color: var(--gold); }
.hero__lede { margin-top: 28px; max-width: 46rem; font-size: var(--t-lg); color: #cfc7bb; }
.hero__lede strong { color: var(--ink); font-weight: 600; }

/* The two doors */
.doors { margin-top: clamp(40px, 6vw, 64px); }
.doors__ask { font-size: var(--t-sm); color: var(--mute); }
.doors__row { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.door {
  display: grid; gap: 8px; padding: 22px 24px; min-height: 44px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2);
  text-decoration: none;
  transition: border-color var(--fast) ease, background-color var(--fast) ease, transform 160ms var(--ease);
}
.door:hover { border-color: #5a5247; }
.door:active { transform: scale(.985); }
.door[aria-pressed="true"] { border-color: var(--gold); background: #1c170f; }
.door__q { font: 500 var(--t-lg)/1.2 var(--f-display); letter-spacing: -.01em; }
.door[aria-pressed="true"] .door__q { color: var(--gold); }
.door__a { color: var(--mute); font-size: var(--t-sm); }
.doors__note { margin-top: 14px; min-height: 1.6em; font-size: var(--t-sm); color: var(--mute); }
.doors__note button { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Blocks */
.order { display: flex; flex-direction: column; }
.block { padding-block: clamp(56px, 8vw, 112px); border-top: 1px solid var(--line); }
.block__head { display: grid; gap: 10px; margin-bottom: clamp(28px, 4vw, 48px); }
.block__title { font-size: var(--t-xl); letter-spacing: -.025em; line-height: 1.1; }
.block__sub { color: var(--mute); max-width: 44rem; }

/* Products */
.product { display: grid; gap: clamp(20px, 3vw, 40px); align-items: start; }
.product + .product { margin-top: clamp(56px, 8vw, 96px); }
@media (min-width: 960px) {
  .product { grid-template-columns: 1.1fr 1fr; }
  .product:nth-of-type(even) .product__shot { order: 2; }
}
.product__shot img { border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); }
.product__shot figcaption { margin-top: 10px; font-size: var(--t-xs); color: var(--mute); }
.product__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.product__name { font-size: var(--t-xl); letter-spacing: -.025em; line-height: 1.1; }
.product__link { font-size: var(--t-sm); color: var(--gold); text-underline-offset: 3px; }
.product__link--muted { color: var(--mute); }
.product__line { margin-top: 12px; font-size: var(--t-lg); color: #cfc7bb; }

.stats { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-block: 18px; border-block: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; }
.stats dt { font-size: var(--t-xs); color: var(--mute); line-height: 1.3; }
.stats dd { font: 500 clamp(1.5rem, 1.1rem + 1.2vw, 2rem)/1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.angle { margin-top: 22px; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.angle::before { display: block; font-size: var(--t-xs); letter-spacing: .04em; color: var(--gold); margin-bottom: 2px; }
.angle[data-angle="data"]::before { content: "The data side"; }
.angle[data-angle="fde"]::before { content: "The product side"; }
.angle li { position: relative; padding-left: 18px; color: #d8d1c6; }
.angle li::before { content: ""; position: absolute; left: 0; top: .68em; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.product__stack { margin-top: 22px; font-size: var(--t-xs); color: var(--mute); }

/* Modes: picking a door shows that side and puts its section first. Without JS, both stay. */
[data-mode="data"] [data-angle="fde"], [data-mode="fde"] [data-angle="data"] { display: none; }
[data-mode="data"] [data-section="pipelines"] { order: -1; }
.block__sub[data-angle] { display: none; }
[data-mode="data"] .block__sub[data-angle="data"], [data-mode="fde"] .block__sub[data-angle="fde"] { display: block; }
html:not([data-mode]) .block__sub[data-angle="fde"] { display: block; }

/* Pipelines */
.repos { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.repo { position: relative; display: grid; align-content: start; gap: 10px; padding: 22px 24px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); transition: border-color var(--fast) ease; }
.repo:hover { border-color: #5a5247; }
.repo a { text-decoration: none; }
.repo a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.repo__name { font: 500 var(--t-md)/1.3 var(--f-display); overflow-wrap: anywhere; }
.repo p { color: #cfc7bb; font-size: var(--t-sm); }
.repo .repo__stack { color: var(--mute); font-size: var(--t-xs); }

/* Rules */
.rules__list { padding-left: 0; list-style: none; counter-reset: rule; display: grid; gap: 28px 32px; }
@media (min-width: 640px) { .rules__list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .rules__list { grid-template-columns: repeat(4, 1fr); } }
.rules__list li { counter-increment: rule; color: var(--mute); }
.rules__list li::before { content: "0" counter(rule); display: block; font: 500 var(--t-sm)/1 var(--f-display); color: var(--gold); margin-bottom: 12px; }
.rules__list strong { display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px; }

/* Contact */
.contact { padding-block: clamp(72px, 10vw, 144px); }
.contact__title { font-size: var(--t-hero); line-height: 1; letter-spacing: -.035em; font-weight: 500; }
.contact__text { margin-top: 18px; color: var(--mute); font-size: var(--t-lg); }
.contact__actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

.foot { max-width: var(--max); margin: 0 auto; padding: 28px var(--gutter) 48px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: var(--t-xs); color: var(--mute); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* The newest pipeline leads the list across the full row, so six cards fill the grid below it. */
.repo:first-child { grid-column: 1 / -1; }
