/* ============================================================
   LAB PORTAL — Design System
   Palette inspired by UKL Leipzig: deep navy, teal accent,
   clean whites, subtle greys.
   ============================================================ */

:root {
  --navy: #003153;
  --navy-dark: #001f3a;
  --teal: #007a6e;
  --teal-light: #009e8f;
  --accent: #e8521a;
  --white: #ffffff;
  --grey-50: #f7f8fa;
  --grey-100: #eef0f3;
  --grey-200: #d8dce3;
  --grey-400: #9aa3b0;
  --grey-700: #3d4452;
  --grey-900: #1a1f2b;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 6px;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, .08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .16);
  --transition: 220ms ease;
}

/* ── Reset ───────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--grey-700);
  background: var(--white);
  line-height: 1.65;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Typography ──────────────────────────────────────────── */
h1,
h2,
h3,
h4 {
  color: var(--navy);
  line-height: 1.25;
  font-weight: 700;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1rem;
}

p {
  max-width: 68ch;
}

/* ── Layout helpers ──────────────────────────────────────── */
.container {
  width: min(1200px, 92vw);
  margin-inline: auto;
}

.section {
  padding-block: 80px;
}

.section--alt {
  background: var(--grey-50);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

/* ── Navigation ──────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  box-shadow: var(--shadow-md);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .02em;
}

.nav__logo-mark {
  width: 36px;
  height: 36px;
  background: var(--teal);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: .85rem;
  font-weight: 800;
  color: var(--white);
  flex-shrink: 0;
}

.nav__links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav__links a {
  color: rgba(255, 255, 255, .8);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.nav__links a:hover,
.nav__links a.active {
  background: rgba(255, 255, 255, .12);
  color: var(--white);
}

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  color: var(--white);
  padding-block: 32px 28px;
  position: relative;
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.18;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
      rgba(0, 31, 58, 0.75) 0%,
      rgba(0, 49, 83, 0.55) 50%,
      rgba(0, 122, 110, 0.45) 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 10;
}

.hero__kicker {
  display: inline-block;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .25);
  color: rgba(255, 255, 255, .9);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 14px;
}

.hero__sub {
  font-size: 1rem;
  color: rgba(255, 255, 255, .8);
  max-width: 55ch;
  margin-bottom: 24px;
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}

.btn--primary:hover {
  background: var(--teal-light);
  border-color: var(--teal-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 110, .35);
}

.btn--outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, .5);
}

.btn--outline:hover {
  background: rgba(255, 255, 255, .1);
  border-color: var(--white);
}

.btn--outline-dark {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.btn--outline-dark:hover {
  background: var(--navy);
  color: var(--white);
}

.btn--sm {
  padding: 8px 18px;
  font-size: .85rem;
}

/* ── Section header ──────────────────────────────────────── */
.section-header {
  margin-bottom: 48px;
}

.section-header__kicker {
  display: inline-block;
  color: var(--teal);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-header h2 {
  margin-bottom: 14px;
}

.section-header p {
  color: var(--grey-400);
  font-size: 1.05rem;
}

/* ── Cards (feature / info) ──────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card__icon {
  width: 44px;
  height: 44px;
  background: var(--grey-50);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  font-size: 1.3rem;
}

.card h3 {
  margin-bottom: 10px;
}

.card p {
  font-size: .95rem;
  color: var(--grey-400);
  max-width: none;
}

/* ── Stats bar ───────────────────────────────────────────── */
.stats {
  background: var(--navy);
  color: var(--white);
  padding-block: 48px;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
  text-align: center;
}

.stats__number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--teal-light);
  line-height: 1;
  margin-bottom: 6px;
}

.stats__label {
  font-size: .85rem;
  color: rgba(255, 255, 255, .65);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── Team / People ───────────────────────────────────────── */
.person {
  text-align: center;
}

.person__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--grey-200);
  margin-inline: auto;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: var(--grey-400);
  overflow: hidden;
}

.person h4 {
  margin-bottom: 4px;
}

.person p {
  font-size: .875rem;
  color: var(--grey-400);
  max-width: none;
}

/* ── App cards (apps page) ───────────────────────────────── */
.app-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.app-card:hover {
  box-shadow: var(--shadow-md);
}

