:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(13, 148, 136, 0.35);
  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.09);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 12px 28px -10px rgba(15, 23, 42, 0.14),
    0 2px 6px rgba(15, 23, 42, 0.05);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.page {
  display: grid;
  grid-template-columns: minmax(320px, 36%) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Left identity panel */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  text-align: right;
  padding: clamp(2.5rem, 5vw, 4.5rem);
  background-color: #1e2433;
  background-image: linear-gradient(
      160deg,
      rgba(15, 23, 42, 0.5) 0%,
      rgba(15, 23, 42, 0.74) 100%
    ),
    url("../../images/bg.svg");
  background-position: top left, center center;
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
  color: #f8fafc;
}

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

.avatar {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
  margin-bottom: 1.25rem;
}

.sidebar h1 {
  margin: 0;
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: rgba(248, 250, 252, 0.84);
}

.sidebar h1 strong {
  color: #ffffff;
  font-weight: 700;
}

.role {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  color: rgba(248, 250, 252, 0.76);
  font-weight: 400;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.6rem;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f8fafc;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease;
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.34);
  transform: translateY(-1px);
}

.social-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.social-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-footer {
  font-size: 0.8rem;
  color: rgba(248, 250, 252, 0.52);
  margin-top: 2rem;
}

/* Right main content */
.content {
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 5vw, 4.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.content-inner {
  width: 100%;
  max-width: 780px;
}

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

/* Intro & Quote */
.intro {
  animation: fadeUp 0.45s ease both;
}

.quote-block {
  margin: 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent);
}

.quote-block p {
  margin: 0;
  font-size: clamp(1.08rem, 1.5vw, 1.25rem);
  line-height: 1.65;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.quote-block cite {
  display: block;
  margin-top: 0.55rem;
  font-style: normal;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.lead {
  margin: 1.4rem 0 0;
  font-size: 0.975rem;
  color: var(--text-secondary);
}

/* Apps grid */
.apps-section {
  margin-top: 2.75rem;
  animation: fadeUp 0.5s ease 0.06s both;
}

.apps-section h2 {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.app-card {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  padding: 1.15rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

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

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background-color: #f1f5f9;
}

.app-body {
  flex: 1;
  min-width: 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.app-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.app-arrow {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.18s ease, color 0.18s ease;
}

.app-card:hover .app-arrow,
.app-card:focus-visible .app-arrow {
  transform: translate(2px, -2px);
  color: var(--accent);
}

.app-desc {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.tag {
  display: inline-block;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background-color: #f1f5f9;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
}

/* Bottom contact strip */
.page-footer {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  animation: fadeUp 0.55s ease 0.12s both;
}

.page-footer p {
  margin: 0;
}

.page-footer a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.page-footer a:hover {
  border-bottom-color: var(--accent);
}

.mobile-copyright {
  display: none;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

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

  .sidebar {
    position: relative;
    height: auto;
    align-items: center;
    text-align: center;
    padding: 3.5rem 1.5rem 2.75rem;
  }

  .sidebar-top {
    align-items: center;
  }

  .social-links,
  .store-links {
    justify-content: center;
  }

  .sidebar-footer {
    display: none;
  }

  .mobile-copyright {
    display: inline;
  }

  .screenshots-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .screenshots-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .content {
    padding: 2rem 1.25rem 2.5rem;
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 1.25rem;
    transform: none;
  }
}

/* App Detail Pages & Lightbox */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(248, 250, 252, 0.85);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 1.75rem;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateX(-2px);
}

.back-link:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.back-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.app-avatar {
  display: block;
  width: 92px;
  height: 92px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.38);
  margin-bottom: 1.25rem;
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.6rem;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f8fafc;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease;
}

.store-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.34);
  transform: translateY(-1px);
}

.store-btn--primary {
  background: #ffffff;
  border-color: #ffffff;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.store-btn--primary:hover {
  background: #f1f5f9;
  border-color: #f1f5f9;
}

.store-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.store-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.app-headline {
  margin: 0;
  font-size: clamp(1.1rem, 1.55vw, 1.3rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.app-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.25rem;
  margin-top: 1.4rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.app-meta strong {
  color: var(--text-primary);
  font-weight: 600;
}

.app-meta a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.app-meta a:hover {
  border-bottom-color: var(--accent);
}

.gallery-section {
  margin-top: 2.75rem;
  animation: fadeUp 0.5s ease 0.06s both;
}

.gallery-section h2 {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.screenshots-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.shot-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.shot-trigger {
  display: block;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.shot-trigger:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.shot-trigger img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.25s ease;
}

.shot-trigger:hover img {
  transform: scale(1.02);
}

.shot-caption {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.1rem;
}

/* Native dialog Lightbox */
dialog.lightbox {
  margin: auto;
  border: 0;
  padding: 1.5rem;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  overflow: visible;
}

dialog.lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

dialog.lightbox::backdrop {
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox-img {
  display: block;
  max-width: min(88vw, 500px);
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  background: #0f172a;
}

.lightbox-caption {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(248, 250, 252, 0.9);
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.68);
  color: #f8fafc;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-close {
  top: 1.25rem;
  right: 1.25rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 1.25rem;
}

.lightbox-next {
  right: 1.25rem;
}

.lightbox-close svg,
.lightbox-nav svg {
  width: 18px;
  height: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .intro,
  .apps-section,
  .gallery-section,
  .page-footer {
    animation: none;
  }

  .social-btn,
  .back-link,
  .store-btn,
  .app-card,
  .app-arrow,
  .shot-trigger,
  .shot-trigger img,
  .app-meta a,
  .page-footer a,
  .lightbox-close,
  .lightbox-nav {
    transition: none;
  }
}
