/* ==========================================================================
   AllSkills Web — Global Theme
   - Design tokens (colours, typography, spacing, layout)
   - Global element styles (headings, body, buttons, forms)
   ========================================================================== */

/* -----------------------------
   Roboto – Self-hosted
   (must be OUTSIDE :root)
------------------------------ */
@font-face {
  font-family: "Roboto";
  src: url("/static/fonts/Roboto-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("/static/fonts/Roboto-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("/static/fonts/Roboto-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* -----------------------------
   1) Tokens
------------------------------ */
:root {
  /* Colours */
  --c-brand: #6425EB;
  --c-bg: #FFFFFF;
  --c-bg-soft: #F1F0FC;
  --c-heading: #110629;
  --c-body: rgba(17, 6, 41, 0.70); /* #110629 @ 70% */
  --c-white: #FFFFFF;

  --c-border: rgba(17, 6, 41, 0.12);
  --c-border-strong: rgba(17, 6, 41, 0.18);

  --c-input-bg: rgba(17, 6, 41, 0.02);
  --c-focus: rgba(100, 37, 235, 0.35);

  /* Typography */
  --font-primary: "Roboto", sans-serif;

  /* Font weights */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;

  /* Layout */
  --container-max: 1200px;
  --container-wide: 1320px;
  --container-narrow: 980px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
  --space-11: 80px;
  --space-12: 96px;

  /* Radius */
  --radius-1: 2px;
  --radius-2: 3px;
  --radius-3: 8px;
  --radius-4: 12px;

  /* Shadows */
  --shadow-1: 0 6px 18px rgba(17, 6, 41, 0.08);

  /* Form + buttons */
  --control-h: 50px;
  --btn-radius: 14px;
  --input-radius: 14px;

  /* Animation */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur-1: 150ms;
  --dur-2: 250ms;
}

/* -----------------------------
   2) Base / Reset-ish
------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
  font-weight: var(--fw-regular);
  color: var(--c-body);
  background: var(--c-bg);
  line-height: 1.5;
}

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

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

a:hover {
  text-decoration: underline;
}

::selection {
  background: rgba(100, 37, 235, 0.18);
}

:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
}

/* -----------------------------
   3) Layout helpers
------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

@media (max-width: 768px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* Optional section spacing helper */
.section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}
@media (max-width: 768px) {
  .section {
    padding-top: var(--space-10);
    padding-bottom: var(--space-10);
  }
}
@media (max-width: 420px) {
  .section {
    padding-top: var(--space-9);
    padding-bottom: var(--space-9);
  }
}

/* -----------------------------
   4) Typography
   Desktop sizes provided by you; using clamp() for responsive scaling.
------------------------------ */
h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--font-primary);
  color: var(--c-heading);
  text-transform: capitalize;
  font-weight: var(--fw-semibold);
}

/* H1: 72px desktop, centred, -4% letter-spacing */
.h1, h1 {
  font-size: clamp(40px, 5.2vw, 72px);
  line-height: 1.10;
  letter-spacing: -0.04em;
  text-align: center;
}

/* H2: 56px desktop, -1% letter-spacing */
.h2, h2 {
  font-size: clamp(32px, 3.2vw, 48px);
  line-height: 1.18;
  letter-spacing: -0.015em;
}

/* H3: 45px desktop, -1% letter-spacing */
.h3, h3 {
  font-size: clamp(26px, 3.3vw, 45px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* H4: 32px desktop, centred */
.h4, h4 {
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.30;
  letter-spacing: 0;
  text-align: center;
}

/* H5: 24px desktop, medium */
.h5, h5 {
  font-size: clamp(18px, 2.0vw, 24px);
  line-height: 1.20;
  letter-spacing: -0.01em;
  font-weight: var(--fw-medium);
  text-transform: none;
}

/* Paragraph */
p,
.p {
  margin: 0;
  font-family: var(--font-primary);
  font-weight: var(--fw-regular);
  font-size: 18px;
  line-height: 1.50;
  letter-spacing: 0;
  text-align: center;
  color: var(--c-body);
}

/* Helpful text styles */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.muted { color: var(--c-body); }
.heading { color: var(--c-heading); }

/* Standard spacing between text blocks (opt-in wrapper) */
.prose > * + * {
  margin-top: var(--space-4);
}

/* -----------------------------
   5) Buttons
------------------------------ */
.btn,
button.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  min-height: var(--control-h);
  padding: 10px 24px;
  border-radius: 14px;

  background: var(--c-brand);
  color: var(--c-white);

  border: 1px solid var(--c-brand);
  cursor: pointer;

  font-family: var(--font-primary);
  font-weight: var(--fw-semibold);
  font-size: 16px;
  line-height: 1;

  transition: transform var(--dur-1) var(--ease),
              box-shadow var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease),
              opacity var(--dur-1) var(--ease);
}

.btn:hover {
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Secondary button (for later use) */
.btn--secondary {
  background: transparent;
  color: var(--c-heading);
  border-color: var(--c-border-strong);
}
.btn--secondary:hover {
  background: rgba(17, 6, 41, 0.04);
}

/* -----------------------------
   6) Form fields (consistent cross-browser)
------------------------------ */
label {
  display: inline-block;
  font-size: 14px;
  color: var(--c-heading);
  margin-bottom: var(--space-2);
  text-align: left;
}

.input,
select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="number"] {
  width: 100%;
  min-height: var(--control-h);

  padding: 12px;
  border-radius: var(--input-radius);

  border: 1px solid var(--c-border);
  background: var(--c-input-bg);
  color: var(--c-heading);

  font-family: var(--font-primary);
  font-weight: var(--fw-regular);
  font-size: 16px;

  outline: none;
  transition: border-color var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}

