/* webhome — public start page */

:root {
    --base: #04030a;
    --text: #f4f3fb;
    --muted: rgba(244, 243, 251, 0.62);
    --pill: rgba(255, 255, 255, 0.96);
    --accent: #22d3ee;
    --accent-2: #c026d3;
    --accent-3: #8b5cf6;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
        Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
    --mono: "SF Mono", ui-monospace, "Cascadia Code", "Roboto Mono", Menlo,
        Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--base);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Fine grain + vignette for depth (no image assets). */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(130% 100% at 50% 0%, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
    mix-blend-mode: multiply;
}

/* Holographic scanlines */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.025) 0px,
        rgba(255, 255, 255, 0.025) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: overlay;
}

/* ----------------------------------------------------------------
 * Wallpaper — layered gradients + animated color glows
 * ---------------------------------------------------------------- */
.wallpaper {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 18% 8%, rgba(124, 58, 237, 0.55) 0%, transparent 55%),
        radial-gradient(90% 80% at 88% 18%, rgba(34, 211, 238, 0.34) 0%, transparent 50%),
        radial-gradient(85% 75% at 82% 95%, rgba(192, 38, 211, 0.40) 0%, transparent 55%),
        radial-gradient(70% 60% at 8% 96%, rgba(59, 7, 100, 0.7) 0%, transparent 60%),
        linear-gradient(160deg, #07060f 0%, #04030a 45%, #08041a 100%);
}

/* Neon perspective grid "floor" — synthwave horizon */
.wallpaper::before {
    content: "";
    position: absolute;
    left: -50%;
    right: -50%;
    bottom: -12%;
    height: 75vh;
    background-image:
        linear-gradient(rgba(34, 211, 238, 0.35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(192, 38, 211, 0.28) 1px, transparent 1px);
    background-size: 54px 54px;
    transform: perspective(440px) rotateX(64deg);
    transform-origin: bottom center;
    -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 78%);
    mask-image: linear-gradient(to top, #000 0%, transparent 78%);
    opacity: 0.5;
    animation: grid-flow 7s linear infinite;
}

/* Horizon glow line sitting on top of the grid */
.wallpaper::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 63%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent-2) 70%, transparent);
    filter: blur(2px);
    opacity: 0.55;
}

