/* -------------------- GENERAL BODY -------------------- */
body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Cormorant Garamond', serif;
    color: #e8e8f0;
    background: radial-gradient(circle at 30% 20%, #14182c, #05060a 60%);
}

/* -------------------- CENTERED WRAPPER -------------------- */
.center-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    padding: 80px 20px 40px;
    box-sizing: border-box;
    z-index: 2;
}

/* -------------------- PARTICLES + GRAIN -------------------- */
#particles {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.grain {
    position: fixed;
    inset: 0;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

/* -------------------- TITLE -------------------- */
.title {
    font-size: 48px;
    font-weight: 300;
    letter-spacing: 4px;
    animation: breathe 6s ease-in-out infinite;
    text-shadow: 0 0 40px rgba(150,150,255,0.15);
}

@keyframes breathe {
    0%,100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.03); opacity: 1; }
}

/* -------------------- GRID -------------------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    box-sizing: border-box;
}

/* -------------------- CARDS -------------------- */
.card {
    min-width: 0;
    height: 170px;
    border-radius: 20px;
    backdrop-filter: blur(16px);
    background: rgba(255,255,255,0.05);
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    transition: 0.5s ease;
    box-shadow: 0 0 40px rgba(120,120,255,0.08);
}

.card:hover {
    transform: translateY(-10px) scale(1.04);
    box-shadow: 0 0 80px rgba(160,160,255,0.35);
}

.poem-title {
    font-size: 24px;
    text-align: center;
}

.poem-sub {
    font-size: 15px;
    opacity: 0.65;
    margin-top: 12px;
    text-align: center;
}

/* -------------------- BACK BUTTON -------------------- */
.back {
    position: absolute;
    top: 40px;
    left: 50px;
    text-decoration: none;
    color: white;
    opacity: 0.6;
    transition: 0.4s;
    z-index: 10;
}

.back:hover {
    opacity: 1;
    letter-spacing: 2px;
}

/* -------------------- FONTS FOR HINDI -------------------- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+Devanagari&display=swap');

/* -------------------- SCENIC POEM LAYOUT -------------------- */
.poem-wrapper {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poem-box {
    max-width: 720px;
    text-align: center;
    padding: 40px;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.04);
    border-radius: 22px;
    box-shadow: 0 0 60px rgba(140,140,255,0.08);
    animation: fadePoem 2.5s ease forwards;
}

@keyframes fadePoem {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

.poem-title-big {
    font-size: 38px;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-shadow: 0 0 35px rgba(150,150,255,0.25);
}

.poem-sub-big {
    opacity: 0.6;
    margin-bottom: 30px;
    font-size: 16px;
}

/* -------------------- BILINGUAL TOGGLE -------------------- */
.language-toggle {
    margin-top: 35px;
    margin-bottom: 30px;
}

.language-toggle button {
    background: rgba(255,255,255,0.06);
    border: none;
    color: white;
    padding: 10px 22px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 1px;
    transition: 0.4s ease;
    backdrop-filter: blur(10px);
}

.language-toggle button:hover {
    background: rgba(150,150,255,0.15);
    transform: scale(1.05);
}

/* -------------------- POEM LAYERS -------------------- */
.poem-layers {
    position: relative;
    min-height: 260px;
}

.poem-layer {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    line-height: 2;
    font-size: 20px;
    white-space: pre-line;
    opacity: 0;
    transition: opacity 1.2s ease;
}

/* Roman Urdu */
#roman {
    font-family: 'Cormorant Garamond', serif;
}

/* Hindi */
#hindi {
    font-family: 'Noto Serif Devanagari', serif;
    font-size: 22px;
    line-height: 2.1;
}

/* Active visible layer */
.poem-layer.active {
    opacity: 0.95;
    position: relative;
}

/* -------------------- TUKDE (FRAGMENTS) PAGE -------------------- */
.tukde-wrapper {
    height: auto;
    min-height: 100vh;
    padding: 80px 20px 80px;
    box-sizing: border-box;
}

.tukde-box {
    max-width: 720px;
    width: 100%;
}

.fragments {
    margin-top: 20px;
}

.fragment {
    position: relative;
    padding: 18px 0;
    min-height: 60px;
}

.frag-layer {
    position: absolute;
    width: 100%;
    left: 0;
    top: 18px;
    line-height: 1.9;
    font-size: 18px;
    white-space: pre-line;
    opacity: 0;
    transition: opacity 0.8s ease;
    font-family: 'Cormorant Garamond', serif;
    text-align: center;
}

.frag-layer.hindi {
    font-family: 'Noto Serif Devanagari', serif;
    font-size: 19px;
    line-height: 2;
}

.frag-layer.active {
    opacity: 0.92;
    position: relative;
    top: 0;
}

.frag-divider {
    width: 50px;
    height: 1px;
    margin: 14px auto;
    background: linear-gradient(to right, transparent, rgba(200,200,255,0.35), transparent);
}

/* -------------------- DIVIDER (OPTIONAL BETWEEN LANGUAGES) -------------------- */
.divider {
    width: 80px;
    height: 1px;
    margin: 50px auto;
    background: linear-gradient(to right, transparent, rgba(200,200,255,0.5), transparent);
    animation: glow 4s ease-in-out infinite;
}

@keyframes glow {
    50% { opacity: 0.4; }
}

/* -------------------- FOOTER -------------------- */
.site-footer {
    position: relative;
    width: 100%;
    text-align: center;
    color: #cfd0ff;
    font-size: 14px;
    opacity: 0.7;
    z-index: 2;
    pointer-events: auto;
    padding: 40px 20px 30px;
    box-sizing: border-box;
}

.site-footer p {
    margin: 0 0 8px 0;
}

.footer-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    color: #e8e8f0;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
    transition: 0.4s ease;
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 1px;
}

.footer-btn:hover {
    background: rgba(160,160,255,0.15);
    transform: scale(1.05);
    opacity: 0.9;
}