/* Milestone public site: shared styles for the homepage, /vacancies, job pages,
   /talent and freelancer registration.
   Dark theme: near-black ground, the logo's red-orange (#F04623) as the accent
   and its blue (#017FBA) as the second colour. Colour washes appear only at the
   top of pages and in the homepage hero and footer. Sizes in px on a 4px grid
   (the job page renders inside Frappe's web template, so rem is avoided and
   every class is prefixed with ms-). */

:root {
    --ms-bg: #0E0F12;
    --ms-frame: #0B0C0F;
    --ms-card: #14161B;
    --ms-raised: #1C1F25;
    --ms-input: #121418;
    --ms-ink: #F2F1EE;
    --ms-text-2: #C9C8C3;
    --ms-muted: #A2A3AB;
    --ms-faint: #7E7F87;
    --ms-line: rgba(255, 255, 255, 0.09);
    --ms-line-strong: rgba(255, 255, 255, 0.18);
    --ms-accent: #F04623;
    --ms-accent-ink: #FF8A6E;
    --ms-accent-strong: #FF6A47;
    --ms-blue: #017FBA;
    --ms-cyan: #5CC8EA;
    --ms-positive: #3DD68C;
    --ms-positive-bg: rgba(61, 214, 140, 0.12);
    --ms-negative: #FF8A80;
    --ms-negative-bg: rgba(255, 107, 94, 0.12);
    --ms-btn-bg: #F2F1EE;
    --ms-btn-fg: #0E0F12;
    --ms-btn-hover: #FFFFFF;
    --ms-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ms-display: 'Outfit', system-ui, sans-serif;
    --ms-ui: 'Inter', system-ui, sans-serif;
    --ms-serif: 'Instrument Serif', Georgia, serif;
    color-scheme: dark;
}

