:root {
  --bg: #07070c;
  --panel: rgba(15, 15, 22, 0.78);
  --panel-2: rgba(255, 255, 255, 0.04);
  --text: rgba(255, 255, 255, 0.95);
  --muted: rgba(255, 255, 255, 0.76);
  --faint: rgba(255, 255, 255, 0.55);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.48);

  --accent: #d8b46a; /* muted gold */
  --accent-2: #ff5ac8;
  --accent-3: #7c5cff;
  --danger: #ff5d5d;

  --menu-overlay: #07070c;
  --menu-item: rgba(255, 255, 255, 0.06);
  --menu-item-hover: rgba(255, 255, 255, 0.09);

  --radius: 16px;
  --radius-sm: 12px;
  --max: 980px;
  --pad: 20px;

  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-serif: ui-serif, "New York", "Iowan Old Style", "Palatino", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: radial-gradient(
      1200px 800px at 20% -10%,
      rgba(216, 180, 106, 0.14),
      transparent 55%
    ),
    radial-gradient(1200px 800px at 80% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    radial-gradient(1000px 700px at 50% 120%, rgba(216, 180, 106, 0.08), transparent 55%),
    var(--bg);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.btn-appstore {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
  color: rgba(12, 12, 18, 0.92);
  padding: 12px 24px;
  border-radius: 99px;
  border: 1px solid rgba(216, 180, 106, 0.28);
  font-weight: 700;
  font-size: 15px;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-decoration: none !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-appstore:hover {
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
  border-color: rgba(216, 180, 106, 0.55);
}

.btn-appstore:focus-visible {
  outline: 3px solid rgba(216, 180, 106, 0.95);
  outline-offset: 4px;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.8);
}

.skip-link:focus {
  left: 12px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(7, 7, 12, 0.72);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: var(--panel-2);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title small {
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.brand-title > span {
  font-family: var(--font-serif);
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-overlay-top {
  display: none;
}

.nav a {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 650;
}

.nav a:hover {
  border-color: var(--border);
  background: var(--panel-2);
  text-decoration: none;
  color: var(--text);
}

.nav a:focus-visible {
  outline: 3px solid rgba(216, 180, 106, 0.95);
  outline-offset: 4px;
  text-decoration: none;
}

.theme-toggle {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: rgba(216, 180, 106, 0.55);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(216, 180, 106, 0.95);
  outline-offset: 4px;
}

.menu-toggle {
  display: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-toggle:hover {
  color: var(--text);
  border-color: rgba(216, 180, 106, 0.55);
  transform: translateY(-1px);
}

.menu-toggle:focus-visible {
  outline: 3px solid rgba(216, 180, 106, 0.95);
  outline-offset: 4px;
}

.menu-toggle[aria-expanded="true"] {
  color: var(--text);
  border-color: rgba(216, 180, 106, 0.55);
  background: rgba(216, 180, 106, 0.1);
}

::selection {
  background: rgba(216, 180, 106, 0.32);
  color: var(--text);
}

.main {
  padding: 34px 0 56px;
}

.hero {
  padding: 40px 0 60px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-family: var(--font-serif);
  font-weight: 650;
}

.hero p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
  max-width: 62ch;
}

.hero-layout {
  display: flex;
  align-items: center;
  gap: 40px;
}

.hero-content {
  flex: 1;
  min-width: 0;
  animation: fadeUp 0.8s ease-out forwards;
  opacity: 0; /* Start hidden for animation */
}

.hero-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-visual {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
}

/* ... existing styles ... */

.phone-mockup {
  /* ... existing properties ... */
  width: 280px;
  height: 560px;
  border: 12px solid #1a1a1a;
  border-radius: 40px;
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  transform: rotateY(-10deg) rotateX(5deg) translateY(20px); /* Initial position for animation */
  transition: transform 0.5s ease;
  animation: phoneEnter 1s ease-out 0.2s forwards; /* Added delay */
  opacity: 0;
}

.phone-mockup::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  z-index: 3;
}

.phone-mockup::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.02) 22%,
    rgba(255, 255, 255, 0) 55%
  );
  pointer-events: none;
  z-index: 2;
}

.hero-visual:hover .phone-mockup {
  transform: rotateY(0) rotateX(0) translateY(0);
}

