/* ============================================
   LazyCat Studios — Modern Cross-Platform Design
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ---------- Custom Properties ---------- */
:root {
  /* Palette */
  --color-bg: #f4f6fb;
  --color-surface: #ffffff;
  --color-primary: #1e1e2e;
  --color-primary-light: #2a2a3d;
  --color-accent: #6c5ce7;
  --color-accent-light: #a29bfe;
  --color-accent-glow: rgba(108, 92, 231, 0.15);
  --color-accent-gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  --color-text: #2d3047;
  --color-text-secondary: #7c7f93;
  --color-text-muted: #a0a3b5;
  --color-border: #e8eaf0;
  --color-border-light: #f0f1f5;
  --color-link: #6c5ce7;
  --color-link-hover: #5a4bd1;
  --color-success: #00b894;
  --color-tag-pp-bg: rgba(108, 92, 231, 0.1);
  --color-tag-pp-text: #6c5ce7;
  --color-tag-tos-bg: rgba(0, 184, 148, 0.1);
  --color-tag-tos-text: #00b894;
  --color-tag-legacy-bg: rgba(124, 127, 147, 0.1);
  --color-tag-legacy-text: #7c7f93;

  /* Layout */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.06), 0 16px 48px rgba(0,0,0,0.08);
  --shadow-accent: 0 4px 24px rgba(108, 92, 231, 0.2);
  --max-width: 820px;
  --font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Transition */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.25s;
}

/* ---------- Dark Mode ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #13131a;
    --color-surface: #1e1e2e;
    --color-primary: #cdd6f4;
    --color-primary-light: #bac2de;
    --color-accent: #a29bfe;
    --color-accent-light: #c4bfff;
    --color-accent-glow: rgba(162, 155, 254, 0.12);
    --color-text: #cdd6f4;
    --color-text-secondary: #9399b2;
    --color-text-muted: #6c7086;
    --color-border: #313244;
    --color-border-light: #2a2a3d;
    --color-link: #a29bfe;
    --color-link-hover: #c4bfff;
    --color-tag-pp-bg: rgba(162, 155, 254, 0.12);
    --color-tag-pp-text: #a29bfe;
    --color-tag-tos-bg: rgba(0, 184, 148, 0.12);
    --color-tag-tos-text: #55efc4;
    --color-tag-legacy-bg: rgba(147, 153, 178, 0.12);
    --color-tag-legacy-text: #9399b2;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 2px 8px rgba(0,0,0,0.2), 0 8px 32px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.3), 0 16px 48px rgba(0,0,0,0.4);
    --shadow-accent: 0 4px 24px rgba(162, 155, 254, 0.15);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Selection ---------- */
::selection {
  background: var(--color-accent);
  color: #fff;
}

/* ===== HEADER ===== */
.site-header {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(19, 19, 26, 0.85);
    border-bottom: 1px solid var(--color-border);
  }
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 1.5rem;
}

.site-header__brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity var(--duration) var(--ease);
}

.site-header__brand::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 28px;
  background: var(--color-accent-gradient);
  border-radius: 8px;
  flex-shrink: 0;
}

.site-header__brand:hover {
  opacity: 0.85;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header__nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
}

.site-header__nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* ===== MAIN CONTENT ===== */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1;
  width: 100%;
}

/* ===== HOME PAGE — HERO ===== */
.hero {
  text-align: center;
  padding: 3.5rem 0 1rem;
  position: relative;
}

.hero__icon {
  width: 72px;
  height: 72px;
  background: var(--color-accent-gradient);
  border-radius: 22px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-accent);
  position: relative;
}

.hero__icon::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  background: var(--color-accent-glow);
  z-index: -1;
}

