/*
 * Contact — page-local styles.
 *
 * Everything is scoped under `.tgd-contact`. That is deliberate and
 * load-bearing: the legacy theme sets `html { font-size: 10px }`,
 * `body { font-size: 20px }`, and styles bare `h1-h6`, `p`, `ul`, and `li`
 * globally. Those rules would otherwise win here, so the page pins its own
 * base and neutralizes the inherited element styles below — without leaking
 * any of it back into the shared header and footer.
 *
 * The element resets use `:where()` so they land at zero specificity. Any
 * single class in this file therefore overrides them without `!important`,
 * which keeps the component rules below plain and easy to adjust.
 *
 * Palette and primitives follow the About rework (public/assets/about/css),
 * which in turn follows the TGD brand tokens already in use on the Hire an
 * Expert, Magai and Genius Club pages (violet #8228f4, bright violet #b832ff,
 * magenta #f01b85). The two pages are intended to read as a matched pair.
 */

.tgd-contact {
    --ctc-violet: #8228f4;
    --ctc-violet-bright: #b832ff;
    --ctc-violet-deep: #5b13b8;
    --ctc-violet-darkest: #2e0b63;
    --ctc-magenta: #f01b85;

    --ctc-ink: #17152d;
    --ctc-ink-soft: #5a5870;
    --ctc-ink-faint: #8b88a0;
    --ctc-line: #e4e0f2;
    --ctc-surface: #ffffff;
    --ctc-surface-alt: #faf8ff;
    --ctc-tint: #f3edff;

    --ctc-shadow-sm: 0 4px 14px rgba(23, 21, 45, .06);
    --ctc-shadow-md: 0 18px 44px rgba(70, 30, 140, .10);
    --ctc-shadow-lg: 0 30px 70px rgba(70, 30, 140, .16);

    --ctc-radius: 20px;
    --ctc-radius-lg: 28px;

    /* Single source of vertical rhythm. Every band uses this top and bottom,
       so the gap between any two adjacent sections is always 2x this value. */
    --ctc-section-y: 92px;
    --ctc-gutter: 24px;

    min-width: 320px;
    background: var(--ctc-surface);
    color: var(--ctc-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /*
     * The theme sets `html { font-size: 10px }`. `rem` is always resolved
     * against that root — pinning a size here does not change it — so every
     * type size in this file is stated in px instead. Pinning 16px here is
     * still what `em`, and any unstyled text, fall back to.
     */
    font-size: 16px;
    line-height: 1.55;
    overflow-x: hidden;
}

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

html:has(.tgd-contact) {
    scroll-behavior: smooth;
}

/* Neutralize the legacy theme's base element styles inside the page only. */
.tgd-contact :where(h1, h2, h3, h4, h5, h6) {
    margin: 0;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.02em;
}

.tgd-contact :where(p) {
    margin: 0;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.tgd-contact :where(ul, ol, dl, dd) {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tgd-contact :where(address) {
    margin: 0;
    font-style: normal;
}

.tgd-contact :where(a) {
    color: inherit;
    text-decoration: none;
}

.tgd-contact :where(a):hover {
    text-decoration: none;
}

.tgd-contact :where(svg) {
    display: block;
}

/* A visible focus ring, since the theme suppresses the default one. */
.tgd-contact a:focus-visible {
    outline: 3px solid var(--ctc-violet-bright);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ── Layout primitives ────────────────────────────────────────────────── */

.ctc-container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--ctc-gutter);
}

.ctc-section {
    padding: var(--ctc-section-y) 0;
}

.ctc-section--tint {
    background: var(--ctc-surface-alt);
}

.ctc-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--ctc-tint);
    color: var(--ctc-violet-deep);
    font-size: 12.48px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ctc-section-head {
    max-width: 720px;
    margin: 0 0 56px;
}

.ctc-section-head--center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.ctc-section-head h2 {
    font-size: clamp(32px, 19.2px + 2.6vw, 49.6px);
}

.ctc-section-head h2 em {
    font-style: normal;
    color: var(--ctc-violet);
}

.ctc-section-head .ctc-lede {
    margin-top: 20px;
    color: var(--ctc-ink-soft);
    font-size: 17.28px;
    line-height: 1.65;
}

.ctc-icon {
    width: 100%;
    height: 100%;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.ctc-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 28px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}

.ctc-btn__arrow {
    transition: transform .2s ease;
}

.ctc-btn:hover .ctc-btn__arrow {
    transform: translateX(4px);
}

.ctc-btn--primary {
    background: linear-gradient(120deg, var(--ctc-violet) 0%, var(--ctc-violet-bright) 100%);
    color: #fff;
    box-shadow: 0 12px 30px rgba(130, 40, 244, .32);
}

.ctc-btn--primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(130, 40, 244, .42);
}

