:root {
    --t1-sage: #5c6b52;
    --t1-sage-dark: #3d4a36;
    --t1-gold: #b8956a;
    --t1-gold-light: #d4bc96;
    --t1-cream: #f7f3eb;
    --t1-paper: #faf8f4;
    --t1-ink: #3a342e;
    --ud-layar: 100svh;
}

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

body.tema-1 {
    background: #2f352c;
    color: var(--t1-ink);
    font-family: "DM Sans", system-ui, sans-serif;
}

body.tema-1.ud-cover-aktif {
    overflow: hidden;
    height: var(--ud-layar, 100svh);
    position: fixed;
    inset: 0;
    width: 100%;
}

body.tema-1.ud-isi-aktif {
    position: static;
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: var(--ud-layar, 100svh);
    background: var(--t1-cream);
}

#layar-cover {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    width: 100%;
    height: var(--ud-layar, 100svh);
    min-height: var(--ud-layar, 100svh);
    overflow-y: auto;
    box-sizing: border-box;
    background: linear-gradient(165deg, #6b7d62 0%, #4a5644 45%, #2f352c 100%);
    color: #fff;
}

#layar-cover.off { display: none; }

.t1-cover-isi {
    margin: auto;
    width: min(100%, 36rem);
    padding: 2.5rem 1.4rem 2rem;
    text-align: center;
    box-sizing: border-box;
}

.cover-emoji {
    margin: 0 0 0.4rem;
    font-size: 2.4rem;
    line-height: 1;
}

#cover-kicker {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--t1-gold-light);
}

#cover-judul {
    margin: 0.45rem 0 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-style: italic;
    font-weight: 600;
    font-size: clamp(2.6rem, 7vw, 4.2rem);
    line-height: 1.05;
    color: #fff;
}

#cover-ringkas {
    margin: 0.9rem auto 0;
    max-width: 26rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

#btn-buka {
    margin-top: 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0.85rem 1.7rem;
    font: 700 0.95rem/1 "DM Sans", system-ui, sans-serif;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--t1-gold) 0%, #9a7849 100%);
    box-shadow: 0 8px 24px rgba(61, 74, 54, 0.35);
}

#cover-petunjuk {
    margin: 0.85rem auto 0;
    max-width: 18rem;
    font-size: 0.75rem;
    line-height: 1.45;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

body.tema-1.ud-isi-aktif {
    padding-bottom: 4.5rem;
}

#rekam-bar:not([hidden]) {
    position: fixed;
    z-index: 40;
    right: max(0.85rem, env(safe-area-inset-right));
    bottom: max(0.85rem, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    width: max-content;
    max-width: calc(100% - 1.5rem);
}

#panel-rekam:not([hidden]) {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
}

#btn-buka-rekam {
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    font: 700 0.78rem/1 "DM Sans", system-ui, sans-serif;
    color: #fff;
    background: var(--t1-sage-dark);
    box-shadow: 0 8px 24px rgba(58, 52, 46, 0.28);
    cursor: pointer;
}

#kecepatan {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 6px 18px rgba(58, 52, 46, 0.16);
}

#kecepatan button {
    border: 0;
    border-radius: 999px;
    padding: 0.4rem 0.7rem;
    font: 700 0.72rem/1 "DM Sans", system-ui, sans-serif;
    color: var(--t1-sage-dark);
    background: transparent;
    cursor: pointer;
}

#kecepatan button.aktif {
    color: #fff;
    background: var(--t1-sage-dark);
}

#btn-rekam {
    border: 0;
    border-radius: 999px;
    padding: 0.8rem 1.25rem;
    font: 700 0.88rem/1 "DM Sans", system-ui, sans-serif;
    color: #fff;
    background: var(--t1-sage-dark);
    box-shadow: 0 8px 24px rgba(58, 52, 46, 0.28);
    cursor: pointer;
}

#btn-tampilan,
#btn-bingkai {
    border: 1px solid rgba(61, 74, 54, 0.35);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font: 700 0.75rem/1 "DM Sans", system-ui, sans-serif;
    color: var(--t1-sage-dark);
    background: #fff;
    cursor: pointer;
}

#btn-bingkai { display: none; }

#btn-tampilan.aktif,
#btn-bingkai.aktif {
    color: #fff;
    background: var(--t1-sage-dark);
    border-color: transparent;
}

