/* =========================================
   Pip Counter — Pug Lane, LLC
   Single Page Website Styling
   ========================================= */

:root {
    color-scheme: light dark;

    /* === Brand Palette === */
    --primary: #1b5e20;              /* Domino felt green */
    --primary-light: #2e7d32;
    --primary-dark: #0f3e13;
    --primary-tint: #e8f5e9;
    --accent: #2563eb;               /* Pug Lane blue */
    --accent-hover: #1d4ed8;
    --accent-tint: #eff6ff;

    /* Domino Theme */
    --domino-bg: #fdfdfd;
    --domino-border: #222222;
    --domino-pip: #111827;
    --overlay-badge-bg: #e11d48;     /* Detection count overlay badge */
    --overlay-badge-text: #ffffff;
    --total-badge-bg: #1b5e20;
    --total-badge-text: #ffffff;

    /* Neutral Colors */
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #64748b;
    --border-color: #cbd5e1;

    /* Header & Nav */
    --header-bg: rgba(255, 255, 255, 0.92);
    --header-border: #e2e8f0;

    /* Layout & Shadows */
    --max-width: 1080px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.12);
    --shadow-domino: 0 6px 18px rgba(0, 0, 0, 0.16);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1120;
        --card-bg: #131d33;
        --card-border: #1e293b;
        --text-main: #f1f5f9;
        --text-muted: #94a3b8;
        --text-light: #64748b;
        --border-color: #334155;

        --primary: #22c55e;
        --primary-light: #4ade80;
        --primary-dark: #15803d;
        --primary-tint: #064e3b33;
        --accent: #3b82f6;
        --accent-hover: #60a5fa;
        --accent-tint: #1e3a8a33;

        --domino-bg: #f8fafc;
        --domino-border: #0f172a;
        --domino-pip: #0f172a;

        --header-bg: rgba(11, 17, 32, 0.92);
        --header-border: #1e293b;

        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.5);
        --shadow-domino: 0 6px 20px rgba(0, 0, 0, 0.6);
    }
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

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

/* Accessibility */
.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1000;
    padding: 0.75rem 1.25rem;
    background: var(--text-main);
    color: var(--bg);
    border-radius: var(--radius-sm);
    transform: translateY(-160%);
    transition: transform 0.2s ease;
    font-weight: 600;
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--header-border);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4.25rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
}


.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--text-main);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    background: var(--primary);
    color: #ffffff !important;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.nav-cta:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    padding: 4.5rem 0 3.5rem;
    text-align: center;
}

.hero-inner {
    max-width: 820px;
    margin: 0 auto;
}

.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    background: var(--primary-tint);
    color: var(--primary);
    border: 1px solid currentColor;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.hero h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}

.hero-lead {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 2.25rem;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* App Store Buttons */
.store-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.4rem;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    text-align: left;
}

.store-btn:hover {
    background: #1e293b;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.store-btn svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    fill: currentColor;
}

.store-btn-text {
    display: flex;
    flex-direction: column;
}

.store-btn-subtitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    line-height: 1.1;
}

.store-btn-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.store-notice {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Interactive Camera & Domino Showcase */
.showcase-wrapper {
    margin: 3.5rem auto 1rem;
    max-width: 780px;
}

.showcase-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    overflow: hidden;
    position: relative;
}

