/* Home page on the design system tokens. Builds on product-page.css (.pd-*). */

/* Hero: Ink, the text on the left and the ERP screen in the application frame */
.hm-hero {
    background: var(--ink);
    color: var(--ink-text);
    padding: 9rem 32px 96px;
}

.hm-hero-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 56px;
}

.hm-hero-text { flex: 1 1 560px; min-width: 0; }

.hm-eyebrow {
    margin: 0;
    color: var(--ink-text-2);
    font-size: 15px;
    font-weight: 600;
}

.hm-title {
    margin: 16px 0 18px;
    font-family: var(--font);
    font-weight: 500;
    font-size: 58px;
    line-height: 1.06;
    letter-spacing: -.02em;
    color: #fff;
}

.hm-lead { max-width: 600px; font-size: 19px; line-height: 1.5; color: var(--ink-text-2); }
.hm .pd-hero-actions { margin-top: 30px; }
.hm .pd-stats { margin-top: 40px; }

.hm-frame {
    flex: 1 1 460px;
    max-width: 600px;
    min-width: 0;
    padding: 0 8px 8px;
    border: 1px solid var(--ink-line);
    border-radius: var(--r-sheet);
    background: var(--ink-panel);
    font-size: 13px;
    animation: hm-frame-in var(--t-base) ease-out both;
}

.hm-frame-top {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    height: 48px;
    padding: 0 var(--s-2);
    color: var(--ink-text-2);
}

.hm-frame-top .plogo { --plogo-h: 20px; }

.hm-frame-search {
    flex: 1;
    max-width: 200px;
    height: 28px;
    margin-left: var(--s-2);
    padding: 0 10px;
    border: 1px solid var(--ink-line);
    border-radius: 8px;
    line-height: 26px;
    font-size: 12.5px;
}

.hm-frame-org { margin-left: auto; white-space: nowrap; font-size: 12.5px; }

.hm-frame-sheet {
    padding: var(--s-5);
    border-radius: var(--r-panel);
    background: var(--sheet);
    color: var(--text);
}

.hm-frame-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.hm-frame-head b { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.hm-frame-head span { color: var(--text-2); }

.hm-frame-kpis {
    margin-top: var(--s-4);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s-2);
}

.hm-frame-kpis > span {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-control);
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.3;
}

.hm-frame-kpis b { color: var(--text); font-size: 18px; font-weight: 600; white-space: nowrap; }

.hm-frame-rows { margin-top: var(--s-4); display: flex; flex-direction: column; }

.hm-frame-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 104px;
    align-items: center;
    gap: var(--s-3);
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.hm-frame-row > span:first-child { display: flex; flex-direction: column; color: var(--text-2); font-size: 12px; }
.hm-frame-row b { color: var(--text); font-size: 13px; font-weight: 600; }
.hm-frame-sum { font-weight: 600; white-space: nowrap; }
.hm-frame-row .status { justify-self: start; }

