/* ==========================================================================
   TenGrains — refinement layer
   Loaded after the design-system tokens. Elevates browser surfaces, type,
   interaction and motion across every public page without changing brand.
   ========================================================================== */

/* ---------- Browser surfaces ---------- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
    scrollbar-color: var(--tg-ink-300) var(--tg-ink-50);
    caret-color: var(--tg-teal-600);
}
::selection { background: var(--tg-teal-200); color: var(--tg-navy); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--tg-ink-50); }
::-webkit-scrollbar-thumb { background: var(--tg-ink-300); border: 3px solid var(--tg-ink-50); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--tg-ink-400); }

:focus-visible {
    outline: 2px solid var(--tg-teal-700);
    outline-offset: 3px;
    box-shadow: none;
    border-radius: 2px;
}
.tg-footer :focus-visible, #tg-video-modal :focus-visible, #sec-kpi_bar :focus-visible, #sec-testimonial :focus-visible, #sec-cta :focus-visible { outline-color: var(--tg-teal-400); }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

/* Skip link */
.tg-skip {
    position: absolute; left: 16px; top: -60px; z-index: 2000;
    padding: 10px 16px; background: var(--tg-navy); color: #fff !important;
    font-weight: 600; font-size: 14px; border-radius: var(--tg-radius-sm);
    transition: top 180ms var(--tg-ease);
}
.tg-skip:focus { top: 12px; text-decoration: none !important; }

/* ---------- Typography ---------- */
/* Archivo Black ships one weight; stop browsers faking a heavier one. */
h1, h2, h3, h4, .tg-h1, .tg-h2, .tg-h3, .tg-hero-title,
[style*="--tg-font-display"] {
    font-synthesis: none;
}
h1, h2, h3, .tg-h1, .tg-h2 { text-wrap: balance; }
p, li, blockquote { text-wrap: pretty; hanging-punctuation: first; }

/* Numerals in stats read as data */
[data-target], .tg-hero-stat-num, .tg-stat-num, .tg-kpi-value,
[style*="font-family: var(--tg-font-display)"] {
    font-variant-numeric: tabular-nums lining-nums;
}

a { text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ---------- Buttons ---------- */
.tg-btn {
    position: relative;
    transition: transform 220ms var(--tg-ease-out),
                background-color 180ms var(--tg-ease),
                border-color 180ms var(--tg-ease),
                box-shadow 220ms var(--tg-ease-out),
                color 180ms var(--tg-ease) !important;
}
.tg-btn:hover { transform: translateY(-1px); }
.tg-btn:active { transform: translateY(0) scale(.985); transition-duration: 80ms !important; }
.tg-btn-primary:hover { box-shadow: 0 8px 22px -8px rgba(7,10,76,.55); }
.tg-btn-accent:hover, .tg-btn-teal:hover { box-shadow: 0 8px 22px -10px rgba(52,117,133,.7); }
.tg-btn svg { transition: transform 240ms var(--tg-ease-out); }
.tg-btn:hover svg:last-child { transform: translateX(3px); }
.tg-btn[disabled], .tg-btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ---------- Header ---------- */
.tg-site-header {
    transition: box-shadow 260ms var(--tg-ease), background-color 260ms var(--tg-ease), border-color 260ms var(--tg-ease) !important;
}
.tg-site-header.is-scrolled {
    box-shadow: 0 10px 30px -18px rgba(7,10,76,.35) !important;
    border-bottom-color: transparent !important;
}
.tg-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    align-self: stretch;
    font-weight: 500;
    color: var(--tg-ink-600);
    text-decoration: none !important;
}
.tg-nav-link::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: var(--tg-teal-500);
    transform: scaleX(0); transform-origin: left;
    transition: transform 280ms var(--tg-ease-out);
}
.tg-nav-link:hover { color: var(--tg-navy); }
.tg-nav-link:hover::after, .tg-nav-link[aria-current="page"]::after { transform: scaleX(1); }
.tg-nav-link[aria-current="page"] { color: var(--tg-navy); font-weight: 600; }
.tg-dd > .tg-nav-link svg { transition: transform 240ms var(--tg-ease-out); }
.tg-dd:hover > .tg-nav-link svg, .tg-dd:focus-within > .tg-nav-link svg { transform: rotate(180deg); }
.tg-dd-panel { padding-top: 10px !important; }
.tg-dd-link { display: block; transition: background-color 160ms var(--tg-ease), color 160ms var(--tg-ease), padding-left 220ms var(--tg-ease-out); }
.tg-dd-link:hover { padding-left: 16px !important; }
.tg-dd-desc { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; line-height: 1.4; color: var(--tg-ink-500); }

