/* ==========================================================================
   Smart Printer App — shared theme
   Design language: warm off-white ground, hairline black borders, generous
   16px radii, near-flat shadows, DM Sans for text, Space Mono for figures.
   Brand primary is the app blue (#0066ff).
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    /* Surfaces */
    --background: oklch(97.89% 0.0082 121.627);
    /* warm off-white page ground */
    --card: #ffffff;
    --muted: oklch(95.51% 0 0);

    /* Text */
    --foreground: #000000;
    --muted-foreground: oklch(32.11% 0 0);
    --card-foreground: #000000;

    /* Brand */
    --primary: #0066ff;
    --primary-hover: #0052cc;
    --primary-foreground: #ffffff;
    --primary-soft: rgba(0, 102, 255, 0.08);
    /* Opaque variant — use where a translucent tint would let a dark
       backdrop (e.g. a hairline-gap grid) show through */
    --primary-tint: #eef4ff;
    --primary-ring: rgba(0, 102, 255, 0.35);

    /* Accents */
    --secondary: oklch(70.38% 0.123 182.503);
    --accent: oklch(76.86% 0.1647 70.0804);
    --success: oklch(72.3% 0.219 149.579);
    --destructive: oklch(63.68% 0.2078 25.3313);

    /* Lines */
    --border: #000000;
    --border-subtle: rgba(0, 0, 0, 0.12);
    --input: oklch(55.55% 0 0);

    /* Geometry */
    --radius: 1rem;
    --radius-lg: 1rem;
    --radius-md: 0.625rem;
    --radius-sm: 0.375rem;
    --radius-full: 999px;

    /* Elevation — deliberately near-flat */
    --shadow-xs: 0 0 0 0 rgba(26, 26, 26, .03);
    --shadow-sm: 0 0 0 0 rgba(26, 26, 26, .05), 0 1px 2px -1px rgba(26, 26, 26, .05);
    --shadow-md: 0 0 0 0 rgba(26, 26, 26, .05), 0 2px 4px -1px rgba(26, 26, 26, .05);
    --shadow-lg: 0 0 0 0 rgba(26, 26, 26, .05), 0 4px 6px -1px rgba(26, 26, 26, .05);
    --shadow-xl: 0 0 0 0 rgba(26, 26, 26, .05), 0 8px 10px -1px rgba(26, 26, 26, .05);

    /* Type */
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Layout */
    --container: 80rem;
    /* max-w-7xl */
    --container-narrow: 64rem;
    /* max-w-5xl */
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-sans);
    font-display: swap;
    line-height: 1.5;
    color: var(--foreground);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
    letter-spacing: -0.02em;
    text-wrap: balance;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

/* Figures read in mono, tabular — the reference site's signature */
.tabular,
.price,
.step-number {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* Accessible focus ring, matching the reference treatment */
:where(a, button, input, [tabindex]):focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-ring);
    border-color: var(--primary);
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    z-index: 100;
    position: fixed;
    background: var(--card);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
}

/* ---------- Layout primitives ---------- */
.container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1rem;
}

.container-narrow {
    max-width: var(--container-narrow);
    margin-inline: auto;
    padding-inline: 1rem;
}

.section {
    padding-block: 4rem;
}

.section-head {
    max-width: 42rem;
    margin-inline: auto;
    text-align: center;
    margin-bottom: 3rem;
}

.section-head h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.section-head .section-subtitle {
    margin-top: 1rem;
    color: var(--muted-foreground);
    font-size: 1.125rem;
}

.eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-foreground);
    font-weight: 500;
}

/* ---------- Card ---------- */
.card {
    background: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.card-hover {
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.card-hover:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

/* ---------- Buttons ---------- */
.button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1;
    min-height: 44px;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--primary);
    color: var(--primary-foreground);
    text-decoration: none;
    cursor: pointer;
    /* Long labels wrap rather than overflow narrow phones */
    white-space: normal;
    text-align: center;
    max-width: 100%;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.button:hover,
.btn:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: transparent;
    color: var(--foreground);
}

.btn-outline:hover {
    background-color: var(--muted);
    color: var(--foreground);
}

.btn-invert {
    background-color: var(--card);
    color: var(--primary);
}

.btn-invert:hover {
    background-color: var(--muted);
    color: var(--primary-hover);
}

.btn-lg {
    padding: 0.9375rem 1.75rem;
    font-size: 1rem;
}

/* ---------- Badge ---------- */
.badge {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.3125rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--card);
    color: var(--foreground);
}

.badge-muted {
    background: var(--muted);
    color: var(--muted-foreground);
}

.badge-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

/* A badge used as a link is a control — give it a real tap target */
a.badge {
    min-height: 44px;
    padding-inline: 1rem;
}

