/*
  MJlabs — site stylesheet
  ========================================
  @author    Jimmy Lindmark
  @copyright MJ STRATEGI TECH SOLUTIONS SL
  @license   All Rights Reserved

  Aesthetic direction: "the vault ledger" — sober, editorial, anti-hype,
  built around the MJ LABS logo: deep navy (#1c375b) and polished chrome.
  Fraunces (display serif) / Archivo (body) / IBM Plex Mono (labels).
*/

/* ------------------------------------------------------------------
   Design tokens — palette derived from the logo's navy + chrome
   ------------------------------------------------------------------ */
:root {
  --navy:       #1c375b;   /* brand navy — the logo's background colour */
  --navy-deep:  #14283f;   /* page background, a step darker for depth */
  --navy-raise: #24436b;   /* raised surfaces: cards, panels */
  --text:       #e9eef6;   /* near-white text on navy */
  --text-soft:  #a9b7cc;   /* secondary text */
  --ice:        #b9cce9;   /* cool highlight — links, numbers, accents */
  --hairline:   rgba(233, 238, 246, 0.16);  /* thin ruled lines */

  /* The chrome: a metallic gradient echoing the logo's finish */
  --chrome: linear-gradient(160deg, #f6f8fc 0%, #c9d3e3 40%, #8c9cb8 75%, #b9c4d8 100%);

  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Archivo", "Helvetica Neue", sans-serif;
  --font-mono:    "IBM Plex Mono", monospace;

  --max-width: 1080px;
  --pad-x: clamp(1.25rem, 5vw, 4rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--navy-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;

  /* Faint ledger ruling + a soft radial glow behind the hero,
     so the dark surface has depth instead of being flat. */
  background-image:
    radial-gradient(1100px 600px at 70% -10%, rgba(86, 118, 165, 0.28), transparent 70%),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 47px,
      rgba(233, 238, 246, 0.035) 47px,
      rgba(233, 238, 246, 0.035) 48px
    );
}

/* Grain overlay for texture. A small pre-rasterized PNG tile — an SVG
   feTurbulence filter here froze the renderer during screen capture
   and cost scroll performance, so the noise is baked into an image. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.55;
  background-image: url("noise.png");
  background-repeat: repeat;
}

::selection { background: var(--ice); color: var(--navy-deep); }

h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }

/* Chrome text: the metallic gradient clipped onto type */
.chrome-text {
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem var(--pad-x);
  border-bottom: 1px solid var(--hairline);
  background: rgba(20, 40, 63, 0.82);
  backdrop-filter: blur(8px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}
.wordmark-logo {
  height: 42px;
  width: auto;
  display: block;
}
/* The name as live text — crisp at any size, set in the logo's chrome */
.wordmark-text {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.32em;
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Language picker — top right, mono, manual choice always wins */
.lang-picker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.lang-picker button {
  appearance: none;
  border: none;
  background: none;
  padding: 0.2rem 0.1rem;
  font: inherit;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.lang-picker button:hover { color: var(--text); }
.lang-picker button.active {
  color: var(--ice);
  border-bottom-color: var(--ice);
}
.lang-sep { color: var(--hairline); user-select: none; }

/* ------------------------------------------------------------------
   Shared layout
   ------------------------------------------------------------------ */
main { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--pad-x); }

.section { padding: clamp(4rem, 9vw, 7rem) 0; border-top: 1px solid var(--hairline); }

/* Section heading row: number + mono label, like a ledger entry */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
  font-family: var(--font-mono);
}
.section-no {
  font-size: 0.85rem;
  color: var(--ice);
  font-weight: 500;
}
.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-soft);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ice);
}

/* ------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------ */
.hero {
  padding: clamp(4.5rem, 11vw, 9rem) 0 clamp(4rem, 9vw, 7rem);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 9vw, 6.5rem);
  font-weight: 380;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 1.4rem 0 1.8rem;
}
/* The key phrase gets the logo's chrome finish */
.hero-title em {
  font-style: italic;
  font-weight: 500;
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title-period {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--ice);
}

.hero-sub {
  max-width: 34em;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.4rem;
}

