/* AppIT Online blog theme. Matches the look of appit-online.de. No external fonts. */

:root {
    --bg: #07080d;
    --bg-alt: #0c0e16;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --text: #eef0f6;
    --muted: #9aa3b8;
    --accent: #8b5cf6;
    --accent-2: #22d3ee;
    --grad: linear-gradient(120deg, #a78bfa 0%, #8b5cf6 35%, #22d3ee 100%);
    --radius: 20px;
    --radius-sm: 12px;
    --max: 1180px;
    --narrow: 720px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

a { color: inherit; }

h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 700;
}

p { margin: 0 0 1.1em; color: var(--muted); }

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

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.container-narrow { width: min(100% - 2.5rem, var(--narrow)); margin-inline: auto; }

.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 100;
    padding: 0.5rem 1rem;
    background: var(--text);
    color: var(--bg);
    border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons & tags ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.975rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    background: var(--text);
    color: var(--bg);
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.7);
}
.btn-sm { padding: 0.5rem 1.1rem; font-size: 0.9rem; }

.tag {
    display: inline-block;
    margin: 0 0.4rem 0.6rem 0;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
}
.tag:hover { color: var(--text); border-color: rgba(139, 92, 246, 0.5); }

.eyebrow {
    display: inline-block;
    margin-bottom: 1.25rem;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.meta {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
}

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
    border-bottom: 1px solid transparent;
    background: rgba(7, 8, 13, 0.6);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}
.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: 0 8px 24px -10px rgba(139, 92, 246, 0.8);
}
.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}
.brand-tld { color: var(--muted); font-weight: 600; }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.nav-menu a:not(.btn) {
    position: relative;
    display: block;
    padding: 0.5rem 0.2rem;
    margin: 0 0.6rem;
    color: rgba(238, 240, 246, 0.72);
    font-size: 0.925rem;
    font-weight: 500;
    text-decoration: none;
}
.nav-menu a:not(.btn):hover,
.nav-menu a[aria-current="page"] { color: var(--text); }
.nav-menu a:not(.btn)::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: -2px;
    height: 2px;
    border-radius: 2px;
    background: var(--grad);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease);
}
.nav-menu a:not(.btn):hover::after,
.nav-menu a[aria-current="page"]::after { transform: scaleX(1); }
.nav-menu .btn { margin-left: 1.1rem; }

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    background: none;
    border: 0;
    cursor: pointer;
    position: relative;
}
.nav-toggle span {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

.progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    z-index: 60;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: linear-gradient(90deg, #a78bfa, #22d3ee);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: 160px 0 80px;
    overflow: hidden;
    isolation: isolate;
}
.hero-compact { padding-bottom: 40px; }
.hero-glow {
    position: absolute;
    inset: -20% -10% auto -10%;
    height: 90%;
    z-index: -1;
    background:
        radial-gradient(45% 55% at 75% 20%, rgba(139, 92, 246, 0.22), transparent 70%),
        radial-gradient(35% 45% at 15% 0%, rgba(34, 211, 238, 0.10), transparent 70%);
    filter: blur(30px);
}
.hero-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 25%, transparent 75%);
    mask-image: radial-gradient(ellipse at 60% 40%, #000 25%, transparent 75%);
    pointer-events: none;
}
.hero-title {
    font-size: clamp(2.6rem, 1.4rem + 5vw, 5rem);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 1.02;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #ffffff 35%, #9aa3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-bottom: 0.08em;
}
.lead {
    font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
    color: var(--muted);
    max-width: 60ch;
}

/* ---------- Feed / cards ---------- */
.feed { padding: 40px 0 120px; }
.feed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color 0.4s, background 0.4s, transform 0.4s var(--ease);
}
.card:hover {
    border-color: rgba(139, 92, 246, 0.45);
    background: var(--surface-hover);
    transform: translateY(-4px);
}
.post-card-media {
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--bg-alt);
    overflow: hidden;
}
.post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease);
}
.card:hover .post-card-media img { transform: scale(1.04); }
.post-card-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--grad);
    opacity: 0.25;
}
.post-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.4rem 1.5rem 1.5rem;
}
.post-card-title {
    font-size: 1.2rem;
    margin: 0.4rem 0 0.6rem;
    line-height: 1.25;
}
.post-card-title a { text-decoration: none; }
.post-card-title a:hover { color: var(--accent-2); }
.post-card-excerpt {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
.post-card-body .meta { margin-top: auto; font-size: 0.85rem; }

.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    color: var(--muted);
}
.pagination a { text-decoration: none; color: var(--text); }

