/* ==========================================================================
   SparksTech — base styles
   Custom, framework-free CSS. Body/UI text uses the system font stack;
   Archivo Black (loaded via Google Fonts in _Layout.cshtml) is reserved for
   h1 headings and the brand wordmark, per the official logo guideline.
   ========================================================================== */

:root {
    /* Brand palette — from the official SparksTech logo guideline. Do not
       introduce colors outside this set; use tints/shades of these three. */
    --color-navy: #031a38;
    --color-teal: #37b09c;
    --color-teal-dark: #2c8a79;
    --color-cyan: #81e0e6;

    --color-ink: var(--color-navy);
    --color-ink-soft: #3a4657;
    --color-paper: #ffffff;
    --color-paper-muted: #f4f6f9;
    --color-border: #dde3ea;

    --color-brand: var(--color-navy);
    --color-brand-dark: #021228;
    --color-brand-light: #e3f7f8;
    --color-accent: var(--color-teal);
    --color-accent-dark: var(--color-teal-dark);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --font-display: "Archivo Black", var(--font-sans);

    --container-width: 72rem;
    --radius: 0.5rem;
    --shadow-card: 0 1px 2px rgba(16, 24, 38, 0.06), 0 4px 12px rgba(16, 24, 38, 0.06);

    color-scheme: light;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-ink);
    background: var(--color-paper);
    line-height: 1.6;
    font-size: 1rem;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--color-brand);
    text-decoration: underline;
    text-decoration-thickness: from-font;
}

a:hover {
    color: var(--color-brand-dark);
}

h1, h2, h3, h4 {
    line-height: 1.25;
    color: var(--color-ink);
    font-weight: 700;
}

h1 {
    font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
    font-family: var(--font-display);
    font-weight: 400; /* Archivo Black ships as a single black weight, loaded at 400 */
}
h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem); }
h3 { font-size: 1.25rem; }

p {
    margin: 0 0 1rem;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* Skip link -------------------------------------------------------------- */

.skip-link {
    position: absolute;
    left: 0.5rem;
    top: -3rem;
    background: var(--color-brand-dark);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    z-index: 1000;
    transition: top 0.15s ease-in-out;
    text-decoration: none;
}

.skip-link:focus {
    top: 0.5rem;
}

/* Focus visibility --------------------------------------------------------*/

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* Header / navigation ----------------------------------------------------- */

.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-paper);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 0.85rem;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.brand__mark {
    width: 1.75rem;
    height: auto;
}

.brand__name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    color: var(--color-accent);
}

.brand:hover .brand__name {
    /* Not teal-dark: teal-dark-on-white is ~4.2:1, just under the 4.5:1 AA text minimum.
       Navy-on-white clears it with room to spare. */
    color: var(--color-brand);
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font: inherit;
    color: var(--color-ink);
    cursor: pointer;
}

.nav-toggle__icon {
    width: 1.1rem;
    height: 2px;
    background: currentColor;
    position: relative;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
}

.nav-toggle__icon::before { top: -6px; }
.nav-toggle__icon::after { top: 6px; }

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--color-ink-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--color-brand);
}

/* Buttons ------------------------------------------------------------------ */

.button {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius);
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    border: 2px solid transparent;
}

.button--primary {
    /* Navy text, not white: white-on-teal is only ~2.7:1 contrast, well under the 4.5:1 AA
       minimum for this bold-but-not-"large" text size. Navy-on-teal is ~6.5:1. */
    background: var(--color-accent);
    color: var(--color-brand);
}

.button--primary:hover {
    /* Cyan rather than a darkened teal: darkening would pull the background closer to the
       navy text's own darkness and reduce contrast further, the opposite of what a hover
       state should do. Cyan lightens instead, improving contrast to ~11:1. */
    background: var(--color-cyan);
    color: var(--color-brand);
}

.button--secondary {
    background: transparent;
    border-color: var(--color-brand);
    color: var(--color-brand);
}