/* Ghost sits on the dark hero; outline sits on light bands. */
.ctc-btn--ghost {
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
}

.ctc-btn--ghost:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    transform: translateY(-2px);
}

.ctc-btn--outline {
    border-color: var(--ctc-line);
    background: var(--ctc-surface);
    color: var(--ctc-violet-deep);
}

.ctc-btn--outline:hover {
    border-color: rgba(130, 40, 244, .45);
    color: var(--ctc-violet-deep);
    transform: translateY(-2px);
    box-shadow: var(--ctc-shadow-sm);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.ctc-hero {
    position: relative;
    padding: 104px 0 120px;
    background:
        radial-gradient(1100px 620px at 78% 12%, rgba(184, 50, 255, .55) 0%, rgba(184, 50, 255, 0) 62%),
        radial-gradient(760px 520px at 8% 88%, rgba(240, 27, 133, .30) 0%, rgba(240, 27, 133, 0) 64%),
        linear-gradient(150deg, var(--ctc-violet-darkest) 0%, var(--ctc-violet-deep) 58%, #7a24d6 100%);
    color: #fff;
    isolation: isolate;
    overflow: hidden;
}

/* Soft drifting light. Pure decoration — stopped under reduced motion. */
.ctc-hero__glow {
    position: absolute;
    top: -26%;
    right: -14%;
    z-index: -1;
    width: 760px;
    height: 760px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .20) 0%, rgba(255, 255, 255, 0) 68%);
    animation: ctc-drift 18s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes ctc-drift {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }

    to {
        transform: translate3d(-40px, 34px, 0) scale(1.08);
    }
}

.ctc-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 64px;
    align-items: center;
}

