<?php
// Original request path + query (as requested by the browser)
$originalUri = $_SERVER['REQUEST_URI'] ?? '/';

// Build the target on the new domain
if ($originalUri === '/' || $originalUri === '') {
    $targetUrl = 'https://homecoming.wiki/';
} else {
    $targetUrl = 'https://homecoming.wiki' . $originalUri;
}

// For display purposes (HTML-escaped)
$displayOriginal = htmlspecialchars('https://hcwiki.cityofheroes.dev' . $originalUri, ENT_QUOTES, 'UTF-8');
$displayTarget   = htmlspecialchars($targetUrl, ENT_QUOTES, 'UTF-8');
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>Homecoming Wiki Has Moved</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style>
        :root {
            --bg: #050816;
            --bg-alt: #0b1220;
            --card-bg: #050816;
            --accent: #38bdf8;
            --accent-soft: rgba(56, 189, 248, 0.25);
            --accent-strong: #0ea5e9;
            --border-subtle: rgba(148, 163, 184, 0.35);
            --text-main: #e5e7eb;
            --text-muted: #9ca3af;
            --text-soft: #6b7280;
            --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.85);
        }

        * {
            box-sizing: border-box;
        }

        html, body {
            margin: 0;
            padding: 0;
            min-height: 100%;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            background: radial-gradient(circle at top, #0f172a 0%, #020617 50%, #020617 100%);
            color: var(--text-main);
        }

        body {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }

        .bg-grid {
            position: fixed;
            inset: 0;
            pointer-events: none;
            background-image:
                linear-gradient(to right, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
                linear-gradient(to bottom, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
            background-size: 40px 40px;
            opacity: 0.4;
            z-index: -2;
        }

        .bg-glow {
            position: fixed;
            inset: 0;
            pointer-events: none;
            overflow: hidden;
            z-index: -1;
        }

        .bg-glow::before {
            content: "";
            position: absolute;
            width: 420px;
            height: 420px;
            border-radius: 999px;
            background:
                radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.25), transparent 60%),
                radial-gradient(circle at 80% 80%, rgba(129, 140, 248, 0.22), transparent 60%);
            filter: blur(14px);
            transform: translate(0, 0);
            opacity: 0.85;
        }

        .shell {
            width: 100%;
            max-width: 720px;
            border-radius: 20px;
            background:
                radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.09), transparent 55%),
                radial-gradient(circle at 100% 100%, rgba(129, 140, 248, 0.08), transparent 55%),
                linear-gradient(to bottom right, #020617 0%, #020617 40%, #020617 100%);
            padding: 1px;
            box-shadow: var(--shadow-soft);
            position: relative;
        }

        .card {
            border-radius: 19px;
            background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
            padding: 24px 24px 22px;
            border: 1px solid rgba(15, 23, 42, 0.9);
            position: relative;
            overflow: hidden;
        }

        .card::before {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: inherit;
            border: 1px solid rgba(148, 163, 184, 0.2);
            pointer-events: none;
        }

        .card::after {
            content: "";
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 60%);
            opacity: 0.8;
            pointer-events: none;
        }

        .card-inner {
            position: relative;
            z-index: 1;
        }

        .badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            border-radius: 999px;
            padding: 6px 12px 6px 6px;
            background: rgba(15, 23, 42, 0.95);
            border: 1px solid var(--border-subtle);
            box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8);
            margin-bottom: 16px;
        }

        .badge-icon {
            width: 24px;
            height: 24px;
            border-radius: 999px;
            background: radial-gradient(circle at 30% 20%, var(--accent-strong), #1e40af);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #0b1120;
            font-size: 14px;
            font-weight: 700;
            box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.7),
                        0 0 20px rgba(56, 189, 248, 0.7);
        }

        .badge-text {
            font-size: 13px;
            color: var(--text-muted);
            letter-spacing: 0.03em;
            text-transform: uppercase;
        }

        .badge-pill {
            padding: 2px 8px;
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.9);
            border: 1px solid rgba(148, 163, 184, 0.45);
            font-size: 11px;
            color: var(--text-soft);
            letter-spacing: 0.08em;
        }

        h1 {
            margin: 0 0 8px;
            font-size: clamp(1.9rem, 2.2vw, 2.25rem);
            letter-spacing: -0.03em;
            color: #f9fafb;
        }

        .subtitle {
            margin: 0 0 18px;
            color: var(--text-muted);
            font-size: 0.98rem;
            line-height: 1.6;
        }

        .domains {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: 10px;
            margin-bottom: 20px;
        }

        .domain-card {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 12px 14px;
            border-radius: 12px;
            background: radial-gradient(circle at 0 0, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.92));
            border: 1px solid rgba(30, 64, 175, 0.4);
            position: relative;
        }

        .domain-card.is-old {
            background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
            border-color: rgba(148, 163, 184, 0.6);
        }

        .domain-info {
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-width: 0;
        }

        .domain-label {
            font-size: 11px;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: var(--text-soft);
        }

        .domain-url {
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
            font-size: 0.9rem;
            color: var(--text-main);
            word-break: break-all;
        }

        .domain-tag {
            padding: 2px 8px;
            border-radius: 999px;
            font-size: 11px;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .domain-tag.old {
            border: 1px solid rgba(239, 68, 68, 0.8);
            color: #fecaca;
            background: rgba(127, 29, 29, 0.6);
        }

        .domain-tag.new {
            border: 1px solid rgba(34, 197, 94, 0.85);
            color: #bbf7d0;
            background: rgba(6, 95, 70, 0.8);
        }

        .steps {
            margin: 0 0 18px;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px dashed rgba(148, 163, 184, 0.7);
            background: radial-gradient(circle at 0 0, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.96));
        }

        .steps-title {
            font-size: 0.78rem;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: var(--text-soft);
            margin-bottom: 8px;
        }

        .steps-list {
            list-style: none;
            margin: 0;
            padding: 0;
            display: grid;
            gap: 4px;
        }

        .steps-list li {
            font-size: 0.88rem;
            color: var(--text-muted);
            display: flex;
            gap: 6px;
        }

        .steps-list li span.step-num {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            border-radius: 999px;
            font-size: 11px;
            color: #e5e7eb;
            background: rgba(15, 23, 42, 0.9);
            border: 1px solid rgba(148, 163, 184, 0.7);
            flex-shrink: 0;
        }

        .primary-action {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 10px 18px;
            border-radius: 999px;
            border: 1px solid rgba(56, 189, 248, 0.9);
            background: radial-gradient(circle at 30% 0, rgba(56, 189, 248, 0.35), rgba(59, 130, 246, 0.8));
            color: #0b1120;
            font-weight: 600;
            font-size: 0.95rem;
            text-decoration: none;
            letter-spacing: 0.03em;
            text-transform: uppercase;
            box-shadow:
                0 0 0 1px rgba(15, 23, 42, 0.8),
                0 18px 38px rgba(37, 99, 235, 0.65);
            position: relative;
            overflow: hidden;
        }

        .primary-action span.label {
            position: relative;
            z-index: 1;
        }

        .primary-action span.chevron {
            position: relative;
            z-index: 1;
            font-size: 1.1rem;
            margin-top: -1px;
        }

        .primary-action::before {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(120deg,
                rgba(248, 250, 252, 0.15),
                rgba(248, 250, 252, 0.5),
                rgba(248, 250, 252, 0.15));
            transform: translateX(-100%);
            transition: transform 0.6s ease;
        }

        .primary-action:hover::before {
            transform: translateX(0);
        }

        .primary-action:hover {
            transform: translateY(-1px);
            box-shadow:
                0 0 0 1px rgba(15, 23, 42, 0.9),
                0 20px 46px rgba(37, 99, 235, 0.8);
        }

        .primary-action:active {
            transform: translateY(0);
            box-shadow:
                0 0 0 1px rgba(15, 23, 42, 0.9),
                0 12px 26px rgba(37, 99, 235, 0.6);
        }

        .footer-note {
            margin-top: 16px;
            padding-top: 14px;
            border-top: 1px solid rgba(30, 64, 175, 0.55);
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 8px;
            font-size: 0.8rem;
            color: var(--text-soft);
        }

        .footer-note strong {
            color: var(--text-muted);
            font-weight: 500;
        }

        .footer-secondary {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .pill-muted {
            border-radius: 999px;
            padding: 3px 9px;
            border: 1px solid rgba(148, 163, 184, 0.6);
            background: rgba(15, 23, 42, 0.96);
            font-size: 0.75rem;
        }

        .pill-muted code {
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
            font-size: 0.75rem;
            color: #e5e7eb;
        }

        @media (min-width: 640px) {
            .card {
                padding: 26px 26px 22px;
            }

            .subtitle {
                font-size: 1rem;
            }

            .domains {
                grid-template-columns: minmax(0, 1fr);
                gap: 12px;
            }

            .domain-card {
                padding: 14px 16px;
            }

            .footer-note {
                font-size: 0.82rem;
            }
        }
    </style>
</head>
<body>
    <div class="bg-grid"></div>
    <div class="bg-glow"></div>

    <main class="shell" aria-labelledby="title">
        <section class="card">
            <div class="card-inner">
                <div class="badge">
                    <div class="badge-icon">HC</div>
                    <div class="badge-text">Homecoming Wiki</div>
                    <div class="badge-pill">Domain update</div>
                </div>

                <h1 id="title">We’ve moved to a new home</h1>
                <p class="subtitle">
                    The Homecoming Wiki is now served from our new official domain. Please update your bookmarks and links so you continue
                    to land on the correct, up-to-date site.
                </p>

                <div class="domains" aria-label="Old and new wiki domains">
                    <div class="domain-card is-old">
                        <div class="domain-info">
                            <div class="domain-label">Old address</div>
                            <div class="domain-url">hcwiki.cityofheroes.dev</div>
                        </div>
                        <div class="domain-tag old">Deprecated</div>
                    </div>

                    <div class="domain-card">
                        <div class="domain-info">
                            <div class="domain-label">New official address</div>
                            <div class="domain-url">homecoming.wiki</div>
                        </div>
                        <div class="domain-tag new">Active</div>
                    </div>
                </div>

                <div class="steps">
                    <div class="steps-title">Quick steps</div>
                    <ul class="steps-list">
                        <li>
                            <span class="step-num">1</span>
                            <span>Open your bookmark or saved link that points to <code>hcwiki.cityofheroes.dev</code>.</span>
                        </li>
                        <li>
                            <span class="step-num">2</span>
                            <span>Replace the domain with <code>homecoming.wiki</code> while keeping the rest of the URL path the same.</span>
                        </li>
                        <li>
                            <span class="step-num">3</span>
                            <span>Save the updated bookmark so it uses the new domain going forward.</span>
                        </li>
                    </ul>
                </div>


                <p class="original-url">
                    You were trying to visit:<br>
                    <code><?php echo $displayOriginal; ?></code>
                </p>

                <a href="<?php echo $displayTarget; ?>" class="primary-action">
                    <span class="label">Go to this page on homecoming.wiki</span>
                    <span class="chevron">↗</span>
                </a>

                <div class="footer-note">
                    <div>
                        <strong>Note:</strong> This page exists only to help you migrate bookmarks from
                        <code>hcwiki.cityofheroes.dev</code> to <code>homecoming.wiki</code>.
                    </div>
                    <div class="footer-secondary">
                        <span class="pill-muted">
                            Update any scripts or integrations to use
                            <code>https://homecoming.wiki/</code>
                        </span>
                    </div>
                </div>
            </div>
        </section>
    </main>
</body>
</html>