input,
select,
textarea {
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(17, 6, 41, 0.65) 50%),
    linear-gradient(135deg, rgba(17, 6, 41, 0.65) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(100, 37, 235, 0.55);
  box-shadow: 0 0 0 4px var(--c-focus);
}

::placeholder {
  color: rgba(17, 6, 41, 0.45);
}

input:-webkit-autofill {
  -webkit-text-fill-color: var(--c-heading);
  transition: background-color 100000s ease-in-out 0s;
  box-shadow: 0 0 0px 1000px var(--c-input-bg) inset;
}

/* -----------------------------
   7) Small utilities you’ll use everywhere
------------------------------ */
.hidden { display: none !important; }

.stack-2 > * + * { margin-top: var(--space-2); }
.stack-3 > * + * { margin-top: var(--space-3); }
.stack-4 > * + * { margin-top: var(--space-4); }
.stack-6 > * + * { margin-top: var(--space-6); }
.stack-8 > * + * { margin-top: var(--space-8); }

.bg-soft { background: var(--c-bg-soft); }

.card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-4);
  box-shadow: var(--shadow-1);
}


/* ==========================================================================
   Header (global)
   Matches Figma screenshot: light rounded bar, centred nav, right CTA
   ========================================================================== */

.no-scroll {
  overflow: hidden;
}

/* wrapper */
.site-header {
  padding-top: 10px;
  padding-bottom: 10px;
}

/* rounded light bar */
.site-header__bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-6);

  background: var(--c-bg-soft);
  border-radius: var(--radius-4);
  padding: 18px 0px;
}

/* logo */
.site-header__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.site-header__logo img {
  height: 40px;
  width: auto;
}

/* desktop nav */
.site-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.site-header__link {
  font-family: var(--font-primary);
  font-weight: var(--fw-regular);
  font-size: 16px;
  line-height: 1;
  color: var(--c-heading);
  text-transform: capitalize;
  text-decoration: none;
  opacity: 0.92;
  transition: opacity var(--dur-1) var(--ease);
}

.site-header__link:hover {
  opacity: 1;
  text-decoration: none;
}

/* CTA button (right) */
.site-header__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
}

.site-header__cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 44px;
  padding: 0 20px;

  border-radius: 10px;
  background: rgba(100, 37, 235, 0.10);
  border: 1px solid rgba(100, 37, 235, 0.12);

  color: var(--c-brand);
  font-weight: var(--fw-medium);
  font-size: 16px;
  text-decoration: none;

  transition: transform var(--dur-1) var(--ease),
              background var(--dur-2) var(--ease);
}

.site-header__cta-btn:hover {
  background: rgba(100, 37, 235, 0.14);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Mobile toggle button (hidden on desktop) */
.site-header__toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(17, 6, 41, 0.10);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 0;
  position: relative;
}

/* Hamburger lines -> X animation */
.site-header__toggle-lines,
.site-header__toggle-lines::before,
.site-header__toggle-lines::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 20px;
  height: 2px;
  background: var(--c-heading);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: transform var(--dur-2) var(--ease),
              top var(--dur-2) var(--ease),
              opacity var(--dur-2) var(--ease);
}

.site-header__toggle-lines { top: 50%; }
.site-header__toggle-lines::before { top: calc(50% - 7px); }
.site-header__toggle-lines::after { top: calc(50% + 7px); }

.site-header.is-menu-open .site-header__toggle-lines {
  background: transparent;
}
.site-header.is-menu-open .site-header__toggle-lines::before {
  top: 50%;
  transform: translateX(-50%) rotate(45deg);
}
.site-header.is-menu-open .site-header__toggle-lines::after {
  top: 50%;
  transform: translateX(-50%) rotate(-45deg);
}

/* Force toggle/X lines colour when menu is open (fix disappearing lines) */
.site-header.is-menu-open .site-header__toggle-lines::before,
.site-header.is-menu-open .site-header__toggle-lines::after {
  background: var(--c-heading) !important;
  opacity: 1 !important;
}

/* Mobile dropdown */
.site-header__mobile {
  display: none;
  background: var(--c-bg-soft);
  border-radius: var(--radius-4);
  margin-top: var(--space-3);

  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 320ms var(--ease),
              opacity 220ms var(--ease),
              transform 220ms var(--ease);
}

.site-header__mobile-inner {
  padding: 14px 16px 18px;
  display: grid;
  gap: 10px;
}

.site-header__mobile-link {
  display: block;
  padding: 12px 12px;
  border-radius: 10px;
  color: var(--c-heading);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(17, 6, 41, 0.08);
  transition: transform var(--dur-1) var(--ease),
              background var(--dur-2) var(--ease);
}
.site-header__mobile-link:hover {
  background: rgba(255, 255, 255, 0.75);
  transform: translateY(-1px);
  text-decoration: none;
}

.site-header__mobile-cta {
  width: 100%;
  margin-top: 6px;
}

/* Responsive behaviour */
@media (max-width: 900px) {
  .site-header__bar {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .site-header__nav,
  .site-header__cta-btn {
    display: none;
  }

  .site-header__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-header__mobile {
    display: block;
  }

  .site-header.is-menu-open .site-header__mobile {
    max-height: 520px;
    opacity: 1;
    transform: translateY(0);
  }
}

