/* =========================================================
   VALRYN — RULES & POLICIES
   policies.css — CLEAN RESPONSIVE VERSION
   ========================================================= */

:root {
    --rp-bg: #050505;
    --rp-panel: rgba(17, 17, 17, 0.94);
    --rp-panel-light: rgba(26, 26, 26, 0.96);

    --rp-gold: #c9a227;
    --rp-gold-light: #f3d98a;

    --rp-red: #c62828;
    --rp-red-light: #ef5350;

    --rp-text: #f5f5f5;
    --rp-muted: #b6b6b6;

    --rp-border: rgba(255, 255, 255, 0.08);
    --rp-gold-border: rgba(201, 162, 39, 0.28);

    --rp-radius: 26px;
    --rp-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

/* =========================================================
   RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    scroll-behavior: smooth;
    background: var(--rp-bg);
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow: hidden;

    color: var(--rp-text);
    background: var(--rp-bg);

    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid var(--rp-gold-light);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

/* =========================================================
   APP BACKGROUND
   ========================================================= */

.rp-app {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    isolation: isolate;
}

.rp-background {
    position: fixed;
    inset: 0;
    z-index: -10;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(201, 162, 39, 0.14),
            transparent 34%
        ),
        radial-gradient(
            circle at 85% 76%,
            rgba(201, 162, 39, 0.06),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            #050505 0%,
            #090909 50%,
            #050505 100%
        );
}

.rp-particles {
    position: fixed;
    inset: 0;
    z-index: -8;

    pointer-events: none;
    opacity: 0.18;

    background-image:
        radial-gradient(
            circle,
            var(--rp-gold-light) 1px,
            transparent 1px
        );

    background-size: 92px 92px;
    animation: rpStars 36s linear infinite;
}

/* =========================================================
   HEADER
   ========================================================= */

.rp-header {
    position: relative;
    z-index: 100;

    width: min(94%, 1650px);
    min-height: 84px;
    margin: max(22px, env(safe-area-inset-top)) auto 0;

    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 28px;

    padding: 14px 26px;

    border: 1px solid var(--rp-border);
    border-radius: 24px;

    background: rgba(17, 17, 17, 0.9);
    box-shadow: var(--rp-shadow);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.rp-logo {
    display: flex;
    align-items: center;
    gap: 14px;

    color: var(--rp-text);
    text-decoration: none;
}

.rp-logo-mark {
    width: 56px;
    height: 56px;

    display: grid;
    place-items: center;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            var(--rp-gold),
            var(--rp-gold-light)
        );

    color: #111111;

    font-family: "Playfair Display", serif;
    font-size: 2rem;
    font-weight: 700;

    box-shadow: 0 0 28px rgba(201, 162, 39, 0.38);
}

.rp-logo strong,
.rp-logo span {
    display: block;
}

.rp-logo strong {
    letter-spacing: 0.18em;
}

.rp-logo span {
    margin-top: 3px;

    color: var(--rp-gold-light);

    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.23em;
}

