/* ============ Schriften (selbst gehostet, in fonts/; Lizenzen: fonts/OFL-*.txt) ============ */
@font-face { font-family: 'Archivo'; src: url('fonts/archivo-latin.woff2') format('woff2'); font-weight: 400 800; font-stretch: 62% 125%; font-display: swap; 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; }
@font-face { font-family: 'Geist'; src: url('fonts/geist-latin.woff2') format('woff2'); font-weight: 300 600; font-display: swap; 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; }

/* ============ Farben ============ */
:root {
    --black: #000000;
    --white: #ffffff;
    --silver: #c3c7cd;
    --silver-dim: #8d929a;
    --line: rgba(255, 255, 255, 0.16);
    --font-display: 'Archivo', 'Arial Black', system-ui, sans-serif;
    --font-text: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

    /* Video etwas nach oben, damit über dem Kopf wenig Platz bleibt */
    --video-shift: -5%;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--black);
}

body {
    font-family: var(--font-text);
    color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-font-smoothing: antialiased;
}

/* ============ Große Bildschirme: unscharfer Hintergrund ============ */
.ambient {
    position: fixed;
    inset: -10%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.ambient img,
.ambient video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(50px) brightness(0.85) saturate(1.2);
    transform: scale(1.1);
}
.ambient::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.7) 100%);
}

/* ============ Karte ============ */
.card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    height: min(calc(100dvh - 60px), 860px);
    border-radius: 36px;
    overflow: hidden;
    background: var(--black);
    text-align: center;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.07);
}

/* ============ Living Portrait ============ */
.portrait {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: var(--black);
}
.portrait-poster,
.portrait-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transform: translateY(var(--video-shift));
    pointer-events: none;
}
.portrait-video { opacity: 0; transition: opacity 0.4s ease; }
.portrait-video.is-playing { opacity: 1; }

/* Fester dunkler Verlauf: Text bleibt lesbar, auch wenn im Video geblitzt wird */
.shade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.55) 28%,
        rgba(0, 0, 0, 0.88) 55%,
        #000 100%);
}

