/* ==========================================================================
   Pia Marketing Site — Custom Styles
   Aesthetic: Digital Editorial — Technor (headlines) + Outfit, blue accent, warm paper
   ========================================================================== */

/* ==========================================================================
   FONTS — self-hosted from /fonts/ (mirrors Google Fonts CSS, latin + latin-ext)
   ========================================================================== */

/* Technor (ITF) — variable display font; one file covers weights 200–900 (no italic) */
@font-face {
    font-family: 'Technor';
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url('/fonts/technor.woff2') format('woff2');
}

/* Outfit — variable font; one file covers weights 300–700 per subset */
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('/fonts/outfit-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('/fonts/outfit-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
}

/* ==========================================================================
   DOT GRID BACKGROUND TEXTURE
   ========================================================================== */

.dot-grid {
    background-image: radial-gradient(circle, #1C191712 1px, transparent 1px);
    background-size: 24px 24px;
}

.dark .dot-grid {
    background-image: radial-gradient(circle, #E7E5E408 1px, transparent 1px);
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.nav-blur {
    background: rgba(250, 250, 247, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
}

.dark .nav-blur {
    background: rgba(12, 12, 12, 0.85);
}

/* ==========================================================================
   REVEAL ANIMATIONS — Orchestrated page load with stagger
   ========================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   HERO PERSONA — Glow + floating animation
   ========================================================================== */

.hero-glow {
    background: radial-gradient(circle, rgba(0, 120, 212, 0.08) 0%, transparent 70%);
    filter: blur(40px);
}

.dark .hero-glow {
    background: radial-gradient(circle, rgba(96, 205, 255, 0.06) 0%, transparent 70%);
}

@keyframes hero-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.hero-persona {
    animation: hero-float 6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .hero-persona {
        animation: none;
    }
}

/* ==========================================================================
   PIA HERO ANIMATION — dark-mode token overrides
   The component CSS lives in /css/pia-hero-animation.css and ships with
   light-mode tokens. Retint here so the laptop, vault and "Local" pill
   surfaces blend with the dark theme.
   ========================================================================== */

.dark .pia-hero-anim {
    --pha-paper:       #161614;
    --pha-ink:         #E7E5E4;
    --pha-ink-soft:    #D6D3D1;
    --pha-ink-mute:    #A8A29E;
    --pha-rule:        #292524;
    --pha-rule-soft:   #1F1E1C;
    --pha-accent:      #60CDFF;
    --pha-accent-soft: rgba(96, 205, 255, .10);
    --pha-accent-mid:  rgba(96, 205, 255, .25);
}

.dark .pia-hero-anim .pha-glow {
    background: radial-gradient(circle, rgba(96, 205, 255, .10) 0%, transparent 60%);
}

.dark .pia-hero-anim .pha-mic-puck {
    background:
        radial-gradient(circle at 35% 30%, rgba(255,255,255,.06) 0%, transparent 55%),
        linear-gradient(180deg, #1F1E1C 0%, #161614 100%);
}

.dark .pia-hero-anim .pha-mic-puck svg rect,
.dark .pia-hero-anim .pha-mic-puck svg path,
.dark .pia-hero-anim .pha-mic-puck svg line { stroke: #E7E5E4; fill: #E7E5E4; }
.dark .pia-hero-anim .pha-mic-puck svg path { fill: none; }

.dark .pia-hero-anim .pha-vault-card,
.dark .pia-hero-anim .pha-pc-card {
    background: linear-gradient(180deg, #1F1E1C 0%, #161614 100%);
}

.dark .pia-hero-anim .pha-bubble.is-user {
    background: linear-gradient(180deg, #44403C 0%, #292524 100%);
}
.dark .pia-hero-anim .pha-bubble.is-assistant {
    background: linear-gradient(180deg, #1F1E1C 0%, #161614 100%);
}

.dark .pia-hero-anim .pha-pc-stand {
    background: linear-gradient(180deg, #44403C 0%, #292524 100%);
}

.dark .pia-hero-anim .pha-replay {
    background: rgba(22, 22, 20, .55);
    color: var(--pha-ink-mute);
}
.dark .pia-hero-anim .pha-replay:hover {
    background: #1F1E1C;
    color: var(--pha-ink);
}

/* ==========================================================================
   BENTO CARDS — Top-line sweep on hover
   ========================================================================== */

.bento-card {
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.bento-card:hover {
    box-shadow: 0 8px 30px -12px rgba(0, 120, 212, 0.08);
}

.dark .bento-card:hover {
    box-shadow: 0 8px 30px -12px rgba(96, 205, 255, 0.06);
}

/* ==========================================================================
   PRICING TIERS
   ========================================================================== */

.pricing-tier {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s ease;
}

.pricing-tier:hover {
    transform: translateY(-4px);
}

/* ==========================================================================
   SCROLLBAR
   ========================================================================== */

.dark ::-webkit-scrollbar {
    width: 8px;
}

.dark ::-webkit-scrollbar-track {
    background: #0C0C0C;
}

.dark ::-webkit-scrollbar-thumb {
    background: #292524;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #44403C;
}

/* ==========================================================================
   COOKIE-BANNER
   ========================================================================== */

/* Der Container bekommt beim Einblenden programmatisch den Fokus, damit die Dialogrolle angesagt
   wird (site.js). Er ist selbst nicht bedienbar und spannt die volle Seitenbreite — ohne dies
   zeichnet der Browser seinen Fokusring als Rahmen um die ganze Fläche. Die Schaltflächen im
   Banner behalten ihren eigenen Indikator, 2.4.7 bleibt erfüllt. */
#cookie-banner:focus,
#cookie-banner:focus-visible {
    outline: none;
}

/* ==========================================================================
   GRAIN OVERLAY — adds texture depth
   ========================================================================== */

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

.dark body::after {
    opacity: 0.04;
}

/* ==========================================================================
   SELECTION HIGHLIGHT
   ========================================================================== */

::selection {
    background: rgba(0, 120, 212, 0.2);
    color: inherit;
}

.dark ::selection {
    background: rgba(96, 205, 255, 0.2);
}

/* ==========================================================================
   AUFKLAPPBARE RECHTSTEXT-ABSCHNITTE (datenschutz.html)
   Nativ über <details>, damit die Abschnitte ohne JavaScript bedienbar bleiben und die <h2>
   in der <summary> für die Überschriften-Navigation erhalten bleibt — ein div[role="button"]
   um die Überschrift verliert genau das.
   ========================================================================== */

.ds-acc {
    border: 1px solid #E7E5E4;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.55);
}

.dark .ds-acc {
    border-color: #292524;
    background: rgba(22, 22, 20, 0.45);
}

.ds-acc-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    border-radius: 0.75rem;
}

.ds-acc-summary::-webkit-details-marker {
    display: none;
}

.ds-acc-summary:hover {
    background: rgba(0, 0, 0, 0.025);
}

.dark .ds-acc-summary:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Eigener Fokusring: die Zusammenfassung spannt die volle Breite, der Standardring des
   Browsers geht auf dem hellen Grund darin unter (WCAG 2.4.7). */
.ds-acc-summary:focus-visible {
    outline: 2px solid rgb(var(--pia-accent-text));
    outline-offset: 2px;
}

.ds-acc-summary::after {
    content: '';
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.3rem;
    margin-bottom: 0.2rem;
    border-right: 2px solid rgb(var(--pia-copy-muted));
    border-bottom: 2px solid rgb(var(--pia-copy-muted));
    transform: rotate(45deg);
    transition: transform 200ms ease;
}

.ds-acc[open] > .ds-acc-summary::after {
    margin-bottom: 0;
    margin-top: 0.2rem;
    transform: rotate(-135deg);
}

@media (prefers-reduced-motion: reduce) {
    .ds-acc-summary::after {
        transition: none;
    }
}

.ds-acc-body {
    padding: 0 1.25rem 1.25rem;
}

/* Gedruckt wird der vollständige Text — das Aufklappen ist eine Lesehilfe, keine Zugangsstufe.
   Das Öffnen erledigt site.js vor dem Druck; hier fällt nur die Aufklapp-Chrome weg. */
@media print {
    .ds-acc {
        border: 0;
        background: none;
        break-inside: avoid;
    }

    .ds-acc-summary {
        padding: 1rem 0 0;
    }

    .ds-acc-summary::after {
        display: none;
    }

    .ds-acc-body {
        padding: 0;
    }

    #ds-toggle-all {
        display: none;
    }
}

/* Glossar-Begriff mit Hover-Erklaerung. Reines CSS: :focus-within statt JS, damit die Bubble
   auch per Tastatur und per Tap auf dem Handy aufgeht (dafuer traegt der Begriff tabindex="0"). */
.pia-term {
    display: inline;
    cursor: help;
    text-decoration: underline dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgb(var(--pia-accent-text) / 0.6);
}

/* Eigener Fokusring wie bei .ds-acc: der Standardring des Browsers geht auf dem hellen Grund
   unter, und der Begriff steht mitten im Flusstext (WCAG 2.4.7). */
.pia-term:focus-visible {
    outline: 2px solid rgb(var(--pia-accent-text));
    outline-offset: 2px;
    border-radius: 0.125rem;
}

/* Die Bubble haengt am Absatz, nicht am Wort. Steht der Begriff am rechten Rand, liefe eine
   wortzentrierte Bubble aus der Karte — und .bento-card schneidet mit overflow:hidden ab. */
[data-i18n-html]:has(.pia-term) {
    position: relative;
}

.pia-term-tip {
    position: absolute;
    bottom: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    z-index: 30;
    padding: 0.625rem 0.75rem;
    border: 1px solid #E7E5E4;
    border-radius: 0.5rem;
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    color: rgb(var(--pia-copy-soft));
    font-size: 0.8125rem;
    line-height: 1.45;
    text-align: left;
    text-decoration: none;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
}

.dark .pia-term-tip {
    border-color: #292524;
    background: #161614;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.pia-term:hover .pia-term-tip,
.pia-term:focus-within .pia-term-tip,
.pia-term:focus .pia-term-tip {
    opacity: 1;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .pia-term-tip {
        transition: none;
    }
}

/* Gedruckt gibt es kein Hover: die Erklaerung wandert als Einschub in den Satz. */
@media print {
    .pia-term-tip {
        position: static;
        display: inline;
        opacity: 1;
        visibility: visible;
        max-width: none;
        transform: none;
        padding: 0;
        border: 0;
        background: none;
        box-shadow: none;
        font-size: inherit;
    }

    .pia-term-tip::before {
        content: ' (';
    }

    .pia-term-tip::after {
        content: ')';
    }
}
