/* =========================================================
   UniMate — base.css
   Used on EVERY page.

   Contents:
     1. Design tokens (colours, fonts, sizes)
     2. Reset & page background
     3. Layout & typography helpers
     4. Navbar
     5. Scroll progress bar
     6. Buttons
     7. Scroll-reveal animation
     8. Chips & process steps
     9. Facebook card + chat mockup
    10. Footer & floating Facebook button
    11. Reduced-motion support
   ========================================================= */


/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  /* Colours */
  --bg: #070a12;
  --surface: #0f1626;
  --surface-2: #151e33;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef1f8;
  --muted: #9aa5bf;

  /* Accent colours (each page theme changes these two) */
  --a1: #7c5cff;
  --a2: #22d3ee;
  --grad: linear-gradient(120deg, var(--a1), var(--a2));

  /* Facebook blue */
  --fb: #1877f2;

  /* Fonts */
  --font-head: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Sizes */
  --maxw: 1180px;
  --nav-h: 72px;
  --radius: 22px;
}

/* Page colour themes — set on <body class="theme-..."> */
body.theme-business {
  --a1: #3b82f6;
  --a2: #22d3ee;
}

body.theme-students {
  --a1: #ff9f43;
  --a2: #ff4d8d;
}


/* ---------- 2. RESET & PAGE BACKGROUND ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  animation: pageIn 0.6s ease backwards;
}

/* Soft coloured glow behind the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, color-mix(in srgb, var(--a1) 24%, transparent), transparent 60%),
    radial-gradient(800px 520px at 100% 8%, color-mix(in srgb, var(--a2) 16%, transparent), transparent 60%);
}

/* Fade out just before opening another page (see main.js) */
body.is-leaving {
  opacity: 0;
  transition: opacity 0.28s ease;
}

@keyframes pageIn {
  from { opacity: 0; }
}

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

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

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

p {
  margin: 0;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--a2);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Icons are injected by main.js from <i data-icon="name"></i> */
.icon {
  display: inline-flex;
  flex: none;
  width: 1.25em;
  height: 1.25em;
}

.icon svg {
  width: 100%;
  height: 100%;
}

.icon--flip {
  transform: rotate(180deg);
}


/* ---------- 3. LAYOUT & TYPOGRAPHY HELPERS ---------- */
.container {
  width: min(var(--maxw), 100% - 40px);
  margin-inline: auto;
}

.section {
  padding: clamp(64px, 9vw, 120px) 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-head);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.text-grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Small uppercase label above headings */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--a2);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

/* Heading block above each section */
.section-head {
  max-width: 740px;
  margin-bottom: 48px;
}

.section-head h2 {
  margin: 14px 0 16px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
}

.section-head p {
  color: var(--muted);
  font-size: 1.1rem;
}


/* ---------- 4. NAVBAR ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav.is-scrolled {
  background: rgba(7, 10, 18, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--grad);
  color: #06080f;
  font-size: 1.1rem;
}

.logo__text span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Menu links */
.nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav__links a {
  display: block;
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.nav__links a.nav__cta {
  margin-left: 8px;
  background: var(--grad);
  color: #06080f;
  font-weight: 600;
}

.nav__links a.nav__cta:hover {
  filter: brightness(1.1);
}

/* Hamburger button (mobile only) */
.nav__toggle {
  display: none;
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.nav__toggle span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s ease, top 0.3s ease;
}

.nav__toggle span:nth-child(1) { top: 18px; }
.nav__toggle span:nth-child(2) { top: 26px; }

.nav--open .nav__toggle span:nth-child(1) {
  top: 22px;
  transform: rotate(45deg);
}

.nav--open .nav__toggle span:nth-child(2) {
  top: 22px;
  transform: rotate(-45deg);
}

@media (max-width: 820px) {
  .nav__toggle {
    display: block;
  }

  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 20px 26px;
    background: rgba(7, 10, 18, 0.97);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  }

  .nav--open .nav__links {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav__links a {
    padding: 16px 18px;
    font-size: 1.1rem;
  }

  .nav__links a.nav__cta {
    margin: 8px 0 0;
    text-align: center;
  }
}


/* ---------- 5. SCROLL PROGRESS BAR ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 0;
  height: 3px;
  background: var(--grad);
}


/* ---------- 6. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--grad);
  color: #06080f;
  box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--a1) 80%, transparent);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
  color: var(--text);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn--fb {
  background: var(--fb);
  color: #fff;
  box-shadow: 0 14px 34px -12px rgba(24, 119, 242, 0.9);
}

.btn--fb:hover {
  box-shadow: 0 18px 40px -10px rgba(24, 119, 242, 1);
}

.btn--lg {
  padding: 18px 34px;
  font-size: 1.1rem;
}

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


/* ---------- 7. SCROLL-REVEAL ANIMATION ----------
   Add class="reveal" to any element. Optional delay: style="--d: .15s"
   (The .js class is added to <html> by a tiny script in each page's <head>,
    so content is never hidden if JavaScript is off.) */
.js .reveal {
  opacity: 0;
  translate: 0 28px;
  transition:
    opacity 0.8s ease var(--d, 0s),
    translate 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s),
    transform 0.25s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.js .reveal.in {
  opacity: 1;
  translate: 0 0;
}

/* Cards that tilt with the mouse (see main.js) */
[data-tilt] {
  transition: transform 0.25s ease;
}


/* ---------- 8. CHIPS & PROCESS STEPS ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips li {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #d5dbeb;
  font-size: 0.85rem;
  font-weight: 500;
}

.chips li.chip--more {
  border-style: dashed;
  color: var(--a2);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.step {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.step__num {
  display: block;
  margin-bottom: 14px;
  font-family: var(--font-head);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.step h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.step p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Variant with 3 steps (Contact page) */
.steps--3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 960px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  .steps--3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .steps {
    grid-template-columns: 1fr;
  }
}


