/*
 * The tool's landing page (views/home.ejs). Loaded after tester.css and built on its tokens and buttons.
 * Light, centred layout (the user asked for punchout-tester.takeoffdigital.co.uk's structure), in our brand:
 * navy text, the #4D6BC0 → #1C99E6 accents, Manrope headings and IBM Plex Sans text.
 */

.page-home { background: #FFFFFF; }
.home-wrap { width: min(1160px, 100%); margin: 0 auto; padding: 0 24px; }

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

.home-nav { position: sticky; top: 0; z-index: 100; background: #FFFFFF; border-bottom: 1px solid var(--line-soft); }
.home-nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.home-brand { margin-right: auto; min-width: 0; }
/* The brand partial is position: fixed in the testers' corner; here it sits in the bar, on white */
.home-brand .brand, .home-foot-about .brand { position: static; width: auto; height: auto; padding: 0; background: none; border: 0; }
.home-brand .brand-name, .home-foot-about .brand-name { color: var(--text-strong); }
.home-brand .brand-by, .home-foot-about .brand-by { color: var(--muted); }
.home-links { display: flex; gap: 24px; }
.home-links a { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none; }
.home-links a:hover { color: var(--brand-1); }

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

.home-hero { padding: 88px 0 96px; text-align: center; background: radial-gradient(60% 70% at 50% 0%, #EEF4FB 0%, rgba(238, 244, 251, 0) 100%), #FFFFFF; }
.home-hero-inner { display: grid; justify-items: center; gap: 22px; }
.home-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--bg-soft); border: 1px solid #D6E3F5; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--brand-1); }
.home-pill svg { width: 14px; height: 14px; fill: currentColor; }
.home-hero h1 { max-width: 20ch; font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem); line-height: 1.1; letter-spacing: -.025em; }
.home-accent { background: linear-gradient(90deg, #4D6BC0, #1C99E6); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.home-lead { max-width: 68ch; font-size: 17px; line-height: 1.65; color: var(--text); }
.home-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }
.home-hero-aside { font-size: 14.5px; color: var(--muted); }
.home-hero-aside svg { width: 16px; height: 16px; fill: #1B7F3B; vertical-align: -3px; margin-right: 6px; }
.home-hero-aside a { font-weight: 600; color: var(--brand-1); }
.btn-lg { padding: 12px 20px; font-size: 15px; border-radius: 12px; }
.btn-lg svg { width: 18px; height: 18px; fill: currentColor; }

/* ------------------------------------------------------------------ bands */

.home-band { padding: 88px 0; background: #FFFFFF; }
.home-band-soft { background: var(--bg); }
.home-head { display: grid; justify-items: center; gap: 12px; text-align: center; margin-bottom: 48px; }
.home-head h2 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); line-height: 1.2; letter-spacing: -.02em; }
.home-head > p { max-width: 64ch; font-size: 16px; color: var(--muted); }

.home-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.home-cards .home-card { padding: 24px; }
.home-card { display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: 16px; box-shadow: var(--shadow); }
.home-card h3 { font-size: 18px; }
.home-card > p { font-size: 14.5px; }
.home-tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.home-tile svg { width: 22px; height: 22px; fill: currentColor; }
.home-tile-sm { width: 34px; height: 34px; border-radius: 9px; }
.home-tile-sm svg { width: 18px; height: 18px; }
.home-tile-blue { background: #E3F2FC; color: var(--brand-2); }
.home-tile-teal { background: #E0F7FC; color: #0E8FB5; }
.home-tile-indigo { background: #E8ECF8; color: var(--brand-1); }
.home-tile-green { background: #E7F6EC; color: #1B7F3B; }
.home-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.home-checks li { display: flex; gap: 8px; align-items: flex-start; }
.home-checks svg { width: 16px; height: 16px; flex: none; margin-top: 3px; fill: var(--brand-2); }
.home-link { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--brand-1); text-decoration: none; }
.home-link svg { width: 16px; height: 16px; fill: currentColor; transition: transform .15s; }
.home-link:hover svg { transform: translateX(3px); }

.home-systems { list-style: none; margin: 0 auto; padding: 0; max-width: 1040px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.home-systems li { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px; font-family: var(--font-display); font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--text-strong); background: #FFFFFF; border: 1px solid var(--line-soft); border-radius: 12px; }
.home-systems img { width: 24px; height: 24px; flex: none; object-fit: contain; border-radius: 4px; }
.home-system-any { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 6px; background: #E3F2FC; color: var(--brand-2); }
.home-system-any svg { width: 16px; height: 16px; fill: currentColor; }

.home-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; text-align: center; }
.home-steps li { display: grid; justify-items: center; gap: 10px; align-content: start; }
.home-step-num { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 14px; background: #E3F2FC; color: var(--brand-1); font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.home-steps h3 { font-size: 17px; }
.home-steps p { max-width: 36ch; font-size: 14.5px; }

.home-about { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.home-about h2 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); line-height: 1.2; letter-spacing: -.02em; margin-bottom: 16px; }
.home-about > div > p + p { margin-top: 12px; }
.home-about > div > p { font-size: 16px; line-height: 1.7; }
/* Highlighted: navy card, the one place in the page body that sells our service */
.home-about-card { display: grid; gap: 12px; padding: 28px; border-radius: 16px; color: #C9D4E6; background-color: var(--navy); background-image: radial-gradient(120% 90% at 100% 0%, rgba(28, 153, 230, .28), transparent 60%), linear-gradient(160deg, #0F1B2D 0%, #16294A 100%); box-shadow: var(--shadow-lg); }
.home-about-kicker { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--brand-light); }
.home-about-title { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.3; color: #FFFFFF; }
.home-about-card .btn { justify-self: start; margin-top: 6px; }
.home-about-card .btn svg { width: 16px; height: 16px; fill: currentColor; }

.home-protocols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.home-card-title { display: flex; align-items: center; gap: 12px; }
.home-terms { margin: 4px 0 0; padding: 16px; display: grid; gap: 10px; font-size: 14px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 12px; }
.home-terms dt { color: var(--text-strong); }
.home-terms dd { margin: 2px 0 0; color: var(--muted); }

.home-faq-wrap { max-width: 860px; }
.home-faqs { border-top: 1px solid var(--line-soft); }
.home-faq { border-bottom: 1px solid var(--line-soft); }
.home-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; padding: 20px 0; font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--text-strong); list-style: none; }
.home-faq summary::-webkit-details-marker { display: none; }
.home-faq-mark { position: relative; flex: none; width: 14px; height: 14px; }
.home-faq-mark::before, .home-faq-mark::after { content: ""; position: absolute; background: var(--brand-1); transition: transform .2s, opacity .2s; }
.home-faq-mark::before { top: 6px; left: 0; width: 14px; height: 2px; }
.home-faq-mark::after { top: 0; left: 6px; width: 2px; height: 14px; }
.home-faq[open] .home-faq-mark::after { transform: scaleY(0); opacity: 0; }
.home-faq p { padding-bottom: 20px; max-width: 72ch; line-height: 1.7; }

.home-ready .home-head { margin-bottom: 0; }

/* ------------------------------------------------------------------ funnel to the main site */

.home-funnel { padding: 0 0 88px; background: var(--bg); }
.home-funnel-card { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 48px; border-radius: 20px; color: #C9D4E6; background-color: var(--navy); background-image: radial-gradient(120% 70% at 50% 0%, rgba(15, 27, 45, 0) 40%, rgba(15, 27, 45, .9) 100%), linear-gradient(rgba(140, 170, 230, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 170, 230, .09) 1px, transparent 1px), linear-gradient(160deg, #0F1B2D 0%, #16294A 100%); background-size: 100% 100%, 40px 40px, 40px 40px, 100% 100%; }
.home-funnel-kicker { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--brand-light); }
.home-funnel h2 { margin-top: 10px; color: #FFFFFF; font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.1rem); line-height: 1.2; letter-spacing: -.02em; }
.home-funnel-steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; }
.home-funnel-steps li { display: flex; gap: 14px; align-items: flex-start; }
.home-funnel-steps li > span { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: rgba(143, 216, 255, .14); color: var(--brand-light); font-family: var(--font-display); font-weight: 600; }
.home-funnel-steps li:last-child > span { background: var(--brand-grad); color: #FFFFFF; }
.home-funnel-steps strong { font-family: var(--font-display); font-weight: 600; color: #FFFFFF; }
.home-funnel-steps p { margin-top: 2px; font-size: 14px; color: #B7C4D9; }
.home-funnel-cta { display: grid; gap: 14px; justify-items: center; text-align: center; }
.home-funnel-cta .btn { width: 100%; }
.home-funnel-cta .btn svg { width: 18px; height: 18px; fill: currentColor; }
.home-funnel-secondary { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--brand-light); }
.home-funnel-secondary:hover { color: #FFFFFF; }

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

.home-foot { padding: 56px 0 24px; border-top: 1px solid var(--line-soft); background: #FFFFFF; font-size: 14px; }
.home-foot-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.home-foot-about { display: grid; gap: 14px; align-content: start; max-width: 40ch; color: var(--muted); }
.home-foot nav { display: grid; gap: 10px; align-content: start; }
.home-foot nav a { color: var(--text); text-decoration: none; }
.home-foot nav a:hover { color: var(--brand-1); }
.home-foot-title { font-family: var(--font-display); font-weight: 600; color: var(--text-strong); margin-bottom: 4px; }
.home-foot-base { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line-soft); text-align: center; font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------ narrower screens */

@media (max-width: 1024px) {
    .home-systems { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .home-cards, .home-steps, .home-protocols, .home-about, .home-funnel-card { grid-template-columns: minmax(0, 1fr); }
    .home-funnel-card { padding: 32px 24px; gap: 28px; }
    .home-funnel { padding-bottom: 64px; }
    .home-hero { padding: 56px 0 64px; }
    .home-band { padding: 64px 0; }
    .home-head { margin-bottom: 32px; }
    .home-foot-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .home-foot-about { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .home-wrap { padding: 0 16px; }
    .home-links { display: none; }
    .home-brand .brand-by { display: none; }
    .home-systems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-systems li { font-size: 13px; padding: 10px; }
    .home-ctas .btn { flex: 1 1 100%; }
}

/* ------------------------------------------------------------------ motion (keyframes in tester.css)
 * The hero rises in on load; each section rises in the first time it scrolls into view (public/js/home.js adds
 * .is-in). Without JavaScript, or with reduced motion, everything is simply shown.
 */
@media (prefers-reduced-motion: no-preference) {
    .home-hero-inner > * { animation: pt-rise .45s ease-out both; }
    .home-hero-inner > :nth-child(2) { animation-delay: .06s; }
    .home-hero-inner > :nth-child(3) { animation-delay: .12s; }
    .home-hero-inner > :nth-child(4) { animation-delay: .18s; }
    .home-hero-inner > :nth-child(5) { animation-delay: .24s; }

    .js-motion [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .5s ease-out, transform .5s ease-out; transition-delay: calc(var(--i, 0) * 60ms); }
    .js-motion [data-reveal].is-in { opacity: 1; transform: none; }
    /* The system tiles pop in quickly, one after another */
    .js-motion .home-systems [data-reveal] { transform: translateY(8px) scale(.97); transition-duration: .28s; transition-delay: calc(var(--i, 0) * 45ms); }
    .js-motion .home-systems [data-reveal].is-in { transform: none; }

    .home-card, .home-systems li { transition: transform .2s ease-out, box-shadow .2s ease-out, border-color .2s; }
    .home-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(15, 27, 45, .08); }
    .home-systems li:hover { transform: translateY(-2px); border-color: #C7D6F0; }
    .home-faq[open] p { animation: pt-drop .2s ease-out; }
}