/* ---------- Single post ---------- */
.post { padding: 150px 0 40px; }
.post-title {
    font-size: clamp(2.2rem, 1.4rem + 3vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.08;
    color: var(--text);
    margin-bottom: 1rem;
}
.post-head .lead { margin-bottom: 1.25rem; }
.post-head .meta { margin-bottom: 2rem; }
.post-feature { margin-bottom: 3rem; }
.post-feature img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.post-feature figcaption {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}
.post-foot { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* Ghost content styles */
.gh-content { color: var(--muted); font-size: 1.0625rem; }
.gh-content > * + * { margin-top: 1.25em; }
.gh-content h2 {
    font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem);
    margin-top: 2.2em;
    color: var(--text);
}
.gh-content h3 {
    font-size: 1.35rem;
    margin-top: 1.8em;
    color: var(--text);
}
.gh-content h4 { font-size: 1.1rem; color: var(--text); margin-top: 1.5em; }
.gh-content strong { color: var(--text); font-weight: 650; }
.gh-content a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: rgba(34, 211, 238, 0.6);
    text-underline-offset: 3px;
}
.gh-content a:hover { text-decoration-color: var(--accent-2); }
.gh-content ul,
.gh-content ol { padding-left: 1.4rem; }
.gh-content li + li { margin-top: 0.4em; }
.gh-content blockquote {
    margin: 2em 0;
    padding: 1rem 1.5rem;
    border-left: 3px solid var(--accent);
    background: var(--surface);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text);
}
.gh-content :not(pre) > code {
    font-family: var(--mono);
    font-size: 0.88em;
    padding: 0.15em 0.4em;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
}
.gh-content pre {
    overflow-x: auto;
    padding: 1.25rem 1.4rem;
    border-radius: var(--radius-sm);
    background: #0d0f17;
    border: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.88rem;
    line-height: 1.6;
    color: #e2e8f0;
}
.gh-content hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 3em 0;
}
.gh-content img,
.gh-content .kg-image-card img {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin: 0 auto;
}
.gh-content figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    text-align: center;
    color: var(--muted);
}
.gh-content .kg-width-wide { width: min(100vw - 2.5rem, var(--max)); position: relative; left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full { width: 100vw; position: relative; left: 50%; transform: translateX(-50%); }
.gh-content .kg-callout-card {
    display: flex;
    gap: 0.9rem;
    padding: 1.1rem 1.3rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
}
.gh-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.gh-content th,
.gh-content td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.gh-content th { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
    background: var(--bg-alt);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 2.5rem;
}
.footer-brand p { max-width: 30ch; margin-top: 1rem; font-size: 0.95rem; }
.site-footer h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text);
    margin-bottom: 1rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 0.6rem; }
.site-footer a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}
.site-footer a:hover { color: var(--text); }
.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
}
.footer-bottom p { margin: 0; }

/* Reveal on scroll (only when JS runs) */
.js .reveal { opacity: 0; translate: 0 24px; transition: opacity 0.8s var(--ease), translate 0.8s var(--ease); }
.js .reveal.is-visible { opacity: 1; translate: 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .feed-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .nav-menu {
        position: fixed;
        inset: 72px 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 1rem 1.25rem 1.5rem;
        background: rgba(7, 8, 13, 0.96);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border);
        transform: translateY(-12px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0.3s;
    }
    .nav-menu.is-open { opacity: 1; visibility: visible; transform: none; }
    .nav-menu a:not(.btn) { margin: 0; padding: 0.9rem 0.5rem; font-size: 1.05rem; }
    .nav-menu a:not(.btn)::after { display: none; }
    .nav-menu .btn { margin: 0.75rem 0 0; }
}

@media (max-width: 680px) {
    .feed-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .footer-brand { grid-column: 1 / -1; }
    .hero { padding-top: 130px; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .js .reveal { opacity: 1; translate: none; }
}

/* Ghost gallery and bookmark cards */
.gh-content .kg-gallery-container { display: flex; flex-direction: column; width: 100%; }
.gh-content .kg-gallery-row { display: flex; gap: 0.75rem; justify-content: center; }
.gh-content .kg-gallery-image { flex: 1 1 0; min-width: 0; }
.gh-content .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }
.gh-content .kg-bookmark-card {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
}
.gh-content .kg-bookmark-container { display: flex; flex: 1; min-width: 0; }
.gh-content .kg-bookmark-content { flex: 1; padding: 1rem 1.2rem; min-width: 0; }
.gh-content .kg-bookmark-title { font-weight: 650; color: var(--text); }
.gh-content .kg-bookmark-description { font-size: 0.9rem; color: var(--muted); margin-top: 0.3rem; }
.gh-content .kg-bookmark-metadata { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted); margin-top: 0.6rem; }
.gh-content .kg-bookmark-icon { width: 18px; height: 18px; }
.gh-content .kg-bookmark-author,
.gh-content .kg-bookmark-publisher { color: var(--muted); }
.gh-content .kg-bookmark-thumbnail { position: relative; flex: 0 0 35%; max-width: 240px; }
.gh-content .kg-bookmark-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 680px) {
    .gh-content .kg-gallery-row { flex-direction: column; }
    .gh-content .kg-bookmark-thumbnail { display: none; }
}

/* Embeds (YouTube, Vimeo, Amazon, ...) */
.gh-content figure.kg-embed-card { width: 100%; margin: 2em 0; }
.gh-content figure.kg-embed-card iframe,
.gh-content iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: var(--radius-sm);
}
.gh-content .kg-video-card video { width: 100%; border-radius: var(--radius-sm); }

/* Blog ad slot and related posts */
.post-ad { margin: 3rem auto; min-height: 120px; }
.related { padding: 3rem 0 2rem; border-top: 1px solid var(--border); margin-top: 3rem; }
.related-title { font-size: 1.4rem; margin-bottom: 1.5rem; color: var(--text); }

