/* ==========================================================================
   PL TECH LABS — DESIGN SYSTEM
   Single stylesheet, no framework, no build step.

   Sibling to Metricstab's marketing surface (static/css/marketing.css): same
   token-first structure and the same self-hosted Inter, but a deliberately
   different palette — deep slate + teal against Metricstab's indigo -> violet —
   so the parent reads as a portfolio owner, not a re-skin of its own product.

   Tokens are prefixed --pl- (Metricstab uses --ms-), classes .pl-.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts — self-hosted variable Inter. No third-party request: faster LCP,
   and no font CDN logging visitor IPs. Files copied from the Metricstab repo.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --pl-ink: #0f172a;
  --pl-ink-soft: #1e293b;
  --pl-primary: #0d9488;
  --pl-primary-dk: #0f766e;
  --pl-primary-dp: #115e59;
  --pl-accent: #2dd4bf;
  --pl-gradient: linear-gradient(135deg, #0f766e 0%, #0f172a 100%);

  /* Surfaces + text */
  --pl-bg: #ffffff;
  --pl-surface: #ffffff;
  --pl-surface-alt: #f8fafc;
  --pl-border: #e2e8f0;
  --pl-border-strong: #cbd5e1;
  --pl-text: #0f172a;
  --pl-text-soft: #475569;
  --pl-muted: #64748b;

  /* On dark bands */
  --pl-on-dark: #f1f5f9;
  --pl-on-dark-soft: #cbd5e1;
  --pl-on-dark-muted: #94a3b8;
  --pl-on-dark-border: rgba(255, 255, 255, .14);

  /* Type */
  --pl-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --pl-font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas,
    'Liberation Mono', monospace;

  /* Rhythm */
  --pl-container: 1120px;
  --pl-container-narrow: 760px;
  --pl-radius: 12px;
  --pl-radius-lg: 18px;
  --pl-section-y: 6rem;

  /* Depth — restrained; this is a corporate site, not a SaaS landing page. */
  --pl-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --pl-shadow: 0 4px 16px rgba(15, 23, 42, .07);
  --pl-shadow-lg: 0 12px 32px rgba(15, 23, 42, .10);

  --pl-focus: 0 0 0 3px rgba(13, 148, 136, .38);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --pl-bg: #0b1220;
    --pl-surface: #111a2b;
    --pl-surface-alt: #0e1626;
    --pl-border: #1f2c42;
    --pl-border-strong: #2b3a54;
    --pl-text: #e8eef7;
    --pl-text-soft: #b3c0d4;
    --pl-muted: #8fa0b8;

    /* Teal lifts on dark so contrast stays >= 4.5:1 against the page. */
    --pl-primary: #2dd4bf;
    --pl-primary-dk: #5eead4;
    --pl-accent: #5eead4;
    --pl-gradient: linear-gradient(135deg, #115e59 0%, #0b1220 100%);

    --pl-shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --pl-shadow: 0 4px 16px rgba(0, 0, 0, .5);
    --pl-shadow-lg: 0 12px 32px rgba(0, 0, 0, .6);
    --pl-focus: 0 0 0 3px rgba(45, 212, 191, .40);
  }
}

/* --------------------------------------------------------------------------
   3. Reset + base
   -------------------------------------------------------------------------- */
*,
*::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: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--pl-font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--pl-text);
  background: var(--pl-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
}

h1, h2, h3, h4 {
  margin: 0 0 .6em;
  line-height: 1.18;
  font-weight: 680;
  letter-spacing: -.021em;
  color: var(--pl-text);
  text-wrap: balance;
}

h1 { font-size: clamp(2.15rem, 5.2vw, 3.35rem); letter-spacing: -.032em; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.35rem); letter-spacing: -.026em; }
h3 { font-size: 1.2rem; font-weight: 640; }
h4 { font-size: 1.02rem; font-weight: 640; }

p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--pl-primary-dk);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--pl-primary); text-decoration: underline; }

:focus-visible {
  outline: 2px solid transparent;
  border-radius: 6px;
  box-shadow: var(--pl-focus);
}

img, svg { max-width: 100%; height: auto; vertical-align: middle; }