.camera-viewfinder {
    background: linear-gradient(145deg, #134e19 0%, #0d3812 100%);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.camera-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 1.8s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.domino-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 1rem 0 2rem;
}

/* Domino Tile */
.domino-tile {
    width: 130px;
    height: 240px;
    background: var(--domino-bg);
    border: 3px solid var(--domino-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-domino);
    transform: rotate(var(--rot, 0deg));
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.domino-tile:hover {
    transform: rotate(0deg) scale(1.04);
}

.domino-half {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 10px;
    position: relative;
}

.domino-divider {
    height: 3px;
    background: var(--domino-border);
    width: 85%;
    margin: 0 auto;
    border-radius: 2px;
}

/* Domino Pips */
.pip {
    width: 12px;
    height: 12px;
    background: var(--domino-pip);
    border-radius: 50%;
    align-self: center;
    justify-self: center;
}

/* Detection Overlay Badge */
.detect-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--overlay-badge-bg);
    color: var(--overlay-badge-text);
    font-weight: 800;
    font-size: 1.15rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(225, 29, 72, 0.45);
    border: 2px solid #ffffff;
    z-index: 5;
    animation: popIn 0.4s ease-out;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
    80% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.showcase-total-banner {
    background: #ffffff;
    color: #0f172a;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.total-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.total-value-pill {
    background: var(--primary);
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 800;
    padding: 0.35rem 1.25rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.interactive-controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.control-btn {
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Sections General */
.section {
    padding: 4.5rem 0;
}

.section-alt {
    background: var(--card-bg);
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}

.section-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 3.5rem;
}

.section-eyebrow {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: clamp(1.85rem, 3.5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.85rem;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* App Flow Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.step-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-tint);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
}

.step-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.step-card p {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.55;
}

/* Feature Highlights Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.75rem;
}

.feature-box {
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-tint);
    color: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.feature-box h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-box p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* Ecosystem / Pug Lane Other Apps */
.ecosystem-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg) 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-md);
}

.ecosystem-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .ecosystem-content {
        grid-template-columns: 1.2fr 0.8fr;
        align-items: center;
    }
}

.app-badge-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.ecosystem-card h3 {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.ecosystem-card p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.app-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}

.app-pill {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-muted);
}

.app-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: #ffffff !important;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.app-action-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.app-preview-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.app-preview-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--accent);
    color: #ffffff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.app-preview-box h4 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.app-preview-box span {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Call to Action Banner */
.cta-banner {
    background: linear-gradient(135deg, #1b5e20 0%, #0d3812 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 3.5rem 2rem;
    text-align: center;
    margin: 3rem 0;
    box-shadow: var(--shadow-lg);
}

.cta-banner h2 {
    font-size: clamp(1.85rem, 3.5vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.cta-banner p {
    font-size: 1.15rem;
    color: #d1fae5;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Footer */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--card-border);
    padding: 3rem 0 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
        text-align: left;
    }
}

.footer-brand {
    font-weight: 700;
    color: var(--text-main);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--text-main);
}

.copyright {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    border-top: 1px solid var(--card-border);
    padding-top: 1.5rem;
}

/* Support / Form Pages */
.lead {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

main > .container > form {
    max-width: 640px;
    margin-top: 2rem;
}

form fieldset {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

form legend {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0 0.5rem;
}

form label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 0.6rem;
}

form label:last-child {
    margin-bottom: 0;
}

form input[type="text"],
form input[type="email"],
form select,
form textarea {
    display: block;
    width: 100%;
    max-width: 400px;
    padding: 0.6rem 0.8rem;
    margin-top: 0.3rem;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    color: var(--text-main);
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-tint);
}

form textarea {
    resize: vertical;
    min-height: 80px;
}

form input[type="checkbox"],
form input[type="radio"] {
    margin-right: 0.4rem;
    accent-color: var(--primary);
}

form br {
    display: block;
    content: "";
    margin-bottom: 0.5rem;
}

form button[type="submit"] {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-sans);
    color: #ffffff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
}

form button[type="submit"]:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Responsive Nav & Sizing */
@media (max-width: 640px) {
    .nav-links {
        display: none;
    }

    .hero {
        padding: 3rem 0 2rem;
    }

    .showcase-card {
        padding: 1.25rem;
    }

    .domino-tile {
        width: 100px;
        height: 190px;
    }

    .pip {
        width: 9px;
        height: 9px;
    }

    .detect-badge {
        width: 26px;
        height: 26px;
        font-size: 0.95rem;
    }
}