@media (min-width: 900px) {
    #btn-bingkai { display: inline-block; }

    body.rekam-bingkai,
    body.tema-1.ud-isi-aktif.rekam-bingkai,
    body.tema-1.ud-cover-aktif.rekam-bingkai {
        background: #2f352c;
    }

    body.rekam-bingkai #layar-cover {
        width: min(100vw, calc(var(--ud-layar) * 9 / 16));
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    body.rekam-bingkai #layar-isi {
        width: min(100%, calc(var(--ud-layar) * 9 / 16));
        margin-left: auto;
        margin-right: auto;
    }
}

body.rekam-pembuka #btn-buka,
body.rekam-pembuka #cover-petunjuk,
body.rekam-penutup #btn-buka,
body.rekam-penutup #cover-petunjuk,
body.rekam-penutup #cover-ringkas {
    display: none;
}

#cover-situs {
    margin: 1.1rem 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--t1-gold-light);
}

#hitung-rekam:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 60;
    margin: 0;
    display: grid;
    place-items: center;
    background: rgba(47, 53, 44, 0.42);
    color: #fff;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 6rem;
    font-weight: 600;
}

#layar-isi {
    min-height: var(--ud-layar, 100svh);
    background: var(--t1-cream);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(92, 107, 82, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(184, 149, 106, 0.08) 0%, transparent 40%);
    padding: 1.5rem 0 3rem;
}

.t1-section {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-sizing: border-box;
}

.t1-panel {
    position: relative;
    background: #fff;
    border-radius: 1.25rem;
    padding: 1.5rem 1.25rem 1.35rem;
    border: 1px solid rgba(184, 149, 106, 0.2);
    box-shadow: 0 4px 20px rgba(58, 52, 46, 0.06);
    text-align: center;
}

.t1-panel::before,
.t1-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: inherit;
    inset: 0.45rem;
    border: 1px solid rgba(184, 149, 106, 0.55);
}

.t1-panel::after {
    inset: 0.75rem;
    border-style: dashed;
    border-color: rgba(92, 107, 82, 0.35);
}

.t1-panel > * { position: relative; z-index: 1; }

.t1-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.35rem 0 1rem;
    color: var(--t1-gold);
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    font-weight: 700;
}

.t1-divider::before,
.t1-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--t1-gold-light), transparent);
}

.t1-judul {
    margin: 0;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--t1-sage-dark);
}

.t1-tutorial-langkah {
    margin: 0.9rem auto 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    text-align: left;
}

.t1-tutorial-langkah li {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.75;
    color: var(--t1-sage-dark);
}

.t1-tutorial-langkah li span {
    flex: 0 0 1.45rem;
    width: 1.45rem;
    height: 1.45rem;
    margin-top: 0.15rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(92, 107, 82, 0.12);
}

.t1-tutorial-langkah p { margin: 0; }

.t1-fitur {
    margin: 0.85rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.7rem;
    text-align: left;
}

.t1-fitur li {
    position: relative;
    margin: 0;
    padding-left: 0.85rem;
    font-size: 0.78rem;
    line-height: 1.45;
    font-weight: 600;
    color: var(--t1-sage-dark);
}

.t1-fitur li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: var(--t1-gold);
}

.t1-tutorial-foto {
    margin: 0.85rem auto 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.t1-tutorial-foto li {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.86rem;
    line-height: 1.55;
    font-weight: 600;
    color: var(--t1-sage-dark);
}

.t1-tutorial-foto img {
    width: min(100%, 26rem);
    height: auto;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0.75rem;
    display: block;
}

.t1-tutorial-foto img.lebar {
    width: min(100%, 40rem);
}

.t1-mulai {
    margin: 0.7rem auto 0;
    max-width: 26rem;
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--t1-sage-dark);
}

.t1-btn-primary {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 1.4rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--t1-gold) 0%, #9a7849 100%);
    box-shadow: 0 8px 24px rgba(61, 74, 54, 0.2);
}

.t1-btn-kedua {
    display: inline-block;
    margin-top: 0.7rem;
    margin-left: 0.5rem;
    padding: 0.8rem 1.4rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    color: var(--t1-sage-dark);
    background: #fff;
    border: 1px solid rgba(61, 74, 54, 0.25);
}

@media (min-width: 641px) {
    .t1-section {
        max-width: none;
        width: 100%;
    }

    .t1-tutorial-langkah,
    .t1-mulai,
    .t1-fitur,
    .t1-tutorial-foto {
        max-width: 40rem;
        margin-left: auto;
        margin-right: auto;
    }

    #cover-judul { font-size: 4.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    #cover-petunjuk { display: none; }
}