/* ---------- Stat strip (bordered grid, hairline gaps) ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.stat-grid>div {
    background: var(--background);
    padding: 1.25rem;
}

.stat-grid dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-foreground);
}

.stat-grid dd {
    margin-top: 0.25rem;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 1.5rem;
    font-weight: 700;
}

@media (min-width: 420px) {
    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---------- Navigation ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding-block: 1rem;
    background-color: color-mix(in srgb, var(--background) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    transition: border-color .3s ease;
}

.nav-container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* Narrow phones: the logo may shrink, the CTA stays tappable */
@media (max-width: 380px) {
    .nav-container {
        padding-inline: 0.75rem;
    }

    .logo {
        font-size: 1rem;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .auth-buttons .button {
        padding-inline: 0.75rem;
        font-size: 0.875rem;
    }
}

.logo>svg {
    flex-shrink: 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: 0.5rem;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.nav-links {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-md);
    transition: background-color .15s ease, color .15s ease;
}

.nav-links a:hover {
    background-color: var(--muted);
    color: var(--foreground);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ---------- Banner ---------- */
.banner {
    background-color: var(--primary);
    color: var(--primary-foreground);
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ---------- Footer ---------- */
.footer {
    border-top: 1px solid var(--border);
    background: var(--background);
    color: var(--foreground);
}

.footer-inner {
    max-width: var(--container);
    margin-inline: auto;
    padding: 4rem 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.footer-brand p {
    color: var(--muted-foreground);
    padding-block: 0.5rem;
    max-width: 22rem;
}

.footer-col-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.footer-col ul {
    list-style: none;
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
}

.footer-col a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    text-decoration: none;
    transition: color .15s ease;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1.5rem;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--foreground);
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.footer-social a:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid var(--border-subtle);
}

.footer-bottom-inner {
    max-width: var(--container);
    margin-inline: auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

@media (min-width: 768px) {
    .footer-inner {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 2rem;
    }
}

/* ---------- Responsive nav ---------- */
@media (min-width: 768px) {
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   Shared page components (guides, legal, 404, printer list)
   ========================================================================== */

/* ---------- Back link (sub-page nav) ---------- */
.subnav {
    position: sticky;
    top: 0;
    z-index: 100;
    padding-block: 0.875rem;
    background-color: color-mix(in srgb, var(--background) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.back-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    text-decoration: none;
    transition: color .15s ease;
}

.back-link:hover {
    color: var(--primary);
}

/* ---------- Page hero band ---------- */
.hero-section {
    padding: 2.5rem 1rem 2.25rem;
    border-bottom: 1px solid var(--border-subtle);
    text-align: center;
}

.hero-section h1 {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    max-width: 22ch;
    margin-inline: auto;
}

.hero-section .subtitle {
    margin-top: 1.25rem;
    color: var(--muted-foreground);
    font-size: 1.125rem;
    line-height: 1.6;
    max-width: 55ch;
    margin-inline: auto;
}

.hero-section .byline {
    margin-top: 1.25rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    font-family: var(--font-mono);
}

@media (min-width: 768px) {
    .hero-section {
        padding-block: 5rem 4rem;
    }

    .hero-section h1 {
        font-size: 3rem;
    }
}

/* ---------- Long-form prose ---------- */
.prose {
    max-width: 46rem;
    margin-inline: auto;
    padding: 2.5rem 1rem 3rem;
}

@media (min-width: 768px) {
    .prose {
        padding: 3.5rem 1rem 4rem;
    }
}

.prose section {
    margin-bottom: 3rem;
}

.prose h2 {
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.prose h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.75rem 0 0.75rem;
}

.prose p {
    color: var(--muted-foreground);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.prose ol,
.prose ul {
    margin: 0 0 1rem 1.25rem;
    color: var(--muted-foreground);
}

.prose li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.prose strong {
    color: var(--foreground);
    font-weight: 600;
}

.prose a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.prose a:hover {
    text-decoration: underline;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
}

/* Wide content must scroll inside its own box, never the page */
.scroll-x {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* ---------- Callouts ---------- */
.callout {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.callout h2,
.callout h3 {
    margin-top: 0;
}

.callout>*:last-child {
    margin-bottom: 0;
}

.callout-primary {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.callout-primary h2,
.callout-primary h3 {
    color: var(--primary);
}

/* ---------- Link list (404, related pages) ---------- */
.link-list {
    display: grid;
    gap: 0.75rem;
    max-width: 40rem;
    margin-inline: auto;
}

.link-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--foreground);
    font-weight: 500;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.link-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.link-card .arrow {
    color: var(--primary);
}

/* ---------- Simple centred footer (sub-pages) ---------- */
.footer-simple {
    border-top: 1px solid var(--border);
    padding: 2.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.footer-simple a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 0.25rem;
    color: var(--muted-foreground);
    text-decoration: none;
}

.footer-simple a:hover {
    color: var(--primary);
}

.footer-simple-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 1rem;
    margin-bottom: 0.5rem;
}
