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

:root {
  --bg: #E8E6E1;
  --ink: #1a1916;
  --ink-muted: #7a7874;
  --ink-light: #b0ada8;
  --dock-bg: rgba(255, 255, 255, 0.42);
  --dock-border: rgba(255, 255, 255, 0.72);
  --dock-blur: 36px;
  --dock-blur-expanded: 32px;
  --dock-saturate: 180%;
  --tooltip-bg: #1a1916;
  --tooltip-text: #f5f3ef;
  --icon-size: 56px;
  --icon-gap: 12px;
  --cursor-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7' fill='%231a1916'/%3E%3C/svg%3E") 10 10, auto;
  font-size: 16px;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: var(--cursor-dot);
}

/* Cursor-following glow: background subtly responds to cursor position */
.cursor-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    circle 420px at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.14) 0%,
    transparent 65%
  );
  transition: background 0.15s ease-out;
}
/* Keep content above the glow */
.nav,
.hero,
.al-bayaan,
.engage,
.dock-wrapper,
.modal-overlay {
  position: relative;
  z-index: 1;
}

/* Click ripple effect at cursor position */
.click-ripple {
  position: fixed;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  margin-top: -12px;
  border-radius: 50%;
  background: rgba(26, 25, 22, 0.25);
  pointer-events: none;
  z-index: 9999;
  opacity: 1;
  animation: click-ripple 0.5s ease-out forwards;
}
@keyframes click-ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ── Nav ────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.nav-logo {
  height: 24px;
  width: auto;
  display: block;
}

.nav-logo-link {
  display: inline-flex;
  align-items: center;
  transition: opacity 0.2s ease;
}

.nav-logo-link:hover {
  opacity: 0.85;
}

/* ── Hero ───────────────────────────────────────────── */
.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 24px 180px;
}

.hero-content {
  max-width: 680px;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 24px;
}

.hero-headline {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 28px;
}

.hero-headline em {
  font-style: italic;
  color: var(--ink-muted);
}

.easter-text {
  position: relative;
  display: inline-block;
  cursor: crosshair;
  transition: opacity 0.3s;
}

.easter-text:hover {
  opacity: 0.8;
}

/* Arabic swap on hover: crossfade to avoid flicker */
.easter-english {
  transition: opacity 0.2s ease;
}

.easter-arabic {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  font-family: 'Zain', 'Noto Naskh Arabic', 'Amiri', 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  text-align: center;
}

.easter-text:hover .easter-english {
  opacity: 0;
}

.easter-text:hover .easter-arabic {
  opacity: 1;
}

.hero-sub {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink-muted);
  letter-spacing: 0.005em;
}

/* ── 404 page (matches hero + nav; used by 404.html) ─── */
.page-404 .hero-headline {
  font-size: clamp(40px, 6vw, 72px);
}

.page-404 .hero-sub {
  max-width: 28em;
  margin-left: auto;
  margin-right: auto;
}

.page-404-actions {
  margin-top: 2rem;
}

.error-404-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(26, 25, 22, 0.18);
  padding-bottom: 3px;
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.error-404-cta:hover {
  color: var(--ink-muted);
  border-color: rgba(122, 120, 116, 0.45);
}

.error-404-cta-arrow {
  font-size: 1.1em;
  transition: transform 0.2s ease;
}

.error-404-cta:hover .error-404-cta-arrow {
  transform: translateX(3px);
}

/* ── Dock wrapper ───────────────────────────────────── */
.dock-wrapper {
  position: fixed;
  bottom: 28px;
  left: 0;
  width: 100%;
  z-index: 50;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

/* ── Dock bar ───────────────────────────────────────── */
.dock {
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  gap: var(--icon-gap);
  padding: 12px 14px;
  background: var(--dock-bg);
  border: 1px solid var(--dock-border);
  border-radius: 20px;
  backdrop-filter: blur(var(--dock-blur)) saturate(var(--dock-saturate)) contrast(1.05);
  -webkit-backdrop-filter: blur(var(--dock-blur)) saturate(var(--dock-saturate)) contrast(1.05);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.06),
    0 8px 28px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  will-change: transform;
  /* Isolate stacking context so backdrop-filter renders correctly in Safari */
  isolation: isolate;
  transform: translateZ(0);
}