/* ============ M-Zeichen oben links ============ */
.mark {
    position: absolute;
    z-index: 4;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    left: 14px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mark img {
    display: block;
    height: 30px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

/* ============ Inhalt ============ */
.content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 22px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2rem, 9.4vw, 2.35rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    white-space: nowrap;
    text-shadow: 0 0 14px rgba(225, 230, 240, 0.28), 0 2px 12px rgba(0, 0, 0, 0.6);
}

.title {
    margin-top: 6px;
    font-weight: 500;
    font-size: 1rem;
    color: var(--silver);
    letter-spacing: 0.01em;
}

.founder {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 14px;
}
/* wie im Logo: dünn, hellgrau, weit gesperrt */
.founder-label {
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    color: #b9bcc2;
}
.founder-logo {
    display: block;
    height: 30px;
    width: auto;
}

/* Großer weißer Button */
.save {
    margin-top: 18px;
    width: 100%;
    max-width: 368px;
    min-height: 54px;
    border-radius: 999px;
    background: var(--white);
    color: var(--black);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.save svg { width: 20px; height: 20px; fill: currentColor; }
.save:active { transform: scale(0.98); }
@media (hover: hover) { .save:hover { background: #ececec; } }

/* Icon-Reihe: immer sichtbar, weiße Icons ohne Kreise */
.links {
    margin-top: 12px;
    width: 100%;
    max-width: 360px;
    display: flex;
    justify-content: space-evenly;
}
.links a,
.links button {
    position: relative;
    flex: 0 0 auto;
    width: 44px;            /* unsichtbare Tippfläche */
    height: 44px;
    border: 0;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease, transform 0.2s ease;
}
.links svg { width: 25px; height: 25px; fill: currentColor; }
.links #qr-btn svg { width: 27px; height: 27px; }

/* Website: Globus wird zum M von Mahran Studio */
.links .web-mark {
    position: absolute;
    height: 22px;
    width: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.links .i-web svg { transition: opacity 0.2s ease; }

/* Markenfarben beim Drüberfahren (Computer) und beim Tippen (Handy) */
@media (hover: hover) {
    .links a:hover, .links button:hover { transform: translateY(-3px); }
    .i-tel:hover  { color: #34b7f1; }
    .i-mail:hover { color: #ea4335; }
    .i-web:hover svg { opacity: 0; }
    .i-web:hover .web-mark { opacity: 1; }
}
.i-tel:active  { color: #34b7f1; }
.i-mail:active { color: #ea4335; }
.i-web:active svg { opacity: 0; }
.i-web:active .web-mark { opacity: 1; }
#qr-btn:active { transform: scale(0.92); }

/* Sichtbarer Fokus für Tastatur */
.save:focus-visible, .links a:focus-visible,
.links button:focus-visible, .mark:focus-visible, .qr-close:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 3px;
}

/* ============ QR im Vollbild ============ */
.qr {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #ffffff;
    color: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
}
.qr[hidden] { display: none; }
.qr-code { padding: 16px; background: #ffffff; }
.qr-svg { display: block; width: min(78vw, 58vh, 420px); height: auto; }
.qr-scan { margin-top: 22px; font-size: 0.95rem; font-weight: 500; color: #333333; }
.qr-close {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: 12px;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.qr-close svg { width: 20px; height: 20px; fill: #000000; }

/* ============ Intro (< 1,2 s, nur erster Besuch) ============ */
.intro {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    transform-origin: 50% 45%;
    animation: cameraPush 0.7s cubic-bezier(0.55, 0, 0.35, 1) 0.3s both;
}
.intro-light {
    position: absolute;
    inset: -20%;
    opacity: 0;
    background: radial-gradient(ellipse 75% 95% at 50% 45%,
        #ffffff 0%, rgba(255, 255, 255, 0.9) 45%, rgba(255, 255, 255, 0.5) 75%, rgba(255, 255, 255, 0.2) 100%);
    animation: lightFlood 0.75s ease-out 0.32s both;
}
.intro-doors {
    position: absolute;
    inset: 0;
    perspective: 1100px;
    perspective-origin: 50% 45%;
}
.intro-door {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50.2%;
    background: #000000;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.intro-door.left  { left: 0;  transform-origin: 0 50%;    animation: doorLeft 0.6s cubic-bezier(0.7, 0, 0.25, 1) 0.3s both; }
.intro-door.right { right: 0; transform-origin: 100% 50%; animation: doorRight 0.6s cubic-bezier(0.7, 0, 0.25, 1) 0.3s both; }

/* Lichtlinie: rein weiß/neutral, kein Farbstich */
.intro-seam {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: #ffffff;
    opacity: 0;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.9), 0 0 26px rgba(255, 255, 255, 0.55), 0 0 60px rgba(255, 255, 255, 0.3);
    animation: seamGlow 0.75s ease 0s both;
}

/* Inhalt während des Intros */
.portrait { animation: arrive 0.8s cubic-bezier(0.3, 0, 0.2, 1) 0.3s both; }
.name, .title, .founder, .save, .links {
    animation: riseIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.name      { animation-delay: 0.62s; }
.title     { animation-delay: 0.68s; }
.founder   { animation-delay: 0.74s; }
.save      { animation-delay: 0.8s; }
.links     { animation-delay: 0.85s; }

@keyframes seamGlow {
    0%   { opacity: 0; transform: scaleY(0.3); }
    40%  { opacity: 1; transform: scaleY(1); }
    70%  { opacity: 1; width: 10px; margin-left: -5px; }
    100% { opacity: 0; width: 40px; margin-left: -20px; }
}
@keyframes doorLeft  { from { transform: rotateY(0); } to { transform: rotateY(-100deg); } }
@keyframes doorRight { from { transform: rotateY(0); } to { transform: rotateY(100deg); } }
@keyframes cameraPush { from { transform: scale(1); } to { transform: scale(1.7); } }
/* ruhigerer Blitz: max. 55 % Deckkraft, ein einziger weicher Anstieg und Abfall */
@keyframes lightFlood {
    0%   { opacity: 0; }
    35%  { opacity: 0.55; }
    100% { opacity: 0; }
}
@keyframes arrive { from { filter: blur(2px); transform: scale(0.94); } to { filter: none; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Kein Intro (2. Besuch, übersprungen oder reduzierte Bewegung): alles sofort da */
.no-intro .intro { display: none; }
.no-intro .portrait,
.no-intro .name, .no-intro .title, .no-intro .founder,
.no-intro .save, .no-intro .links { animation: none; }
/* Fußzeile: während des Intros unsichtbar, kommt mit den Icons (gleiche Zeit, gleiche Bewegung).
   Eigenes "translate", damit das Zentrieren per transform am Computer erhalten bleibt. */
.card-foot { animation: footRise 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) 0.85s both; }
.no-intro .card-foot { animation: none; }
@keyframes footRise { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }

/* Reduzierte Bewegung: nur Standbild, keine Übergänge */
.rm .portrait-video, .rm .ambient video { display: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

/* ============ Handy: Vollbild ============ */
@media (max-width: 480px) {
    .ambient { display: none; }
    .card {
        position: fixed;
        inset: 0;
        max-width: none;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
    }
}

/* Sehr schmale Handys: Icons dürfen umbrechen */
@media (max-width: 352px) {
    .links { flex-wrap: wrap; justify-content: center; gap: 2px; }
}

/* Niedrige Bildschirme: etwas kompakter */
@media (max-height: 680px) {
    .name { font-size: 1.9rem; }
    .founder { margin-top: 10px; }
    .save { margin-top: 12px; min-height: 50px; }
    .links { margin-top: 10px; }
}

/* ============ WhatsApp, LinkedIn und Instagram: offizielle Logo-Dateien ============
   Weiß = offizielle weiße Datei; Hover/Tippen = offizielle farbige Datei (keine Umfärbung per CSS). */
.links .brand { display: block; width: auto; height: 22px; }
.links .brand-on { position: absolute; opacity: 0; transition: opacity 0.2s ease; }
@media (hover: hover) {
    .i-wa:hover .brand-on, .i-in:hover .brand-on, .i-ig:hover .brand-on { opacity: 1; }
}
.i-wa:active .brand-on, .i-in:active .brand-on, .i-ig:active .brand-on { opacity: 1; }

/* ============ Fußzeile (wie mahranstudio.de) ============
   Unter der Karte statt darin: Bild, Name, Button und Icons bleiben genau, wo sie sind.
   Computer: direkt unter der Karte. Handy: die Karte füllt weiter den Bildschirm, die Fußzeile kommt mit
   einem kleinen Scroll darunter, mit Abstand über der Home-Leiste bzw. Safaris Leiste (safe-area + 16px). */
html { overflow-x: hidden; overflow-y: auto; }
body { overflow: visible; }
.card-foot {
    position: absolute;
    z-index: 4;
    left: 50%;
    transform: translateX(-50%);
    width: min(368px, calc(100% - 32px));
    top: calc(50% + min(50dvh - 30px, 430px) + 10px);
    padding: 7px 0 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    white-space: nowrap;
    color: #9A9DA3;
    font-size: 0.9rem;
    line-height: 1;
}
@media (max-width: 480px) {
    /* the card scrolls with the page instead of being fixed: same place, same size (the whole screen) */
    .card { position: absolute; top: 0; left: 0; right: auto; bottom: auto; width: 100%; height: 100%; }
    /* Start below the whole screen, including the part under Safari's floating bar (iOS: 100lvh), so nothing of the
       footer shows before scrolling. At the end of the scroll it keeps the bar's height free (100lvh - 100svh). */
    .card-foot {
        top: calc(100% + 8px);
        top: calc(max(100%, 100lvh) + 8px);
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + max(0px, 100lvh - 100svh) + 16px);
    }
}
.card-foot a { color: inherit; text-decoration: none; }
.card-foot a:hover { color: #ECEDEF; }
.card-foot a:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* "Info" sieht aus wie die Links daneben */
.ai-info { all: unset; cursor: pointer; color: inherit; }
.ai-info:hover { color: #ECEDEF; }
.ai-info:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* ============ Info: über mich + Hinweis zum Porträt (im Stil der Karte) ============ */
.about {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.about[hidden] { display: none; }
.about-panel {
    position: relative;
    width: 100%;
    max-width: 368px;
    padding: 30px 24px 26px;
    border-radius: 28px;
    background: #0b0b0c;
    border: 1px solid var(--line);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
    text-align: left;
    color: var(--silver);
    font-size: 0.95rem;
    line-height: 1.55;
}
.about-title {
    margin: 0 44px 12px 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.45rem;
    letter-spacing: -0.02em;
    color: var(--white);
}
.about-panel p + p { margin-top: 10px; }
.about-ai { padding-top: 12px; border-top: 1px solid var(--line); }
.about-ai strong { color: var(--white); font-weight: 600; }
.about-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.about-close svg { width: 16px; height: 16px; fill: var(--white); }
.about-close:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* Computer: leichter dunkler Hintergrund hinter der Fußzeile, damit sie auf dem unscharfen Bild gut lesbar ist */
@media (min-width: 481px) {
    .card-foot {
        width: min(400px, calc(100% - 32px));
        padding: 9px 16px 10px;
        border-top: 0;
        border-radius: 14px;
        background: rgba(0, 0, 0, 0.55);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }
}
