/* ============================================================
   GOOGLE FONTS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* Sheet / card */
  --sheet-bg:           rgba(82, 74, 172, 0.30);
  --sheet-radius:       30px;
  --sheet-padding-x:    80px;
  --sheet-padding-y:    60px;
  --sheet-max-width:    1100px;
  --sheet-blur:         blur(5px);

  /* Typography */
  --font-body:          'Inter', sans-serif;
  --color-title:        #ffffff;
  --color-tagline:      #DBECFF;
  --color-body:         #ffffff;
  --color-legal:        #7D77B2;

  /* App icon */
  --icon-grid-size:     200px;
  --icon-list-size:     150px;

  /* Divider */
  --divider-color:      rgba(219, 236, 255, 0.25);

  /* Footer */
  --footer-color:       rgba(255,255,255,0.4);
  --footer-link-color:  rgba(255,255,255,0.55);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--color-body);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   BACKGROUND
   ============================================================ */
body {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 90px 100px;
  background-color: #333994;
  background-image: url('images/background.svg'), linear-gradient(to bottom, #333994 0%, #303587 60%, #1B1649 85%, #0F0C2B 100%);
  background-size: cover, 100% 100%;
  background-position: center, center;
  background-attachment: fixed, fixed;
  overflow-x: hidden;
}

/* ============================================================
   SHEET / CARD
   ============================================================ */
.sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--sheet-max-width);
  background: var(--sheet-bg);
  backdrop-filter: var(--sheet-blur);
  -webkit-backdrop-filter: var(--sheet-blur);
  border-radius: var(--sheet-radius);
  padding: var(--sheet-padding-y) var(--sheet-padding-x);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ============================================================
   HEADER
   ============================================================ */
.sheet-header {
  text-align: center;
}

.sheet-header h1 {
  font-size: 48px;
  font-weight: 600;
  color: var(--color-title);
  margin-bottom: 8px;
}

.sheet-header p {
  font-size: 24px;
  font-weight: 500;
  color: var(--color-tagline);
}

/* ============================================================
   ICON GRID (section 1)
   ============================================================ */
.icon-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.icon-grid .app-icon {
  width: var(--icon-grid-size);
  height: var(--icon-grid-size);
  object-fit: cover;
  display: block;
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  height: 1px;
  background: var(--divider-color);
}

/* ============================================================
   APP LIST (section 2)
   ============================================================ */
.app-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.app-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.app-item .app-icon {
  width: var(--icon-list-size);
  height: var(--icon-list-size);
  object-fit: cover;
  flex-shrink: 0;
}

.app-item-content {
  flex: 1;
}

.app-item-name {
  font-size: 24px;
  font-weight: 600;
  color: #DBECFF;
  margin-bottom: 6px;
}

.app-item-name .accent {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-item-description {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-body);
  margin-bottom: 8px;
}

.app-item-privacy {
  font-size: 15px;
  font-weight: 400;
  color: #DBECFF;
}

.app-item-privacy .privacy-label {
  font-weight: 600;
}

/* ============================================================
   FOOTER
   ============================================================ */
.sheet-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  font-size: 0.78rem;
  color: var(--footer-color);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a {
  color: var(--footer-link-color);
  text-decoration: none;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-sep {
  color: var(--footer-color);
}

#footer-legal {
  font-size: 10px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-legal);
  border-top: 1px solid var(--divider-color);
  padding-top: 16px;
  margin-top: -16px;
  text-align: center;
}

.footer-back {
  color: var(--footer-link-color);
  text-decoration: none;
}

.footer-back:hover {
  color: #ffffff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 785px) {
  :root {
    --sheet-padding-x: 24px;
    --sheet-padding-y: 32px;
    --icon-grid-size:  80px;
    --icon-list-size:  56px;
    --icon-radius:     16px;
  }

  html {
    height: 100%;
  }

  body {
    padding: 0;
    align-items: stretch;
    min-height: 100%;
  }

  .sheet {
    border-radius: 0;
    width: 100%;
    max-width: none;
    flex: 1 0 auto;
    padding-top: max(var(--sheet-padding-y), env(safe-area-inset-top));
    padding-bottom: max(var(--sheet-padding-y), env(safe-area-inset-bottom));
  }

  .legal-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sheet-header h1 {
    font-size: 32px;
  }

  .sheet-header p {
    font-size: 18px;
  }

  .app-item-name {
    font-size: 20px;
  }

  .sheet-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}


/* ============================================================
   LEGAL CONTENT
   ============================================================ */
.legal-content {
  color: var(--color-body);
  font-size: 15px;
  line-height: 1.7;
}

.legal-content h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-title);
  margin-top: 40px;
  margin-bottom: 12px;
}

.legal-content h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-title);
  margin-top: 32px;
  margin-bottom: 10px;
}

.legal-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-tagline);
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-content p {
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.legal-content ul,
.legal-content ol {
  padding-left: 24px;
  margin-bottom: 14px;
}

.legal-content li {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.85);
}

.legal-content strong {
  font-weight: 600;
  color: var(--color-title);
}

.legal-content a {
  color: var(--color-tagline);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content a:hover {
  color: #ffffff;
}

.legal-content hr {
  border: none;
  border-top: 1px solid var(--divider-color);
  margin: 32px 0;
}

.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
}

.legal-content th {
  text-align: left;
  font-weight: 600;
  color: var(--color-tagline);
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider-color);
}

.legal-content td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(219, 236, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  vertical-align: top;
}

/* Hide the H1 from the markdown since the sheet-header already shows the title */
.legal-content > h1:first-child {
  display: none;
}