/* ---------- 9. FACEBOOK CARD + CHAT MOCKUP ----------
   Used on the Home page and the Contact page. */
.fbcard {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid rgba(24, 119, 242, 0.4);
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.18), rgba(124, 92, 255, 0.1) 60%, rgba(255, 255, 255, 0.03));
  overflow: hidden;
  isolation: isolate;
}

/* Blue glow that follows the mouse */
.fbcard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(520px circle at var(--mx, 75%) var(--my, 20%), rgba(24, 119, 242, 0.3), transparent 45%);
}

.fbcard h2 {
  margin: 14px 0 16px;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 800;
}

.fbcard p {
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.fbcard__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 26px;
  margin-top: 30px;
}

.fbcard__link {
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 600;
  transition: border-color 0.2s ease;
}

.fbcard__link:hover {
  border-color: #fff;
}

/* Fake Messenger-style chat */
.chat {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(7, 10, 18, 0.65);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
}

.chat__top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.chat__avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--grad);
  color: #06080f;
  font-family: var(--font-head);
  font-weight: 800;
}

.chat__name {
  font-weight: 600;
  line-height: 1.2;
}

.chat__status {
  color: #34d399;
  font-size: 0.8rem;
}

.chat__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 250px;
}

.bubble {
  max-width: 84%;
  padding: 10px 15px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0;
  translate: 0 10px;
}

.bubble--them {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: #1b2540;
}

.bubble--me {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: var(--fb);
  color: #fff;
}

/* Bubbles pop in one by one when the card scrolls into view */
.chat.in .bubble,
html:not(.js) .bubble {
  animation: bubbleIn 0.5s ease forwards;
}

.chat .bubble:nth-child(1) { animation-delay: 0.3s; }
.chat .bubble:nth-child(2) { animation-delay: 1.5s; }
.chat .bubble:nth-child(3) { animation-delay: 2.7s; }
.chat .bubble:nth-child(4) { animation-delay: 3.9s; }

@keyframes bubbleIn {
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@media (max-width: 900px) {
  .fbcard {
    grid-template-columns: 1fr;
  }
}


/* ---------- 10. FOOTER & FLOATING FACEBOOK BUTTON ---------- */
.footer {
  margin-top: 40px;
  padding: 48px 0 32px;
  border-top: 1px solid var(--line);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  color: var(--muted);
  font-weight: 500;
}

.footer__links a:hover {
  color: var(--text);
}

.footer__fb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6fa8ff;
}

.footer__copy {
  width: 100%;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Floating button (Home page only) */
.fb-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 14px 16px;
  border-radius: 999px;
  background: var(--fb);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 14px 34px -10px rgba(24, 119, 242, 0.85);
  transition: transform 0.25s ease;
}

.fb-float:hover {
  transform: translateY(-3px) scale(1.03);
}

/* Pulsing ring */
.fb-float::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--fb);
  border-radius: inherit;
  animation: ring 2.4s ease-out infinite;
}

@keyframes ring {
  from {
    transform: scale(1);
    opacity: 0.7;
  }
  to {
    transform: scale(1.35);
    opacity: 0;
  }
}

@media (max-width: 560px) {
  .fb-float {
    right: 14px;
    bottom: 14px;
    padding: 15px;
  }

  .fb-float__label {
    display: none;
  }
}


/* ---------- 11. REDUCED-MOTION SUPPORT ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    translate: none;
  }

  .bubble {
    opacity: 1;
    translate: none;
  }
}
