/* Code Experts — codeexperts.io. Layout follows the Adobe XD design "Code Experts V3" (1440px artboard);
   logo, gradient and Fira Code follow the brand kit (~/dev/code-experts/brand/tokens). */

:root {
    --ink: #000;
    --paper: #fff;
    /* signature gradient, carried over from the previous codeexperts.io (brand kit --ce-gradient) */
    --pink: #ff46c8;
    --blue: #1e64ff;
    --blue-deep: #003bdb;
    --gradient: linear-gradient(90deg, #ff46c8 1.83%, #1e64ff 59.06%, #003bdb 96.56%);
    --footer-bg: #2b2b2b;
    --footer-bar: #101010;   /* copyright bar */
    --rule-light: #3a3a3a;   /* footer column dividers (embossed pair) */
    --rule-dark: #1c1c1c;
    --gutter: clamp(16px, 2.6vw, 38px);
    --font-code: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; /* the whole site, as on the previous codeexperts.io */
}

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-code);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.wrap {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ---------- header ---------- */

.site-header {
    position: relative;
    z-index: 1; /* above the hero mark */
    background: var(--paper);
}

/* soft 30px shade under the header, as in the design */
.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 30px;
    background: linear-gradient(rgba(230, 230, 230, .5), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 100px;
}

/* logo assembled from parts (brand kit logo/parts): mark image + live wordmark and tagline */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}

.logo-mark { width: 84px; height: 45px; }

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

/* the XD wordmark is outlined; Rubik 700 is the closest web font to its letterforms */
.logo-name {
    font: 700 27.5px/1 Rubik, sans-serif;
    text-transform: uppercase;
    white-space: nowrap;
}

.logo-tagline {
    margin-top: 6px;
    white-space: nowrap;
    font: 500 12px/1 Montserrat, sans-serif;
    letter-spacing: 0.2em;
    color: var(--blue);
}

.header-contact {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.chat img { width: 37px; height: 32px; }

.header-phone {
    font-family: var(--font-code);
    font-size: 18px;
    line-height: 24px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.header-phone:hover { text-decoration: underline; }

/* ---------- hero ---------- */

main { overflow-x: clip; } /* the hero mark may be wider than a phone screen */

.hero {
    position: relative;
    isolation: isolate;
    padding-top: 70px;
    text-align: center;
}

/* the logo mark, scaled up at 3% opacity behind the hero (brand kit) */
.hero-mark {
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 50%;
    width: min(900px, 110%);
    transform: translate(-50%, -42%);
    opacity: .03;
    pointer-events: none;
}

h1, h2, .intro-lead {
    font-family: var(--font-code);
    text-transform: uppercase;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--blue); /* fallback */
}

h1 {
    margin: 0;
    font-size: clamp(26px, 3.7vw, 50px);
    line-height: 1.15;
    font-weight: 700;
}

.hero-sub {
    margin: 10px 0 0;
    font-size: clamp(15px, 1.5vw, 20px);
    line-height: 1.5;
}

.hero h1, .hero-sub { margin-left: auto; margin-right: auto; }
.hero h1 { width: fit-content; max-width: 100%; }

.btn {
    display: inline-block;
    margin-top: 32px;
    padding: 10px 15px 11px;
    min-width: 280px;
    border-radius: 8px;
    background: var(--gradient);
    background-size: 160% 100%;
    background-position: 0 0;
    color: #fff;
    font-family: var(--font-code);
    font-size: 22px;
    line-height: 29px;
    font-weight: 600;
    text-decoration: none;
    transition: background-position 300ms ease-out;
}

/* hover slides the gradient towards the deep blue end */
.btn:hover,
.btn:focus-visible { background-position: 100% 0; }

/* ---------- intro ---------- */

.intro {
    display: grid;
    grid-template-columns: minmax(0, 746px) minmax(0, 625px);
    justify-content: space-between;
    column-gap: 32px;
}

.intro-text { padding: 71px 0 40px; }

h2 {
    margin: 0;
    width: fit-content; /* keep the gradient span to the text, not the column */
    font-size: clamp(28px, 4.2vw, 50px);
    line-height: 1.15;
    font-weight: 700;
}

.intro-lead {
    margin: 12px 0 30px;
    width: fit-content;
    font-size: clamp(20px, 2.3vw, 30px);
    line-height: 1.2;
    font-weight: 600;
}

.intro-text p:not(.intro-lead) {
    margin: 0 0 26px;
    font-size: 17px;
    line-height: 1.65;
}

.intro-text p:last-child { margin-bottom: 0; }

/* the illustration rises above the heading and sits on the footer */
.intro-art {
    align-self: end;
    width: 625px;
    margin-top: -4px;
}

/* ---------- footer ---------- */

.site-footer {
    background: var(--footer-bg);
    color: #fff;
}

.contacts {
    display: grid;
    grid-template-columns: 464fr 568fr 408fr; /* column widths from the design */
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 0;
}

.contact {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 184px;
    padding: 0 var(--gutter);
    text-decoration: none;
    font-size: 18px;
    line-height: 24px;
}

.contact + .contact {
    border-left: 1px solid var(--rule-light);
    box-shadow: inset 1px 0 0 var(--rule-dark);
}

.contact:nth-child(2) { justify-content: center; }
.contact:nth-child(3) { justify-content: flex-end; }

.contact img { flex-shrink: 0; }

.contact strong {
    display: block;
    font-family: var(--font-code);
    margin-bottom: 15px;
    font-weight: 700;
}

.contact address { font-style: normal; }

a.contact:hover span { text-decoration: underline; }
a.contact:hover strong { text-decoration: none; }

.copyright {
    background: var(--footer-bar);
    font-size: 16px;
    line-height: 24px;
}

.copyright-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 13px;
    padding-bottom: 13px;
}