@keyframes hm-frame-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* Products */
.hm-core { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.hm-core-card {
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    display: flex;
    flex-direction: column;
    background: var(--sheet);
    color: var(--text);
    transition: border-color var(--t-fast);
}

.hm-core-card:hover { border-color: var(--line-strong); color: var(--text); }
.hm-core-body { padding: 28px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.hm-core-name { --plogo-h: 30px; align-self: flex-start; }
.hm-core-title { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; min-height: 2.6em; }
.hm-core-card .pd-tick { background: var(--plogo-tint); color: var(--plogo-text); }
.hm--erp { --plogo-tint: var(--p-erp-tint); --plogo-text: var(--p-erp-text); }
.hm--chat { --plogo-tint: var(--p-chat-tint); --plogo-text: var(--p-chat-text); }
.hm--hub { --plogo-tint: var(--p-hub-tint); --plogo-text: var(--p-hub-text); }

.hm-core-price {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    color: var(--text-2);
    font-size: 14px;
}

.hm-core-price b { font-size: 28px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.hm-core-more { margin-left: auto; color: var(--link); font-weight: 600; font-size: 14px; }

.hm-more { margin-top: 20px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }

.hm-more-card {
    border-radius: var(--r-panel);
    background: var(--mist);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text);
    transition: background-color var(--t-fast);
}

.hm-more-card:hover { background: var(--line); color: var(--text); }
.hm-more-head { display: flex; align-items: center; gap: 8px; }
.hm-more-head .plogo { --plogo-h: 22px; }

.hm-tag {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: var(--r-status);
    background: var(--mute-bg);
    color: var(--mute);
    font-size: 11.5px;
    font-weight: 600;
}

.hm-more-text { color: var(--text-2); font-size: 14px; line-height: 1.4; }

/* A day in the agency */
.hm-day { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }

.hm-day li {
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-2);
}

.hm-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hm-day-head b { font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.hm-day-head .pbadge { --plogo-h: 32px; }

/* Section head with a link on the right */
.hm-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 28px; }
.hm-head > div { flex: 1 1 600px; }
.hm .hm-all { color: var(--link); font-weight: 600; font-size: 15px; }
.hm .hm-all:hover { color: var(--cobalt); }

/* Tools */
.hm-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.hm-tool {
    border-radius: var(--r-panel);
    background: var(--mist);
    padding: 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    color: var(--text);
    transition: background-color var(--t-fast);
}

.hm-tool:hover { background: var(--line); color: var(--text); }

.hm-tool-icon {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: var(--r-control);
    background: var(--sheet);
    color: var(--link);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hm-tool-text { display: flex; flex-direction: column; gap: 2px; }
.hm-tool-text b { font-size: 15px; font-weight: 600; }
.hm-tool-text span { color: var(--text-2); font-size: 14px; line-height: 1.45; }

/* Services */
.hm-svc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.hm-svc-card {
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hm-svc-head { display: flex; align-items: center; gap: 10px; }

.hm-svc-n {
    width: 28px;
    height: 28px;
    border-radius: var(--r-status);
    background: var(--mist);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.hm-svc-head h3 { margin: 0; font-family: var(--font); font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.hm-svc-card p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.5; min-height: 3em; }
.hm-svc-links { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.hm-svc-links a { display: flex; justify-content: space-between; font-size: 15px; font-weight: 600; color: var(--text); }
.hm-svc-links a span { color: var(--text-2); }
.hm-svc-links a:hover { color: var(--link); }

.hm-trust {
    margin-top: 16px;
    border-radius: var(--r-panel);
    background: var(--ink);
    color: var(--ink-text);
    padding: 24px 30px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 32px;
}

.hm-trust b { font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: #fff; }
.hm-trust > span { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-text-2); }
.hm-trust > span svg { flex: none; color: var(--teal); }
.hm .hm-trust a { margin-left: auto; color: #fff; font-weight: 600; font-size: 15px; }
.hm .hm-trust a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Blog */
.hm-posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.hm-post {
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--sheet);
    color: var(--text);
    transition: border-color var(--t-fast);
}

.hm-post:hover { border-color: var(--line-strong); color: var(--text); }
.hm-post-img { position: relative; height: 180px; background: var(--ink); }
.hm-post-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hm-post-cat {
    position: absolute;
    left: 16px;
    bottom: 14px;
    padding: 3px 9px;
    border-radius: var(--r-status);
    background: var(--sheet);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
}

.hm-post-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.hm-post-date { color: var(--text-2); font-size: 13px; }
.hm-post-body h3 { margin: 0; font-family: var(--font); font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; color: var(--text); }
.hm-post:hover h3 { color: var(--link); }
.hm-post-excerpt { color: var(--text-2); font-size: 15px; line-height: 1.5; }

/* Logos */
.hm-logos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.hm-logo-group { border: 1px solid var(--line); border-radius: var(--r-panel); padding: 28px 30px; }
.hm-logo-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 18px; }
.hm-logo-head h2 { margin: 0; font-family: var(--font); font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.hm-logo-head span { color: var(--text-2); font-size: 14px; }
.hm-logo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.hm-logo {
    height: 54px;
    border-radius: var(--r-control);
    background: var(--mist);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
}

.hm-logo img { max-width: 100%; max-height: 30px; width: auto; height: auto; object-fit: contain; filter: grayscale(1); opacity: .75; transition: filter var(--t-fast), opacity var(--t-fast); }
.hm-logo:hover img { filter: none; opacity: 1; }

/* Newsletter */
.hm-news {
    border-radius: var(--r-sheet);
    background: var(--mist);
    padding: 40px 44px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px 48px;
}

.hm-news-text { flex: 1 1 420px; }
.hm-news-text h2 { margin: 0 0 6px; font-family: var(--font); font-size: 24px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.hm-news-text p { margin: 0; color: var(--text-2); }
.hm-news-form { flex: 1 1 460px; display: flex; flex-direction: column; gap: 8px; }
.hm-news-row { display: flex; gap: 10px; }
.hm-news-label { flex: 1; display: flex; }

.hm-news-form .newsletter-input {
    flex: 1;
    min-width: 0;
    height: var(--h-control);
    border-radius: var(--r-control);
    border: 1px solid var(--line-strong);
    background: var(--sheet);
    color: var(--text);
    padding: 0 14px;
    font: inherit;
    font-size: 14px;
}

.hm-news-form .newsletter-submit {
    padding: 0 6px 0 16px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--r-control);
    font-size: 14px;
    gap: 12px;
}

.hm-news-form .newsletter-submit:hover { background: var(--cobalt); transform: none; box-shadow: none; }

.hm-news-form .newsletter-input:focus { outline: 2px solid var(--action); outline-offset: 1px; border-color: var(--action); }
.hm-news-note { color: var(--text-2); font-size: 13px; }
.hm-news-note a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }

/* Demo */
.hm-demo-phone { margin-top: 16px !important; color: var(--ink-text-2); }
.hm .hm-demo-phone a { color: #fff; font-weight: 600; }

@media (max-width: 1100px) {
    .hm-core { grid-template-columns: 1fr; }
    .hm-more { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hm-day { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-tools, .hm-svc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-posts, .hm-logos { grid-template-columns: 1fr; }
    .hm-core-title { min-height: 0; }
    .hm-frame { max-width: none; }
}

@media (max-width: 768px) {
    .hm-hero { padding: 7rem 20px 56px; }
    .hm-hero-inner { gap: 40px; }
    .hm-title { font-size: 38px; }
    .hm-lead { font-size: 17px; }
    .hm-frame { flex-basis: 100%; }
    .hm-frame-search { display: none; }
    .hm-frame-sheet { padding: var(--s-4); }
    .hm-frame-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-frame-row { grid-template-columns: minmax(0, 1fr) auto; }
    .hm-frame-sum { display: none; }
    .hm-more, .hm-day, .hm-tools, .hm-svc { grid-template-columns: 1fr; }
    .hm-svc-card p { min-height: 0; }
    .hm-trust { padding: 22px 20px; }
    .hm .hm-trust a { margin-left: 0; }
    .hm-logo-group, .hm-news { padding: 24px 20px; }
    .hm-news-row { flex-direction: column; }
    .hm-logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .hm-frame { animation: none; }
}