/* Mobile drawer */
.tg-menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; }
.tg-menu-btn .tg-menu-close { display: none; }
.tg-menu-btn[aria-expanded="true"] .tg-menu-open { display: none; }
.tg-menu-btn[aria-expanded="true"] .tg-menu-close { display: inline-flex; }
#tg-mobile-drawer.is-open { animation: tg-drawer-in 320ms var(--tg-ease-out); }
@keyframes tg-drawer-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.tg-drawer-link { transition: color 160ms var(--tg-ease), padding-left 220ms var(--tg-ease-out); }
.tg-drawer-link:hover { color: var(--tg-navy) !important; padding-left: 6px; text-decoration: none !important; }

/* ---------- Footer ---------- */
.tg-footer a.tg-footer-link {
    color: rgba(255,255,255,.74);
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%;
    transition: color 180ms var(--tg-ease), background-size 300ms var(--tg-ease-out);
}
.tg-footer a.tg-footer-link:hover { color: #fff; background-size: 100% 1px; text-decoration: none; }
.tg-footer-cta-title {
    font-family: var(--tg-font-display);
    font-size: clamp(34px, 5.4vw, 72px);
    line-height: .96;
    letter-spacing: -0.03em;
    color: #fff;
    margin: 0;
    max-width: 14ch;
}
.tg-footer-cta-title em { font-style: normal; color: var(--tg-teal-400); }
@media (max-width: 1024px) {
    .tg-footer-top { grid-template-columns: 1fr !important; gap: 32px !important; }
}

/* ---------- Cards ---------- */
.tg-card-interactive, .tg-case {
    transition: border-color 220ms var(--tg-ease), box-shadow 320ms var(--tg-ease-out), transform 320ms var(--tg-ease-out) !important;
}
.tg-card-interactive:hover, .tg-case:hover {
    border-color: var(--tg-ink-300) !important;
    box-shadow: 0 18px 40px -22px rgba(7,10,76,.45) !important;
    transform: translateY(-3px);
}
.tg-case img { transition: transform 700ms var(--tg-ease-out); }
.tg-case:hover img { transform: scale(1.035); }
.tg-case:hover .tg-case-rule { background: var(--tg-teal-500) !important; }

/* ---------- Scroll reveal (progressive: content is visible without JS) ---------- */
html.tg-js .tg-sr:not(.is-in) { opacity: 0; translate: 0 18px; }
html.tg-js .tg-sr {
    transition: opacity 700ms var(--tg-ease-out), translate 900ms var(--tg-ease-out) !important;
    transition-delay: var(--tg-sr-delay, 0ms) !important;
}

/* Hero entrance used by section heroes: only hidden when JS is present */
.tg-reveal { opacity: 1 !important; transform: none !important; }
html.tg-js .tg-hero-section .tg-reveal:not(.tg-revealed) { opacity: 0 !important; transform: translateY(16px) !important; }
html.tg-js .tg-hero-section .tg-reveal { transition: opacity 760ms var(--tg-ease-out), transform 900ms var(--tg-ease-out) !important; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
    html.tg-js .tg-sr, html.tg-js .tg-hero-section .tg-reveal:not(.tg-revealed) { opacity: 1 !important; transform: none !important; translate: none !important; }
}

/* ---------- Responsive fixes ---------- */
@media (max-width: 1024px) {
    .tg-faq-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
}
@media (max-width: 640px) {
    .tg-team-photo { aspect-ratio: 4 / 3 !important; }
}
@media (max-width: 900px) {
    .tg-3col-story { grid-template-columns: 1fr !important; gap: 36px !important; }
}

/* ---------- Brand-surface heroes (build / growth overviews) ---------- */
.tg-brand-hero [data-hero-copy] h1 { color: var(--tg-white) !important; }
.tg-brand-hero [data-hero-copy] .tg-eyebrow { color: var(--tg-teal-300) !important; }
.tg-brand-hero [data-hero-copy] :is(p, div, span, li):not(.tg-btn):not(.tg-btn *):not(.tg-eyebrow) { color: rgba(255,255,255,.76) !important; border-color: rgba(255,255,255,.2) !important; }
.tg-brand-hero [data-hero-copy] strong { color: var(--tg-white) !important; }

/* ---------- Footer on small screens ---------- */
@media (max-width: 1024px) {
    .tg-footer .tg-footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 40px 24px !important; padding-bottom: 48px !important; }
    .tg-footer .tg-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .tg-footer .tg-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 36px 20px !important; }
    .tg-footer .tg-footer-brand .tg-btn { width: 100%; }
    .tg-footer ul { gap: 11px !important; font-size: 14px !important; }
    .tg-footer .tg-footer-mark { padding-bottom: 24px !important; }
    .tg-footer .tg-footer-mark img { margin-top: 28px !important; }
}