.app-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px;
  gap: 16px;
  cursor: pointer;
  user-select: none;
}

.app-card__header:hover .app-card__title {
  color: var(--teal);
}

.app-card__meta {
  flex: 1;
}

.app-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.app-card__badge--active {
  background: #d4f5ef;
  color: var(--teal);
}

.app-card__badge--beta {
  background: #fef3e2;
  color: #c47a00;
}

.app-card__badge--dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.app-card__type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
}

.app-card__type-badge--hosted {
  background: rgba(0, 122, 110, .1);
  color: var(--teal);
  border: 1px solid rgba(0, 122, 110, .25);
}

.app-card__type-badge--download {
  background: rgba(232, 82, 26, .1);
  color: var(--accent);
  border: 1px solid rgba(232, 82, 26, .25);
}

.app-card__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  transition: color var(--transition);
}

.app-card__subtitle {
  font-size: .9rem;
  color: var(--grey-400);
}

.app-card__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.app-card__chevron {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grey-100);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform var(--transition), background var(--transition);
  font-size: .9rem;
  color: var(--grey-400);
}

.app-card.is-open .app-card__chevron {
  transform: rotate(180deg);
  background: var(--teal);
  color: var(--white);
}

.app-card__body {
  display: none;
  border-top: 1px solid var(--grey-100);
}

.app-card.is-open .app-card__body {
  display: block;
}

.app-card__tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--grey-100);
  padding: 0 28px;
  background: var(--grey-50);
}

.app-tab-btn {
  padding: 12px 18px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--grey-400);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}

.app-tab-btn:hover {
  color: var(--navy);
}

.app-tab-btn.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.app-tab-panel {
  display: none;
  padding: 28px;
}

.app-tab-panel.active {
  display: block;
}

.app-card__screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.app-card__screenshot {
  aspect-ratio: 16/10;
  background: var(--grey-100);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--grey-400);
  font-size: .8rem;
  border: 1px solid var(--grey-200);
}

.ref-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref-list li {
  padding: 12px 16px;
  background: var(--grey-50);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .9rem;
}

.ref-list a {
  color: var(--teal);
  font-weight: 600;
}

.ref-list a:hover {
  text-decoration: underline;
}

/* ── Tag pills ───────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--grey-100);
  color: var(--grey-700);
  margin: 2px;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  background: var(--navy-dark);
  color: rgba(255, 255, 255, .6);
  padding-block: 48px 32px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer__brand h3 {
  color: var(--white);
  margin-bottom: 10px;
  font-size: 1rem;
}

.footer__brand p {
  font-size: .875rem;
  max-width: 28ch;
}

.footer__col h4 {
  color: rgba(255, 255, 255, .85);
  font-size: .875rem;
  margin-bottom: 14px;
  letter-spacing: .04em;
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer__links a {
  font-size: .875rem;
  transition: color var(--transition);
}

.footer__links a:hover {
  color: var(--white);
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .8rem;
}

.footer__bottom a {
  color: var(--teal-light);
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--teal-light), transparent);
}

/* ── App card content utilities ──────────────────────────── */
.app-card__section-title {
  margin-bottom: 10px;
  color: var(--navy);
}

.app-card__section-title--lg {
  margin-bottom: 12px;
  color: var(--navy);
}

.app-card__feature-list {
  font-size: .9rem;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--grey-700);
}

.app-card__feature-list--numbered {
  font-size: .9rem;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--grey-700);
}

.app-card__tech-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-card__downloads {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-card__manual-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.app-card__manual-col {
  flex: 1;
  min-width: 240px;
}

.app-card__citation-note {
  margin-top: 16px;
  font-size: .875rem;
  color: var(--grey-400);
}

/* ── Reveal animation ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav__links {
    display: none;
    flex-direction: column;
  }

  .nav__links.is-open {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--navy-dark);
    padding: 16px;
    gap: 4px;
    box-shadow: var(--shadow-md);
  }

  .nav__burger {
    display: flex;
  }

  .section {
    padding-block: 56px;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .app-card__header {
    flex-wrap: wrap;
  }

  .app-card__actions .btn {
    display: none;
  }
}

@media (max-width: 480px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-block: 24px 20px;
  }

  .stats__grid {
    grid-template-columns: 1fr 1fr;
  }
}