html { scroll-behavior: smooth; background: var(--ms-bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body.ms-body, .ms-page {
    background:
        radial-gradient(60% 420px at 18% 0, rgba(240, 70, 35, 0.20), transparent 70%),
        radial-gradient(50% 380px at 86% 0, rgba(1, 127, 186, 0.24), transparent 70%),
        var(--ms-bg) !important;
    background-repeat: no-repeat !important;
    color: var(--ms-ink);
    font-family: var(--ms-ui);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body.ms-body.ms-plain { background: var(--ms-bg) !important; }
body.ms-body { margin: 0; }
.ms-page { min-height: 100vh; }
:where(.ms-page) *, :where(.ms-page) *::before, :where(.ms-page) *::after { box-sizing: border-box; }
.ms-page a { color: inherit; text-decoration: none; }
.ms-page a:hover { text-decoration: none; }
:where(.ms-page) h1, :where(.ms-page) h2, :where(.ms-page) h3, :where(.ms-page) h4 {
    font-family: var(--ms-display); font-weight: 500; color: var(--ms-ink); margin: 0;
}
:where(.ms-page) p { margin: 0; }
.ms-page img { max-width: 100%; }
.ms-page :focus-visible { outline: 2px solid var(--ms-accent-ink); outline-offset: 2px; border-radius: 6px; }
.ms-page ::selection { background: rgba(240, 70, 35, 0.45); color: #fff; }
.ms-num { font-variant-numeric: tabular-nums; }

.ms-skip {
    position: absolute; left: 16px; top: -48px; z-index: 400;
    background: var(--ms-btn-bg); color: var(--ms-btn-fg) !important; padding: 8px 16px; border-radius: 8px;
    transition: top 160ms var(--ms-ease);
}
.ms-skip:focus { top: 16px; }

.ms-container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.ms-container.ms-narrow { max-width: 800px; }

/* Buttons: off-white primary with dark text, outlined secondary */
.ms-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 20px; border-radius: 12px;
    font-family: var(--ms-ui); font-size: 15px; font-weight: 500; line-height: 1;
    border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    transition: background-color 160ms var(--ms-ease), border-color 160ms var(--ms-ease), color 160ms var(--ms-ease), transform 120ms var(--ms-ease);
}
.ms-btn:active { transform: scale(0.98); }
.ms-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ms-btn-primary { background: var(--ms-btn-bg); color: var(--ms-btn-fg) !important; }
.ms-btn-primary:hover { background: var(--ms-btn-hover); }
.ms-btn-secondary { background: transparent; color: var(--ms-ink) !important; border-color: var(--ms-line-strong); }
.ms-btn-secondary:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.28); }
.ms-btn-accent { background: var(--ms-accent); color: #fff !important; }
.ms-btn-accent:hover { background: #ff5a36; }
.ms-btn-sm { height: 36px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.ms-btn-lg { height: 48px; padding: 0 22px; }
.ms-btn-block { width: 100%; }
.ms-btn i, .ms-btn svg { font-size: 14px; width: 16px; height: 16px; opacity: 0.85; display: inline-flex; align-items: center; justify-content: center; }

.ms-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ms-accent-ink) !important; }
.ms-link:hover { text-decoration: underline !important; text-underline-offset: 3px; }
.ms-link i { font-size: 12px; }

/* Signature: milestone marker (the peak from the logo) */
.ms-marker {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--ms-display); font-size: 14px; font-weight: 500;
    color: var(--ms-text-2); font-variant-numeric: tabular-nums;
}
.ms-marker::before {
    content: ""; width: 12px; height: 10px; background: var(--ms-accent);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

/* Header: a floating pill, as in the mockups */
.ms-header { position: sticky; top: 0; z-index: 100; padding: 16px 16px 0; background: transparent; pointer-events: none; }
.ms-nav {
    pointer-events: auto;
    width: max-content; max-width: 100%; margin: 0 auto; padding: 6px 8px 6px 12px;
    display: flex; align-items: center; gap: 4px;
    border-radius: 16px; background: rgba(22, 24, 29, 0.72); border: 1px solid var(--ms-line);
    backdrop-filter: saturate(1.2) blur(14px); -webkit-backdrop-filter: saturate(1.2) blur(14px);
}
.ms-nav > a:first-child { display: flex; align-items: center; padding: 2px 12px 2px 0; margin-right: 4px; border-right: 1px solid var(--ms-line-strong); }
.ms-logo { height: 32px; width: auto; display: block; }
.ms-nav-links { display: flex; align-items: center; gap: 2px; }
.ms-nav-link {
    height: 36px; display: inline-flex; align-items: center; padding: 0 12px;
    border-radius: 10px; font-size: 14px; font-weight: 400; color: var(--ms-text-2) !important;
    transition: color 160ms var(--ms-ease), background-color 160ms var(--ms-ease);
}
.ms-nav-link:hover { color: var(--ms-ink) !important; background: rgba(255, 255, 255, 0.06); }
.ms-nav-link.is-current { color: var(--ms-ink) !important; background: rgba(255, 255, 255, 0.10); }
.ms-nav-actions { display: flex; align-items: center; gap: 6px; margin-left: 6px; }
.ms-nav-actions .ms-btn, .ms-nav-actions .btn-portal { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.ms-nav-actions .ms-nav-link { color: var(--ms-text-2) !important; }
.ms-menu-toggle {
    display: none; margin-left: auto; width: 40px; height: 40px; border-radius: 10px; padding: 0;
    border: 1px solid var(--ms-line-strong); background: rgba(255, 255, 255, 0.06); color: var(--ms-ink); cursor: pointer;
    align-items: center; justify-content: center; font-size: 16px;
}
.ms-menu-toggle svg { width: 18px; height: 18px; }

.ms-mobile-menu {
    position: fixed; inset: 0; z-index: 300; background: var(--ms-bg);
    padding: 16px 24px 32px; display: flex; flex-direction: column;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 200ms var(--ms-ease), transform 200ms var(--ms-ease), visibility 0s linear 200ms;
}
.ms-mobile-menu.open, .ms-mobile-menu.active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.ms-mobile-top { height: 56px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ms-mobile-top .ms-menu-toggle { display: inline-flex; margin: 0; }
.ms-mobile-top .ms-logo { height: 34px; }
.ms-mobile-link {
    height: 56px; display: flex; align-items: center; font-family: var(--ms-display);
    font-size: 22px; color: var(--ms-ink) !important; border-bottom: 1px solid var(--ms-line);
}
.ms-mobile-actions { margin-top: auto; display: grid; gap: 12px; }

/* Page heading */
.ms-pagehead { padding: 72px 0 40px; }
.ms-pagehead h1 { font-size: 72px; font-weight: 400; line-height: 0.98; letter-spacing: -0.04em; max-width: 18ch; }
.ms-pagehead h1 .ms-count { color: var(--ms-accent-strong); font-variant-numeric: tabular-nums; }
.ms-pagehead .ms-lead { margin-top: 18px; font-size: 18px; color: var(--ms-text-2); max-width: 600px; }
.ms-promise { margin-top: 14px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ms-muted); }
.ms-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ms-positive); flex-shrink: 0; display: inline-block; }

/* Form controls */
.ms-label { display: block; font-size: 13px; font-weight: 500; color: var(--ms-muted); margin: 0 0 6px; }
.ms-label .ms-req { color: var(--ms-accent-ink); }
.ms-input, .ms-select, .ms-textarea {
    width: 100%; height: 46px; padding: 0 14px; border-radius: 12px;
    border: 1px solid var(--ms-line-strong); background: var(--ms-input); color: var(--ms-ink);
    font-family: var(--ms-ui); font-size: 15px; line-height: 1.4; box-shadow: none;
    transition: border-color 160ms var(--ms-ease), box-shadow 160ms var(--ms-ease);
    -webkit-appearance: none; appearance: none;
}
.ms-textarea { height: auto; padding: 12px 14px; resize: vertical; }
.ms-select {
    padding-right: 38px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A2A3AB' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
.ms-select option { background: var(--ms-card); color: var(--ms-ink); }
.ms-input::placeholder, .ms-textarea::placeholder { color: #6E6F77; }
.ms-input:hover, .ms-select:hover, .ms-textarea:hover { border-color: rgba(255, 255, 255, 0.30); }
.ms-input:focus, .ms-select:focus, .ms-textarea:focus {
    outline: none; border-color: var(--ms-accent-ink); box-shadow: 0 0 0 3px rgba(240, 70, 35, 0.18);
}
.ms-search { position: relative; }
.ms-search > i, .ms-search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ms-muted); font-size: 14px; width: 16px; height: 16px; pointer-events: none; }
.ms-search .ms-input { padding-left: 40px; }

/* Cards and chips */
.ms-card { background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: 18px; }
.ms-chip { display: inline-flex; align-items: center; font-size: 13px; color: var(--ms-text-2); background: var(--ms-raised); border-radius: 8px; padding: 4px 10px; line-height: 1.4; }
.ms-meta { font-size: 13px; color: var(--ms-muted); }

.ms-empty { text-align: center; padding: 64px 24px; color: var(--ms-text-2); grid-column: 1 / -1; }
.ms-empty h3 { font-size: 22px; margin-bottom: 8px; }
.ms-empty .ms-btn { margin-top: 20px; }

/* Footer used on subpages */
.ms-footer { margin-top: 96px; padding: 32px 0 48px; border-top: 1px solid var(--ms-line); font-size: 14px; color: var(--ms-muted); }
.ms-footer .ms-container { display: flex; justify-content: space-between; align-items: center; gap: 16px 32px; flex-wrap: wrap; }
.ms-footer-links { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.ms-footer-links a { color: var(--ms-text-2) !important; }
.ms-footer-links a:hover { color: var(--ms-ink) !important; text-decoration: underline !important; text-underline-offset: 3px; }

/* Scroll reveal: elements start slightly lowered and fade in once.
   Only applied when JS adds .ms-motion to <html>, so nothing hides without it. */
.ms-motion .ms-reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ms-ease), transform 600ms var(--ms-ease); }
.ms-motion .ms-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .ms-motion .ms-reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 960px) {
    .ms-nav-links, .ms-nav-actions { display: none; }
    .ms-menu-toggle { display: inline-flex; }
    .ms-nav { width: 100%; justify-content: space-between; }
    .ms-nav > a:first-child { border-right: 0; }
}
@media (max-width: 720px) {
    .ms-container { padding: 0 20px; }
    .ms-header { padding: 12px 12px 0; }
    .ms-logo { height: 30px; }
    .ms-pagehead { padding: 40px 0 28px; }
    .ms-pagehead h1 { font-size: 42px; }
    .ms-pagehead .ms-lead { font-size: 16px; }
    .ms-footer { margin-top: 64px; }
    .ms-footer .ms-container { flex-direction: column; align-items: flex-start; }
}
