/* Shared public surfaces: Info landing + Login (no app chrome).
   Cool, light palette that sits with Microsoft branding — not gold-on-dark. */

@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;1,400&display=swap");

*, *::before, *::after { box-sizing: border-box; }

:root {
  --pub-bg0: #eef2f7;
  --pub-bg1: #f8fafc;
  --pub-ink: #0f172a;
  --pub-ink-soft: #334155;
  --pub-muted: #64748b;
  --pub-line: #cbd5e1;
  --pub-accent: #0284c7;
  --pub-accent-hover: #0369a1;
  --pub-accent-soft: rgba(2, 132, 199, 0.12);
  --pub-surface: rgba(255, 255, 255, 0.78);
  --pub-surface-solid: #ffffff;
  --pub-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --pub-font-display: "Outfit", "Segoe UI", sans-serif;
  --pub-font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --pub-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--pub-bg1);
  color: var(--pub-ink);
  font-family: var(--pub-font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pub-accent); }
a:hover { color: var(--pub-accent-hover); }

/* ---- Atmosphere shell ---- */
.pub-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 55% at 12% -10%, rgba(14, 165, 233, 0.16), transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 8%, rgba(100, 116, 139, 0.14), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(2, 132, 199, 0.08), transparent 55%),
    linear-gradient(165deg, var(--pub-bg0) 0%, var(--pub-bg1) 48%, #e8eef6 100%);
}

.pub-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}

.pub-shell > * { position: relative; z-index: 1; }

/* ---- Top bar (login link only — not app nav) ---- */
.pub-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem 0;
  max-width: 1120px;
  margin: 0 auto;
}

.pub-top-brand {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--pub-ink);
  text-decoration: none;
  font-family: var(--pub-font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.pub-top-brand .pub-mark { width: 1.35rem; height: 1.35rem; }

.pub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--pub-font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s var(--pub-ease), border-color 0.2s var(--pub-ease),
    color 0.2s var(--pub-ease), box-shadow 0.2s var(--pub-ease);
}

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

.pub-btn-primary {
  background: var(--pub-accent);
  color: #fff;
  padding: 0.7rem 1.25rem;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.22);
}

.pub-btn-primary:hover {
  background: var(--pub-accent-hover);
  color: #fff;
}

.pub-btn-ghost {
  background: transparent;
  color: var(--pub-ink-soft);
  border-color: var(--pub-line);
  padding: 0.55rem 1rem;
}

.pub-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--pub-ink);
  border-color: #94a3b8;
}

.pub-btn-block { width: 100%; }

/* ---- Diamond mark ---- */
.pub-mark {
  display: inline-block;
  color: var(--pub-accent);
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transform-origin: center center;
}

.pub-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---- Info landing hero ---- */
.pub-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4.5rem) 1.5rem clamp(3rem, 8vh, 5rem);
  min-height: calc(100vh - 4rem);
  box-sizing: border-box;
}

.pub-hero-copy {
  max-width: 34rem;
  animation: pub-rise 0.85s var(--pub-ease) both;
}

.pub-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.35rem;
  font-family: var(--pub-font-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 3.2vw, 2.45rem);
  letter-spacing: -0.02em;
  color: var(--pub-ink);
  line-height: 1.1;
}

.pub-brand .pub-mark {
  width: clamp(2rem, 3.2vw, 2.6rem);
  height: clamp(2rem, 3.2vw, 2.6rem);
}

.pub-hero h1 {
  margin: 0 0 0.85rem;
  font-family: var(--pub-font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--pub-ink-soft);
}

.pub-hero-lede {
  margin: 0 0 1.75rem;
  font-size: 1.08rem;
  color: var(--pub-muted);
  max-width: 32rem;
}

.pub-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.pub-hero-visual {
  display: grid;
  place-items: center;
  animation: pub-fade 1.1s var(--pub-ease) 0.15s both;
}

.pub-hero-orb {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  /* Cursor-follow hue defaults; JS updates --hue-x / --hue-y inside the orb */
  --hue-x: 35%;
  --hue-y: 30%;
}

.pub-hero-orb::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at var(--hue-x) var(--hue-y), rgba(255, 255, 255, 0.92), transparent 52%),
    radial-gradient(circle at var(--hue-x) var(--hue-y), rgba(14, 165, 233, 0.32), transparent 48%),
    radial-gradient(circle at calc(100% - var(--hue-x)) calc(100% - var(--hue-y)), rgba(2, 132, 199, 0.14), transparent 55%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(226, 232, 240, 0.35));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--pub-shadow);
  animation: pub-breathe 7s ease-in-out infinite;
  transition: background 0.12s linear;
}

.pub-hero-diamond {
  position: relative;
  width: 46%;
  color: var(--pub-accent);
  filter: drop-shadow(0 12px 28px rgba(2, 132, 199, 0.25));
  animation: pub-float 6.5s ease-in-out infinite;
  cursor: pointer;
  transform-origin: center center;
}

.pub-hero-diamond svg { width: 100%; height: auto; display: block; }

