/*
 * File: /styles/tomsmess.css
 * Purpose: Modern responsive styles for tomsmess.com
 */

:root {
    --bg: #050814;
    --bg-elevated: #0f1320;
    --bg-elevated-alt: #151a28;
    --accent: #4fd1c5;
    --accent-soft: rgba(79, 209, 197, 0.2);
    --accent-strong: #38b2ac;
    --text: #f5f7ff;
    --muted: #9ca3af;
    --border-subtle: rgba(148, 163, 184, 0.4);
    --danger: #f97373;

    --radius-lg: 16px;
    --radius-xl: 22px;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.65);
    --shadow-subtle: 0 8px 22px rgba(15, 23, 42, 0.55);

    --content-width: 1120px;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #111827 0, #020617 40%, #020617 100%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* Layout wrappers */

.page-main {
    padding: 1.5rem 1rem 3rem;
}

/* Header + nav */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
    background: linear-gradient(to bottom, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.84), transparent);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.site-header-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-link {
    text-decoration: none;
    color: inherit;
}

.brand-title {
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.05em;
    text-transform: lowercase;
}

.brand-tagline {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.nav-link {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.85rem;
    color: var(--muted);
    border: 1px solid transparent;
    transition:
        background-color 140ms ease-out,
        color 140ms ease-out,
        border-color 140ms ease-out,
        transform 100ms ease-out;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.25);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--text);
    background: var(--accent-soft);
    border-color: var(--accent);
}

/* Hero */

.hero {
    position: relative;
    max-width: var(--content-width);
    margin: 1.5rem auto 2.5rem;
    padding: 0;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    background: radial-gradient(circle at top left, #1f2937 0, #020617 55%);
    isolation: isolate;
}

.hero-background {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to bottom right, rgba(15, 23, 42, 0.3), rgba(15, 23, 42, 0.9)),
        url("/dark_moon-2560x1600_small.jpg");
    background-size: cover;
    background-position: center;
    opacity: 0.9;
    z-index: -1;
    transform: scale(1.02);
    filter: saturate(1.05);
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.2fr);
    gap: 2rem;
    padding: 2.6rem 2.4rem 2.4rem;
}

.hero-text h1 {
    margin: 0 0 0.9rem;
    font-size: clamp(2.1rem, 3vw, 2.8rem);
    letter-spacing: 0.03em;
}

.hero-text p {
    margin: 0 0 1.2rem;
    max-width: 36rem;
    color: var(--muted);
    font-size: 0.98rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-callout {
    align-self: center;
    padding: 1.1rem 1.3rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: var(--shadow-subtle);
}

.hero-callout h2 {
    margin: 0 0 0.6rem;
    font-size: 1.02rem;
}

.hero-callout ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.hero-callout li + li {
    margin-top: 0.2rem;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition:
        background-color 140ms ease-out,
        border-color 140ms ease-out,
        transform 100ms ease-out,
        box-shadow 140ms ease-out;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    border-color: transparent;
    color: #020617;
    box-shadow: 0 10px 25px rgba(56, 178, 172, 0.45);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 35px rgba(56, 178, 172, 0.6);
}

.btn.ghost {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.5);
    color: var(--muted);
}

.btn.ghost:hover {
    color: var(--text);
    background: rgba(15, 23, 42, 0.95);
}

/* Sections */

.section {
    max-width: var(--content-width);
    margin: 0 auto 2.5rem;
    padding: 2rem 2.4rem;
    border-radius: var(--radius-xl);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.95));
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-subtle);
}

.section-alt {
    background: radial-gradient(circle at top right, #111827, #020617);
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0 0 0.4rem;
    font-size: 1.4rem;
}

.section-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Card grid */

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.6rem;
}

.card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.4);
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.6);
}

.card-image-wrap {
    position: relative;
    padding-top: 58%;
    overflow: hidden;
}

.card-image-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    filter: saturate(1.08);
    transition: transform 200ms ease-out, filter 200ms ease-out;
}

.card:hover .card-image-wrap img {
    transform: scale(1.06);
    filter: saturate(1.18);
}

.card-body {
    padding: 1rem 1.1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-body h3 {
    margin: 0;
    font-size: 1.05rem;
}

.card-body p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted);
}

.card-link {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--accent-strong);
}

.card-link:hover {
    text-decoration: underline;
}

/* Nerd grid */

.nerd-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.8rem;
}

.nerd-col h3 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-size: 1.02rem;
}

.nerd-col ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.92rem;
    color: var(--muted);
}

.nerd-col li + li {
    margin-top: 0.2rem;
}

/* Thumb strip */

.thumb-strip {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.8rem;
    padding-bottom: 0.3rem;
    scrollbar-width: thin;
}

.thumb-strip::-webkit-scrollbar {
    height: 6px;
}

.thumb-strip::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.65);
    border-radius: 999px;
}

.thumb {
    flex: 0 0 auto;
    width: 130px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #020617;
}

.thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Footer */

.site-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    margin-top: 1.5rem;
    padding: 1.4rem 1rem 1.6rem;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.95));
}

.site-footer-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    text-align: center;
    color: var(--muted);
    font-size: 0.86rem;
}

.footer-note {
    margin-top: 0.3rem;
}

/* Responsive tweaks */

@media (max-width: 900px) {
    .site-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
        padding: 1.8rem 1.6rem 1.6rem;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nerd-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section {
        padding-inline: 1.5rem;
    }
}

@media (max-width: 640px) {
    .page-main {
        padding-inline: 0.8rem;
    }

    .hero {
        margin-inline: 0.1rem;
        border-radius: 0;
    }

    .hero-inner {
        padding-inline: 1.2rem;
    }

    .card-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .nerd-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .main-nav {
        justify-content: flex-start;
    }
}