hr {
  border: 0;
  border-top: 1px solid var(--pl-border);
  margin: 2.5rem 0;
}

/* Skip link — keyboard users shouldn't have to tab the nav on every page. */
.pl-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: .7rem 1.1rem;
  background: var(--pl-primary-dk);
  color: #fff;
  border-radius: 0 0 var(--pl-radius) 0;
  font-weight: 600;
}
.pl-skip:focus {
  left: 0;
  color: #fff;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.pl-container {
  width: 100%;
  max-width: var(--pl-container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
.pl-narrow { max-width: var(--pl-container-narrow); }

.pl-section { padding-block: var(--pl-section-y); }
.pl-section--tight { padding-block: 4rem; }
.pl-section--alt { background: var(--pl-surface-alt); }

/* The one dark full-bleed band per page. */
.pl-section--dark {
  background: var(--pl-gradient);
  color: var(--pl-on-dark);
}
.pl-section--dark h1,
.pl-section--dark h2,
.pl-section--dark h3,
.pl-section--dark h4 { color: #fff; }
.pl-section--dark p { color: var(--pl-on-dark-soft); }
.pl-section--dark a { color: var(--pl-accent); }
.pl-section--dark a:hover { color: #fff; }

.pl-eyebrow {
  display: block;
  margin-bottom: .85rem;
  font-size: .78rem;
  font-weight: 660;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--pl-primary-dk);
}
.pl-section--dark .pl-eyebrow { color: var(--pl-accent); }

.pl-lead {
  font-size: clamp(1.09rem, 2vw, 1.24rem);
  line-height: 1.6;
  color: var(--pl-text-soft);
  text-wrap: pretty;
}
.pl-section--dark .pl-lead { color: var(--pl-on-dark-soft); }

.pl-section-head { max-width: 44rem; margin-bottom: 3rem; }

/* --------------------------------------------------------------------------
   5. Header / nav
   -------------------------------------------------------------------------- */
.pl-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--pl-bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--pl-border);
}

.pl-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 68px;
}

.pl-logo {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 680;
  font-size: 1.03rem;
  letter-spacing: -.02em;
  color: var(--pl-text);
  margin-right: auto;
}
.pl-logo:hover { color: var(--pl-text); text-decoration: none; }
.pl-logo svg { width: 30px; height: 30px; border-radius: 8px; flex: none; }

.pl-nav-links {
  display: flex;
  align-items: center;
  gap: .35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pl-nav-links a {
  display: block;
  padding: .45rem .75rem;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 520;
  color: var(--pl-text-soft);
}
.pl-nav-links a:hover {
  color: var(--pl-text);
  background: var(--pl-surface-alt);
  text-decoration: none;
}
/* aria-current="page" is the accessible source of truth; styling follows it
   rather than a separate .active class that could drift out of sync. */
.pl-nav-links a[aria-current="page"] {
  color: var(--pl-primary-dk);
  font-weight: 620;
}

@media (max-width: 720px) {
  .pl-nav {
    flex-wrap: wrap;
    gap: .5rem;
    padding-block: .85rem;
  }
  .pl-logo { margin-right: 0; width: 100%; }
  .pl-nav-links {
    width: 100%;
    flex-wrap: wrap;
    gap: .2rem;
    margin-left: -.75rem;
  }
  .pl-nav-links a { padding-inline: .6rem; font-size: .9rem; }
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.pl-hero {
  position: relative;
  padding-block: clamp(4.5rem, 11vw, 8rem);
  background: var(--pl-surface-alt);
  border-bottom: 1px solid var(--pl-border);
  overflow: hidden;
}
/* A single soft teal wash, top-right. Enough to stop the page reading flat
   without tipping into decoration. */
.pl-hero::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 46rem;
  height: 46rem;
  background: radial-gradient(circle, rgba(13, 148, 136, .10) 0%, transparent 62%);
  pointer-events: none;
}
.pl-hero > * { position: relative; z-index: 1; }
.pl-hero h1 { max-width: 18ch; }
.pl-hero .pl-lead { max-width: 56ch; margin-top: 1.4rem; }

.pl-hero--page { padding-block: clamp(3.5rem, 8vw, 5.5rem); }
.pl-hero--page h1 { max-width: 22ch; }

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */
.pl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 2.1rem;
}