.ctc-hero .ctc-eyebrow {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.ctc-hero h1 {
    font-size: clamp(38.4px, 22.4px + 3.6vw, 64px);
    letter-spacing: -.03em;
    line-height: 1.06;
}

.ctc-hero h1 span {
    display: block;
    background: linear-gradient(100deg, #ffd9f1 0%, #e6c6ff 55%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.ctc-hero__lede {
    max-width: 540px;
    margin-top: 24px;
    color: rgba(255, 255, 255, .84);
    font-size: 17.92px;
    line-height: 1.68;
}

.ctc-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 38px;
}

/* ── Hero card ────────────────────────────────────────────────────────── */

.ctc-hero__visual {
    position: relative;
}

.ctc-card {
    padding: 36px 34px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: var(--ctc-radius-lg);
    background: rgba(255, 255, 255, .10);
    box-shadow: 0 34px 80px rgba(20, 6, 54, .40);
    /* Progressive enhancement — the panel is legible without it. */
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.ctc-card__tag {
    display: inline-flex;
    margin-bottom: 26px;
    padding: 6px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 11.84px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ctc-card__list {
    display: grid;
    gap: 22px;
}

.ctc-card__list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.ctc-card__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 10px;
    border-radius: 13px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.ctc-card__text {
    display: block;
    min-width: 0;
    color: rgba(255, 255, 255, .88);
    font-size: 15.36px;
    line-height: 1.5;
    /* Long e-mail addresses must not push the panel wide on small screens. */
    overflow-wrap: anywhere;
}

.ctc-card__text strong {
    display: block;
    margin-bottom: 3px;
    color: rgba(255, 255, 255, .62);
    font-size: 11.84px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.ctc-card__text a {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, .34);
    text-underline-offset: 3px;
    transition: text-decoration-color .2s ease;
}

.ctc-card__text a:hover {
    color: #fff;
    text-decoration-color: #fff;
}

/* ── Referred-by panel ────────────────────────────────────────────────── */

.ctc-sponsor {
    padding: 56px 0 0;
}

.ctc-sponsor__panel {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 40px;
    align-items: center;
    padding: 36px 40px;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-lg);
    background: var(--ctc-surface);
    box-shadow: var(--ctc-shadow-md);
}

.ctc-sponsor__intro {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ctc-sponsor__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 14px;
    border-radius: 17px;
    background: var(--ctc-tint);
    color: var(--ctc-violet);
}

.ctc-sponsor__label {
    display: block;
    margin-bottom: 5px;
    color: var(--ctc-ink-faint);
    font-size: 12.48px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ctc-sponsor__intro h2 {
    font-size: clamp(22.4px, 17.6px + 1vw, 28.8px);
}

.ctc-sponsor__details p {
    color: var(--ctc-ink-soft);
    font-size: 16px;
    line-height: 1.62;
}

.ctc-sponsor__links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.ctc-sponsor__links a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 18px;
    border: 1px solid var(--ctc-line);
    border-radius: 999px;
    background: var(--ctc-surface-alt);
    color: var(--ctc-violet-deep);
    font-size: 15.36px;
    font-weight: 600;
    overflow-wrap: anywhere;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.ctc-sponsor__links a:hover {
    border-color: rgba(130, 40, 244, .4);
    color: var(--ctc-violet-deep);
    transform: translateY(-2px);
    box-shadow: var(--ctc-shadow-sm);
}

.ctc-sponsor__links .ctc-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

/* ── Direct channels ──────────────────────────────────────────────────── */

.ctc-channels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.ctc-channel {
    display: flex;
    flex-direction: column;
    padding: 36px 32px;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius);
    background: var(--ctc-surface);
    box-shadow: var(--ctc-shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.ctc-channel:hover {
    transform: translateY(-4px);
    border-color: rgba(130, 40, 244, .35);
    box-shadow: var(--ctc-shadow-md);
}

.ctc-channel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 22px;
    padding: 14px;
    border-radius: 16px;
    background: var(--ctc-tint);
    color: var(--ctc-violet);
}

.ctc-channel__label {
    display: block;
    margin-bottom: 8px;
    color: var(--ctc-ink-faint);
    font-size: 11.84px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ctc-channel h3 {
    font-size: 19.84px;
}

.ctc-channel p {
    margin-top: 12px;
    color: var(--ctc-ink-soft);
    font-size: 16px;
    line-height: 1.62;
}

.ctc-channel__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    /* Pushes the link to the bottom so every card's link lines up. */
    margin-top: auto;
    padding-top: 22px;
    color: var(--ctc-violet);
    font-size: 15.36px;
    font-weight: 600;
    /* Carries the e-mail address, which must be able to break if the card
       narrows rather than pushing the grid wide. */
    overflow-wrap: anywhere;
}

.ctc-channel__link span {
    transition: transform .2s ease;
}

.ctc-channel__link:hover {
    color: var(--ctc-violet);
}

.ctc-channel__link:hover span {
    transform: translateX(4px);
}

/* ── Where to go next ─────────────────────────────────────────────────── */

.ctc-routes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.ctc-route {
    display: flex;
    flex-direction: column;
    padding: 32px 30px;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius);
    background: var(--ctc-surface);
    box-shadow: var(--ctc-shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.ctc-route:hover {
    transform: translateY(-4px);
    border-color: rgba(130, 40, 244, .35);
    box-shadow: var(--ctc-shadow-md);
}

.ctc-route__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 14px;
    background: linear-gradient(130deg, rgba(130, 40, 244, .12) 0%, rgba(240, 27, 133, .12) 100%);
    color: var(--ctc-violet);
}

.ctc-route h3 {
    font-size: 18.24px;
}

.ctc-route p {
    margin-top: 10px;
    color: var(--ctc-ink-soft);
    font-size: 15.36px;
    line-height: 1.6;
}

.ctc-route__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 20px;
    color: var(--ctc-violet);
    font-size: 14.72px;
    font-weight: 600;
}

.ctc-route__link span {
    transition: transform .2s ease;
}

.ctc-route__link:hover {
    color: var(--ctc-violet);
}

.ctc-route__link:hover span {
    transform: translateX(4px);
}

/* ── Office ───────────────────────────────────────────────────────────── */

.ctc-office {
    padding: var(--ctc-section-y) 0;
}

.ctc-office__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
}

.ctc-office__copy p {
    max-width: 480px;
    margin-top: 20px;
    color: var(--ctc-ink-soft);
    font-size: 17.28px;
    line-height: 1.65;
}

.ctc-office__copy h2 {
    font-size: clamp(30.4px, 20.8px + 2vw, 44.8px);
}

.ctc-office__copy h2 em {
    font-style: normal;
    color: var(--ctc-violet);
}

.ctc-office__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.ctc-office__panel {
    position: relative;
    padding: 44px 40px;
    border: 1px solid var(--ctc-line);
    border-radius: var(--ctc-radius-lg);
    background:
        linear-gradient(170deg, var(--ctc-tint) 0%, var(--ctc-surface) 46%);
    box-shadow: var(--ctc-shadow-lg);
}

.ctc-office__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 24px;
    padding: 14px;
    border-radius: 17px;
    background: linear-gradient(120deg, var(--ctc-violet) 0%, var(--ctc-violet-bright) 100%);
    color: #fff;
    box-shadow: 0 12px 28px rgba(130, 40, 244, .30);
}

