/* ==========================================================================
   SFS Academy — foundation styles
   1. Fonts   2. Tokens   3. Base   4. Layout helpers   5. Typography
   6. Buttons and links   7. Utilities   8. Motion
   ========================================================================== */

/* 1. Fonts --------------------------------------------------------------- */

@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-variable.woff2") format("woff2");
}

/* 2. Tokens -------------------------------------------------------------- */

:root {
    /* Brand: the indigo of the school seal and the orange of its flame,
       which is also the orange of the uniform and the campus brickwork. */
    --navy-950: #07142f;
    --navy-900: #0b1f4d;
    --navy-800: #12306e;
    --indigo-700: #1f4fd8;
    --indigo-600: #3a6df0;
    --indigo-100: #e6eefc;
    --orange-600: #c2410c;
    --orange-500: #f97316;
    --orange-300: #f9a977;
    --sky-400: #4db5f5;
    --cyan-400: #00c8e6;
    --red-500: #e5283d;
    --saffron-400: #fbbf24;
    --amber-500: #f5b50a;

    --cream: #f4f8ff;
    --sand: #eaf3fd;
    --white: #ffffff;

    --ink: #0b1b3f;
    --text: #2c3a57;
    --muted: #526079;
    --line: #dce6f4;
    --line-dark: rgba(255, 255, 255, 0.16);

    --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --container: 1240px;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --section: clamp(4.5rem, 9vw, 8rem);
    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 18px 40px -18px rgba(11, 31, 77, 0.28);
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

    --header-height: 84px;
    --topbar-height: 40px;
}

/* 3. Base ---------------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

img {
    height: auto;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
}

/* Zero specificity, so component classes can set their own spacing. */
:where(ul[role="list"], ol[role="list"]) {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
}

address {
    font-style: normal;
}

button {
    font: inherit;
    color: inherit;
}

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

::selection {
    background: var(--indigo-700);
    color: var(--white);
}

/* 4. Layout helpers ------------------------------------------------------ */

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--section);
}

.section--cream {
    background: var(--cream);
}

.section--sand {
    background: var(--sand);
}

.section--navy {
    background: var(--navy-900);
    color: rgba(255, 255, 255, 0.78);
}

/* 5. Typography ---------------------------------------------------------- */

h1,
h2,
h3,
h4 {
    color: var(--ink);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.022em;
    text-wrap: balance;
}

h3 {
    font-size: 1.25rem;
    line-height: 1.3;
    letter-spacing: -0.012em;
}

p {
    text-wrap: pretty;
}

.lead {
    font-size: 1.1875rem;
    line-height: 1.65;
    color: var(--ink);
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--indigo-700);
}

.eyebrow::before {
    content: "";
    flex: none;
    width: 2rem;
    height: 2px;
    background: var(--orange-500);
}

.eyebrow--light,
.section-heading--light .eyebrow {
    color: rgba(255, 255, 255, 0.86);
}

.section-heading__title {
    font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.section-heading--light .section-heading__title {
    color: var(--white);
}

/* The accent phrase inside headings: same face and weight as the rest of
   the heading, picked out by colour only. */
h1 em,
h2 em {
    font: inherit;
    letter-spacing: inherit;
    color: var(--indigo-700);
}

.section-heading--light em,
.hero__title em {
    color: var(--saffron-400);
}

/* 6. Buttons and links --------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 3rem;
    padding: 0.75rem 1.375rem;
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.005em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn .icon {
    transition: transform 0.25s var(--ease);
}

.btn:hover .icon:last-child {
    transform: translateX(4px);
}

.btn--lg {
    min-height: 3.5rem;
    padding-inline: 1.75rem;
    font-size: 1rem;
}

/* Navy text on orange keeps the accent button comfortably above AA contrast. */
.btn--accent {
    background: var(--orange-500);
    color: var(--navy-950);
}

.btn--accent:hover {
    background: var(--saffron-400);
}

.btn--primary {
    background: var(--indigo-700);
    color: var(--white);
}

.btn--primary:hover {
    background: var(--navy-900);
}

.btn--ghost-light {
    border-color: rgba(255, 255, 255, 0.55);
    color: var(--white);
}

.btn--ghost-light:hover {
    background: var(--white);
    border-color: var(--white);
    color: var(--navy-900);
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-block: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--indigo-700);
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat;
    transition: color 0.2s var(--ease);
}

.link-arrow .icon {
    transition: transform 0.25s var(--ease);
}

.link-arrow:hover {
    color: var(--orange-600);
}

.link-arrow:hover .icon {
    transform: translateX(4px);
}

.link-arrow--light {
    color: var(--white);
}

.link-arrow--light:hover {
    color: var(--saffron-400);
}

/* 7. Utilities ----------------------------------------------------------- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon {
    flex: none;
}

/* 8. Motion -------------------------------------------------------------- */

/* Content is only hidden for the reveal when scripting is available, so
   nothing depends on JavaScript to become visible. */
.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

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

/* Links switched off on the Home page (see HomeController): look unchanged, do nothing. */
[data-link-disabled] {
    cursor: default;
    pointer-events: none;
}
