/* ===========================
   Eclipse Links — Style Sheet
   Mobile-first QR Landing Page
   =========================== */

:root {
  /* Color palette */
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-card: #16163a;
  --bg-card-hover: #1e1e4a;
  --accent: #6c5ce7;
  --accent-glow: rgba(108, 92, 231, 0.2);
  --text-primary: #f0f0f5;
  --text-secondary: #9999b8;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.12);

  /* Platform brand colours */
  --facebook: #1877f2;
  --instagram: #e4405f;
  --tiktok: #ff0050;
  --website: #6c5ce7;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Radii */
  --radius-md: 14px;
  --radius-lg: 18px;

  /* Transitions */
  --transition-base: 200ms ease;
}

/* ===========================
   Reset & Base
   =========================== */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  min-width: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* Safe-area aware outer padding for notched phones */
body {
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

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

img {
  max-width: 100%;
  display: block;
}

/* ===========================
   Page Layout — Mobile First
   =========================== */

.page {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vh, 26px);
  padding: clamp(18px, 4vh, 32px) clamp(16px, 4vw, 24px) clamp(20px, 3vh, 28px);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  box-sizing: border-box;
}

/* Short viewports (iPhone SE, landscape, split-screen): anchor to top
   so logo/header never gets cropped by vertical centering */
@media (max-height: 700px) {
  body {
    align-items: flex-start;
  }
  .page {
    justify-content: flex-start;
    padding-top: max(16px, env(safe-area-inset-top));
    min-height: auto;
  }
}

@media (min-height: 701px) and (max-height: 800px) {
  .page {
    gap: 20px;
    padding-top: clamp(16px, 3vh, 24px);
  }
}

/* ===========================
   Hero / Header — Brand Header
   =========================== */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  width: 100%;
}

/* Logo — deliberately centered brand mark */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  /* breathing room from top: subtle but intentional */
  padding-top: 2px;
}

.logo-image {
  /* Responsive, preserves aspect-ratio, never stretched/cropped */
  width: clamp(68px, 18vw, 96px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
  /* subtle elevation so white logo reads on dark bg */
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
  display: block;
  /* prevent layout shift */
  flex-shrink: 0;
}

.logo-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: clamp(68px, 18vw, 96px);
  height: clamp(68px, 18vw, 96px);
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* Typography hierarchy */
.heading {
  font-size: clamp(1.55rem, 5.8vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
  /* gradient kept subtle, fallback solid color for accessibility */
  background: linear-gradient(135deg, var(--text-primary) 0%, #a99cff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: var(--text-primary);
  max-width: 16ch;
  margin: 0 auto;
}

.subheading {
  font-size: clamp(0.875rem, 3.6vw, 0.9375rem);
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.4;
  max-width: 28ch;
  margin: 0 auto;
  text-wrap: balance;
}

/* ===========================
   Link Buttons — Touch-First
   =========================== */

.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: stretch;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

/* Remove Firefox inner focus */
.link-btn::-moz-focus-inner {
  border: 0;
}

.link-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.link-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.link-btn:active {
  transform: scale(0.985);
}

/* Platform accents — left border glow instead of heavy shadows */
.link-btn--facebook {
  border-left: 3px solid transparent;
}
.link-btn--facebook:hover,
.link-btn--facebook:focus-visible {
  border-left-color: var(--facebook);
  box-shadow: 0 6px 20px rgba(24, 119, 242, 0.15);
}

.link-btn--instagram:hover,
.link-btn--instagram:focus-visible {
  border-left: 3px solid var(--instagram);
  box-shadow: 0 6px 20px rgba(228, 64, 95, 0.15);
}

.link-btn--tiktok:hover,
.link-btn--tiktok:focus-visible {
  border-left: 3px solid var(--tiktok);
  box-shadow: 0 6px 20px rgba(255, 0, 80, 0.15);
}

.link-btn--website:hover,
.link-btn--website:focus-visible {
  border-left: 3px solid var(--website);
  box-shadow: 0 6px 20px var(--accent-glow);
}

/* Icon — fixed size, never shrinks oddly */
.link-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: currentColor;
  display: block;
}

.link-btn--facebook .link-icon { color: var(--facebook); }
.link-btn--instagram .link-icon { color: var(--instagram); }
.link-btn--tiktok .link-icon { color: var(--tiktok); }
.link-btn--website .link-icon { color: var(--website); }

/* Label — readable without zoom, flexes */
.link-label {
  font-size: clamp(0.9375rem, 3.8vw, 1.0625rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================
   Footer
   =========================== */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 4px;
}

.footer-divider {
  width: 36px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 1px;
  opacity: 0.9;
}

.footer-text {
  font-size: 0.68rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

/* ===========================
   Responsive Scaling — Tablets / Desktop
   =========================== */

/* Larger phones: 390–430px — slightly more breathing room, but clamp already handles */
@media (min-width: 390px) {
  .links {
    gap: 13px;
  }
  .link-btn {
    min-height: 58px;
    padding-inline: 20px;
  }
}

/* Tablets (≥480px) */
@media (min-width: 480px) {
  .page {
    max-width: 480px;
    padding: 32px 24px 28px;
    gap: 24px;
  }

  .logo-image,
  .logo-fallback {
    width: 88px;
    height: 88px;
  }
  .logo-image {
    width: 88px;
  }

  .heading {
    font-size: 2rem;
  }

  .link-btn {
    min-height: 60px;
    border-radius: 16px;
  }
}

/* Desktop (≥769px) — centered card feel, not oversized */
@media (min-width: 769px) {
  .page {
    max-width: 500px;
    padding: 40px 32px 32px;
    gap: 28px;
  }

  .logo-image,
  .logo-fallback {
    width: 96px;
    height: 96px;
  }
  .logo-image {
    width: 96px;
  }

  .heading {
    font-size: 2.1rem;
  }

  .subheading {
    font-size: 0.975rem;
  }

  .link-btn {
    min-height: 62px;
    padding: 16px 22px;
  }

  .link-btn:hover {
    transform: translateY(-1px);
  }
  .link-btn:active {
    transform: translateY(0) scale(0.988);
  }
}

/* Very narrow (320px) — tighten to avoid overflow */
@media (max-width: 340px) {
  .page {
    padding-left: 14px;
    padding-right: 14px;
  }
  .link-btn {
    padding: 12px 14px;
    gap: 12px;
    min-height: 54px;
  }
  .link-icon {
    width: 20px;
    height: 20px;
  }
  .heading {
    font-size: 1.5rem;
  }
}

/* ===========================
   Reduced Motion & Accessibility
   =========================== */

/* Subtle entrance only — no stagger, no bounce, respects preference */
@media (prefers-reduced-motion: no-preference) {
  .hero {
    animation: fadeIn 320ms ease both;
  }
  .links {
    animation: fadeIn 360ms ease 80ms both;
  }
  .footer {
    animation: fadeIn 360ms ease 140ms both;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast focus */
@media (forced-colors: active) {
  .link-btn {
    border: 1px solid CanvasText;
  }
}

/* Prevent horizontal scroll at any width */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}