/* ---------- responsive (the design is desktop-only; below is our adaptation) ---------- */

@media (max-width: 1200px) {
    .intro { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
    .intro-art { width: 100%; }
}

@media (max-width: 900px) {
    .hero { padding-top: 48px; }

    .intro { grid-template-columns: 1fr; }
    .intro-text { padding: 56px 0 24px; }
    .intro-text p:not(.intro-lead) { font-size: 15px; margin-bottom: 18px; }
    .intro-art { width: min(100%, 520px); margin: 0 auto; }

    .contacts { grid-template-columns: 1fr; padding: 8px 0; }
    .contact,
    .contact:nth-child(2),
    .contact:nth-child(3) { justify-content: flex-start; min-height: 0; padding-top: 20px; padding-bottom: 20px; }
    .contact + .contact {
        border-left: 0;
        border-top: 1px solid var(--rule-light);
        box-shadow: inset 0 1px 0 var(--rule-dark);
    }
    .contact img { width: 56px; }
}

@media (max-width: 600px) {
    .header-inner { height: 72px; }
    .logo { gap: 7px; }
    .logo-mark { width: 50px; height: 27px; }
    .logo-name { font-size: 17px; }
    .logo-tagline { margin-top: 4px; font-size: 7px; }
    .header-contact { gap: 8px; }
    .chat img { width: 30px; height: 26px; }
    .header-phone { font-size: 14px; }

    .btn { min-width: 0; width: 100%; max-width: 320px; font-size: 20px; }

    .contact { font-size: 16px; }
    .contact strong { margin-bottom: 8px; }

    .copyright { font-size: 13px; }
}

/* no room for logo + chat + number; the number stays in the footer */
@media (max-width: 420px) {
    .header-phone { display: none; }
    .chat img { width: 34px; height: 30px; }
}

@media (max-width: 370px) {
    .logo-mark { width: 42px; height: 22px; }
    .logo-name { font-size: 15px; }
    .logo-tagline { font-size: 6px; }
    .header-phone { font-size: 13px; }
}