.ctc-office__panel h3 {
    font-size: 22.4px;
}

.ctc-office__address {
    margin-top: 12px;
    color: var(--ctc-ink-soft);
    font-size: 17.28px;
    line-height: 1.6;
}

.ctc-office__meta {
    display: grid;
    gap: 18px;
    margin-top: 30px;
    padding-top: 28px;
    border-top: 1px solid var(--ctc-line);
}

.ctc-office__meta dt {
    margin-bottom: 4px;
    color: var(--ctc-ink-faint);
    font-size: 11.84px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ctc-office__meta dd {
    color: var(--ctc-ink);
    font-size: 16px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.ctc-office__meta dd a {
    color: var(--ctc-violet-deep);
    transition: color .2s ease;
}

.ctc-office__meta dd a:hover {
    color: var(--ctc-magenta);
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
    .tgd-contact {
        --ctc-section-y: 76px;
    }

    .ctc-hero {
        padding: 84px 0 96px;
    }

    .ctc-hero__grid,
    .ctc-office__grid {
        gap: 44px;
    }

    .ctc-routes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .ctc-hero__grid,
    .ctc-office__grid,
    .ctc-sponsor__panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .ctc-hero__lede,
    .ctc-office__copy p {
        max-width: none;
    }

    .ctc-channels {
        grid-template-columns: minmax(0, 1fr);
    }

    .ctc-sponsor__panel {
        gap: 28px;
        padding: 32px 28px;
    }

    .ctc-office__panel {
        padding: 36px 30px;
    }
}

@media (max-width: 620px) {
    .tgd-contact {
        --ctc-section-y: 60px;
        --ctc-gutter: 18px;
    }

    .ctc-hero {
        padding: 64px 0 76px;
    }

    .ctc-section-head {
        margin-bottom: 40px;
    }

    .ctc-routes {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Full-width actions read better than two cramped pills side by side. */
    .ctc-hero__actions .ctc-btn,
    .ctc-office__actions .ctc-btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .ctc-channel,
    .ctc-route {
        padding: 28px 24px;
    }

    /*
     * The support e-mail is the longest unbreakable string on the page. At
     * 375px the panel is ~7px short of fitting it on one line, so the card
     * trades a little padding and type size to keep the address intact
     * instead of breaking it mid-word.
     */
    .ctc-card {
        padding: 26px 20px;
    }

    .ctc-card__text {
        font-size: 14.4px;
    }

    .ctc-office__panel {
        padding: 30px 24px;
    }
}

/* ── Reduced motion ───────────────────────────────────────────────────── */

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

    .tgd-contact *,
    .tgd-contact *::before,
    .tgd-contact *::after {
        animation: none !important;
        transition: none !important;
    }
}
