/* ═══════════════════════════════════════════════════════════════════════════
   Homepage — hero and template gallery (light design system)
   Loaded by index.php; templates.php reuses its tokens, buttons and chips.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --hx-ink: #0f172a;
    --hx-text: #475569;
    --hx-muted: #94a3b8;
    --hx-blue: #2563eb;
    --hx-teal: #0d9488;
    --hx-teal-soft: #14b8a6;
    --hx-line: rgba(148, 163, 184, .28);
    --hx-glass: rgba(255, 255, 255, .78);
    --hx-shadow: 0 24px 60px -18px rgba(15, 23, 42, .18), 0 6px 18px -8px rgba(15, 23, 42, .08);
    --hx-grad: linear-gradient(120deg, #2563eb 0%, #0ea5e9 45%, #14b8a6 100%);
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hx-hero {
    position: relative;
    overflow: hidden;
    padding: 72px 0 96px;
    background: linear-gradient(180deg, #f4f8ff 0%, #f8fbff 55%, #ffffff 100%);
    isolation: isolate;
}
.hx-hero::before,                       /* soft colour light */
.hx-hero::after {
    content: '';
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
}
.hx-hero::before { width: 560px; height: 560px; right: -120px; top: -160px; background: rgba(20, 184, 166, .20); }
.hx-hero::after  { width: 520px; height: 520px; left: -200px; top: 120px;  background: rgba(37, 99, 235, .12); }

.hx-dots {                               /* faint dot grid, fading out */
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: radial-gradient(rgba(37, 99, 235, .16) 1px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 65% 35%, #000 0%, transparent 75%);
            mask-image: radial-gradient(ellipse 70% 60% at 65% 35%, #000 0%, transparent 75%);
}
.hx-skyline {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: -1;
    width: 100%; height: clamp(48px, 13.2vw, 190px);   /* 13.2vw ≈ the drawing's 1440×190 ratio */
    pointer-events: none; opacity: .9;
}

.hx-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}

/* copy */
.hx-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px 7px 10px;
    border: 1px solid #d6e4ff; border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    color: #1e3a8a; font-size: .8rem; font-weight: 600;
    box-shadow: 0 2px 10px rgba(37, 99, 235, .06);
}
.hx-badge svg { color: var(--hx-teal-soft); flex-shrink: 0; }

