/* Base Styles */
:root {
    --bg-ink: #0c0b0d;
    --bg-iron: #14121a;
    --text-ice: #e6e1db;
    --text-mute: #c4bab0;
    --ember: #e0872e;
    --ember-strong: #f0a24b;
    --ember-glow: rgba(224, 135, 46, 0.35);
    --card: rgba(18, 16, 22, 0.82);
    --card-stroke: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Khand", sans-serif;
    color: var(--text-ice);
    background-color: var(--bg-ink);
    overflow-x: hidden;
}

.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.6;
    pointer-events: none;
}

.bg-one {
    background-image: url("../images/ui/u0-bg.jpg");
    background-image: image-set(
        url("../images/ui/u0-bg.webp") type("image/webp"),
        url("../images/ui/u0-bg.jpg") type("image/jpeg")
    );
    filter: saturate(0.75) contrast(1.05);
}

.bg-two {
    background-image: url("../images/ui/u1-bg.jpg");
    background-image: image-set(
        url("../images/ui/u1-bg.webp") type("image/webp"),
        url("../images/ui/u1-bg.jpg") type("image/jpeg")
    );
    mix-blend-mode: screen;
    opacity: 0.35;
}

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top, rgba(12, 11, 13, 0.2), rgba(12, 11, 13, 0.9) 55%, rgba(12, 11, 13, 0.98) 100%);
}

header.hero {
    padding: 4.5rem 6vw 3rem;
    text-align: left;
}

.hero__content {
    max-width: 860px;
    animation: rise-in 0.9s ease-out both;
}

.eyebrow {
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    color: var(--text-mute);
    margin: 0 0 1rem;
}

header h1 {
    font-family: "Cinzel", serif;
    font-size: clamp(2.4rem, 4vw, 4rem);
    letter-spacing: 0.05em;
    margin: 0 0 1rem;
    text-shadow: 0 0 32px rgba(0, 0, 0, 0.7);
}

.hero__lead {
    font-size: 1.2rem;
    max-width: 620px;
    color: var(--text-mute);
    margin: 0 0 1.5rem;
}

.hero__chips {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hero__chips span {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--card-stroke);
    background: rgba(10, 9, 12, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.85rem;
}

main.grid {
    padding: 1rem 6vw 4rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.75rem;
}

.app-card {
    background: var(--card);
    border-radius: 18px;
    border: 1px solid var(--card-stroke);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    padding: 1.8rem;
    text-align: left;
    backdrop-filter: blur(6px);
    transform: translateY(18px);
    opacity: 0;
    animation: card-in 0.6s ease-out forwards;
    display: flex;
    flex-direction: column;
}

.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }
.app-card:nth-child(3) { animation-delay: 0.3s; }
.app-card:nth-child(4) { animation-delay: 0.4s; }

.app-card:hover {
    transform: translateY(8px);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
    border-color: rgba(224, 135, 46, 0.4);
}

.app-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin: 0 auto 1rem;
    display: block;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}

.app-card h2 {
    font-family: "Cinzel", serif;
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    letter-spacing: 0.03em;
}

.app-card p {
    margin: 0 0 1.5rem;
    color: var(--text-mute);
    line-height: 1.4;
    flex: 1;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: 14px;
    background: linear-gradient(120deg, var(--ember), var(--ember-strong));
    color: #0a090b;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 0 18px var(--ember-glow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    align-self: flex-start;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(240, 162, 75, 0.5);
}

footer {
    padding: 1.5rem 6vw 2rem;
    text-align: left;
    color: var(--text-mute);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 9, 12, 0.65);
    margin-top: auto;
}

.back-to-top {
    position: fixed;
    right: clamp(1rem, 3vw, 2rem);
    bottom: clamp(1rem, 4vw, 2.5rem);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.tool-hero {
    padding: 3.5rem 6vw 2rem;
    text-align: left;
}

.tool-hero__content {
    max-width: 900px;
    animation: rise-in 0.9s ease-out both;
}

.tool-hero .backlink {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    color: var(--ember);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
}

.tool-hero .backlink:hover {
    color: var(--ember-strong);
}

.panel {
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--card-stroke);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    padding: 1.5rem;
    backdrop-filter: blur(6px);
}

.panel h2 {
    font-family: "Cinzel", serif;
    margin: 0 0 0.6rem;
    letter-spacing: 0.03em;
}

.tool-input,
.tool-button,
.tool-select {
    font-family: "Khand", sans-serif;
    font-size: 1rem;
}

.tool-input,
.tool-select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(10, 9, 12, 0.75);
    color: var(--text-ice);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.4);
}

.tool-input:focus,
.tool-select:focus {
    outline: none;
    border-color: rgba(240, 162, 75, 0.7);
    box-shadow: 0 0 0 2px rgba(240, 162, 75, 0.2);
}

.tool-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(240, 162, 75, 0.4);
    background: linear-gradient(120deg, rgba(255, 171, 80, 0.2), rgba(255, 171, 80, 0.35));
    color: var(--text-ice);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tool-button:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 171, 80, 0.8);
    box-shadow: 0 0 18px rgba(255, 171, 80, 0.35);
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    header.hero {
        padding: 3.5rem 7vw 2rem;
    }

    main.grid {
        padding: 1rem 7vw 3rem;
    }
}

@media (max-width: 640px) {
    header.hero {
        text-align: center;
        padding: 3rem 8vw 2rem;
    }

    .hero__chips {
        justify-content: center;
    }

    footer {
        text-align: center;
    }

    .tool-hero {
        text-align: center;
        padding: 3rem 8vw 2rem;
    }
}