/* ==========================================================================
   Home page — phone layout pass
   ========================================================================== */
@media (max-width: 640px) {
    /* Hero: compact stats strip instead of a tall panel */
    .tg-hero-section .tg-hero-container { padding-top: 40px !important; padding-bottom: 40px !important; gap: 28px !important; }
    .tg-hero-section .tg-hero-panel { padding: 18px 16px !important; gap: 14px !important; }
    .tg-hero-section .tg-panel-tabs,
    .tg-hero-section .tg-panel-desc,
    .tg-hero-section .tg-panel-footer,
    .tg-hero-section .tg-panel-divider,
    .tg-hero-section .tg-stat-chip,
    .tg-hero-section .tg-stat-sublabel { display: none !important; }
    .tg-hero-section .tg-panel-stats-list { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 !important; }
    .tg-hero-section .tg-hero-stat { display: flex !important; flex-direction: column; align-items: flex-start; gap: 6px !important; padding: 2px 10px !important; border-left: 1px solid rgba(255,255,255,.14) !important; }
    .tg-hero-section .tg-hero-stat:first-child { padding-left: 0 !important; border-left: 0 !important; }
    .tg-hero-section .tg-hero-stat-num { font-size: 26px !important; white-space: nowrap; }
    .tg-hero-section .tg-stat-label { font-size: 12px !important; line-height: 1.3 !important; color: rgba(255,255,255,.75) !important; font-weight: 500 !important; }

    /* Model: connected timeline instead of three boxed cards */
    .tg-model-chain { gap: 0 !important; }
    .tg-model-section .tg-phase {
        position: relative;
        border: 0 !important;
        padding: 0 0 28px 60px !important;
        gap: 6px !important;
        min-height: 0 !important;
    }
    .tg-model-section .tg-phase::before {
        content: ""; position: absolute; left: 21px; top: 48px; bottom: 4px; width: 1px;
        background: linear-gradient(var(--tg-teal-400), var(--tg-ink-200));
    }
    .tg-model-section .tg-phase-ico { position: absolute; left: 0; top: 0; background: var(--tg-white); }
    .tg-model-section .tg-phase > div:first-child { min-height: 0; }
    .tg-model-section .tg-phase > div:nth-child(2) { font-size: 22px !important; }
    .tg-model-section .tg-phase p { font-size: 14.5px !important; }
    .tg-model-section .tg-phase > div:last-child:not(:nth-child(2)) { flex-direction: row !important; flex-wrap: wrap; gap: 6px !important; padding-top: 8px !important; }
    .tg-model-section .tg-phase > div:last-child:not(:nth-child(2)) > div {
        padding: 4px 10px; border-radius: 999px; background: var(--tg-ink-50); border: 1px solid var(--tg-ink-150);
        font-size: 12.5px !important; gap: 6px !important;
    }
    .tg-model-section .tg-model-highlight { padding: 20px !important; flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 4px 14px !important; }
    .tg-model-section .tg-model-highlight > span { flex: none; }
    .tg-model-section .tg-model-highlight > div { flex: 1; font-size: 21px !important; }
    .tg-model-section .tg-model-highlight > p { flex-basis: 100%; margin-top: 6px !important; }

    /* How we work: tighter cards, swipeable tag row */
    .tg-how-we-work-section { padding-top: 56px !important; padding-bottom: 56px !important; }
    .tg-dual-track { gap: 14px !important; }
    .tg-dual-track > .tg-card { padding: 22px 18px !important; }
    .tg-dual-track .tg-card-how-title { font-size: 26px !important; }
    .tg-dual-track p { font-size: 15px !important; line-height: 1.6 !important; }
    .tg-tags-container { flex-wrap: nowrap !important; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 6px; scrollbar-width: none; }
    .tg-tags-container::-webkit-scrollbar { display: none; }
    .tg-tags-container .tg-tag { flex: none; }
    .tg-card-btn-wrap .tg-btn { width: 100%; justify-content: center; }

    /* Why: calmer rhythm */
    .tg-why-section { padding-top: 56px !important; padding-bottom: 56px !important; }

    /* Testimonials: swipe through quotes */
    .tg-testimonials-section { padding: 56px 0 !important; }
    .tg-test-ratings { width: 100%; justify-content: space-between; }
    .tg-testimonial-grid {
        display: flex !important; gap: 12px !important;
        overflow-x: auto; scroll-snap-type: x mandatory;
        margin: 0 -16px !important; padding: 2px 16px 10px !important;
        scrollbar-width: none;
    }
    .tg-testimonial-grid::-webkit-scrollbar { display: none; }
    .tg-testimonial-grid > .tg-card { flex: 0 0 86%; scroll-snap-align: start; padding: 22px !important; }
    .tg-test-quote { font-size: 18px !important; }

    /* Closing band */
    .tg-cta-banner-title { font-size: clamp(34px, 10vw, 44px) !important; }
}
@media (max-width: 640px) {
    /* One heading size for every section on phones */
    main .tg-h2, main .tg-test-title, main .tg-industry-title, main .tg-model-title, main .tg-how-title, main .tg-why-title {
        font-size: clamp(30px, 8.6vw, 38px) !important;
        line-height: 1.02 !important;
        letter-spacing: -0.03em !important;
    }
}

