/* ===================================================
   Happy Software — main.css
   Vanilla CSS, no frameworks.
   =================================================== */

/* --- Custom Properties --- */
:root {
    /* Colours */
    --color-bg:         #faf9f7;
    --color-surface:    #ffffff;
    --color-sidebar:    #1a1a1a;
    --color-sidebar-tx: #c8c5c0;
    --color-text:       #2c2c2c;
    --color-text-muted: #6b6b6b;
    --color-accent:     #c0693a;
    --color-accent-hover: #a8562c;
    --color-rule:       #e4e2de;
    --color-card-border:#e8e6e2;

    /* Status badges */
    --badge-live:       #2a7d4f;
    --badge-live-bg:    #e6f4ec;
    --badge-beta:       #a07418;
    --badge-beta-bg:    #fdf3dc;
    --badge-dev:        #6b6b6b;
    --badge-dev-bg:     #f0efed;

    /* Type */
    --font-heading: 'DM Sans', system-ui, sans-serif;
    --font-body:    'Source Serif 4', Georgia, serif;
    --font-mono:    'DM Sans', system-ui, sans-serif;

    /* Scale */
    --size-xs:   0.75rem;
    --size-sm:   0.875rem;
    --size-base: 1.05rem;
    --size-lg:   1.25rem;
    --size-xl:   1.5rem;
    --size-2xl:  2rem;
    --size-3xl:  2.75rem;

    /* Spacing */
    --space-xs:  0.5rem;
    --space-sm:  0.75rem;
    --space-md:  1.25rem;
    --space-lg:  2rem;
    --space-xl:  3rem;
    --space-2xl: 5rem;

    /* Layout */
    --sidebar-width: 300px;
}


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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--size-base);
    line-height: 1.65;
    color: var(--color-text);
    background: var(--color-bg);
}

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

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

a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 2px;
}


/* --- Layout --- */
.layout {
    display: flex;
    min-height: 100vh;
}


/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--color-sidebar);
    color: var(--color-sidebar-tx);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar__inner {
    padding: var(--space-xl) var(--space-lg);
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.sidebar__brand {
    margin-bottom: var(--space-lg);
}

.sidebar__logo {
    font-family: var(--font-heading);
    font-size: var(--size-xl);
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.sidebar__logo:hover {
    color: #ffffff;
    opacity: 0.85;
}

.sidebar__tagline {
    font-family: var(--font-body);
    font-size: var(--size-sm);
    line-height: 1.6;
    color: var(--color-sidebar-tx);
    margin-bottom: var(--space-xl);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: auto;
}

.sidebar__nav a {
    font-family: var(--font-heading);
    font-size: var(--size-sm);
    font-weight: 500;
    color: var(--color-sidebar-tx);
    padding: var(--space-xs) 0;
    transition: color 0.2s ease;
    letter-spacing: 0.01em;
}

.sidebar__nav a:hover {
    color: #ffffff;
}

.sidebar__contact {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__contact a {
    font-family: var(--font-heading);
    font-size: var(--size-xs);
    color: var(--color-sidebar-tx);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.sidebar__contact a:hover {
    opacity: 1;
    color: var(--color-sidebar-tx);
}


/* --- Main Content --- */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: var(--space-2xl) var(--space-xl);
    max-width: 820px;
}


/* --- Hero --- */
.hero {
    margin-bottom: var(--space-2xl);
    animation: fadeUp 0.6s ease both;
}

.hero__title {
    font-family: var(--font-heading);
    font-size: var(--size-3xl);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--color-text);
    margin-bottom: var(--space-md);
}

.hero__subtitle {
    font-family: var(--font-body);
    font-size: var(--size-lg);
    line-height: 1.55;
    color: var(--color-text-muted);
    max-width: 540px;
}


/* --- Section --- */
.section {
    margin-bottom: var(--space-2xl);
    animation: fadeUp 0.6s ease both;
    animation-delay: 0.15s;
}

.section__label {
    font-family: var(--font-heading);
    font-size: var(--size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.section__rule {
    border: none;
    height: 1px;
    background: var(--color-rule);
    margin-bottom: var(--space-xl);
}


/* --- Product Cards --- */
.products {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 8px;
    padding: var(--space-lg);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    border-color: #d0cdc8;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.card__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}

.card__name {
    font-family: var(--font-heading);
    font-size: var(--size-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    line-height: 1.2;
}

.card__badge {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    line-height: 1;
    white-space: nowrap;
}

.card__badge--live {
    color: var(--badge-live);
    background: var(--badge-live-bg);
}

.card__badge--beta {
    color: var(--badge-beta);
    background: var(--badge-beta-bg);
}

.card__badge--dev {
    color: var(--badge-dev);
    background: var(--badge-dev-bg);
}

.card__desc {
    font-family: var(--font-body);
    font-size: var(--size-base);
    line-height: 1.6;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.card__cta {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: var(--size-sm);
    font-weight: 500;
    color: var(--color-accent);
    padding: 0.5em 1.2em;
    border: 1px solid var(--color-accent);
    border-radius: 5px;
    transition: background 0.2s ease, color 0.2s ease;
    letter-spacing: 0.01em;
}

.card__cta:hover {
    background: var(--color-accent);
    color: #ffffff;
}

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


/* --- Contact Section --- */
.contact {
    animation: fadeUp 0.6s ease both;
    animation-delay: 0.3s;
}

.contact__note {
    font-family: var(--font-body);
    font-size: var(--size-base);
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

.contact__email {
    font-family: var(--font-heading);
    font-size: var(--size-lg);
    font-weight: 500;
    color: var(--color-accent);
}


/* --- Footer --- */
.footer {
    margin-top: var(--space-2xl);
}

.footer__rule {
    height: 1px;
    background: var(--color-rule);
    margin-bottom: var(--space-lg);
}

.footer p {
    font-family: var(--font-heading);
    font-size: var(--size-xs);
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}


/* --- Animation --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- Responsive --- */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
        --size-3xl: 2rem;
        --size-2xl: 1.5rem;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .sidebar__inner {
        padding: var(--space-lg);
        min-height: auto;
    }

    .sidebar__tagline {
        margin-bottom: var(--space-md);
    }

    .sidebar__nav {
        flex-direction: row;
        gap: var(--space-md);
        margin-bottom: var(--space-sm);
    }

    .sidebar__contact {
        margin-top: var(--space-md);
        padding-top: var(--space-sm);
    }

    .content {
        margin-left: 0;
        padding: var(--space-xl) var(--space-lg);
    }
}

@media (max-width: 480px) {
    .content {
        padding: var(--space-lg) var(--space-md);
    }

    .card {
        padding: var(--space-md);
    }
}