/* The inequality that summarises the pitch */
.hero-equation {
  margin-top: clamp(3rem, 7vw, 5rem);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.hero-equation .eq-gt {
  color: var(--ice);
  font-size: 1.2rem;
  font-weight: 500;
}
.hero-equation .eq-left { color: var(--ice); font-weight: 500; }

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.btn {
  appearance: none;       /* the email-reveal control is a <button> */
  cursor: pointer;
  display: inline-block;
  padding: 0.8rem 1.7rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.2s ease, color 0.2s ease,
              border-color 0.2s ease, filter 0.2s ease;
}
/* Primary: chrome-plated, navy type — like the logo's metal */
.btn-primary {
  background: var(--chrome);
  color: var(--navy);
  border: 1px solid rgba(233, 238, 246, 0.4);
  font-weight: 500;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hairline);
}
.btn-ghost:hover { border-color: var(--ice); color: var(--ice); }
.btn-large { font-size: 1rem; padding: 1rem 2.2rem; text-transform: none; letter-spacing: 0.03em; }

/* ------------------------------------------------------------------
   01 · Positioning
   ------------------------------------------------------------------ */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 3.1rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 18em;
  margin-bottom: 2rem;
}

.pos-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 64em;
  color: var(--text-soft);
}

.pull-quote {
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding-left: 1.5rem;
  border-left: 3px solid var(--ice);
}
.pull-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  line-height: 1.3;
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------------
   02 · Process
   ------------------------------------------------------------------ */
.process-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0;
  border: 1px solid var(--hairline);
  background: var(--navy);   /* the logo's exact navy as the panel colour */
}

.process-step {
  padding: 2.2rem 1.9rem 2.4rem;
  border-right: 1px solid var(--hairline);
}
.process-step:last-child { border-right: none; }

.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--ice);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ice);
  margin-bottom: 1.3rem;
}

.process-step h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin-bottom: 0.7rem;
}
.process-step p { color: var(--text-soft); font-size: 0.98rem; }

/* On narrow screens the steps stack: swap the dividing line to horizontal */
@media (max-width: 820px) {
  .process-step { border-right: none; border-bottom: 1px solid var(--hairline); }
  .process-step:last-child { border-bottom: none; }
}

/* ------------------------------------------------------------------
   03 · Examples
   ------------------------------------------------------------------ */
.section-intro {
  max-width: 40em;
  color: var(--text-soft);
  margin-bottom: 2.5rem;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}

.example-card {
  padding: 1.9rem 1.7rem 2.1rem;
  border: 1px solid var(--hairline);
  background: var(--navy);
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.example-card:hover {
  border-color: var(--ice);
  background: var(--navy-raise);
  transform: translateY(-3px);
}
.example-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.65rem;
}
.example-card p { color: var(--text-soft); font-size: 0.97rem; }

/* ------------------------------------------------------------------
   04 · Contact
   ------------------------------------------------------------------ */
.contact-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 3.1rem);
  font-weight: 500;
  line-height: 1.12;
  max-width: 18em;
  margin-bottom: 1.2rem;
}
.contact-body { max-width: 36em; color: var(--text-soft); margin-bottom: 2.2rem; }

.about-note {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  max-width: 44em;
  font-size: 0.92rem;
  color: var(--text-soft);
}

/* Company details — a quiet ledger block under the contact section */
.legal {
  margin: 2.5rem 0 0;
  max-width: 34rem;
  font-size: 0.88rem;
}
.legal-row {
  display: flex;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(233, 238, 246, 0.08);
}
.legal dt {
  flex: 0 0 7.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  padding-top: 0.15rem;
}
.legal dd { margin: 0; color: var(--text); }
.legal dd a { color: var(--ice); text-decoration: none; }
.legal dd a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.6rem var(--pad-x);
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}
.footer-domain { color: var(--ice); }

/* ------------------------------------------------------------------
   Reveal animations
   ------------------------------------------------------------------
   .reveal-load  — staggered entrance on page load (hero)
   .reveal       — fades in when scrolled into view (via main.js)
   ------------------------------------------------------------------ */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal-load {
  opacity: 0;
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
/* Stagger the hero entrance top-to-bottom */
.reveal-load:nth-of-type(1) { animation-delay: 0.05s; }
.hero-title.reveal-load     { animation-delay: 0.15s; }
.hero-sub.reveal-load       { animation-delay: 0.3s; }
.hero-actions.reveal-load   { animation-delay: 0.45s; }
.hero-equation.reveal-load  { animation-delay: 0.65s; }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-load { animation: none; opacity: 1; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
