:root {
    --red-900: #74070d;
    --red-700: #a20c13;
    --red-600: #c71019;
    --red-500: #dc1822;
    --cream: #fff8e9;
    --cream-deep: #f4e4c1;
    --coffee-950: #1f0e08;
    --coffee-900: #2b130c;
    --coffee-800: #452014;
    --gold: #dca447;
    --muted: #c9ad91;
    --shadow: 0 22px 55px rgba(31, 5, 4, .28);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--coffee-950); }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--cream);
    font-family: "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at 18% 8%, rgba(218, 29, 35, .42), transparent 29rem),
        radial-gradient(circle at 91% 75%, rgba(124, 17, 15, .52), transparent 25rem),
        linear-gradient(145deg, #180a06 0%, #3a160d 52%, #210b07 100%);
}

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

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

.page-shell::before {
    position: fixed;
    inset: 0;
    z-index: -2;
    content: "";
    opacity: .3;
    background-image: radial-gradient(rgba(255, 244, 217, .18) .7px, transparent .7px);
    background-size: 8px 8px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.ambient {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}

.ambient-one {
    width: 270px;
    height: 270px;
    top: -120px;
    left: calc(50% - 310px);
    background: rgba(233, 27, 33, .24);
}

.ambient-two {
    width: 390px;
    height: 390px;
    right: calc(50% - 440px);
    bottom: -230px;
    border: 1px solid rgba(220, 164, 71, .18);
}

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

.share-button {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 248, 233, .18);
    border-radius: 50%;
    color: var(--cream);
    background: rgba(30, 11, 7, .48);
    backdrop-filter: blur(12px);
    cursor: pointer;
    font-size: 22px;
    transition: transform .2s ease, background-color .2s ease;
}

.share-button:hover { transform: translateY(-2px); background: rgba(169, 13, 20, .62); }
.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 { text-align: center; padding: 8px 54px 28px; }

.logo-wrap {
    display: grid;
    place-items: center;
    width: 154px;
    height: 154px;
    margin: 0 auto 16px;
    border: 1px solid rgba(255, 248, 233, .18);
    border-radius: 42px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .12), rgba(103, 7, 11, .18));
    box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .16);
    transform: rotate(-2deg);
}

.logo-wrap img { width: 137px; height: auto; filter: drop-shadow(0 10px 12px rgba(47, 3, 5, .28)); transform: rotate(2deg); }

.eyebrow {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
}

h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(35px, 8vw, 51px); line-height: 1; letter-spacing: -.04em; }

.intro { max-width: 430px; margin: 14px auto 0; color: #ead8c5; font-size: 16px; line-height: 1.55; }

.links-list { display: grid; gap: 13px; }

.link-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 76px;
    padding: 10px 17px 10px 11px;
    border: 1px solid rgba(255, 248, 233, .16);
    border-radius: 22px;
    color: var(--cream);
    background: linear-gradient(135deg, rgba(255, 248, 233, .105), rgba(255, 248, 233, .055));
    box-shadow: 0 12px 28px rgba(19, 3, 2, .18);
    backdrop-filter: blur(14px);
    text-decoration: none;
    opacity: 0;
    transform: translateY(12px);
    animation: link-in .5s cubic-bezier(.2, .75, .2, 1) forwards;
    transition: border-color .2s ease, transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.link-card:nth-child(2) { animation-delay: 55ms; }
.link-card:nth-child(3) { animation-delay: 110ms; }
.link-card:nth-child(4) { animation-delay: 165ms; }
.link-card:nth-child(5) { animation-delay: 220ms; }
.link-card:nth-child(6) { animation-delay: 275ms; }
.link-card:nth-child(7) { animation-delay: 330ms; }
.link-card:nth-child(8) { animation-delay: 385ms; }

.link-card:hover { transform: translateY(-3px); border-color: rgba(255, 231, 190, .45); background-color: rgba(255, 248, 233, .09); box-shadow: 0 18px 34px rgba(19, 3, 2, .27); }

.link-card--featured { border-color: rgba(255, 210, 133, .42); background: linear-gradient(135deg, var(--red-600), var(--red-900)); box-shadow: 0 16px 35px rgba(105, 4, 8, .36); }

.link-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 248, 233, .17);
    border-radius: 15px;
    background: rgba(18, 4, 2, .22);
    font-size: 23px;
}

.link-copy { min-width: 0; padding: 0 13px; }
.link-copy strong { display: block; overflow: hidden; font-size: 16px; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.link-copy small { display: block; overflow: hidden; margin-top: 4px; color: #ddc8b3; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.link-card--featured .link-copy small { color: #f8dacf; }
.link-arrow { color: var(--gold); font-size: 21px; }
.link-badge { padding: 6px 9px; border-radius: 999px; color: #40170e; background: var(--cream-deep); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

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

.profile-footer { padding: 34px 10px 0; color: var(--muted); text-align: center; }
.profile-footer p { margin: 7px 0 9px; font-family: Georgia, "Times New Roman", serif; font-size: 14px; font-style: italic; }
.coffee-mark { color: var(--gold); font-size: 10px; }
.privacy-link { border: 0; color: #bea78f; background: transparent; cursor: pointer; font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

.toast {
    position: fixed;
    z-index: 10;
    left: 50%;
    bottom: 24px;
    padding: 11px 16px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px;
    color: var(--cream);
    background: rgba(24, 7, 4, .92);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translate(-50%, 18px);
    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), 450px);
    padding: 30px;
    border: 1px solid rgba(255, 248, 233, .18);
    border-radius: 24px;
    color: var(--cream);
    background: #32130c;
    box-shadow: var(--shadow);
}
.privacy-dialog::backdrop { background: rgba(13, 4, 2, .72); backdrop-filter: blur(5px); }
.privacy-dialog h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 27px; }
.privacy-dialog > p:not(.eyebrow) { color: #dbc4ac; 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: 12px; color: white; background: var(--red-600); 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: 132px; height: auto; filter: drop-shadow(0 14px 25px rgba(0, 0, 0, .35)); }
.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: #ddc8b3; line-height: 1.6; }
.error-page a { margin-top: 8px; }

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

@media (max-width: 520px) {
    .page-shell { padding-right: 14px; padding-left: 14px; }
    .profile-header { padding-right: 42px; padding-left: 42px; }
    .logo-wrap { width: 136px; height: 136px; border-radius: 36px; }
    .logo-wrap img { width: 121px; }
    .link-card { min-height: 72px; border-radius: 19px; }
    .link-copy { padding-right: 8px; padding-left: 11px; }
    .link-badge { padding: 5px 7px; font-size: 9px; }
}

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