.pl-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .72rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .97rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease,
    transform .15s ease, box-shadow .15s ease;
}
.pl-btn:hover { text-decoration: none; transform: translateY(-1px); }
.pl-btn:active { transform: translateY(0); }

.pl-btn--primary {
  background: var(--pl-primary-dk);
  color: #fff;
  box-shadow: var(--pl-shadow-sm);
}
.pl-btn--primary:hover {
  background: var(--pl-primary-dp);
  color: #fff;
  box-shadow: var(--pl-shadow);
}

.pl-btn--ghost {
  background: transparent;
  border-color: var(--pl-border-strong);
  color: var(--pl-text);
}
.pl-btn--ghost:hover {
  border-color: var(--pl-primary-dk);
  color: var(--pl-primary-dk);
  background: var(--pl-surface);
}

/* On the dark band the teal loses contrast, so invert instead. */
.pl-section--dark .pl-btn--primary {
  background: #fff;
  color: var(--pl-ink);
}
.pl-section--dark .pl-btn--primary:hover { background: var(--pl-on-dark); color: var(--pl-ink); }
.pl-section--dark .pl-btn--ghost {
  border-color: var(--pl-on-dark-border);
  color: #fff;
}
.pl-section--dark .pl-btn--ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .pl-btn--primary { background: var(--pl-primary-dk); color: #05221f; }
  .pl-btn--primary:hover { background: var(--pl-accent); color: #05221f; }
}

/* Inline "read more" arrow link. */
.pl-arrow {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
  font-size: .95rem;
}
.pl-arrow::after {
  content: "\2192";
  transition: transform .15s ease;
}
.pl-arrow:hover { text-decoration: none; }
.pl-arrow:hover::after { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   8. Grid + cards
   -------------------------------------------------------------------------- */
.pl-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.pl-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }

/* Explicit 1 / 2 / 4 steps rather than auto-fit. Four cards under auto-fit land
   as 3 + 1 at desktop width, and the orphan reads as a mistake. */
.pl-grid--4 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) {
  .pl-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .pl-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.pl-card {
  padding: 1.9rem;
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  box-shadow: var(--pl-shadow-sm);
}
.pl-card h3 { margin-bottom: .55rem; }
.pl-card p { color: var(--pl-text-soft); font-size: .985rem; }

.pl-card__num {
  display: block;
  margin-bottom: 1rem;
  font-family: var(--pl-font-mono);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--pl-primary-dk);
}

.pl-section--dark .pl-card {
  background: rgba(255, 255, 255, .05);
  border-color: var(--pl-on-dark-border);
  box-shadow: none;
}
.pl-section--dark .pl-card p { color: var(--pl-on-dark-soft); }
.pl-section--dark .pl-card__num { color: var(--pl-accent); }

/* --------------------------------------------------------------------------
   9. Portfolio card — one product today, built to take siblings without
   any layout change.
   -------------------------------------------------------------------------- */
.pl-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  padding: 2.1rem;
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  box-shadow: var(--pl-shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.pl-product:hover {
  border-color: var(--pl-border-strong);
  box-shadow: var(--pl-shadow);
  transform: translateY(-2px);
}

.pl-product__head {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
}
.pl-product__logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex: none;
}
.pl-product__name {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 680;
  letter-spacing: -.022em;
}
.pl-product__tag {
  font-size: .95rem;
  color: var(--pl-muted);
}
.pl-product__body p { color: var(--pl-text-soft); }

.pl-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--pl-primary) 14%, transparent);
  color: var(--pl-primary-dk);
  border: 1px solid color-mix(in srgb, var(--pl-primary) 28%, transparent);
}
.pl-badge--muted {
  background: var(--pl-surface-alt);
  color: var(--pl-muted);
  border-color: var(--pl-border);
}

/* Placeholder slot for the next product. Dashed, deliberately quiet — it
   signals a portfolio without pretending something exists that doesn't. */
.pl-product--next {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  color: var(--pl-muted);
}
.pl-product--next:hover { transform: none; box-shadow: none; }