.button--secondary:hover {
    background: var(--color-brand-light);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Hero ---------------------------------------------------------------------*/

.hero {
    background: linear-gradient(160deg, var(--color-brand-dark), var(--color-brand));
    color: #fff;
    padding-block: clamp(3rem, 5vw, 5.5rem);
}

.hero h1,
.hero h2 {
    color: #fff;
    max-width: 40rem;
}

.hero p {
    color: #dce8f4;
    max-width: 36rem;
    font-size: 1.15rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.75rem;
}

.hero .button--secondary {
    border-color: #fff;
    color: #fff;
}

.hero .button--secondary:hover {
    background: rgba(129, 224, 230, 0.18);
}

/* Sections ------------------------------------------------------------------*/

.section {
    padding-block: clamp(2.5rem, 4vw, 4rem);
}

.section--muted {
    background: var(--color-paper-muted);
}

.section__header {
    max-width: 40rem;
    margin-bottom: 2rem;
}

.section__header p {
    color: var(--color-ink-soft);
}

.section__footer {
    margin-top: 2rem;
}

/* Card grid ------------------------------------------------------------------*/

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--color-paper);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Card titles are h2 or h3 depending on the page's document outline (see the pages that use this
   class), so this targets the class rather than a tag — the visual size stays consistent either
   way, matching what used to be a hardcoded h3. */
.card__title {
    margin: 0;
    font-size: 1.25rem;
}

.card__title a {
    color: var(--color-ink);
    text-decoration: none;
}

.card__title a:hover {
    color: var(--color-brand);
}

.card p {
    color: var(--color-ink-soft);
    margin: 0;
}

.card__meta {
    font-size: 0.85rem;
    color: var(--color-ink-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
}

.tag {
    display: inline-block;
    background: var(--color-brand-light);
    color: var(--color-brand);
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

a.tag:hover {
    /* Navy, not white — see the .button--primary comment above for the contrast math. */
    background: var(--color-accent);
    color: var(--color-brand);
}

.tag--draft {
    background: transparent;
    border: 1px dashed var(--color-ink-soft);
    color: var(--color-ink-soft);
}

/* Tag filter (insights listing) --------------------------------------------*/

.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.tag-filter__item {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    color: var(--color-ink-soft);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.tag-filter__item:hover {
    border-color: var(--color-accent);
    color: var(--color-brand);
}

.tag-filter__item.is-active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-brand);
    /* Selection isn't color-only: a heavier weight and a checkmark carry the same
       information for anyone who can't distinguish the fill color (aria-current, set in the
       markup, covers assistive tech). */
    font-weight: 800;
}

.tag-filter__item.is-active::before {
    content: "✓ ";
}

/* Page header (interior pages) -----------------------------------------------*/

.page-header {
    padding-block: clamp(2rem, 4vw, 3rem);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-paper-muted);
}

.page-header p {
    color: var(--color-ink-soft);
    max-width: 42rem;
}

.page-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Article content ------------------------------------------------------------*/

.article {
    max-width: 42rem;
    margin-inline: auto;
    padding-block: clamp(2rem, 4vw, 3rem);
}

.article img {
    border-radius: var(--radius);
    margin-block: 1.5rem;
    width: 100%;
    height: auto;
    /* Content authors are asked (see Content/README.md) to provide 16:9 featured images.
       Reserving that ratio here — rather than relying on each image's actual intrinsic size —
       means the layout doesn't shift when the image loads, even before we know its real
       dimensions, and crops gracefully (object-fit) if an image doesn't quite match. */
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.article h2 {
    margin-top: 2rem;
}

.article ul,
.article ol {
    color: var(--color-ink-soft);
}

/* Contact ------------------------------------------------------------------*/

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 2rem;
}