/* Public logo easter egg (10 clicks / 10s): spin → flash → sparkles */
@keyframes pub-egg-spin {
  0% { transform: rotate(0) scale(1); }
  70% { transform: rotate(1080deg) scale(1.18); }
  100% { transform: rotate(1440deg) scale(1); }
}
@keyframes pub-egg-flash {
  0% { transform: scale(1); filter: brightness(1); }
  25% { transform: scale(1.3); filter: brightness(3.2) drop-shadow(0 0 18px var(--pub-accent)); }
  55% { transform: scale(0.92); filter: brightness(1.4); }
  100% { transform: scale(1); filter: brightness(1); }
}
.pub-mark.egg-spin,
.pub-hero-diamond.egg-spin {
  animation: pub-egg-spin 1.2s cubic-bezier(0.45, 0.05, 0.3, 1) both;
}
.pub-mark.egg-flash,
.pub-hero-diamond.egg-flash {
  animation: pub-egg-flash 0.6s ease-out both;
}
.pub-egg-sparkles {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 5;
}
.pub-egg-sparkle {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  margin: -4px;
  border-radius: 50%;
  background: var(--pub-accent);
  box-shadow: 0 0 7px 2px color-mix(in srgb, var(--pub-accent) 70%, transparent);
  animation: pub-egg-sparkle-fly 0.9s ease-out forwards;
}
.pub-egg-sparkle:nth-child(3n) {
  background: color-mix(in srgb, var(--pub-accent) 72%, white 28%);
}
.pub-egg-sparkle:nth-child(3n + 1) {
  background: color-mix(in srgb, var(--pub-accent) 35%, white 65%);
}
@keyframes pub-egg-sparkle-fly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.2); opacity: 0; }
}

/* ---- Below-fold sections ---- */
.pub-sections {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem 4.5rem;
  display: grid;
  gap: 3.25rem;
}

.pub-section {
  max-width: 40rem;
  animation: pub-rise 0.7s var(--pub-ease) both;
}

.pub-section:nth-child(2) { animation-delay: 0.05s; }
.pub-section:nth-child(3) { animation-delay: 0.1s; }

.pub-section h2 {
  margin: 0 0 0.55rem;
  font-family: var(--pub-font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--pub-ink);
}

.pub-section p {
  margin: 0;
  color: var(--pub-muted);
  font-size: 1.02rem;
}

.pub-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  color: var(--pub-muted);
  font-size: 0.88rem;
}

/* ---- Login surface ---- */
.pub-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.pub-login-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(400px, 100%);
  max-width: 100%;
  box-sizing: border-box;
  background: var(--pub-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  padding: 2rem 1.65rem 1.75rem;
  box-shadow: var(--pub-shadow);
  text-align: center;
  overflow: hidden;
  animation: pub-rise 0.7s var(--pub-ease) both;
}

.pub-login-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
  font-family: var(--pub-font-display);
  font-weight: 650;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--pub-ink);
  text-decoration: none;
}

.pub-login-brand .pub-mark { width: 1.5rem; height: 1.5rem; }

.pub-login-card h1 {
  margin: 0 0 0.4rem;
  font-family: var(--pub-font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--pub-ink);
  line-height: 1.25;
}

.pub-login-card > p,
.pub-login-blurb {
  margin: 0 0 1.35rem;
  color: var(--pub-muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.pub-login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  margin-bottom: 0.85rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.pub-login-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--pub-ink-soft);
}

.pub-login-form input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--pub-line);
  background: var(--pub-surface-solid);
  color: var(--pub-ink);
  font-family: var(--pub-font-body);
  font-size: 1rem;
}

.pub-login-form input:focus {
  outline: 2px solid var(--pub-accent-soft);
  border-color: var(--pub-accent);
}

.pub-login-card #ssoBlock {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.pub-login-card a.pub-btn-ms,
.pub-login-card .pub-btn.pub-btn-ms {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  background: var(--pub-surface-solid);
  color: #1f2937;
  border: 1px solid #c5cdd8;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-family: var(--pub-font-body);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pub-login-card .pub-btn-ms svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.pub-login-card .pub-btn-ms:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.pub-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--pub-muted);
  font-size: 0.8rem;
}

.pub-divider::before,
.pub-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--pub-line);
}

.pub-error {
  margin-top: 1rem;
  color: #b91c1c;
  font-size: 0.9rem;
}

.pub-login-back {
  display: inline-block;
  align-self: center;
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--pub-muted);
  text-decoration: none;
}

.pub-login-back:hover { color: var(--pub-accent); }

.hidden { display: none !important; }

@keyframes pub-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pub-fade {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pub-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pub-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.03); opacity: 0.92; }
}

@media (max-width: 820px) {
  .pub-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    min-height: auto;
    padding-top: 1.75rem;
    text-align: center;
  }
  .pub-hero-copy {
    max-width: none;
    margin: 0 auto;
  }
  .pub-brand { justify-content: center; }
  .pub-hero-lede { margin-left: auto; margin-right: auto; }
  .pub-hero-actions { justify-content: center; }
  .pub-hero-orb { width: min(100%, 280px); }
  .pub-section { max-width: none; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .pub-hero-copy,
  .pub-hero-visual,
  .pub-section,
  .pub-login-card,
  .pub-hero-diamond,
  .pub-hero-orb::before {
    animation: none !important;
  }
  .pub-hero-orb::before {
    transition: none;
  }
  .pub-mark.egg-spin,
  .pub-hero-diamond.egg-spin {
    animation: pub-egg-flash 0.25s ease-out both;
  }
  .pub-egg-sparkle { animation-duration: 0.4s; }
}