/* Team monogram tiles: tinted by department */
.tg-dept-build { --tg-dept-bg: radial-gradient(120% 90% at 100% 0%, rgba(90,168,186,.38), transparent 60%), var(--tg-navy); }
.tg-dept-growth-loop { --tg-dept-bg: radial-gradient(120% 90% at 0% 100%, rgba(10,16,60,.45), transparent 60%), linear-gradient(160deg, #3f93a6, #1D5F8A); }
.tg-dept-leadership { --tg-dept-bg: radial-gradient(120% 90% at 100% 0%, rgba(90,168,186,.5), transparent 55%), linear-gradient(180deg, #121a4a, #070b2a); }
.tg-dept-growth-loop .tg-initials, .tg-dept-growth-loop span { color: #fff; }
.tg-dept-growth-loop > span:first-child { color: rgba(255,255,255,.8) !important; }

/* Showcase pull quote */
.tgc-quote { position: relative; margin: 36px 0 0; padding: 40px 44px 36px 112px; border-radius: var(--tg-radius-md); background: var(--tg-gradient-brand); color: var(--tg-white); overflow: hidden; }
.tgc-quote-mark { position: absolute; left: 40px; top: 40px; width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.12); color: var(--tg-teal-300); }
.tgc-quote blockquote { margin: 0; font-family: var(--tg-font-display); font-size: clamp(20px, 2.2vw, 30px); line-height: 1.22; letter-spacing: -0.02em; max-width: 46ch; }
.tgc-quote blockquote::before { content: '\201C'; } .tgc-quote blockquote::after { content: '\201D'; }
.tgc-quote figcaption { margin-top: 18px; font-size: 14.5px; font-weight: 600; color: rgba(255,255,255,.75); }
@media (max-width: 640px) {
  .tgc-quote { padding: 76px 20px 24px; }
  .tgc-quote-mark { left: 20px; top: 20px; width: 40px; height: 40px; }
}

/* Showcase results list */
.tgc-results { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-width: 64ch; }
.tgc-results li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; font-size: 16px; line-height: 1.55; color: var(--tg-ink-600); }
.tgc-results strong { color: var(--tg-navy); font-weight: 700; }
.tgc-results-tick { margin-top: 3px; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tg-teal-100); color: var(--tg-teal-700); }

/* Empty states */
.tg-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 64px 24px; border: 1px dashed var(--tg-ink-300); border-radius: var(--tg-radius-md); background: var(--tg-white); }
.tg-empty-ico { width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tg-teal-100); color: var(--tg-teal-700); }
.tg-empty-title { font-family: var(--tg-font-display); font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -0.02em; color: var(--tg-navy); }
.tg-empty-body { margin: 0 0 8px; max-width: 52ch; font-size: 16px; line-height: 1.6; color: var(--tg-text-muted); }

/* Home: keep intro paragraphs readable under the wider headings */
.tg-model-lede { max-width: 62ch; }
