/* ==========================================================================
   marcopirela.com
   Palette drawn from the subject: concrete grey, ink, and OM4 aqua —
   the colour of multimode fibre patch cords in a data hall.
   Type: IBM Plex superfamily (condensed / sans / mono), self-hosted.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Plex Cond";
  src: url("../fonts/ibm-plex-sans-condensed-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex";
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex";
  src: url("../fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Plex";
  src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex";
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --ink:        #0C1517;
  --ink-soft:   #233437;
  --surface:    #142326;
  --paper:      #EDEFED;
  --paper-lift: #F5F6F4;
  --steel:      #55666A;
  --rule:       #C7CFCB;
  --rule-soft:  #DCE2DE;
  --aqua:       #0E8F86;
  --aqua-text:  #0A6B64;

  --rail:       9.5rem;
  --gap:        3rem;
  --measure:    38rem;

  --pad-x:      clamp(1.25rem, 5vw, 4.5rem);
  --step:       clamp(3.5rem, 7vw, 6rem);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Plex", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }

/* ---------- Utilities ---------- */
.wrap { max-width: 76rem; margin-inline: auto; padding-inline: var(--pad-x); }

.tag {
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--steel);
}

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: .75rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

a { color: var(--aqua-text); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--aqua-text); outline-offset: 3px; }

/* ---------- Header ---------- */
.masthead { border-bottom: 1px solid var(--rule); background: var(--paper); }
.masthead__in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; padding-block: 1.2rem;
}
.brand { display: block; text-decoration: none; color: var(--ink); }
.brand__name {
  display: block;
  font-family: "Plex Cond", "Plex", sans-serif;
  font-weight: 600; font-size: 1.35rem; letter-spacing: .005em; line-height: 1.05;
}
.brand__title {
  display: block; margin-top: .18rem;
  font-family: "Plex Mono", monospace; font-size: .625rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--steel);
}
.brand:hover .brand__name { color: var(--aqua-text); }
.brand:hover .brand__title { color: var(--ink-soft); }

.nav { display: flex; align-items: baseline; gap: 1.6rem; flex-wrap: wrap; }
.nav a {
  font-family: "Plex Mono", monospace;
  font-size: .6875rem; font-weight: 500;
  letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none;
  padding-bottom: .25rem; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--aqua-text); border-bottom-color: var(--rule); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--aqua); }
.nav .lang { color: var(--steel); }
.nav .lang::before { content: "/ "; color: var(--rule); }

/* ---------- Section grid with label rail ---------- */
.band { padding-block: var(--step); border-top: 1px solid var(--rule-soft); }
.band:first-of-type { border-top: 0; }

.grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}
.rail { position: sticky; top: 2rem; }
.rail__mark {
  display: block; width: 1.75rem; height: 2px;
  background: var(--aqua); margin-bottom: .85rem;
}
.rail__note {
  font-family: "Plex Mono", monospace;
  font-size: .6875rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--steel); line-height: 1.7;
}
.rail__note b { display: block; color: var(--ink-soft); font-weight: 500; }

.flow > * + * { margin-top: 1.15rem; }
.flow p, .flow li { max-width: var(--measure); }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: "Plex Cond", "Plex", sans-serif; font-weight: 600; }
h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.01; letter-spacing: -.012em;
  margin: 0;
}
h2 {
  font-size: clamp(1.65rem, 3.4vw, 2.3rem);
  line-height: 1.1; letter-spacing: -.008em;
  margin: 0 0 1.1rem;
}
h3 {
  font-family: "Plex", sans-serif; font-weight: 600;
  font-size: 1.0625rem; letter-spacing: .002em;
  margin: 0 0 .4rem;
}
p { margin: 0; }
.lede { font-size: clamp(1.15rem, 2.1vw, 1.4rem); line-height: 1.42; font-weight: 500; }
.meta { color: var(--steel); }
.pull {
  font-size: 1.0625rem; color: var(--ink-soft);
  border-left: 2px solid var(--aqua); padding-left: 1.1rem;
  max-width: var(--measure);
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3rem, 7vw, 5.5rem) 0; }
.hero__top {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .72fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: end;
}
.hero__eyebrow { margin-bottom: 1.1rem; }
.hero__scope { margin-top: 1.5rem; max-width: 34rem; }
.hero__sub { margin-top: 1rem; max-width: 34rem; }
.portrait { position: relative; }
.portrait img { border: 1px solid var(--rule); }

