:root {
    --ink: #1b0709;
    --ink-soft: #260a0d;
    --paper: #ffffff;
    --cream: #f7f1e5;
    --gold: #e2aa2e;
    --muted: #aaa7a0;
    --red: #c30d17;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #7f0710; }

body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    color: var(--cream);
    font-family: "Segoe UI", Arial, sans-serif;
    background-color: #a50b15;
    background-image:
        radial-gradient(circle at 18% 4%, rgba(226, 36, 46, .68), transparent 28rem),
        radial-gradient(circle at 88% 88%, rgba(95, 0, 7, .9), transparent 31rem),
        linear-gradient(145deg, #c3111c 0%, #940811 46%, #6d050c 100%);
}

body::before,
body::after {
    position: fixed;
    inset: 0;
    content: "";
    pointer-events: none;
}

body::before {
    z-index: 0;
    background-image: radial-gradient(rgba(255, 235, 217, .075) .7px, transparent .8px);
    background-size: 7px 7px;
    opacity: .6;
}

body::after {
    z-index: 1;
    background:
        radial-gradient(ellipse at center top, rgba(22, 2, 4, .26), rgba(18, 2, 4, .57) 76%),
        linear-gradient(to bottom, rgba(21, 2, 4, .18), rgba(16, 2, 3, .48));
}

button, a { -webkit-tap-highlight-color: transparent; }

.page-shell {
    position: relative;
    z-index: 2;
    isolation: isolate;
    min-height: 100vh;
    overflow: hidden;
    padding: max(38px, env(safe-area-inset-top)) 18px max(30px, env(safe-area-inset-bottom));
}

.page-shell::before,
.page-shell::after {
    position: fixed;
    z-index: -1;
    top: -150px;
    bottom: -170px;
    width: min(58vw, 760px);
    content: "";
    background-image: url("../img/coffee-branches-transparent.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: .4;
    filter: brightness(1.32) saturate(.72);
    pointer-events: none;
}

.page-shell::before {
    left: -120px;
    transform: rotate(-4deg);
}

.page-shell::after {
    right: -120px;
    transform: scaleX(-1) rotate(-4deg);
}

.profile {
    position: relative;
    width: min(100%, 520px);
    margin: 0 auto;
}

.share-button {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 50%;
    color: #d7d4cc;
    background: rgba(36, 2, 5, .28);
    backdrop-filter: blur(6px);
    cursor: pointer;
    font-size: 18px;
    transition: color .2s ease, border-color .2s ease, transform .2s ease;
}

.share-button:hover { color: white; border-color: rgba(255, 255, 255, .38); transform: translateY(-2px); }
.share-button:focus-visible, .link-card:focus-visible, .privacy-link:focus-visible, .dialog-action:focus-visible, .dialog-close:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.profile-header { padding: 0 44px 24px; text-align: center; }

.logo-wrap {
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    margin: 0 auto 15px;
    border: 3px solid var(--paper);
    border-radius: 50%;
    background: var(--paper);
    box-shadow: 0 0 0 2px rgba(195, 13, 23, .65), 0 12px 28px rgba(0, 0, 0, .28);
    overflow: hidden;
}

.logo-wrap img { width: 98px; height: 88px; object-fit: contain; }

h1 {
    margin: 0;
    font-size: clamp(20px, 5vw, 24px);
    font-weight: 700;
    letter-spacing: -.02em;
}

.intro {
    max-width: 390px;
    margin: 9px auto 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.links-list { display: grid; gap: 0; }

.link-section { display: grid; gap: 12px; }
.link-section + .link-section { margin-top: 24px; }

.link-section h2 {
    margin: 0 0 3px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -.01em;
    text-align: center;
}

.link-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 13px 28px;
    border: 1px solid rgba(255, 255, 255, .92);
    border-radius: 999px;
    color: #171a19;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 7px 20px rgba(30, 0, 3, .26);
    text-align: center;
    text-decoration: none;
    opacity: 0;
    transform: translateY(8px);
    animation: link-in .42s ease forwards;
    transition: color .2s ease, background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.link-card:nth-of-type(2) { animation-delay: 45ms; }
.link-card:nth-of-type(3) { animation-delay: 90ms; }
.link-card:nth-of-type(4) { animation-delay: 135ms; }
.link-card:nth-of-type(5) { animation-delay: 180ms; }

.link-card strong { font-size: 13px; font-weight: 650; line-height: 1.25; }

.link-card:hover {
    color: var(--red);
    background: #fffaf2;
    transform: translateY(-2px);
    box-shadow: 0 10px 23px rgba(0, 0, 0, .25);
}

.empty-state { padding: 24px; border: 1px dashed rgba(255, 255, 255, .18); border-radius: 22px; text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state span { margin-top: 6px; color: var(--muted); font-size: 13px; }

.profile-footer { padding: 30px 10px 0; color: #817f7a; text-align: center; }
.profile-footer p { margin: 0 0 8px; font-size: 11px; }
.privacy-link { border: 0; color: #8f8c86; background: transparent; cursor: pointer; font: inherit; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }

.toast {
    position: fixed;
    z-index: 10;
    left: 50%;
    bottom: 24px;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    color: white;
    background: rgba(20, 22, 21, .94);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .32);
    opacity: 0;
    transform: translate(-50%, 16px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.privacy-dialog {
    width: min(calc(100% - 32px), 430px);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 22px;
    color: var(--cream);
    background: rgba(38, 7, 11, .98);
    box-shadow: 0 22px 55px rgba(0, 0, 0, .35);
}
.privacy-dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px); }
.privacy-dialog .eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.privacy-dialog h2 { margin: 0; font-size: 24px; }
.privacy-dialog > p:not(.eyebrow) { color: #b9b5ad; font-size: 14px; line-height: 1.6; }
.dialog-close { position: absolute; top: 12px; right: 14px; border: 0; color: var(--cream); background: transparent; cursor: pointer; font-size: 28px; }
.dialog-action, .error-page a { display: inline-flex; justify-content: center; padding: 11px 18px; border: 0; border-radius: 999px; color: #171a19; background: white; cursor: pointer; font-weight: 800; text-decoration: none; }

.error-page { display: grid; place-items: center; align-content: center; min-height: 100vh; padding: 30px; text-align: center; }
.error-page img { width: 120px; height: auto; }
.error-code { margin-top: 20px; color: var(--gold); font-weight: 900; letter-spacing: .18em; }
.error-page h1 { margin-top: 8px; }
.error-page p { max-width: 450px; color: var(--muted); line-height: 1.6; }
.error-page a { margin-top: 8px; }

@keyframes link-in { to { opacity: 1; transform: translateY(0); } }

@media (max-width: 520px) {
    body::after { background: rgba(20, 2, 4, .43); }
    .page-shell::before, .page-shell::after { top: -60px; bottom: -80px; width: 86vw; opacity: .26; }
    .page-shell::before { left: -57vw; }
    .page-shell::after { right: -57vw; }
    .page-shell { padding-right: 22px; padding-left: 22px; }
    .profile-header { padding-bottom: 22px; }
    .logo-wrap { width: 102px; height: 102px; }
    .logo-wrap img { width: 89px; height: 80px; }
    .link-card { min-height: 50px; padding-right: 20px; padding-left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
