/* ==========================================================================
   Malay Glen — v2 minimal landing card
   True-black, cyan brand accent. Single-screen prestige card + /client/ stub.
   ========================================================================== */

:root {
  --bg: #08090C; /* matches the logo PNG's baked-in near-black (8,10,12), avoids a visible box edge around the logo */
  --cyan: #12E0ED;
  --cyan-glow: rgba(18, 224, 237, 0.35);
  --text: #F1F5F9;
  --text-muted: #9AA4AE;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Reset ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; }

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Skip link ---------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 100;
  background: var(--cyan);
  color: #000;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 12px;
}

/* Focus rings --------------------------------------------------------------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Landing card (index.html)
   ========================================================================== */

.landing {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

/* "Client" link — tucked in the top-right corner, whisper-quiet */
.landing-client {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  padding: 16px 18px;
  margin: -16px -18px 0 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.landing-client:hover {
  color: var(--cyan);
}

.landing-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 560px;
  width: 100%;
}

/* Logo + breathing glow ---------------------------------------------------- */
.landing-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.landing-glow {
  position: absolute;
  width: min(560px, 90vw);
  height: min(420px, 68vw);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  background: radial-gradient(circle, var(--cyan-glow) 0%, rgba(18, 224, 237, 0.14) 42%, rgba(18, 224, 237, 0) 72%);
  filter: blur(6px);
  opacity: 0.75;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
  animation: breathe 4.5s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes breathe {
  0%, 100% { opacity: 0.30; transform: translate(-50%, -50%) scale(0.82); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.15); }
}

.landing-logo-wrap {
  position: relative;
  z-index: 1;
  width: min(440px, 78vw);
}

.landing-logo {
  display: block;
  width: 100%;
  height: auto;
  /* The source PNG is a fully opaque raster (no alpha) with a near-black
     background baked in. `screen` blending makes its near-black pixels
     resolve to whatever is behind them (page bg / glow) instead of
     painting a visible rectangle, so the mark reads as if it were
     transparent while the bright cyan strokes stay unaffected. */
  mix-blend-mode: screen;
}

/* Specular sheen — a soft diagonal light band that travels through the
   glyph strokes only. The logo PNG has no real transparency (alpha is
   always 255) and `mask-mode: luminance` on a raster mask-image is
   unreliable across browsers (Chromium/WebKit fall back to alpha, which
   is opaque everywhere and would let the band bleed across the whole
   rectangle). Instead we ship a dedicated alpha mask asset
   (mg-logo-mask.png) whose alpha channel is derived from the source
   PNG's luminance — background near-0, glyph strokes near-255 — and
   mask against that using the universally-supported default alpha mode,
   so the highlight can only ever render inside the letterforms. */
.landing-logo-sheen {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  -webkit-mask-image: url(mg-logo-mask.png);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url(mg-logo-mask.png);
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
  mask-position: center;
  background-image: linear-gradient(115deg,
    transparent 0%,
    transparent 42%,
    rgba(236, 253, 255, 0.32) 48%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(236, 253, 255, 0.32) 52%,
    transparent 58%,
    transparent 100%);
  background-size: 320% 320%;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  animation: logo-sheen 7s ease-in-out infinite;
  will-change: background-position;
}

@keyframes logo-sheen {
  0%   { background-position: 190% -40%; }
  22%  { background-position: -90% 60%; }
  100% { background-position: -90% 60%; }
}

/* Tagline / referral / footer ---------------------------------------------- */
.landing-tagline {
  margin: 36px 0 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.landing-referral {
  margin: 14px 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.7;
}

.landing-footer {
  margin: 40px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.landing-footer a {
  padding: 15px 4px;
  margin: -15px 0;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.landing-footer a:hover {
  color: var(--cyan);
}

.landing-footer-divider {
  opacity: 0.5;
}

.landing-copyright {
  white-space: nowrap;
}

/* Reduced motion — freeze the glow to a static state, disable the sheen -- */
@media (prefers-reduced-motion: reduce) {
  .landing-glow {
    animation: none;
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1);
  }
  .landing-logo-sheen {
    display: none;
  }
}

/* Small screens ------------------------------------------------------------ */
@media (max-width: 480px) {
  .landing { padding: 40px 16px; }
  .landing-tagline { font-size: 0.6rem; letter-spacing: 0.22em; }
  .landing-referral { font-size: 0.66rem; letter-spacing: 0.16em; }
  .landing-footer { flex-direction: column; gap: 8px; margin-top: 32px; }
  .landing-footer-divider { display: none; }
}

/* ==========================================================================
   Client portal placeholder (client/index.html)
   ========================================================================== */

.portal {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.portal-back-link {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  padding: 16px 18px;
  margin: -16px 0 0 -18px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.portal-back-link:hover {
  color: var(--cyan);
}

.portal-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  padding: 48px 32px;
  border: 1px solid rgba(18, 224, 237, 0.18);
  border-radius: 16px;
  background: rgba(18, 224, 237, 0.03);
}

.portal-logo {
  display: inline-block;
  width: min(160px, 40vw);
  margin: 0 auto 28px;
}
.portal-logo img { width: 100%; height: auto; mix-blend-mode: screen; }

.portal-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}

.portal-card h1 {
  margin: 0 0 28px;
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 20px;
  border: 1px solid rgba(18, 224, 237, 0.35);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: not-allowed;
  opacity: 0.55;
}

.portal-back {
  display: inline-block;
  margin-top: 12px;
  padding: 15px 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.portal-back:hover {
  color: var(--cyan);
}