.hx-title {
    margin: 22px 0 18px;
    font-size: clamp(2.2rem, 3.7vw, 3.3rem);
    line-height: 1.07;
    font-weight: 800;
    letter-spacing: -.035em;
    color: var(--hx-ink);
    text-wrap: balance;                  /* no single word left alone on a line (RU, TR) */
}
.hx-title .hx-grad {
    display: block;
    background: var(--hx-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    padding-bottom: .06em;               /* keeps descenders inside the clipped gradient */
}
.hx-desc {
    max-width: 540px;
    font-size: 1.1rem; line-height: 1.7;
    color: var(--hx-text);
    margin: 0 0 30px;
}

.hx-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }
.hx-btn {
    display: inline-flex; align-items: center; gap: 10px;
    height: 54px; padding: 0 26px;
    border-radius: 14px;
    font-size: 1rem; font-weight: 700;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.hx-btn-primary {
    color: #fff;
    background: linear-gradient(120deg, #2563eb, #0ea5e9 60%, #14b8a6);
    box-shadow: 0 12px 28px -10px rgba(14, 165, 233, .65);
}
.hx-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -10px rgba(14, 165, 233, .75); color: #fff; }
.hx-btn-ghost {
    color: var(--hx-ink);
    background: rgba(255, 255, 255, .85);
    border: 1px solid #cbd5e1;
}
.hx-btn-ghost:hover { background: #fff; border-color: #94a3b8; transform: translateY(-2px); color: var(--hx-ink); }
.hx-btn svg { flex-shrink: 0; }

.hx-stats { display: flex; flex-wrap: wrap; gap: 14px 24px; }
.hx-stat { display: flex; align-items: center; gap: 10px; }
.hx-stat-ico {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center;
    background: #fff; border: 1px solid var(--hx-line);
    color: var(--hx-blue);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}
.hx-stat strong { display: block; font-size: 1rem; color: var(--hx-ink); line-height: 1.2; white-space: nowrap; }
.hx-stat span   { font-size: .78rem; color: var(--hx-muted); white-space: nowrap; }
.hx-stars { color: #f59e0b; letter-spacing: 1px; font-size: .78rem; }

/* visual */
.hx-visual { position: relative; height: 520px; }
.hx-card {
    position: absolute;
    background: var(--hx-glass);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
            backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, .9);
    outline: 1px solid var(--hx-line);
    border-radius: 20px;
    box-shadow: var(--hx-shadow);
    color: var(--hx-ink);
}
.hx-card-title { font-size: .86rem; font-weight: 700; color: var(--hx-ink); display: flex; align-items: center; justify-content: space-between; }
.hx-card-title small { font-weight: 500; color: var(--hx-muted); }

/* back: a mini CV */
.hx-doc {
    right: 0; top: 0; width: 58%; height: 270px;
    padding: 18px;
    transform: rotate(3deg);
    background: rgba(255, 255, 255, .92);
}
.hx-doc-head { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid #eef2f7; }
.hx-doc-av {
    width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--hx-grad); color: #fff; font-weight: 800; font-size: .85rem;
}
.hx-doc-name { font-weight: 800; font-size: .86rem; }
.hx-doc-role { font-size: .7rem; color: var(--hx-blue); font-weight: 600; }
.hx-doc-sec  { margin-top: 12px; font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--hx-blue); }
.hx-doc-line { height: 6px; border-radius: 4px; background: #e8eef8; margin-top: 7px; }
.hx-doc-row  { display: flex; justify-content: space-between; margin-top: 7px; font-size: .64rem; font-weight: 700; }
.hx-doc-row span:last-child { color: var(--hx-muted); font-weight: 500; }

/* front: CV strength */
.hx-strength {
    right: 0; top: 176px; width: 60%;
    padding: 18px 20px 16px;
    z-index: 3;
}
.hx-strength-body { display: flex; align-items: center; gap: 18px; margin: 8px 0 14px; }
.hx-ring { position: relative; width: 104px; height: 104px; flex-shrink: 0; }
.hx-ring > svg { width: 100%; height: 100%; }
.hx-ring svg { transform: rotate(-90deg); }
.hx-ring-val {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; color: var(--hx-ink);
}
.hx-ring-val sup { font-size: .5em; font-weight: 700; margin: -.6em 0 0 1px; }
.hx-bars { flex: 1; min-width: 0; display: grid; gap: 9px; }
.hx-bar  { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; align-items: baseline; }
.hx-bar span { font-size: .74rem; font-weight: 600; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-bar b    { font-size: .74rem; font-weight: 800; color: var(--hx-ink); padding-left: 8px; }
.hx-bar i    { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 99px; background: #e8eef8; overflow: hidden; }
.hx-bar i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: inherit; background: var(--hx-grad); }
.hx-improve {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    background: linear-gradient(120deg, rgba(37, 99, 235, .07), rgba(20, 184, 166, .10));
    border: 1px solid rgba(20, 184, 166, .25);
    text-decoration: none; color: var(--hx-ink);
}
.hx-improve svg:first-child { color: var(--hx-teal); flex-shrink: 0; }
.hx-improve b     { display: block; font-size: .84rem; }
.hx-improve small { display: block; font-size: .72rem; line-height: 1.35; color: var(--hx-text); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.hx-improve .hx-go { margin-left: auto; color: var(--hx-blue); }

/* left top: AI match */
.hx-match {
    left: 0; top: 24px; width: 37%;
    padding: 16px 18px;
    z-index: 4;
}
.hx-match .hx-ring { width: 88px; height: 88px; margin: 10px auto 8px; }
.hx-match .hx-ring-val { font-size: 1.5rem; }
.hx-match p { margin: 0; font-size: .74rem; color: var(--hx-text); text-align: center; line-height: 1.4; }

/* left bottom: recommended jobs */
.hx-jobs {
    left: 0; top: 278px; width: 37%;
    padding: 16px 16px 12px;
    z-index: 5;
}
.hx-job { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid #eef2f7; }
.hx-job:last-of-type { border-bottom: 0; }
.hx-job-logo {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    font-weight: 800; font-size: .8rem; color: #fff;
}
.hx-job-t { font-size: .82rem; font-weight: 700; line-height: 1.25;
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hx-job-c { font-size: .7rem; color: var(--hx-muted); }
.hx-job-s { font-weight: 800; color: var(--hx-teal); white-space: nowrap; }
.hx-job > div:nth-child(2) { min-width: 0; }
.hx-jobs-all {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
    font-size: .76rem; font-weight: 700; color: var(--hx-teal); text-decoration: none;
}
.hx-jobs-all:hover { color: var(--hx-blue); }

/* the glow the front card stands on */
.hx-floor {
    position: absolute; right: 2%; bottom: -10px; width: 58%; height: 46px; z-index: 1;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(20, 184, 166, .32), rgba(37, 99, 235, .08) 55%, transparent 72%);
    filter: blur(6px);
}

/* gentle float */
@keyframes hx-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
.hx-match    { animation: hx-float 7s ease-in-out infinite; }
.hx-jobs     { animation: hx-float 8s ease-in-out .8s infinite; }
.hx-strength { animation: hx-float 9s ease-in-out .4s infinite; }
@media (prefers-reduced-motion: reduce) {
    .hx-match, .hx-jobs, .hx-strength { animation: none; }
    .hx-btn { transition: none; }
}

/* ── Template gallery ──────────────────────────────────────────────────────── */
.tg-section { padding: 96px 0; background: #fff; }
.tg-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: end; margin-bottom: 36px; }
.tg-kicker {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px;
    background: #eff6ff; color: var(--hx-blue);
    font-size: .76rem; font-weight: 700; margin-bottom: 14px;
}
.tg-head h2 { text-wrap: balance; font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; color: var(--hx-ink); margin: 0 0 12px; }
.tg-head p  { max-width: 620px; color: var(--hx-text); font-size: 1.02rem; line-height: 1.7; margin: 0; }
.tg-points { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; padding: 0; list-style: none; }
.tg-points li { display: flex; align-items: center; gap: 7px; font-size: .86rem; color: #334155; font-weight: 500; }
.tg-points li svg { color: var(--hx-teal-soft); flex-shrink: 0; }
.tg-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.tg-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.tg-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-arrows { display: flex; gap: 8px; flex-shrink: 0; }
.tg-arrow {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center;
    border: 1px solid #e2e8f0; background: #fff; color: var(--hx-ink);
    transition: all .15s ease;
}
.tg-arrow:hover:not(:disabled) { border-color: #93c5fd; color: var(--hx-blue); }
.tg-arrow:disabled { opacity: .35; cursor: default; }
.tg-filter {
    height: 36px; padding: 0 16px; border-radius: 999px;
    border: 1px solid #e2e8f0; background: #fff;
    font-size: .84rem; font-weight: 600; color: #475569;
    transition: all .15s ease;
}
.tg-filter:hover { border-color: #93c5fd; color: var(--hx-blue); }
.tg-filter.is-on { background: var(--hx-ink); border-color: var(--hx-ink); color: #fff; }

.tg-track {
    display: grid; grid-auto-flow: column;
    grid-auto-columns: calc((100% - 3 * 22px) / 4);
    gap: 22px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding: 0 2px;
    padding: 10px 2px 20px;
    scrollbar-width: none;
}
.tg-track::-webkit-scrollbar { display: none; }
.tg-card { scroll-snap-align: start; }
.tg-card { position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.tg-card[hidden] { display: none; }
.tg-shot {
    position: relative; overflow: hidden;
    aspect-ratio: 620 / 877;               /* A4, the builder's paper */
    border-radius: 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px -14px rgba(15, 23, 42, .25);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.tg-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.tg-card:hover .tg-shot,
.tg-card:focus-visible .tg-shot { transform: translateY(-6px); box-shadow: 0 26px 50px -18px rgba(37, 99, 235, .35); border-color: #93c5fd; }
.tg-over {
    position: absolute; inset: 0;
    display: flex; align-items: flex-end; justify-content: center;
    padding: 18px;
    background: linear-gradient(180deg, transparent 45%, rgba(15, 23, 42, .55));
    opacity: 0; transition: opacity .22s ease;
}
.tg-card:hover .tg-over, .tg-card:focus-visible .tg-over { opacity: 1; }
.tg-use {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 12px;
    background: #fff; color: var(--hx-ink); font-size: .86rem; font-weight: 700;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .25);
}
.tg-tag {                               /* beside the name — over the image it covered the CV's own header */
    display: inline-block; vertical-align: 2px; margin-left: 6px;
    padding: 2px 8px; border-radius: 6px;
    font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.tg-tag-free { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.tg-tag-pro  { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; }
.tg-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 2px 0; }
.tg-name { font-weight: 700; font-size: .95rem; color: var(--hx-ink); }
.tg-kind { font-size: .76rem; color: var(--hx-muted); }
.tg-more { display: flex; justify-content: center; margin-top: 36px; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .hx-visual { height: 480px; }
}
@media (max-width: 960px) {
    .hx-hero  { padding: 48px 0 72px; }
    .hx-grid  { grid-template-columns: 1fr; gap: 40px; }
    .hx-copy  { text-align: center; }
    .hx-desc  { margin-left: auto; margin-right: auto; }
    .hx-actions, .hx-stats { justify-content: center; }
    .hx-visual { height: 470px; max-width: 620px; width: 100%; margin: 0 auto; }
    .tg-head  { grid-template-columns: 1fr; }
    .tg-track { grid-auto-columns: calc((100% - 2 * 22px) / 3); }
}
@media (max-width: 640px) {
    .hx-title  { font-size: 2.15rem; }
    .hx-btn    { width: 100%; justify-content: center; }
    .hx-stats  { gap: 12px 18px; }
    .hx-visual { height: auto; display: grid; grid-template-columns: 1fr; gap: 14px; }
    .hx-card   { position: relative; inset: auto; width: auto; animation: none; }
    .hx-doc, .hx-floor { display: none; }
    .hx-match  { display: grid; grid-template-columns: 72px 1fr; column-gap: 14px; align-items: center; text-align: left; }
    .hx-match .hx-card-title { grid-column: 2; grid-row: 1; align-self: end; }
    .hx-match .hx-card-title svg { display: none; }
    .hx-match .hx-ring { grid-column: 1; grid-row: 1 / span 2; margin: 0; width: 72px; height: 72px; }
    .hx-match p { grid-column: 2; grid-row: 2; align-self: start; margin-top: 2px; }
    .hx-match .hx-ring-val { font-size: 1.2rem; }
    .hx-match p { text-align: left; }
    .tg-section { padding: 64px 0; }
    .tg-track  { grid-auto-columns: 64%; gap: 14px; }
    .tg-bar    { flex-direction: column; align-items: stretch; }
    .tg-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .tg-filter { flex-shrink: 0; }
    .tg-arrows { display: none; }
    .tg-over   { opacity: 1; background: linear-gradient(180deg, transparent 62%, rgba(15, 23, 42, .45)); }
}