@keyframes grid-flow { to { background-position: 0 54px, 54px 0; } }

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
    will-change: transform;
}
.glow--purple {
    width: 48vw; height: 48vw;
    left: -10vw; top: -12vw;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    animation: drift1 18s ease-in-out infinite alternate;
}
.glow--indigo {
    width: 42vw; height: 42vw;
    right: -8vw; top: 2vw;
    background: radial-gradient(circle, #4f46e5, transparent 70%);
    animation: drift2 22s ease-in-out infinite alternate;
}
.glow--orange {
    width: 40vw; height: 40vw;
    right: 4vw; bottom: -14vw;
    background: radial-gradient(circle, #fb7701, transparent 70%);
    animation: drift3 20s ease-in-out infinite alternate;
}

/* A soft flowing wave band across the middle for the reference vibe. */
.wave {
    position: absolute;
    left: -10%;
    right: -10%;
    top: 28%;
    height: 55vh;
    background:
        conic-gradient(from 210deg at 50% 50%,
            rgba(139, 92, 246, 0.38),
            rgba(79, 70, 229, 0.26),
            rgba(249, 115, 22, 0.30),
            rgba(236, 72, 153, 0.20),
            rgba(139, 92, 246, 0.38));
    filter: blur(130px);
    opacity: 0.55;
    transform: rotate(-8deg);
    animation: sway 26s ease-in-out infinite alternate;
}

@keyframes drift1 { to { transform: translate(8vw, 6vh) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-7vw, 8vh) scale(1.06); } }
@keyframes drift3 { to { transform: translate(-5vw, -8vh) scale(1.14); } }
@keyframes sway   { to { transform: rotate(-2deg) translateY(-4vh); } }

/* ----------------------------------------------------------------
 * Stage (centered content)
 * ---------------------------------------------------------------- */
.stage {
    flex: 1;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 6vh 24px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 44px;
}

/* ----------------------------------------------------------------
 * Hero — live clock + greeting
 * ---------------------------------------------------------------- */
.hero {
    text-align: center;
    animation: fade-down 0.8s ease both;
}
.clock {
    font-family: var(--mono);
    font-size: clamp(48px, 9vw, 92px);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    background: linear-gradient(180deg, #ffffff 0%, #a5f3fc 55%, #67e8f9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow:
        0 0 22px rgba(34, 211, 238, 0.45),
        0 8px 50px rgba(124, 58, 237, 0.35);
    font-variant-numeric: tabular-nums;
}
.greeting {
    margin-top: 14px;
    font-size: clamp(12px, 2.2vw, 15px);
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.42em;
    text-indent: 0.42em;
    text-shadow: 0 0 16px rgba(34, 211, 238, 0.4);
}

/* ----------------------------------------------------------------
 * Search pill (glassy white, glowing focus)
 * ---------------------------------------------------------------- */
.search {
    position: relative;
    width: min(660px, 100%);
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--pill);
    border-radius: 999px;
    padding: 8px 8px 8px 22px;
    box-shadow:
        0 30px 70px rgba(12, 7, 30, 0.6),
        0 8px 22px rgba(124, 58, 237, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: transform 0.25s ease, box-shadow 0.3s ease;
    animation: fade-up 0.8s 0.05s ease both;
}
.search::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 999px;
    padding: 2px;
    background: linear-gradient(120deg, var(--accent), var(--accent-3), var(--accent-2));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.search:focus-within {
    transform: translateY(-2px);
    box-shadow:
        0 36px 80px rgba(12, 7, 30, 0.65),
        0 12px 34px rgba(124, 58, 237, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.search:focus-within::before { opacity: 1; }

.search__logo { display: inline-flex; flex: 0 0 auto; }
.search__input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 18px;
    color: #1a1a1a;
    font-family: inherit;
    padding: 14px 0;
    min-width: 0;
}
.search__input::placeholder { color: #9094a0; }
.search__btn {
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #06121a;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.search__btn:hover {
    transform: scale(1.08);
    filter: brightness(1.12);
    box-shadow: 0 10px 28px rgba(34, 211, 238, 0.6);
}
.search__btn:active { transform: scale(0.96); }

/* ----------------------------------------------------------------
 * Tile grid
 * ---------------------------------------------------------------- */
.tiles {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 24px;
    justify-content: center;
}

.tile {
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 11px;
    opacity: 0;
    transform: translateY(16px);
    animation: tile-in 0.6s ease forwards;
    animation-delay: var(--delay, 0ms);
}

.tile__thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 140px;
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow:
        0 16px 32px rgba(5, 3, 15, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -16px 30px rgba(0, 0, 0, 0.18);
    transition: transform 0.28s cubic-bezier(.2,.7,.3,1.4), box-shadow 0.28s ease;
}
/* Glossy top sheen */
.tile__thumb::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 45%);
    pointer-events: none;
}
/* Holographic conic ring (revealed on hover) */
.tile__thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(from 0deg,
        var(--accent), var(--accent-3), var(--accent-2), var(--accent));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: ring-spin 4s linear infinite;
    pointer-events: none;
    z-index: 3;
}
.tile:hover .tile__thumb::after { opacity: 1; }
@keyframes ring-spin { to { transform: rotate(1turn); } }
.tile__thumb img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    position: relative;
    z-index: 1;
}
.tile__glyph {
    position: relative;
    z-index: 1;
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.tile:hover .tile__thumb {
    transform: translateY(-8px) scale(1.06);
    box-shadow:
        0 28px 52px rgba(5, 3, 15, 0.62),
        0 0 28px rgba(34, 211, 238, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.tile__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    text-align: center;
    transition: color 0.2s ease;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tile:hover .tile__label { color: var(--text); }

/* ----------------------------------------------------------------
 * Animations
 * ---------------------------------------------------------------- */
@keyframes tile-in { to { opacity: 1; transform: translateY(0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
    .tile { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------- */
@media (max-width: 600px) {
    .stage { gap: 32px; padding-top: 5vh; }
    .tiles { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 16px; }
    .tile__glyph { font-size: 32px; }
    .search__input { font-size: 16px; }
}