.screen-content {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1c1c2e, #0b0b12);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

/* Abstract UI Elements - Enhanced */
.ui-header {
  height: 40px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.ui-header::before {
  content: "";
  width: 80px;
  height: 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
}

.ui-header::after {
  content: "";
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.ui-card {
  flex: 1;
  background: linear-gradient(180deg, rgba(216, 180, 106, 0.95) 0%, rgba(16, 16, 22, 0.95) 100%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(216, 180, 106, 0.18);
  position: relative;
  overflow: hidden;
}

/* Mimic Profile Name/Info */
.ui-card::after {
  content: "";
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 120px;
  height: 16px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.ui-card::before {
  content: "";
  position: absolute;
  bottom: 44px;
  left: 20px;
  width: 60px;
  height: 24px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.ui-card.secondary {
  height: 60px;
  flex: none;
  background: #1a1a24;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: none;
  margin-top: -10px;
  z-index: 0;
  opacity: 1;
  transform: scale(0.92);
  transform-origin: bottom center;
}

.ui-card.secondary::after, .ui-card.secondary::before {
  display: none;
}

.ui-nav {
  height: 60px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  margin-top: auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.ui-nav::before, .ui-nav::after {
  content: "";
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

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

@keyframes phoneEnter {
  from {
    opacity: 0;
    transform: rotateY(-10deg) rotateX(5deg) translateY(50px);
  }
  to {
    opacity: 1;
    transform: rotateY(-10deg) rotateX(5deg) translateY(20px);
  }
}


.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.card {
  grid-column: span 6;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.015em;
  font-family: var(--font-serif);
  font-weight: 650;
}

.card h2 span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.callout {
  margin-top: 18px;
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
}

.callout strong {
  color: var(--text);
}

.article {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
  max-width: 860px;
  margin: 0 auto;
}

.article h1 {
  margin: 0 0 8px;
  font-size: 34px;
  letter-spacing: -0.03em;
  font-family: var(--font-serif);
  font-weight: 650;
}

.meta {
  margin: 0 0 18px;
  color: var(--faint);
  font-size: 14px;
}

.article h2 {
  margin: 20px 0 8px;
  font-size: 18px;
  letter-spacing: -0.015em;
  font-family: var(--font-serif);
  font-weight: 650;
}

.article p,
.article li {
  color: var(--muted);
  line-height: 1.65;
}

.article p {
  margin: 10px 0;
}

.article li {
  margin: 6px 0;
}

.article a {
  color: var(--text);
}

.article code {
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font-mono);
  color: var(--text);
  font-size: 0.95em;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 34px;
  color: var(--faint);
}

.footer a {
  color: var(--muted);
}

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

.footer small {
  display: block;
  margin-top: 10px;
  color: var(--faint);
}

body.theme-ivory {
  --bg: #fbf9f4;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-2: rgba(0, 0, 0, 0.04);
  --text: rgba(12, 12, 18, 0.92);
  --muted: rgba(12, 12, 18, 0.68);
  --faint: rgba(12, 12, 18, 0.52);
  --border: rgba(12, 12, 18, 0.14);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.14);
  --menu-overlay: #fbf9f4;
  --menu-item: rgba(12, 12, 18, 0.04);
  --menu-item-hover: rgba(216, 180, 106, 0.14);
  color-scheme: light;

  background: radial-gradient(1200px 800px at 18% -10%, rgba(216, 180, 106, 0.16), transparent 55%),
    radial-gradient(1000px 650px at 85% 0%, rgba(124, 92, 255, 0.06), transparent 60%),
    radial-gradient(1000px 650px at 50% 120%, rgba(0, 0, 0, 0.04), transparent 55%),
    var(--bg);
}

body.theme-ivory .header {
  background: rgba(251, 249, 244, 0.78);
}

body.theme-ivory .btn-appstore {
  background: rgba(12, 12, 18, 0.92);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(12, 12, 18, 0.16);
}

body.theme-ivory .btn-appstore:hover {
  background: rgba(12, 12, 18, 0.98);
  border-color: rgba(216, 180, 106, 0.65);
}

body.theme-ivory .article code {
  background: rgba(0, 0, 0, 0.06);
}

body[data-menu-open="true"] {
  overflow: hidden;
  overscroll-behavior: none;
}

/* Fix: Remove backdrop-filter when menu is open to release nav from stacking context */
body[data-menu-open="true"] .header {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (max-width: 860px) {
  .menu-toggle {
    display: inline-flex;
  }

  .nav {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    padding: calc(16px + env(safe-area-inset-top)) var(--pad)
      calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    background: var(--menu-overlay);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .nav::before,
  .nav::after {
    content: none;
  }

  .nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
    z-index: 9999;
  }

  .nav-overlay-top {
    width: min(560px, 100%);
    display: none;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto 18px;
  }

  .nav[data-open="true"] .nav-overlay-top {
    display: flex;
  }

  .nav-close {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }

  .nav-close:hover {
    transform: translateY(-1px);
    border-color: rgba(216, 180, 106, 0.55);
  }

  .nav-close:focus-visible {
    outline: 3px solid rgba(216, 180, 106, 0.95);
    outline-offset: 4px;
  }

  .nav-overlay-brand {
    font-family: var(--font-serif);
    font-weight: 650;
    letter-spacing: -0.03em;
    font-size: 18px;
  }

  .nav-overlay-top .theme-toggle {
    display: inline-flex;
  }

  .nav a {
    width: min(560px, 100%);
    margin: 0 auto;
    padding: 22px 0;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    text-decoration: none;
    text-transform: none;
    letter-spacing: -0.03em;
    font-size: clamp(40px, 8.5vw, 56px);
    font-weight: 650;
    font-family: var(--font-serif);
    text-align: left;
    box-shadow: none;
  }

  .nav a:hover {
    opacity: 0.82;
    text-decoration: none;
  }

  .nav a:focus-visible {
    outline: 3px solid rgba(216, 180, 106, 0.95);
    outline-offset: 4px;
    text-decoration: none;
  }

  .hero-layout {
    flex-direction: column;
    text-align: center;
    gap: 60px;
  }

  .hero p {
    margin: 12px auto 0;
  }

  .hero-actions {
    justify-content: center;
  }

  .card {
    grid-column: span 12;
  }

  .phone-mockup {
    transform: none;
    animation: none;
    opacity: 1;
  }
}

@media (max-width: 680px) {
  .brand-title small {
    display: none;
  }

  .phone-mockup {
    width: 250px;
    height: 500px;
  }
}

@media (max-width: 560px) {
  :root {
    --pad: 16px;
  }

  .phone-mockup {
    width: 240px;
    height: 480px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-content,
  .phone-mockup {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .btn-appstore {
    transition: none;
  }
}