/* ---------- Signature: rack elevation band ---------- */
.elevation {
  margin-top: clamp(2.75rem, 6vw, 4rem);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding-block: 1.1rem;
}
.elevation__ticks {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 0; height: 44px; overflow: hidden;
}
.elevation__ticks i {
  flex: 0 0 3px; width: 3px; height: 34%;
  background: var(--rule); display: block;
}
.elevation__ticks i.u2 { height: 62%; }
.elevation__ticks i.u3 { height: 100%; }
.elevation__ticks i.on { background: var(--aqua); }
.elevation__legend {
  display: flex; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-top: .85rem;
}

/* ---------- Service entries ---------- */
.entry { border-top: 1px solid var(--rule-soft); padding-top: 2.25rem; margin-top: 2.75rem; }
.entry:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.entry__claim { font-size: 1.15rem; font-weight: 500; color: var(--ink); max-width: var(--measure); }
.spec { list-style: none; margin: 1.4rem 0 0; padding: 0; max-width: var(--measure); }
.spec li {
  border-top: 1px solid var(--rule-soft);
  padding: .55rem 0 .55rem 1.5rem; position: relative;
}
.spec li::before {
  content: ""; position: absolute; left: 0; top: 1.15rem;
  width: .6rem; height: 1px; background: var(--aqua);
}
.engaged {
  margin-top: 1.4rem; font-family: "Plex Mono", monospace;
  font-size: .75rem; line-height: 1.7; color: var(--steel);
  max-width: var(--measure);
}
.engaged b { color: var(--ink-soft); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; font-size: .6875rem; display: block; }

/* ---------- Record list (credentials, legal data) ---------- */
.record { margin: 0; max-width: 44rem; }
.record > div {
  display: grid; grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1.25rem; border-top: 1px solid var(--rule-soft); padding: .7rem 0;
}
.record dt {
  font-family: "Plex Mono", monospace; font-size: .6875rem;
  letter-spacing: .09em; text-transform: uppercase; color: var(--steel);
  padding-top: .18rem;
}
.record dd { margin: 0; }

/* ---------- Call to action ---------- */
.contactline { margin-top: 1.75rem; }
.mailto {
  font-family: "Plex Cond", sans-serif; font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -.005em;
  color: var(--ink); text-decoration: none;
  border-bottom: 3px solid var(--aqua); padding-bottom: .1rem;
}
.mailto:hover { color: var(--aqua-text); border-bottom-color: var(--ink); }