.rp-nav {
    min-width: 0;

    display: flex;
    justify-content: center;
    gap: 10px;

    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.rp-nav::-webkit-scrollbar {
    display: none;
}

.rp-nav-button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 15px;

    color: var(--rp-muted);

    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;

    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;

    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.rp-nav-button:hover,
.rp-nav-button.active {
    color: var(--rp-gold-light);
    border-color: rgba(201, 162, 39, 0.18);
    background: rgba(201, 162, 39, 0.07);
}

.rp-nav-button:hover {
    transform: translateY(-2px);
}

/* =========================================================
   SCREEN SYSTEM
   ========================================================= */

.rp-main {
    width: min(94%, 1650px);
    height: calc(100vh - 128px);
    height: calc(100dvh - 128px);

    margin: 0 auto;
    padding: 14px 0 18px;
}

.rp-screen {
    width: 100%;
    height: 100%;
}

.rp-screen:not(.active) {
    display: none;
}

.rp-screen.active {
    display: block;
}

.rp-screen-shell {
    width: 100%;
    height: 100%;

    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
}

.rp-screen-header {
    min-height: 126px;

    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 22px;

    padding: 20px 24px;

    border: 1px solid var(--rp-border);
    border-radius: 24px;

    background: var(--rp-panel);
    box-shadow: var(--rp-shadow);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.rp-screen-header h2 {
    margin: 5px 0 0;

    font-family: "Playfair Display", serif;
    font-size: clamp(2.1rem, 4vw, 3.9rem);
    line-height: 1;
}

.rp-screen-header p:last-child {
    max-width: 900px;
    margin: 8px 0 0;

    color: var(--rp-muted);
    line-height: 1.65;
}

.rp-back-button {
    min-height: 46px;
    padding: 0 17px;

    color: var(--rp-text);

    border: 1px solid var(--rp-gold-border);
    border-radius: 14px;
    background: rgba(201, 162, 39, 0.07);

    font-weight: 800;

    transition:
        transform 0.2s ease,
        color 0.2s ease,
        background 0.2s ease;
}

.rp-back-button:hover {
    transform: translateY(-3px);
    color: #111111;

    background:
        linear-gradient(
            135deg,
            var(--rp-gold),
            var(--rp-gold-light)
        );
}

/* =========================================================
   SHARED TEXT
   ========================================================= */

.rp-label,
.rp-section-label {
    color: var(--rp-gold-light);

    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

/* =========================================================
   CONSTITUTION HALL
   ========================================================= */

.rp-home-layout {
    width: 100%;
    height: 100%;

    display: grid;
    grid-template-columns:
        minmax(0, 1.18fr)
        minmax(340px, 0.82fr);
    align-items: center;
    gap: 54px;

    overflow: hidden;
}

.rp-home-copy {
    min-height: 0;
    padding: clamp(10px, 2vw, 30px);
}

.rp-home-copy h1 {
    margin: 16px 0 0;

    font-family: "Playfair Display", serif;
    font-size: clamp(3.6rem, 6vw, 6.3rem);
    line-height: 0.93;
}

.rp-description {
    max-width: 780px;
    margin: 22px 0 0;

    color: var(--rp-muted);

    font-size: 1rem;
    line-height: 1.75;
}

.rp-home-options {
    margin-top: 28px;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.rp-entry-card {
    min-height: 118px;

    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;

    padding: 18px;

    color: var(--rp-text);

    border: 1px solid var(--rp-border);
    border-radius: 20px;

    background:
        linear-gradient(
            145deg,
            var(--rp-panel),
            var(--rp-panel-light)
        );

    text-align: left;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);

    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.rp-entry-card:hover {
    transform: translateY(-5px);
    border-color: rgba(201, 162, 39, 0.4);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.34);
}

.rp-entry-card.danger:hover {
    border-color: rgba(239, 83, 80, 0.6);
    box-shadow: 0 24px 48px rgba(198, 40, 40, 0.16);
}

.rp-entry-number {
    color: var(--rp-gold-light);

    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.rp-entry-icon {
    font-size: 2rem;
}

.rp-entry-copy {
    display: grid;
    gap: 4px;
}

.rp-entry-copy strong {
    font-size: 1rem;
}

.rp-entry-copy small {
    color: var(--rp-muted);

    font-size: 0.7rem;
    line-height: 1.4;
}

.rp-home-visual {
    min-height: 100%;

    display: grid;
    place-items: center;
}

.rp-constitution {
    position: relative;

    width: min(390px, 100%);
    min-height: 420px;
    height: min(500px, 65vh);
    height: min(500px, 65dvh);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border: 1px solid rgba(201, 162, 39, 0.22);
    border-radius: 32px;

    background:
        linear-gradient(
            145deg,
            var(--rp-panel),
            var(--rp-panel-light)
        );

    box-shadow: var(--rp-shadow);
    text-align: center;
}

.rp-glow {
    position: absolute;

    width: 320px;
    height: 320px;

    border-radius: 50%;
    background: rgba(201, 162, 39, 0.1);
    filter: blur(70px);
}

.rp-book {
    position: relative;
    z-index: 2;
    font-size: 6rem;
}

.rp-constitution h2 {
    position: relative;
    z-index: 2;

    margin: 20px 0 0;

    color: var(--rp-gold-light);

    font-family: "Playfair Display", serif;
    font-size: 2rem;
}

.rp-constitution p {
    position: relative;
    z-index: 2;

    margin: 10px 0 0;

    color: var(--rp-muted);

    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* =========================================================
   THE VALRYN WAY ROOM
   ========================================================= */

.rp-policy-grid {
    min-height: 0;

    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.rp-policy-card {
    min-height: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 22px;

    border: 1px solid var(--rp-border);
    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            var(--rp-panel),
            var(--rp-panel-light)
        );

    box-shadow: var(--rp-shadow);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.rp-policy-card:hover {
    transform: translateY(-5px);
    border-color: rgba(201, 162, 39, 0.36);
}

.rp-policy-card span {
    font-size: 2rem;
}

.rp-policy-card h3 {
    margin: 14px 0 0;

    color: var(--rp-gold-light);
    font-size: 1.05rem;
}

.rp-policy-card p {
    margin: 9px 0 0;

    color: var(--rp-muted);

    font-size: 0.76rem;
    line-height: 1.55;
}

/* =========================================================
   ZERO TOLERANCE ROOM
   ========================================================= */

.rp-zero-room-grid {
    min-height: 0;

    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows:
        repeat(2, minmax(0, 1fr))
        auto;
    gap: 14px;
}

.rp-zero-room-card {
    min-height: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 20px;

    border: 1px solid rgba(239, 83, 80, 0.14);
    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            rgba(21, 16, 16, 0.96),
            rgba(29, 21, 21, 0.98)
        );

    box-shadow: var(--rp-shadow);
    text-align: center;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.rp-zero-room-card:hover {
    transform: translateY(-5px);
    border-color: rgba(239, 83, 80, 0.62);
}

.rp-zero-room-card span {
    font-size: 2.2rem;
}

.rp-zero-room-card h3 {
    margin: 14px 0 0;
    font-size: 1rem;
}

.rp-zero-room-statement {
    grid-column: 1 / -1;

    padding: 14px 20px;

    border: 1px solid rgba(201, 162, 39, 0.18);
    border-radius: 16px;

    background: rgba(17, 17, 17, 0.94);
    text-align: center;
}

.rp-zero-room-statement h3 {
    margin: 0;

    color: var(--rp-gold-light);

    font-family: "Playfair Display", serif;
    font-size: 1.2rem;
}

.rp-zero-room-statement p {
    max-width: 950px;
    margin: 5px auto 0;

    color: var(--rp-muted);

    font-size: 0.7rem;
    line-height: 1.45;
}

/* =========================================================
   PUBLIC COMMITMENT ROOM
   ========================================================= */

.rp-commitment-room {
    min-height: 0;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows:
        repeat(3, minmax(0, 1fr))
        auto;
    gap: 14px;
}

.rp-promise-room-card {
    min-height: 0;

    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 18px;

    padding: 20px 24px;

    border: 1px solid var(--rp-border);
    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            var(--rp-panel),
            var(--rp-panel-light)
        );

    box-shadow: var(--rp-shadow);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.rp-promise-room-card:hover {
    transform: translateY(-4px);
    border-color: rgba(201, 162, 39, 0.38);
}

.rp-promise-room-card span {
    color: var(--rp-gold-light);

    font-size: 1.3rem;
    font-weight: 900;
    text-align: center;
}

.rp-promise-room-card p {
    color: var(--rp-muted);

    font-size: 0.83rem;
    line-height: 1.6;
}

.rp-public-quote {
    grid-column: 1 / -1;

    padding: 14px;

    color: var(--rp-gold-light);

    font-family: "Playfair Display", serif;
    font-size: 1.6rem;
    font-style: italic;
    text-align: center;
}

/* =========================================================
   OATH ROOM
   ========================================================= */

.rp-oath-room {
    min-height: 0;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows:
        repeat(3, minmax(0, 1fr))
        auto;
    gap: 14px;
}

.rp-oath-room-line {
    min-height: 0;

    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    align-items: center;
    gap: 18px;

    padding: 20px 24px;

    border: 1px solid var(--rp-border);
    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            var(--rp-panel),
            var(--rp-panel-light)
        );

    box-shadow: var(--rp-shadow);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.rp-oath-room-line:hover {
    transform: translateY(-4px);
    border-color: rgba(201, 162, 39, 0.38);
}

.rp-oath-room-line span {
    color: var(--rp-gold-light);

    font-size: 1.25rem;
    font-weight: 900;
    text-align: center;
}

.rp-oath-room-line p {
    color: var(--rp-text);

    font-size: 0.9rem;
    line-height: 1.55;
}

.rp-oath-room-final {
    grid-column: 1 / -1;

    padding: 14px;

    color: var(--rp-gold-light);

    font-family: "Playfair Display", serif;
    font-size: 1.8rem;
    letter-spacing: 0.06em;
    text-align: center;
}

/* =========================================================
   TOAST
   ========================================================= */

.rp-toast {
    position: fixed;
    right: max(22px, env(safe-area-inset-right));
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 1000;

    max-width: min(400px, calc(100% - 44px));
    padding: 14px 18px;

    color: var(--rp-text);

    border: 1px solid var(--rp-gold-border);
    border-radius: 14px;

    background: rgba(17, 17, 17, 0.97);
    box-shadow: var(--rp-shadow);

    font-size: 0.8rem;
    font-weight: 800;

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes rpStars {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-92px);
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1120px) {
    body {
        overflow: auto;
    }

    .rp-app {
        min-height: 100vh;
        min-height: 100dvh;
        height: auto;
        overflow: visible;
    }

    .rp-header {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .rp-nav {
        justify-content: flex-start;
    }

    .rp-main {
        height: auto;
        min-height: calc(100vh - 150px);
        min-height: calc(100dvh - 150px);
    }

    .rp-home-layout {
        min-height: 760px;
        height: auto;

        grid-template-columns: 1fr;
        gap: 34px;

        overflow: visible;
    }

    .rp-home-copy {
        text-align: center;
    }

    .rp-description {
        margin-inline: auto;
    }

    .rp-home-visual {
        display: none;
    }

    .rp-screen,
    .rp-screen-shell {
        height: auto;
    }

    .rp-policy-grid,
    .rp-zero-room-grid,
    .rp-commitment-room,
    .rp-oath-room {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .rp-policy-card,
    .rp-zero-room-card,
    .rp-promise-room-card,
    .rp-oath-room-line {
        min-height: 150px;
    }

    .rp-zero-room-statement,
    .rp-public-quote,
    .rp-oath-room-final {
        grid-column: auto;
    }
}

@media (max-width: 680px) {
    .rp-header,
    .rp-main {
        width: min(100% - 24px, 1650px);
    }

    .rp-header {
        padding: 16px;
        border-radius: 18px;
    }

    .rp-logo-mark {
        width: 48px;
        height: 48px;
        border-radius: 15px;
        font-size: 1.7rem;
    }

    .rp-logo strong {
        font-size: 0.92rem;
        letter-spacing: 0.14em;
    }

    .rp-logo span {
        font-size: 0.61rem;
        letter-spacing: 0.18em;
    }

    .rp-nav-button {
        min-height: 44px;
    }

    .rp-main {
        padding-top: 12px;
    }

    .rp-screen-header {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 16px;

        padding: 20px;
        border-radius: 20px;

        text-align: center;
    }

    .rp-back-button {
        width: 100%;
    }

    .rp-home-layout {
        min-height: auto;
        padding: 36px 0 20px;
    }

    .rp-home-copy {
        padding: 8px 0;
    }

    .rp-home-copy h1 {
        font-size: clamp(3rem, 14vw, 3.8rem);
    }

    .rp-description {
        font-size: 0.94rem;
        line-height: 1.7;
    }

    .rp-home-options {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .rp-entry-card {
        min-height: 110px;
        padding: 18px;
    }

    .rp-policy-card,
    .rp-zero-room-card,
    .rp-promise-room-card,
    .rp-oath-room-line {
        min-height: 0;
        padding: 20px;
        border-radius: 20px;
    }

    .rp-promise-room-card,
    .rp-oath-room-line {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 14px;
    }

    .rp-public-quote {
        font-size: 1.35rem;
    }

    .rp-oath-room-final {
        font-size: 1.5rem;
    }

    .rp-toast {
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 12px;

        max-width: none;
    }
}

@media (max-width: 390px) {
    .rp-header,
    .rp-main {
        width: min(100% - 18px, 1650px);
    }

    .rp-header {
        padding: 14px;
    }

    .rp-logo strong {
        font-size: 0.82rem;
    }

    .rp-logo span {
        display: none;
    }

    .rp-nav {
        gap: 8px;
    }

    .rp-nav-button {
        padding-inline: 12px;
        font-size: 0.76rem;
    }

    .rp-label,
    .rp-section-label {
        font-size: 0.66rem;
        letter-spacing: 0.22em;
    }

    .rp-home-copy h1 {
        font-size: 2.75rem;
    }

    .rp-entry-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .rp-entry-number {
        display: none;
    }

    .rp-promise-room-card,
    .rp-oath-room-line {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* =========================================================
   TOUCH DEVICES
   ========================================================= */

@media (hover: none) and (pointer: coarse) {
    .rp-nav-button:hover,
    .rp-back-button:hover,
    .rp-entry-card:hover,
    .rp-policy-card:hover,
    .rp-zero-room-card:hover,
    .rp-promise-room-card:hover,
    .rp-oath-room-line:hover {
        transform: none;
    }

    .rp-nav-button,
    .rp-back-button,
    .rp-entry-card {
        min-height: 44px;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
