:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --border: #e2e8f0;
  --radius: 14px;
  --max-w: 1040px;
}

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

html {
  scroll-behavior: smooth;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}

.brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-logo-hero {
  height: 52px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--muted);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--text);
  font-weight: 600;
}

/* Product menu (Miriam: Overview, User Guide, Terms, Privacy, Support), shown under the studio header */
.product-nav {
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.product-nav-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  min-height: 48px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.product-nav-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}

.product-nav-title img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.product-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 0.92rem;
}

.product-nav-links a {
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.product-nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.product-nav-links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Hero */
.hero {
  padding: 72px 0 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 12px;
}

.app-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.app-icon-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.lead {
  font-size: 1.125rem;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 52ch;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--text);
  color: #fff;
}

.btn-primary:hover {
  background: #1e293b;
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: #cbd5e1;
  text-decoration: none;
}

/* Device Frame */
.device-frame {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 9 / 19;
  margin: 0 auto;
  border-radius: 36px;
  border: 8px solid #0f172a;
  background: var(--surface);
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.15);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.device-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sections */
.section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

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

h2 {
  font-size: 1.75rem;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}

.section-intro {
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 36px;
}

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

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Support & FAQ */
.support-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: start;
}

details {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: var(--bg);
}

summary {
  font-weight: 600;
  cursor: pointer;
}

details p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Legal / Subpages */
.prose {
  max-width: 72ch;
  padding: 56px 0 72px;
}

.prose h2 {
  font-size: 1.3rem;
  margin-top: 32px;
}

.prose p,
.prose li {
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-links a {
  color: var(--muted);
}

@media (max-width: 820px) {
  .hero-grid,
  .grid-3,
  .products-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 48px 0;
  }

  .nav-links {
    gap: 16px;
    font-size: 0.9rem;
  }
}

/* Products Grid & Disabled/Grayed-Out Cards */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 16px;
}