/* ── Individual dock item ───────────────────────────── */
.dock-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  /* transform-origin is bottom center so icon grows upward */
  transform-origin: bottom center;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  list-style: none;
}

/* ── App icon ───────────────────────────────────────── */
.dock-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.18s ease;
  overflow: hidden;
  flex-shrink: 0;
}

@media (hover: hover) {
  .dock-item:hover .dock-icon {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}

.dock-icon svg {
  width: 60%;
  height: 60%;
}

.dock-icon .dock-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Tooltip ────────────────────────────────────────── */
.dock-tooltip {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  border-radius: 10px;
  padding: 9px 13px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 200;
  min-width: 140px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

@media (hover: hover) {
  .dock-item:hover .dock-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.dock-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--tooltip-bg);
}

.tooltip-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
  color: #fff;
}

.tooltip-desc {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

/* ── The Philosophy (second page) ───────────────────── */
.al-bayaan {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 120px;
  text-align: center;
}

.al-bayaan-content {
  max-width: 560px;
}

/* Assalamu Alaikum greeting: English by default, Arabic on hover */
.al-bayaan-salam {
  position: relative;
  display: inline-block;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 24px;
  cursor: default;
}

.al-bayaan-salam-english {
  transition: opacity 0.2s ease;
}

.al-bayaan-salam-arabic {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  font-family: 'Zain', 'Noto Naskh Arabic', 'Amiri', 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  text-align: center;
}

.al-bayaan-salam:hover .al-bayaan-salam-english {
  opacity: 0;
}

.al-bayaan-salam:hover .al-bayaan-salam-arabic {
  opacity: 1;
}

.al-bayaan-headline {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 40px;
}

.al-bayaan-headline-word {
  position: relative;
  cursor: default;
}

.al-bayaan-hover-card {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%) translateY(4px);
  min-width: 200px;
  padding: 12px 16px;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  border-radius: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  text-align: center;
}

.al-bayaan-hover-card::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--tooltip-bg);
}

