:root {
  --ink: #1b1b1b;
  --muted: #5b5b5b;
  --cream: #f6f0e6;
  --peach: #f4c9a8;
  --sea: #3a8d8f;
  --gold: #d39a3e;
  --card: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 40px rgba(27, 27, 27, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Playfair Display", "Times New Roman", serif;
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(60vw 40vw at 10% 15%, rgba(244, 201, 168, 0.55), transparent 60%),
    radial-gradient(45vw 30vw at 90% 20%, rgba(58, 141, 143, 0.35), transparent 65%),
    linear-gradient(160deg, #fff7ee 0%, #f3efe9 45%, #f7f1e3 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(27, 27, 27, 0.05) 0px,
    rgba(27, 27, 27, 0.05) 1px,
    transparent 1px,
    transparent 12px
  );
  opacity: 0.2;
  pointer-events: none;
}

.card {
  width: min(520px, 92vw);
  background: var(--card);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 36px 32px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  backdrop-filter: blur(8px);
  animation: float-in 700ms ease-out both;
}

.logo-wrap {
  width: 140px;
  height: 140px;
  border-radius: 38px;
  background: linear-gradient(135deg, rgba(211, 154, 62, 0.2), rgba(58, 141, 143, 0.2));
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 2px rgba(27, 27, 27, 0.1);
  overflow: hidden;
  clip-path: inset(0 round 38px);
}

.logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0.01em;
}

p {
  margin: 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  font-size: 16px;
}

.buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.store-btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0f0f0f;
  color: #fdf6ee;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
  animation: rise 800ms ease-out both;
}

.store-btn.secondary {
  background: #0f0f0f;
  color: #fdf6ee;
  border-color: rgba(255, 255, 255, 0.12);
}

.store-btn.recommended {
  background: linear-gradient(120deg, #0f0f0f 0%, #2d2d2d 100%);
  box-shadow: 0 10px 22px rgba(27, 27, 27, 0.25);
}

.store-btn:hover {
  transform: translateY(-2px);
}

.store-btn .icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 6px;
  clip-path: inset(0 round 6px);
}

.store-btn .icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.status {
  font-size: 14px;
  color: #3b3b3b;
  min-height: 20px;
  text-align: center;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .buttons {
    flex-direction: row;
  }

  .store-btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .store-btn {
    animation: none;
    transition: none;
  }
}

.app-list {
  width: 100%;
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.app-link {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(27, 27, 27, 0.1);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 16px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.app-link span {
  font-size: 12px;
  color: var(--muted);
}

.app-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(27, 27, 27, 0.12);
}

.logo-text {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 24px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #1b1b1b;
}

.release-date {
  margin: 0;
  font-size: 14px;
  color: rgba(27, 27, 27, 0.55);
  letter-spacing: 0.02em;
}

/* ==============================================
   HOME PAGE — DARK MODERN REDESIGN
   body.home scoped — does not affect app pages
   ============================================== */

body.home {
  display: block;
  padding: 0;
  background: #0c0c0f;
  color: #e8e4de;
  font-family: "Inter", "Segoe UI", sans-serif;
}

body.home::before {
  display: none;
}

/* Global overrides for home page */
body.home p {
  text-align: left;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

body.home h1 {
  font-size: clamp(40px, 7vw, 62px);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* --- Animated blob background --- */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.blob-1 {
  width: 700px;
  height: 700px;
  background: rgba(124, 106, 246, 0.17);
  top: -220px;
  left: -160px;
  animation: blob1 18s ease-in-out infinite;
}

.blob-2 {
  width: 520px;
  height: 520px;
  background: rgba(58, 141, 143, 0.14);
  top: 35%;
  right: -120px;
  animation: blob2 15s ease-in-out infinite;
}

.blob-3 {
  width: 460px;
  height: 460px;
  background: rgba(211, 154, 62, 0.12);
  bottom: -80px;
  left: 20%;
  animation: blob3 22s ease-in-out infinite;
}

@keyframes blob1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%       { transform: translate(50px, 70px) scale(1.07); }
  70%       { transform: translate(-20px, 40px) scale(0.95); }
}
@keyframes blob2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  35%       { transform: translate(-60px, -50px) scale(1.09); }
  65%       { transform: translate(30px, 60px) scale(0.96); }
}
@keyframes blob3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(70px, -50px) scale(1.06); }
}