/* Must come after the rule above, or the 3 columns win on small screens too. */
@media (max-width: 820px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card.active:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.product-card.disabled {
  opacity: 0.55;
  filter: grayscale(80%);
  background: rgba(240, 243, 246, 0.8);
  border-style: dashed;
  pointer-events: none;
  cursor: not-allowed;
}

.product-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.product-badge.active-badge {
  background: rgba(2, 132, 199, 0.15);
  color: var(--accent);
}

.product-badge.tba-badge {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

.product-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.product-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.product-icon-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #cbd5e1;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
}

/* Background Image styling for main page */
body.has-bg {
  background: #0f172a url('../img/miriam-background.webp') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
}

body.has-bg .site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

body.has-bg .hero {
  background: transparent;
  border-bottom: 1px solid rgba(226, 232, 240, 0.4);
}

body.has-bg .section {
  background: transparent;
}

body.has-bg .section-alt {
  background: rgba(248, 250, 252, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.has-bg .card,
body.has-bg .product-card,
body.has-bg .prose {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
}

body.has-bg .prose {
  padding: 40px;
  margin-top: 40px;
  margin-bottom: 60px;
}

/* Banner text (home and product pages) sits over the background picture: a light card keeps it readable. */
body.has-bg .hero-text {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  padding: 36px 40px;
}

body.has-bg .product-card.disabled {
  background: rgba(240, 243, 246, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: none;
}

body.has-bg details {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.has-bg .site-footer {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(226, 232, 240, 0.6);
}

/* Video Intro Overlay */
.video-intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #090d16;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  padding: 24px;
}

.video-intro-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

.video-intro-container {
  position: relative;
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.video-intro-container video {
  width: 100%;
  max-height: 75vh;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  background: #000;
  object-fit: contain;
}

.video-controls-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.skip-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 12px 28px;
  border-radius: 30px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.skip-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: #ffffff;
  color: #ffffff;
  transform: translateY(-2px);
  text-decoration: none;
}

.hidden-initial {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.main-content-container.fade-in {
  opacity: 1;
}

/* Team Page Styling */
.team-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  align-items: start;
  padding: 36px;
  border-radius: 24px;
}

.team-media {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.team-avatar-video {
  width: 240px;
  height: 240px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  border: 3px solid rgba(2, 132, 199, 0.3);
  background: #000;
}

.team-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.role-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(2, 132, 199, 0.12);
  color: var(--accent);
  border: 1px solid rgba(2, 132, 199, 0.25);
}

@media (max-width: 720px) {
  /* Phone: less padding inside the banner card. */
  body.has-bg .hero-text {
    padding: 24px 20px;
  }

  /* Phone: the menu wraps under the logo instead of running off the screen. */
  .nav-wrap {
    height: auto;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 6px 14px;
  }

  .team-card {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
    padding: 24px;
  }

  .team-info {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .team-roles {
    justify-content: center;
  }
}

/* Miriam Teaser: screenshots on a turning cylinder (assets/js/teaser.js) */
html.teaser-open {
  overflow: hidden;
}

.teaser {
  /* Front card width: as big as the screen height allows once the caption and frame (~182px) are below it.
     Screenshots are about 1 : 2.11, and the front card is drawn ~9% bigger (FRONT_LIFT in teaser.js): 2.3.
     Dividing by 2.47 instead (and 428px, 65vw) makes the screens 7% smaller than the most that would fit.
     The cards beside it are drawn smaller (SIDE_SCALE in teaser.js). */
  --card-w: min(428px, 65vw, calc((100vh - 182px) / 2.47));
  --card-w: min(428px, 65vw, calc((100dvh - 182px) / 2.47));
  /* A frame over the page, as tall as the window (less a 16px gap), and narrow enough to see the page beside it. */
  width: min(860px, calc(100vw - 32px));
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  margin: auto;
  padding: 12px 24px 14px;
  border: 0;
  border-radius: 20px;
  background: radial-gradient(ellipse at 50% 35%, #1e3a5f 0%, #0f172a 70%);
  color: #f1f5f9;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}

.teaser[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.teaser::backdrop {
  /* Light enough that the page still shows beside the frame. */
  background: rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(2px);
}

.teaser-close {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.teaser-close:hover,
.teaser-arrow:hover {
  background: rgba(255, 255, 255, 0.22);
}

.teaser-stage {
  position: relative;
  width: min(100%, 1100px);
  flex: 1;
  display: flex;
  align-items: center;
  padding: 10px 0 8px;
  perspective: 1500px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.teaser-stage:active {
  cursor: grabbing;
}

.teaser-cylinder {
  position: relative;
  width: var(--card-w);
  height: calc(var(--card-w) * 2.11);
  margin: 0 auto;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.teaser-cylinder.dragging {
  transition: none;
}

.teaser-cylinder.no-anim,
.teaser-cylinder.no-anim .teaser-card {
  transition: none;
}

.teaser-card {
  position: absolute;
  inset: 0;
  margin: 0;
  /* The screenshots already include the phone frame, so the card adds only a shadow. */
  border-radius: calc(var(--card-w) * 0.09);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.7s cubic-bezier(0.22, 0.8, 0.3, 1), opacity 0.7s ease, box-shadow 0.7s ease;
  cursor: pointer;
}

.teaser-card.is-active {
  cursor: default;
  box-shadow: 0 24px 60px -10px rgba(56, 189, 248, 0.45);
}

.teaser-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.teaser-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: #cbd5e1;
  pointer-events: none;
}

.teaser-status:empty {
  display: none;
}

.teaser-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.teaser-prev {
  left: 4px;
}

.teaser-next {
  right: 4px;
}

.teaser-counter {
  position: absolute;
  top: 18px;
  left: 24px;
  z-index: 2;
  font-size: 0.9rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.teaser-caption {
  flex: none;
  max-width: 64ch;
  height: 108px;
  overflow-y: auto;
  text-align: center;
}

.teaser-caption h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  line-height: 1.3;
  color: #fff;
}

.teaser-caption p {
  margin: 0 0 6px;
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.5;
}

.teaser-close:focus-visible,
.teaser-arrow:focus-visible,
.teaser-card:focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 3px;
}

/* Phones: the whole screen, since there is no room for a frame. */
@media (max-width: 600px) {
  .teaser {
    --card-w: min(428px, 65vw, calc((100vh - 200px) / 2.47));
    --card-w: min(428px, 65vw, calc((100dvh - 200px) / 2.47));
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    padding: 56px 10px 12px;
  }

  .teaser-arrow {
    width: 42px;
    height: 42px;
    margin-top: -21px;
    font-size: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .teaser-cylinder,
  .teaser-card {
    transition: none;
  }
}

/* Blog (public/blog/, built by update-blog.ps1) */
.blog-list {
  margin-top: 32px;
}

.blog-item {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.blog-item h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.blog-item .blog-more {
  margin-top: 12px;
  font-weight: 600;
}

.blog-item p {
  margin: 8px 0 0;
}

.post-meta {
  font-size: 0.9rem;
  margin: 0 0 28px;
}

.blog-item .post-meta {
  margin: 0;
}

.blog-back {
  display: inline-block;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.blog-post p,
.blog-post li {
  color: var(--text);
}

.blog-post .post-meta,
.blog-post .post-share {
  color: var(--muted);
}

.blog-post figure {
  margin: 28px 0;
}

.blog-post img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* Phone screenshots: small and centered; click to enlarge (assets/js/lightbox.js). */
.blog-post figure.phone img {
  display: block;
  width: 100%;
  max-width: 180px;
  margin: 0 auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-post figure.phone img:hover,
.blog-post figure.phone img:focus-visible {
  transform: scale(1.04);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 14, 20, 0);
  cursor: zoom-out;
  transition: background 0.32s ease;
}

.lightbox-backdrop.is-open {
  background: rgba(10, 14, 20, 0.85);
}

.lightbox-img {
  position: fixed;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: left 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
    width 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.lightbox-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-backdrop,
  .lightbox-img,
  .blog-post figure.phone img {
    transition: none;
  }
}

.blog-post figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}

.post-share {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.post-share a {
  margin-left: 12px;
}