.hero__icon svg {
  width: 36px;
  height: 36px;
  fill: #fff;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 900;
  color: var(--color-primary);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

@media (prefers-color-scheme: dark) {
  .hero__title {
    background: linear-gradient(135deg, #cdd6f4 0%, #a29bfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--color-text-secondary);
  max-width: 440px;
  margin: 0 auto;
  font-weight: 500;
  line-height: 1.6;
}

/* ===== HOME PAGE — APPS GRID ===== */
.apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
}

@media (min-width: 540px) {
  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 780px) {
  .apps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== APP CARD ===== */
.app-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent-gradient);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.app-card:hover {
  border-color: var(--color-accent-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.app-card:hover::before {
  opacity: 1;
}

.app-card__name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.app-card__links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.app-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
  width: fit-content;
}

/* Privacy Policy link style */
.app-card__link {
  color: var(--color-tag-pp-text);
  background: var(--color-tag-pp-bg);
}

.app-card__link:hover {
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

/* Tag-like link variations via content detection — uses nth-child as fallback */
.app-card__link[href*="terms"] {
  color: var(--color-tag-tos-text);
  background: var(--color-tag-tos-bg);
}

.app-card__link[href*="terms"]:hover {
  background: var(--color-success);
  color: #fff;
  box-shadow: 0 4px 24px rgba(0, 184, 148, 0.2);
}

/* Legacy links */
.app-card__link:last-child:nth-child(3) {
  color: var(--color-tag-legacy-text);
  background: var(--color-tag-legacy-bg);
  font-size: 0.78rem;
}

.app-card__link:last-child:nth-child(3):hover {
  background: var(--color-text-secondary);
  color: #fff;
}

/* Link icons */
.app-card__link::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2.5' stroke='%236c5ce7'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.app-card__link[href*="terms"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2.5' stroke='%2300b894'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z'/%3E%3C/svg%3E");
}

.app-card__link:hover::before {
  filter: brightness(0) invert(1);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0;
}

.breadcrumb a {
  color: var(--color-link);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--duration) var(--ease);
}

.breadcrumb a:hover {
  color: var(--color-link-hover);
}

.breadcrumb__sep {
  color: var(--color-text-muted);
  font-weight: 500;
  user-select: none;
}

/* ===== DOCUMENT PAGE (PP / TOS) ===== */
.document {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  padding: clamp(1.75rem, 5vw, 3rem);
  margin-top: 1.25rem;
  position: relative;
  overflow: hidden;
}

.document::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-accent-gradient);
}

.document__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
  padding-top: 0.5rem;
}

.document__meta {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border-light);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.document__meta::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%23a0a3b5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Document headings */
.document h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  padding-top: 1.25rem;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 1rem;
}

.document h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.25rem;
  bottom: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--color-accent-gradient);
}

.document h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
}

.document h2:first-of-type::before {
  top: 0;
}

/* Document paragraphs */
.document p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

/* Document links */
.document a {
  color: var(--color-link);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1.5px solid transparent;
  transition: all var(--duration) var(--ease);
}

.document a:hover {
  color: var(--color-link-hover);
  border-bottom-color: var(--color-link-hover);
}

/* Document lists */
.document ul,
.document ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
}

.document li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.document li a {
  word-break: break-all;
}

.document li::marker {
  color: var(--color-accent);
}

.document strong {
  color: var(--color-primary);
  font-weight: 700;
}

.document hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 2rem 0;
}

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-weight: 500;
  border-top: 1px solid var(--color-border-light);
  margin-top: auto;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .site-header__inner {
    height: 52px;
    padding: 0 1rem;
  }

  .page-wrapper {
    padding: 1.25rem 1rem 3rem;
  }

  .hero {
    padding: 2rem 0 0.5rem;
  }

  .hero__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin-bottom: 1.25rem;
  }

  .hero__icon::after {
    inset: -6px;
    border-radius: 22px;
  }

  .app-card {
    padding: 1.25rem;
  }

  .document {
    padding: 1.25rem;
    border-radius: var(--radius);
  }

  .document h2 {
    font-size: 1.05rem;
  }
}

/* ===== PRINT ===== */
@media print {
  .site-header {
    position: static;
    background: #fff;
    color: #000;
    border-bottom: 2px solid #000;
  }
  .site-header__brand { color: #000; }
  .site-header__brand::before { display: none; }
  .page-wrapper { padding: 1rem 0; }
  .document {
    box-shadow: none;
    border: 1px solid #ccc;
    border-radius: 0;
  }
  .document::before { display: none; }
  .app-card { box-shadow: none; border: 1px solid #ccc; }
  .app-card::before { display: none; }
  body { background: #fff; }
}

/* ===== ANIMATIONS ===== */
@media (prefers-reduced-motion: no-preference) {
  .app-card {
    animation: fadeInUp 0.4s var(--ease) backwards;
  }
  .app-card:nth-child(1) { animation-delay: 0.05s; }
  .app-card:nth-child(2) { animation-delay: 0.1s; }
  .app-card:nth-child(3) { animation-delay: 0.15s; }
  .app-card:nth-child(4) { animation-delay: 0.2s; }
  .app-card:nth-child(5) { animation-delay: 0.25s; }
  .app-card:nth-child(6) { animation-delay: 0.3s; }

  .document {
    animation: fadeInUp 0.5s var(--ease) backwards;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
