/* ==========================================================================
   FIRSTSAVEPOINT • APPLE DARK MODE DESIGN SYSTEM
   Ultra-refined, fluid responsive typography, mobile-first optimization
   ========================================================================== */

:root {
  --bg: #000000;
  --bg-secondary: #0d0d0f;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.065);
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-border-hover: rgba(255, 255, 255, 0.2);
  
  --text-primary: #ffffff;
  --text-secondary: #94949b;
  --text-tertiary: #6e6e73;
  
  --apple-blue: #2997ff;
  --apple-blue-hover: #0077ed;
  --apple-green: #30d158;
  --apple-purple: #bf5af2;
  --apple-orange: #ff9f0a;

  --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', Menlo, Monaco, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-system);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

/* 3D WebGL Background Canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* NAVBAR (Responsive & Clean) */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem clamp(1rem, 3.5vw, 3rem);
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  position: relative;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-title {
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
}

.brand-title span {
  color: var(--text-secondary);
  font-weight: 400;
}

.server-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--surface-border);
  padding: 5px 12px;
  border-radius: 980px;
  font-size: clamp(0.7rem, 2vw, 0.75rem);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--apple-green);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(48, 209, 88, 0.4);
}

/* WIDE CONTAINER */
.hub-container {
  max-width: 1620px;
  width: 94%;
  margin: 0 auto;
  padding: 2rem 1rem 5rem;
  flex: 1;
  position: relative;
  z-index: 10;
}

/* HERO SECTION (Fluid Mobile Typography) */
.hero-section {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  position: relative;
  z-index: 20;
  padding: 0 0.5rem;
}

.hero-tag {
  display: inline-block;
  font-size: clamp(0.68rem, 1.8vw, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--apple-blue);
  margin-bottom: 0.65rem;
}

.hero-headline {
  font-size: clamp(2rem, 6.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.85rem;
  color: #ffffff !important;
  position: relative;
  z-index: 20;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.hero-desc {
  font-size: clamp(0.88rem, 2.5vw, 1.12rem);
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.55;
  font-weight: 400;
}

/* METRICS ROW (Fluid wrap) */
.metrics-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 2rem);
  margin-bottom: clamp(2rem, 4vw, 3rem);
  flex-wrap: wrap;
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(0.75rem, 2vw, 0.82rem);
  color: var(--text-secondary);
  white-space: nowrap;
}

.metric-item strong {
  color: #ffffff;
  font-weight: 600;
}

.metric-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
}

/* APPS SECTION */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: clamp(1.15rem, 3vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
}

/* RESPONSIVE GRID (Auto fills smoothly on all screen sizes) */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

/* APPLE FROSTED GLASS CARD */
.app-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
  position: relative;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.app-card:hover {
  background: var(--surface-hover);
  border-color: var(--surface-border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.app-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

/* Squircle App Icons */
.app-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.icon-face {
  background: linear-gradient(135deg, rgba(41, 151, 255, 0.15), rgba(41, 151, 255, 0.05));
  border-color: rgba(41, 151, 255, 0.25);
}

.icon-stick {
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.15), rgba(48, 209, 88, 0.05));
  border-color: rgba(48, 209, 88, 0.25);
}

.icon-dex {
  background: linear-gradient(135deg, rgba(191, 90, 242, 0.15), rgba(191, 90, 242, 0.05));
  border-color: rgba(191, 90, 242, 0.25);
}

.icon-flow {
  background: linear-gradient(135deg, rgba(255, 159, 10, 0.15), rgba(255, 159, 10, 0.05));
  border-color: rgba(255, 159, 10, 0.25);
}

.app-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
  white-space: nowrap;
}

.app-name {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
  color: #ffffff;
}

.app-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.app-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 1.5rem;
}

.app-tech-tags span {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.app-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 8px;
}

.app-subdomain-lbl {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* BUTTONS */
.btn-apple-primary {
  background: #ffffff;
  color: #000000;
  padding: 7px 14px;
  border-radius: 980px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap !important;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-apple-primary:hover {
  background: #f0f0f2;
  transform: scale(1.03);
}

.btn-apple-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 980px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--surface-border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-apple-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* UPCOMING CARD */
.upcoming-card {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.015);
}

.upcoming-card:hover {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.2);
}

/* APPLE PASSCODE / PIN MODAL */
.pin-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(35px);
  -webkit-backdrop-filter: blur(35px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1rem;
}

.pin-modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.pin-modal-card {
  background: rgba(28, 28, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  padding: 2.5rem 1.75rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  animation: applePop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes applePop {
  0% { transform: scale(0.94); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.pin-lock-glyph {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.pin-modal-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #ffffff;
}

.pin-modal-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 1.75rem;
}

.pin-input-group {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.pin-input-field {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 10px 14px;
  color: #fff;
  font-family: var(--font-system);
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: 3px;
  width: 150px;
  outline: none;
  transition: all 0.2s ease;
}

.pin-input-field:focus {
  border-color: var(--apple-blue);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.15);
}

.pin-error {
  color: #ff453a;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 12px;
  display: none;
}

/* 100% STEALTH EASTER EGG LINK (ON '7') */
.secret-easter-link {
  color: inherit !important;
  text-decoration: none !important;
  cursor: inherit !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-weight: inherit !important;
}

.secret-easter-link:hover,
.secret-easter-link:active,
.secret-easter-link:focus {
  color: inherit !important;
  text-decoration: none !important;
  cursor: inherit !important;
  background: transparent !important;
  outline: none !important;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 3rem 1.5rem;
  border: none;
  color: var(--text-tertiary);
  font-size: clamp(0.75rem, 2vw, 0.82rem);
  position: relative;
  z-index: 10;
}

/* MOBILE MEDIA QUERIES */
@media (max-width: 768px) {
  .hub-container {
    width: 100%;
    padding: 1.5rem 1rem 4rem;
  }
  
  .apps-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .app-card {
    padding: 1.4rem 1.25rem;
    border-radius: 18px;
  }

  .metrics-bar {
    gap: 0.6rem 1rem;
  }
}