@media (min-width: 800px) {
  .pl-product { grid-template-columns: 15rem minmax(0, 1fr); gap: 2.5rem; }
}

/* --------------------------------------------------------------------------
   10. Definition list — used for the registered entity block
   -------------------------------------------------------------------------- */
.pl-facts {
  margin: 0;
  padding: 1.9rem;
  background: var(--pl-surface-alt);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  display: grid;
  gap: 1rem 2rem;
}
.pl-facts > div {
  display: grid;
  gap: .15rem;
}
.pl-facts dt {
  font-size: .78rem;
  font-weight: 660;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--pl-muted);
}
.pl-facts dd {
  margin: 0;
  font-size: 1rem;
  color: var(--pl-text);
}
.pl-facts dd address { font-style: normal; }

@media (min-width: 640px) {
  .pl-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-facts > div.pl-facts__wide { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   11. Prose — legal pages and long-form copy
   -------------------------------------------------------------------------- */
.pl-prose { max-width: 44rem; }
.pl-prose h2 {
  margin-top: 2.8rem;
  font-size: 1.45rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--pl-border);
}
.pl-prose h2:first-of-type { margin-top: 1.5rem; }
.pl-prose h3 { margin-top: 1.9rem; font-size: 1.08rem; }
.pl-prose p,
.pl-prose li { color: var(--pl-text-soft); }
.pl-prose ul,
.pl-prose ol { padding-left: 1.3rem; margin: 0 0 1.1rem; }
.pl-prose li { margin-bottom: .45rem; }
.pl-prose strong { color: var(--pl-text); font-weight: 620; }

.pl-note {
  padding: 1.1rem 1.35rem;
  margin-bottom: 2rem;
  background: var(--pl-surface-alt);
  border: 1px solid var(--pl-border);
  border-left: 3px solid var(--pl-primary);
  border-radius: 0 var(--pl-radius) var(--pl-radius) 0;
  font-size: .96rem;
  color: var(--pl-text-soft);
}

.pl-updated {
  font-size: .88rem;
  color: var(--pl-muted);
  margin-bottom: 2rem;
}

/* --------------------------------------------------------------------------
   12. Contact
   -------------------------------------------------------------------------- */
.pl-contact-mail {
  display: inline-block;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 660;
  letter-spacing: -.02em;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.pl-footer {
  padding-block: 3.5rem 2.5rem;
  background: var(--pl-surface-alt);
  border-top: 1px solid var(--pl-border);
  font-size: .93rem;
}
.pl-footer-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 2.5rem;
}
@media (min-width: 720px) {
  .pl-footer-grid { grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); gap: 2rem; }
}

.pl-footer-brand p {
  margin-top: .9rem;
  max-width: 32ch;
  color: var(--pl-muted);
  font-size: .92rem;
}
.pl-footer-h {
  margin-bottom: .85rem;
  font-size: .76rem;
  font-weight: 660;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pl-muted);
}
.pl-footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}
.pl-footer-list a { color: var(--pl-text-soft); }
.pl-footer-list a:hover { color: var(--pl-primary-dk); }

.pl-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  padding-top: 1.75rem;
  border-top: 1px solid var(--pl-border);
  color: var(--pl-muted);
  font-size: .88rem;
}

/* --------------------------------------------------------------------------
   14. 404
   -------------------------------------------------------------------------- */
.pl-404 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 58vh;
  padding-block: 5rem;
}
.pl-404__code {
  font-family: var(--pl-font-mono);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--pl-primary-dk);
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   15. Utilities
   -------------------------------------------------------------------------- */
.pl-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pl-mt-0 { margin-top: 0; }
.pl-mt-3 { margin-top: 2rem; }

/* --------------------------------------------------------------------------
   16. Print — legal pages get printed and filed by lawyers and reviewers.
   -------------------------------------------------------------------------- */
@media print {
  .pl-header, .pl-footer, .pl-actions, .pl-skip { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .pl-hero { background: none; border: 0; padding-block: 0 1.5rem; }
  .pl-hero::after { display: none; }
  a { color: #000; text-decoration: underline; }
  /* Print the destination — a bare "see our privacy page" is useless on paper. */
  .pl-prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