.contact-card {
    background: var(--color-paper);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.contact-card dt {
    font-weight: 700;
    margin-top: 1rem;
}

.contact-card dt:first-child {
    margin-top: 0;
}

.contact-card dd {
    margin: 0;
    color: var(--color-ink-soft);
}

/* Footer ---------------------------------------------------------------------*/

.site-footer {
    background: var(--color-ink);
    color: #cbd5e1;
    margin-top: clamp(3rem, 5vw, 5rem);
}

.site-footer a {
    color: #e2e8f0;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) auto;
    gap: 2.5rem;
    padding-block: 3rem;
    align-items: start;
}

.site-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.site-footer__brand-row {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.site-footer__brand-row .brand__mark {
    width: 1.75rem;
}

.site-footer__brand-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    color: var(--color-accent);
}

.site-footer__tagline {
    color: #94a3b8;
    max-width: 24rem;
    margin: 0;
}

.site-footer__nav {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.site-footer__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.site-footer__nav a {
    text-decoration: none;
    font-size: 0.95rem;
}

.site-footer__nav a:hover {
    text-decoration: underline;
}

.site-footer__legal {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-block: 1.25rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Process steps ------------------------------------------------------------*/

.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
    gap: 1.5rem;
}

.process-step {
    background: var(--color-paper);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.process-step__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--color-accent);
    color: var(--color-brand);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.process-step h3 {
    margin: 0 0 0.4rem;
}

.process-step p {
    color: var(--color-ink-soft);
    margin: 0;
}

/* Technical capabilities ---------------------------------------------------*/

.capability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}

.capability {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-paper);
}

.capability h3 {
    font-size: 1rem;
    margin: 0;
}

.capability p {
    color: var(--color-ink-soft);
    font-size: 0.9rem;
    margin: 0;
}

/* Trust / "how we work" list ------------------------------------------------*/

.trust-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1.5rem 2rem;
}

.trust-list li {
    position: relative;
    padding-left: 1.75rem;
    color: var(--color-ink-soft);
}

.trust-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    background: var(--color-accent);
}

/* Callouts (e.g. the "this is a fictional example" notice) -----------------*/

.callout {
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-brand);
    background: var(--color-paper-muted);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.callout p {
    margin: 0;
    color: var(--color-ink-soft);
}

.callout--example {
    border-left-color: var(--color-accent);
}

/* Blockquotes within rendered Markdown (used for in-content TODO markers and
   the fictional-example disclaimer at the top of example case studies) ------*/

.article blockquote {
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    border-left: 4px solid var(--color-accent);
    background: var(--color-paper-muted);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--color-ink-soft);
}

.article blockquote p:last-child {
    margin-bottom: 0;
}

/* Forms ---------------------------------------------------------------------*/

.form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 32rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-field label {
    font-weight: 700;
    font-size: 0.95rem;
}

.form-field input,
.form-field textarea {
    font: inherit;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-ink);
    background: var(--color-paper);
}

.form-field textarea {
    resize: vertical;
    min-height: 8rem;
}

/* Errors are marked by more than color: the "Error:" text label and border weight/style both
   carry the meaning, so the red hue alone is never the only signal. */
.form-field.has-error input,
.form-field.has-error textarea {
    border-color: #b3261e;
    border-width: 2px;
}

.field-error {
    color: #b3261e;
    font-size: 0.875rem;
    font-weight: 600;
}

.form-hint {
    color: var(--color-ink-soft);
    font-size: 0.85rem;
    margin: 0;
}

.form-success {
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-accent);
    background: var(--color-paper-muted);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1rem 1.25rem;
}

/* Honeypot anti-spam field: hidden from sighted/mouse users without using display:none (which
   some screen readers and form-fill heuristics special-case), and never reachable by Tab. */
.form-field--honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Reduced motion ------------------------------------------------------------*/

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Empty state ------------------------------------------------------------- */

.empty-state {
    padding: 2rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    color: var(--color-ink-soft);
    text-align: center;
}

/* Responsive: mobile navigation --------------------------------------------*/

@media (max-width: 47.99rem) {
    .nav-toggle {
        display: inline-flex;
    }

    .primary-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-paper);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-card);
    }

    .primary-nav.is-open {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 1.25rem 1rem;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--color-border);
    }

    .site-header {
        position: relative;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
    }
}