/* --- Cursor spotlight --- */
.spotlight {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    700px circle at var(--sx, 50vw) var(--sy, 30vh),
    rgba(255, 255, 255, 0.036),
    transparent 50%
  );
}

/* --- Layout --- */
.site-main {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  padding: 80px 28px 100px;
}

/* --- Hero --- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  margin-bottom: 72px;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Avatar */
.avatar-wrap {
  position: relative;
  width: 128px;
  height: 128px;
  margin-bottom: 8px;
}

.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 40px;
  background: conic-gradient(from 0deg, #7c6af6, #4ec9cc, #e4bb74, #7c6af6);
  animation: ring-spin 7s linear infinite;
  z-index: 0;
}

.avatar-ring::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: #0c0c0f;
  border-radius: 37px;
}

.avatar {
  position: relative;
  z-index: 1;
  width: 122px;
  height: 122px;
  border-radius: 36px;
  object-fit: cover;
  display: block;
  margin: 3px;
}

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

/* Hero text */
.hero-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232, 228, 222, 0.38);
}

.hero-name {
  margin: 0;
  font-family: "Playfair Display", serif;
  color: #e8e4de;
}

.gradient-text {
  background: linear-gradient(120deg, #a89cf7 0%, #5ecdd0 55%, #e4bb74 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 100%;
  animation: grad-shift 5s ease infinite;
}

@keyframes grad-shift {
  0%, 100% { background-position: 0% center; }
  50%       { background-position: 100% center; }
}

.hero-divider {
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 228, 222, 0.18), transparent);
  margin: 4px 0;
}

.hero-bio {
  margin: 0;
  max-width: 440px;
  color: rgba(232, 228, 222, 0.48);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 300;
  text-align: center;
}

/* --- Section label --- */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232, 228, 222, 0.28);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(232, 228, 222, 0.07);
}

/* --- Projects grid --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* --- Project card --- */
.proj-card {
  display: block;
  text-decoration: none;
  color: #e8e4de;
  position: relative;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
  /* Reveal state */
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.proj-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.proj-card:nth-child(1) { transition-delay: 0.06s; }
.proj-card:nth-child(2) { transition-delay: 0.16s; }
.proj-card:nth-child(3) { transition-delay: 0.26s; }

.proj-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Accent top line (uses --accent CSS variable) */
.card-top-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 4;
  background: linear-gradient(90deg, var(--accent, #888), transparent);
  opacity: 0.45;
  transition: opacity 0.3s ease;
}

.proj-card:hover .card-top-line {
  opacity: 1;
}

/* Mouse-tracking glow */
.card-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  border-radius: inherit;
  transition: opacity 0.3s ease;
}

/* Shimmer sweep */
.proj-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.055) 50%,
    transparent 70%
  );
  transform: translateX(-100%) skewX(-10deg);
  z-index: 2;
  pointer-events: none;
  transition: transform 0.65s ease;
}

.proj-card:hover::before {
  transform: translateX(120%) skewX(-10deg);
}

/* Card content */
.card-inner {
  position: relative;
  z-index: 3;
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.app-icon-wrap {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
}

.app-icon {
  width: 62px;
  height: 62px;
  border-radius: 15px;
  object-fit: cover;
  display: block;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.proj-card:hover .app-icon {
  transform: scale(1.08) rotate(2deg);
}

.year-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(232, 228, 222, 0.38);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 5px 11px;
  border-radius: 100px;
  flex-shrink: 0;
}

.card-body {
  flex: 1;
}

.app-name {
  margin: 0 0 9px;
  font-family: "Playfair Display", serif;
  font-size: 21px;
  font-weight: 700;
  color: #e8e4de;
  line-height: 1.2;
}

.app-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: rgba(232, 228, 222, 0.48);
  font-weight: 300;
}

.app-downloads {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(232, 228, 222, 0.45);
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 3px 10px;
  margin-top: 8px;
  width: fit-content;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.store-tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid;
}