.al-bayaan-hover-card-arabic {
  display: block;
  font-family: 'Zain', 'Noto Naskh Arabic', 'Amiri', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.al-bayaan-hover-card-meaning {
  display: block;
  font-size: 13px;
  opacity: 0.9;
}

@media (hover: hover) {
  .al-bayaan-headline-word:hover .al-bayaan-hover-card {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.al-bayaan-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

.al-bayaan-body p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  font-weight: 400;
}

.al-bayaan-body p em {
  font-style: italic;
  color: var(--ink-muted);
}

.al-bayaan-signature {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(26, 25, 22, 0.12);
  text-align: right;
}

.al-bayaan-sign-img {
  height: 58px;
  width: auto;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-bottom: 8px;
  /* PNG used as-is: black signature */
}

.al-bayaan-signature-line {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
}

.al-bayaan-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.al-bayaan-role {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.al-bayaan-closing {
  position: relative;
  margin-top: 32px;
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: var(--ink-muted);
  text-align: center;
  max-width: 100%;
  cursor: default;
}

.al-bayaan-closing-arabic {
  font-family: 'Zain', 'Scheherazade New', 'Noto Naskh Arabic', 'Amiri', Georgia, serif;
  direction: rtl;
  transition: opacity 0.2s ease;
}

.al-bayaan-closing-english {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  font-family: 'Inter', system-ui, sans-serif;
  transition: opacity 0.2s ease;
}

.al-bayaan-closing:hover .al-bayaan-closing-arabic {
  opacity: 0;
}

.al-bayaan-closing:hover .al-bayaan-closing-english {
  opacity: 1;
}

/* ── Engage / Contact (last page) ─────────────────────── */
.engage {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 120px;
  background: var(--bg);
}

.engage-inner {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.engage-headline {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 12px;
  text-align: center;
}

.engage-intro {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-muted);
  text-align: center;
  margin-bottom: 48px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.engage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 56px;
}

@media (min-width: 560px) {
  .engage-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

.engage-card {
  display: block;
  padding: 24px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(26, 25, 22, 0.08);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.engage-card:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(26, 25, 22, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.engage-card-email {
  cursor: default;
  pointer-events: auto;
}

.engage-card-email:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(26, 25, 22, 0.08);
  box-shadow: none;
}

.engage-card-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.engage-card-title {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.engage-card-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0;
}

.engage-card-desc a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.engage-card-desc a:hover {
  color: var(--ink-muted);
}

.engage-card-arrow {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 18px;
  color: var(--ink-light);
  transition: transform 0.2s ease, color 0.2s ease;
}

.engage-card:hover .engage-card-arrow {
  transform: translateX(4px);
  color: var(--ink);
}

.engage-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 32px;
  border-top: 1px solid rgba(26, 25, 22, 0.1);
}

.engage-footer-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.engage-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.engage-social-link {
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease;
}

.engage-social-link:hover {
  color: var(--ink-muted);
  background: rgba(26, 25, 22, 0.06);
}

/* ── Modal ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg);
  width: 100%;
  max-width: 480px;
  border-radius: 24px;
  padding: 32px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay[aria-hidden="false"] .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* ── All Apps Modal (wide grid of big icons, web only) ──── */
.all-apps-modal {
  display: none;
}

@media (min-width: 769px) {
  .all-apps-modal {
    display: flex;
  }
}

.all-apps-modal .all-apps-modal-card {
  background: var(--bg);
  width: 100%;
  max-width: 720px;
  border-radius: 28px;
  padding: 0 32px 36px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.06);
  transform: translateY(24px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(26, 25, 22, 0.12) transparent;
}

.all-apps-modal .all-apps-modal-card::-webkit-scrollbar {
  width: 5px;
}

.all-apps-modal .all-apps-modal-card::-webkit-scrollbar-track {
  background: transparent;
}

.all-apps-modal .all-apps-modal-card::-webkit-scrollbar-thumb {
  background: rgba(26, 25, 22, 0.12);
  border-radius: 3px;
}

.all-apps-modal .all-apps-modal-card::-webkit-scrollbar-thumb:hover {
  background: rgba(26, 25, 22, 0.22);
}

.all-apps-modal[aria-hidden="false"] .all-apps-modal-card {
  transform: translateY(0) scale(1);
}

.all-apps-modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 24px;
  margin-bottom: 4px;
  background: var(--bg);
}

.all-apps-modal .all-apps-modal-header .modal-close {
  position: static;
  flex-shrink: 0;
}

.all-apps-modal-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  padding-right: 0;
}

.all-apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 20px;
  list-style: none;
}

.all-apps-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.all-apps-grid-item:hover,
.all-apps-grid-item:active {
  background: rgba(0, 0, 0, 0.06);
  transform: scale(1.02);
}

.all-apps-grid-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.all-apps-grid-icon svg {
  width: 52%;
  height: 52%;
}

.all-apps-grid-icon .dock-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.all-apps-grid-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  line-height: 1.3;
}

.all-apps-grid-desc {
  font-size: 12px;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.35;
  max-width: 140px;
}

