:root {
  color-scheme: dark;
  --bg: #000000;
  --text: #f5f5f7;
  --muted: #86868b;
  --accent: #2997ff;
  --border: #424245;
  --card: #1c1c1e;
  --secondary-bg: #161617;
  --hover-bg: #2c2c2e;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

.layout-header {
  position: sticky;
  top: 0;
  height: 64px;
  background: rgba(22, 22, 23, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
}

.layout-container {
  display: flex;
  flex: 1;
}

.layout-sidebar {
  width: 260px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 40px 0;
  flex-shrink: 0;
}

.layout-main {
  flex: 1;
  padding: 40px 80px 80px;
  max-width: 1000px;
}

main {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.language-switch {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  font-weight: 600;
  font-size: 0.9rem;
}

.language-switch a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.language-switch a:hover {
  color: var(--text);
}

.content-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.role, .subtitle {
  font-size: 1.25rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: -0.01em;
}

section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h2 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
}

p, li {
  margin: 0;
}

ul {
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

ul.tight {
  padding-left: 20px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  text-decoration: underline;
}

/* Sidebar Navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

.sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding: 0 12px;
}

.sidebar-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  display: block;
}

.sidebar-link:hover {
  background: var(--hover-bg);
  color: var(--text);
  text-decoration: none;
}

.sidebar-link.active {
  background: var(--card);
  color: #ffffff;
  font-weight: 500;
}

/* Header Elements */
.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.header-link {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.header-link:hover {
  color: var(--text);
  text-decoration: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Download PDF Button */
.btn-download {
  background: #5856d6;
  color: #ffffff;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
  white-space: nowrap;
}

.btn-download:hover {
  background: #6e6ce0;
  transform: translateY(-1px);
}

.btn-download:active {
  transform: translateY(0);
}

.btn-download:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Contacts */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.contact-item {
  display: flex;
  gap: 12px;
  color: var(--muted);
}

.contact-label {
  min-width: 90px;
  font-weight: 600;
  color: var(--text);
}

/* Entries */
.entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.entry:first-of-type {
  border-top: none;
  padding-top: 0;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

blockquote {
  margin: 0;
  padding: 16px 20px;
  border-left: 2px solid var(--accent);
  color: var(--text);
  background: var(--secondary-bg);
  border-radius: 0 8px 8px 0;
}

/* Apps Specific */
.info-list {
  color: var(--muted);
}

.apps {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.app-card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: transform 0.2s ease;
  border: 1px solid var(--border);
}

.app-top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.app-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.app-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.platform {
  color: var(--muted);
  font-size: 0.8rem;
  background: var(--secondary-bg);
  padding: 2px 8px;
  border-radius: 4px;
}

.stats {
  display: flex;
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

.description {
  color: var(--text);
  font-size: 1rem;
}

.app-analytics {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
}

@media (max-width: 850px) {
  .layout-sidebar {
    display: none;
  }

  .layout-main {
    padding: 40px 20px;
  }
}

@media (max-width: 640px) {
  .layout-header {
    padding: 0 12px;
    gap: 12px;
  }

  .header-links {
    display: none;
  }

  h1 {
    font-size: 2.2rem;
  }

  .app-card {
    padding: 20px;
  }

  .app-icon {
    width: 48px;
    height: 48px;
  }

  .contact-list {
    grid-template-columns: 1fr;
  }
}

/* Print / Save as PDF */
@media print {
  /* Hide non-content elements */
  .layout-header,
  .layout-sidebar,
  .btn-download {
    display: none !important;
  }

  /* Reset dark theme to print-friendly colors */
  :root {
    color-scheme: light;
  }

  body {
    background: #ffffff;
    color: #1a1a1a;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Layout: full width, no sidebar gap */
  .layout-container {
    display: block;
  }

  .layout-main {
    padding: 0;
    max-width: 100%;
  }

  /* Typography: dark text */
  h1, h3, strong, .sidebar-title {
    color: #000000;
  }

  h2 {
    color: #4338ca;
  }

  .role, .subtitle, .meta {
    color: #555555;
  }

  p, li, .contact-item {
    color: #1a1a1a;
  }

  .contact-label {
    color: #000000;
  }

  /* Links: visible and underlined for print */
  a {
    color: #2563eb;
    text-decoration: underline;
  }

  /* Borders */
  .content-header,
  .entry {
    border-color: #e5e5e5;
  }

  /* Code blocks */
  code {
    background: #f3f4f6;
    color: #1a1a1a;
  }

  /* Page breaks */
  .entry {
    break-inside: avoid;
  }

  section {
    break-inside: avoid;
  }
}