.store-tag.ios {
  color: rgba(232, 228, 222, 0.6);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.store-tag.android {
  color: rgba(100, 213, 130, 0.85);
  background: rgba(100, 213, 130, 0.1);
  border-color: rgba(100, 213, 130, 0.2);
}

.card-arrow {
  margin-left: auto;
  font-size: 17px;
  color: rgba(232, 228, 222, 0.22);
  transition: transform 0.25s ease, color 0.25s ease;
  line-height: 1;
}

.proj-card:hover .card-arrow {
  transform: translateX(5px);
  color: rgba(232, 228, 222, 0.65);
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  body.home .hero,
  body.home .proj-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  body.home .avatar-ring { animation: none; }
  body.home .blob         { animation: none; }
  body.home .gradient-text { animation: none; }
}

/* --- Responsive --- */
@media (max-width: 500px) {
  .site-main    { padding: 52px 16px 72px; }
  .hero         { margin-bottom: 52px; }
  .hero-name    { font-size: 36px; }
  .projects-grid { grid-template-columns: 1fr; }
}

/* ==============================================
   APP DETAIL PAGE — DARK MODERN REDESIGN
   body.app-page scoped — consistent with home
   Uses --ar, --ag, --ab for per-app accent RGB
   ============================================== */

body.app-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 72px 20px 48px;
  background: #0c0c0f;
  color: #e8e4de;
  font-family: "Inter", "Segoe UI", sans-serif;
}

body.app-page::before {
  display: none;
}

/* Accent blobs (inherit --ar/--ag/--ab from body inline style) */
.app-blob-1 {
  background: rgba(var(--ar, 124), var(--ag, 106), var(--ab, 246), 1);
  opacity: 0.13;
  width: 560px;
  height: 560px;
  top: -180px;
  left: -150px;
  animation: blob1 22s ease-in-out infinite;
}

.app-blob-2 {
  background: rgba(var(--ar, 124), var(--ag, 106), var(--ab, 246), 1);
  opacity: 0.07;
  width: 360px;
  height: 360px;
  bottom: -100px;
  right: -80px;
  animation: blob3 28s ease-in-out infinite;
}

/* Back navigation */
.back-link {
  position: fixed;
  top: 22px;
  left: 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(232, 228, 222, 0.42);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  padding: 7px 14px 7px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.back-link:hover {
  color: rgba(232, 228, 222, 0.88);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

/* Dark card */
body.app-page .card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Logo wrap — accent glow using rgb vars */
body.app-page .logo-wrap {
  clip-path: none;
  background: rgba(var(--ar, 124), var(--ag, 106), var(--ab, 246), 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 48px rgba(var(--ar, 124), var(--ag, 106), var(--ab, 246), 0.22);
}

/* Text overrides */
body.app-page h1 {
  color: #e8e4de;
  font-family: "Playfair Display", serif;
}

body.app-page p {
  color: rgba(232, 228, 222, 0.55);
  text-align: center;
}

body.app-page .release-date {
  color: rgba(232, 228, 222, 0.4);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 12px;
  letter-spacing: 0.07em;
  font-weight: 500;
}

body.app-page .download-stat {
  color: rgba(232, 228, 222, 0.4);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 12px;
  letter-spacing: 0.07em;
  font-weight: 500;
}

body.app-page .status {
  color: rgba(232, 228, 222, 0.4);
}

/* Store buttons — glassmorphism */
body.app-page .store-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e8e4de;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.app-page .store-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

body.app-page .store-btn.recommended {
  background: rgba(var(--ar, 124), var(--ag, 106), var(--ab, 246), 0.18);
  border-color: rgba(var(--ar, 124), var(--ag, 106), var(--ab, 246), 0.45);
  box-shadow: 0 8px 24px rgba(var(--ar, 124), var(--ag, 106), var(--ab, 246), 0.2);
}

body.app-page .store-btn.recommended:hover {
  background: rgba(var(--ar, 124), var(--ag, 106), var(--ab, 246), 0.26);
  border-color: rgba(var(--ar, 124), var(--ag, 106), var(--ab, 246), 0.6);
  box-shadow: 0 12px 32px rgba(var(--ar, 124), var(--ag, 106), var(--ab, 246), 0.3);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .app-blob-1,
  .app-blob-2 { animation: none; }
}