/* ---------- Footer ---------- */
.foot { background: var(--surface); color: #C4D2D2; margin-top: var(--step); }
.foot__in { padding-block: 3rem; display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.foot h4 { font-family: "Plex Mono", monospace; font-size: .6875rem; letter-spacing: .11em; text-transform: uppercase; color: #7C9694; margin: 0 0 .8rem; font-weight: 500; }
.foot a { color: #E4ECEA; text-decoration: none; border-bottom: 1px solid #37504F; }
.foot a:hover { color: #fff; border-bottom-color: var(--aqua); }
.foot p { font-size: .95rem; line-height: 1.7; }
.foot__base { border-top: 1px solid #24393B; padding-block: 1.25rem; font-family: "Plex Mono", monospace; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: #7C9694; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Legal pages ---------- */
.legal { max-width: 46rem; }
.legal h2 { font-size: 1.5rem; margin-top: 2.5rem; }
.legal h2:first-of-type { margin-top: 0; }
.legal p, .legal li { max-width: 44rem; }
.legal address { font-style: normal; line-height: 1.8; }

/* ---------- Responsive ---------- */
@media (max-width: 60rem) {
  .hero__top { grid-template-columns: 1fr; align-items: start; }
  .portrait { max-width: 20rem; }
}
@media (max-width: 48rem) {
  :root { --gap: 1.5rem; }
  .grid { grid-template-columns: 1fr; }
  .rail { position: static; }
  .rail__note b { display: inline; }
  .rail__note { display: flex; gap: .75rem; flex-wrap: wrap; }
  .record > div { grid-template-columns: 1fr; gap: .15rem; }
  .elevation__ticks { height: 30px; }
  .elevation__ticks i { flex: 0 0 2px; width: 2px; }
}

/* ---------- Spacing utilities (no inline styles: keeps CSP strict) ---------- */
.mt-s  { margin-top: 1rem; }
.mt-m  { margin-top: 1.6rem; }
.mt-l  { margin-top: 2rem; }
.mt-xl { margin-top: 2.25rem; }
.narrow { max-width: 38rem; }
.regular { font-weight: 400; }

/* Legal pages: breathing room under the page title */
.legal h1 { margin-bottom: 2rem; }
.legal ul { padding-left: 1.1rem; }
.legal li { margin-bottom: .35rem; }

/* ==========================================================================
   v2 — visual weight: dark hero, alternating surfaces, scroll reveals
   ========================================================================== */

/* ---------- Dark hero over the vector data hall ---------- */
.stage {
  position: relative;
  background: #081214;
  color: #E8EFEE;
  overflow: hidden;
  isolation: isolate;
}
.stage__bg {
  position: absolute; inset: -8% 0 -8% 0;
  z-index: -1;
  background: url("../img/datahall.svg") center/cover no-repeat;
}
.stage__in { padding-block: clamp(4rem, 10vw, 8rem) clamp(3rem, 6vw, 5rem); }
.stage .tag { color: #6FA9A4; }
.stage h1 { color: #FFF; }
.stage .lede { color: #DCE8E6; }
.stage .meta { color: #93B2AF; }

.stage__top {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, .7fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: end;
}
.stage .portrait img {
  border: 1px solid #2C4A4C;
  filter: saturate(.92) contrast(1.04);
}
.stage__rule { height: 3px; background: var(--aqua); width: 4.5rem; margin-bottom: 1.6rem; }

/* masthead sitting on the dark stage */
.masthead--dark { background: #081214; border-bottom-color: #1B3234; }
.masthead--dark .brand { color: #fff; }
.masthead--dark .brand__title { color: #6FA9A4; }
.masthead--dark .nav a { color: #C3D6D4; }
.masthead--dark .nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--aqua); }
.masthead--dark .nav a:hover { color: #6FE0D4; border-bottom-color: #2C4A4C; }
.masthead--dark .nav .lang { color: #7C9694; }

.stage .elevation { border-color: #23403F; }
.stage .elevation__ticks i { background: #2A4749; }
.stage .elevation__ticks i.on { background: #2FD5C6; }

/* ---------- Alternating dark band inside the light page ---------- */
.band--dark {
  background: var(--surface); color: #DCE8E6;
  border-top: 0;
}
.band--dark h2 { color: #fff; }
.band--dark .lede { color: #E8EFEE; }
.band--dark .rail__note { color: #7C9694; }
.band--dark .rail__note b { color: #C3D6D4; }
.band--dark h3 { color: #fff; }
.band--dark p { color: #C9DAD8; }
.band--dark a { color: #6FE0D4; }
.band--dark a:hover { color: #fff; }
.band--dark .mailto { color: #fff; }
.band--dark .mailto:hover { color: #6FE0D4; }
.band--dark .spec li { border-top-color: #26403F; }

/* ---------- Motion: scroll-linked reveals, no JavaScript ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal-rise linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 30%;
    }
    .stage__bg {
      animation: hall-drift linear both;
      animation-timeline: scroll();
    }
  }
}
@keyframes reveal-rise {
  from { opacity: 0; transform: translateY(2rem); }
  to   { opacity: 1; transform: none; }
}
@keyframes hall-drift {
  from { transform: scale(1.02) translateY(0); }
  to   { transform: scale(1.14) translateY(-3%); }
}

/* ---------- Compact dark page header for interior pages ---------- */
.stage--compact .stage__in { padding-block: clamp(3rem, 6vw, 5rem) clamp(2.5rem, 5vw, 4rem); }
.stage--compact h1 { color: #fff; }
.stage--compact .rail__note { color: #7C9694; }
.stage--compact .rail__note b { color: #C3D6D4; }
.stage--compact p { color: #C9DAD8; }
.stage--compact .lede { color: #E8EFEE; }
.stage--compact .rail__mark { background: var(--aqua); }

/* ---------- Mid-page statement ---------- */
.statement-band { border-top: 0; }
.statement {
  font-family: "Plex Cond", "Plex", sans-serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 3.6vw, 2.8rem);
  line-height: 1.14; letter-spacing: -.01em;
  color: var(--ink); max-width: 24ch;
  border-left: 3px solid var(--aqua); padding-left: 1.4rem;
}

/* ---------- Portrait on the dark stage: deliberate, not pasted ---------- */
.stage .portrait { position: relative; }
.stage .portrait img {
  border: 0; border-left: 3px solid var(--aqua);
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.stage .portrait figcaption {
  margin-top: .85rem;
  font-family: "Plex Mono", monospace; font-size: .625rem;
  letter-spacing: .16em; text-transform: uppercase; color: #6FA9A4;
}

/* ---------- Links and mail address on dark surfaces (fixes dark-on-dark) ---------- */
.stage a { color: #6FE0D4; }
.stage a:hover { color: #fff; }
.stage .mailto { color: #fff; border-bottom-color: var(--aqua); }
.stage .mailto:hover { color: #6FE0D4; border-bottom-color: #fff; }
.stage .record dt { color: #7C9694; }
.stage .record dd { color: #C9DAD8; }
.stage .record > div { border-top-color: #26403F; }
.stage h2, .stage h3 { color: #fff; }
.stage .pull { color: #C9DAD8; }

/* ---------- Entrance on load: works in every browser, no JavaScript ---------- */
@media (prefers-reduced-motion: no-preference) {
  .stage__rule, .hero__eyebrow, .stage h1, .stage .lede,
  .stage .meta, .stage .portrait, .elevation, .stage--compact .flow > * {
    animation: enter .7s cubic-bezier(.22,.7,.3,1) both;
  }
  .stage__rule            { animation-delay: .05s; }
  .hero__eyebrow          { animation-delay: .12s; }
  .stage h1               { animation-delay: .19s; }
  .stage .lede            { animation-delay: .30s; }
  .stage .meta            { animation-delay: .38s; }
  .stage .portrait        { animation-delay: .26s; }
  .elevation              { animation-delay: .46s; }
  .stage--compact .flow > *:nth-child(2) { animation-delay: .18s; }
  .stage--compact .flow > *:nth-child(3) { animation-delay: .28s; }
}
@keyframes enter {
  from { opacity: 0; transform: translateY(1.1rem); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Insights listing ---------- */
.postlist { list-style: none; margin: 0; padding: 0; }
.postlist li { border-top: 1px solid var(--rule-soft); padding-top: 1.4rem; margin-top: 1.4rem; }
.postlist li:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.postlist time { display: block; margin-bottom: .5rem; }
.postlist__title {
  font-family: "Plex Cond", "Plex", sans-serif; font-weight: 600;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.12;
  color: var(--ink); text-decoration: none;
  border-bottom: 2px solid var(--aqua); padding-bottom: .08rem;
}
.postlist__title:hover { color: var(--aqua-text); border-bottom-color: var(--ink); }
.postlist__blurb { margin-top: .8rem; max-width: var(--measure); color: var(--steel); }

/* ---------- Article body ---------- */
.article { max-width: 36rem; }
.article > * + * { margin-top: 1.3rem; }
.article p { font-size: 1.09rem; line-height: 1.72; }
.article h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  margin-top: 2.9rem; margin-bottom: 0;
  padding-top: 1.4rem; border-top: 1px solid var(--rule-soft);
}
.article h2 + p { margin-top: 1rem; }
.article blockquote { margin: 0; padding: 0; }
.article blockquote p {
  font-family: "Plex Cond", "Plex", sans-serif; font-weight: 600;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.25;
  color: var(--ink);
  border-left: 3px solid var(--aqua); padding-left: 1.2rem;
}
.article strong { font-weight: 600; }
.article .rule { border: 0; border-top: 1px solid var(--rule); margin-top: 2.6rem; }
.article .meta { font-size: .98rem; }
.postlist__date { display: block; margin-top: .6rem; margin-bottom: 0; }