.all-apps-grid-status {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.all-apps-grid-status--in-production {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.all-apps-grid-status--pre-release {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

.all-apps-grid-status--building {
  background: rgba(234, 179, 8, 0.2);
  color: #a16207;
}

.all-apps-grid-status--next-quarter {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}

@media (max-width: 640px) {
  .all-apps-modal .all-apps-modal-card {
    max-width: 100%;
    padding: 0 20px 28px;
    border-radius: 24px 24px 0 0;
  }

  .all-apps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 16px;
  }

  .all-apps-grid-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .all-apps-grid-name {
    font-size: 14px;
  }

  .all-apps-grid-desc {
    font-size: 11px;
    max-width: 100%;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-icon svg {
  width: 50%;
  height: 50%;
}

.modal-icon .dock-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.modal-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 4px;
}

.modal-type {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

.modal-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 24px;
}

.modal-details {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 24px;
}

.modal-detail-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
}

.modal-detail-label {
  color: var(--ink-muted);
}

.modal-detail-value {
  font-weight: 500;
  color: var(--ink);
}

.modal-visit {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-visit-link {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.modal-visit-link:hover {
  opacity: 0.75;
}

.modal-detail-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-detail-status--in-production {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.modal-detail-status--pre-release {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

.modal-detail-status--building {
  background: rgba(234, 179, 8, 0.2);
  color: #a16207;
}

.modal-detail-status--next-quarter {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}

/* ── Dock dot indicator (invisible by default, visible after app modal opened) ─── */
.dock-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-light);
  margin-top: 5px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dock-item.dock-item-visited .dock-dot {
  opacity: 1;
}

/* ── Noise overlay for warmth ───────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.03;
  z-index: 999;
}

/* ── All-apps icon (dock-item + dock-icon, shown on web and mobile) ───── */
.dock-item-all-apps .dock-icon,
.dock-icon-all-apps {
  background: var(--ink) !important;
  color: var(--bg);
}

.dock-item-all-apps .dock-icon svg {
  width: 56%;
  height: 56%;
}

.dock-backdrop {
  display: none;
}

/* ── Desktop: closed dock — equal top/bottom spacing; dot can overlap ─── */
@media (min-width: 769px) {
  .dock-wrapper:not(.dock-expanded) .dock .dock-item .dock-dot {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
  }
}

/* ── Desktop: all-apps panel when dock expanded ─────── */
@media (min-width: 769px) {
  .dock-backdrop.dock-backdrop-visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    z-index: 49;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.25s ease, backdrop-filter 0.25s ease;
  }

  .dock-wrapper.dock-expanded {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 50;
    pointer-events: none;
  }

  .dock-wrapper.dock-expanded .dock {
    pointer-events: auto;
    flex: none;
    width: 100%;
    max-width: 440px;
    max-height: min(80vh, 560px);
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    align-content: flex-start;
    justify-content: flex-start;
    gap: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
    -webkit-backdrop-filter: blur(var(--dock-blur-expanded)) saturate(var(--dock-saturate)) contrast(1.05);
    backdrop-filter: blur(var(--dock-blur-expanded)) saturate(var(--dock-saturate)) contrast(1.05);
    scrollbar-width: thin;
    scrollbar-color: rgba(26, 25, 22, 0.12) transparent;
  }

  .dock-wrapper.dock-expanded .dock::-webkit-scrollbar {
    width: 5px;
  }

  .dock-wrapper.dock-expanded .dock::-webkit-scrollbar-track {
    background: transparent;
  }

  .dock-wrapper.dock-expanded .dock::-webkit-scrollbar-thumb {
    background: rgba(26, 25, 22, 0.12);
    border-radius: 3px;
  }

  .dock-wrapper.dock-expanded .dock::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 25, 22, 0.22);
  }

  .dock-wrapper.dock-expanded .dock .dock-item {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    transform: none;
    width: 100%;
    min-height: 72px;
    text-align: left;
    box-sizing: border-box;
  }

  .dock-wrapper.dock-expanded .dock .dock-item:hover,
  .dock-wrapper.dock-expanded .dock .dock-item:active {
    background: rgba(0, 0, 0, 0.06);
  }

  .dock-wrapper.dock-expanded .dock .dock-item .dock-tooltip {
    position: static;
    transform: none;
    opacity: 1;
    background: transparent;
    color: var(--ink);
    padding: 0;
    min-width: 0;
    box-shadow: none;
    text-align: left;
    bottom: auto;
    left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    padding: 2px 0;
  }

  .dock-wrapper.dock-expanded .dock .dock-item .dock-tooltip::after {
    display: none;
  }

  .dock-wrapper.dock-expanded .dock .dock-item .tooltip-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.25;
  }

  .dock-wrapper.dock-expanded .dock .dock-item .tooltip-desc {
    font-size: 14px;
    color: var(--ink-muted);
    line-height: 1.35;
    margin-bottom: 0;
  }

  .dock-wrapper.dock-expanded .dock .dock-item .dock-dot {
    display: none;
  }

  .dock-wrapper.dock-expanded .dock .dock-item .dock-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    order: -1;
  }

  .dock-wrapper.dock-expanded .dock .dock-item-all-apps {
    display: none !important;
  }
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --icon-size: 52px;
    --icon-gap: 14px;
  }

  .nav {
    padding: 24px;
  }

  .hero {
    padding: 80px 20px 120px;
  }

  .engage {
    padding: 80px 20px 100px;
  }

  /* Mobile: show iOS-style dock (expandable vertically) — stronger blur for glass effect */
  .dock-wrapper {
    display: flex;
    bottom: 0;
    padding: 0 16px env(safe-area-inset-bottom, 16px) 16px;
    align-items: flex-end;
    justify-content: center;
    pointer-events: auto;
  }

  .dock-wrapper .dock {
    flex: 1;
    max-width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: var(--icon-gap);
    padding: 14px 16px;
    border-radius: 28px 28px 0 0;
    max-height: 88px;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.32, 0.72, 0, 1),
                border-radius 0.3s ease,
                box-shadow 0.3s ease;
    /* Stronger blur on mobile for iOS-style frosted bar */
    -webkit-backdrop-filter: blur(56px) saturate(200%) contrast(1.06);
    backdrop-filter: blur(56px) saturate(200%) contrast(1.06);
    background: rgba(255, 255, 255, 0.38);
  }

  /* Collapsed: show first 3 app icons + all-apps (hide 4th–8th items only) */
  .dock-wrapper .dock .dock-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .dock-wrapper .dock .dock-item:first-child {
    display: none;
  }

  .dock-wrapper .dock .dock-item:nth-of-type(n+5):not(.dock-item-all-apps) {
    display: none;
  }

  .dock-wrapper:not(.dock-expanded) .dock .dock-item .dock-tooltip {
    display: none;
  }

  .dock-wrapper .dock .dock-icon {
    width: var(--icon-size);
    height: var(--icon-size);
    border-radius: 16px;
  }

  /* Expanded state: full app list vertically — frosted glass panel */
  .dock-wrapper.dock-expanded .dock {
    max-height: min(80vh, 560px);
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    align-content: flex-start;
    justify-content: flex-start;
    gap: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 24px;
    border-radius: 24px 24px 0 0;
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    -webkit-backdrop-filter: blur(40px) saturate(200%) contrast(1.06);
    backdrop-filter: blur(40px) saturate(200%) contrast(1.06);
  }

  .dock-wrapper.dock-expanded .dock .dock-item {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    transform: none;
    width: 100%;
    min-height: 72px;
    text-align: left;
    box-sizing: border-box;
  }

  .dock-wrapper.dock-expanded .dock .dock-item:first-child {
    display: none !important;
  }

  .dock-wrapper.dock-expanded .dock .dock-item:hover {
    background: transparent;
  }
  .dock-wrapper.dock-expanded .dock .dock-item:active {
    background: rgba(0, 0, 0, 0.06);
  }

  .dock-wrapper.dock-expanded .dock .dock-item .dock-tooltip {
    position: static;
    transform: none;
    opacity: 1;
    background: transparent;
    color: var(--ink);
    padding: 0;
    min-width: 0;
    box-shadow: none;
    text-align: left;
    bottom: auto;
    left: auto;
  }

  .dock-wrapper.dock-expanded .dock .dock-item .dock-tooltip::after {
    display: none;
  }

  .dock-wrapper.dock-expanded .dock .dock-item .tooltip-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.25;
  }

  .dock-wrapper.dock-expanded .dock .dock-item .tooltip-desc {
    font-size: 14px;
    color: var(--ink-muted);
    line-height: 1.35;
    margin-bottom: 0;
  }

  .dock-wrapper.dock-expanded .dock .dock-item .dock-dot {
    display: none;
  }

  .dock-wrapper.dock-expanded .dock .dock-item .dock-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    order: -1;
  }

  /* Expanded row: icon left, title + description right */
  .dock-wrapper.dock-expanded .dock .dock-item .dock-tooltip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    padding: 2px 0;
  }

  /* When expanded, hide all-apps item (list shows only app rows) */
  .dock-wrapper.dock-expanded .dock {
    flex-direction: column;
  }

  .dock-wrapper.dock-expanded .dock .dock-item-all-apps {
    display: none !important;
  }

  /* Backdrop when dock is expanded — blurred overlay for depth */
  .dock-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, backdrop-filter 0.25s ease;
  }

  .dock-backdrop.dock-backdrop-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .modal-card {
    padding: 24px;
    border-radius: 20px;
  }

  .modal-title {
    font-size: 20px;
  }
}

/* ── Initial Load Animations ────────────────────────── */
@keyframes revealUp {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes itemPop {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(20px);
  }

  70% {
    opacity: 1;
    transform: scale(1.05) translateY(-2px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.nav {
  opacity: 0;
  animation: revealUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.hero-content {
  opacity: 0;
  animation: revealUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.dock-wrapper {
  opacity: 0;
  animation: revealUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.engage-inner {
  opacity: 0;
  animation: revealUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

.dock-item-anim {
  opacity: 0;
  animation: itemPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}