* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    background: #ffffff;
    color: #171717;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    width: 100%;
    padding: 20px 40px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #eeeeee;
}

.brand img {
    width: 150px;
    height: auto;
    display: block;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

.site-header nav a {
    font-size: 15px;
    font-weight: 500;
}

.nav-button,
.button {
    display: inline-block;
    padding: 12px 20px;

    border-radius: 7px;

    background: #171717;
    color: white;

    font-weight: 600;

    transition: opacity 0.2s ease;
}

.nav-button:hover,
.button:hover {
    opacity: 0.8;
}

.button-secondary {
    background: transparent;
    color: #171717;
    border: 1px solid #cccccc;
}

.home {
    min-height: calc(100vh - 150px);
}

.hero {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 25px;

    text-align: center;
}

.hero-logo {
    width: 280px;
    max-width: 80%;
    margin-bottom: 35px;
}

.hero h1 {
    margin: 0 0 20px;

    font-size: clamp(2.2rem, 6vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero p {
    margin: 0 auto 35px;

    max-width: 550px;

    color: #666666;
    font-size: 1.2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.site-footer {
    padding: 30px 20px;

    text-align: center;

    border-top: 1px solid #eeeeee;

    color: #777777;
    font-size: 14px;
}

@media (max-width: 700px) {

    .site-header {
        padding: 15px 20px;
    }

    .brand img {
        width: 120px;
    }

    .site-header nav {
        gap: 12px;
    }

    .site-header nav a:not(.nav-button) {
        display: none;
    }

    .hero {
        padding: 70px 20px;
    }

}


.auth-page {
    min-height: calc(100vh - 150px);

    display: flex;
    justify-content: center;
    align-items: flex-start;

    padding: 70px 20px;
}

.auth-card {
    width: 100%;
    max-width: 460px;

    padding: 40px;

    border: 1px solid #e5e5e5;
    border-radius: 12px;

    background: #ffffff;
}

.auth-card h1 {
    margin: 0 0 10px;

    font-size: 2rem;
    letter-spacing: -0.03em;
}

.auth-subtitle {
    margin: 0 0 30px;

    color: #707070;

    line-height: 1.5;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    font-weight: 600;
}

.form-group input {
    width: 100%;

    padding: 12px 14px;

    border: 1px solid #cccccc;
    border-radius: 7px;

    background: #ffffff;

    color: #171717;

    font-size: 16px;
}

.form-group input:focus {
    outline: none;

    border-color: #171717;

    box-shadow: 0 0 0 2px rgba(23, 23, 23, 0.08);
}

.form-group small {
    display: block;

    margin-top: 6px;

    color: #777777;
}

.button-full {
    width: 100%;

    border: 0;

    cursor: pointer;

    font-size: 16px;
}

.alert {
    margin-bottom: 20px;

    padding: 12px 15px;

    border-radius: 7px;

    font-size: 14px;
}

.alert-error {
    background: #fff0f0;
    color: #a00000;
    border: 1px solid #ffd0d0;
}

.auth-footer {
    margin: 25px 0 0;

    text-align: center;

    color: #666666;
}

.auth-footer a {
    color: #171717;
    font-weight: 600;
    text-decoration: underline;
}

.dashboard {
    min-height: calc(100vh - 150px);
    padding: 70px 20px;
}

.dashboard-container {
    max-width: 1000px;
    margin: 0 auto;
}

.dashboard-container h1 {
    font-size: 2.5rem;
    letter-spacing: -0.04em;
}

.dashboard-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.profile-form {
    max-width: 700px;
    margin-top: 30px;
}

.form-group textarea {
    width: 100%;

    padding: 12px 14px;

    border: 1px solid #cccccc;
    border-radius: 7px;

    background: #ffffff;

    color: #171717;

    font-family: inherit;
    font-size: 16px;

    resize: vertical;
}

.form-group textarea:focus {
    outline: none;

    border-color: #171717;

    box-shadow: 0 0 0 2px rgba(23, 23, 23, 0.08);
}

.alert-success {
    background: #effaf1;
    color: #176b2c;
    border: 1px solid #ccebd3;
}


.editor {
    max-width: 900px;
    margin-top: 30px;
}

.editor textarea {
    min-height: 400px;

    line-height: 1.7;
}

.editor-options {
    margin: 20px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;

    font-weight: 600;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
}

.editor-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.editor-buttons button {
    font-family: inherit;
}


.dashboard-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 35px;
}

.post-list {
    border-top: 1px solid #eeeeee;
}

.post-row {
    padding: 22px 0;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    border-bottom: 1px solid #eeeeee;
}

.post-row h2 {
    margin: 0 0 7px;

    font-size: 1.15rem;
}

.post-meta {
    color: #777777;
    font-size: 14px;
}

.button-small {
    padding: 8px 14px;
    font-size: 14px;
}

.empty-state {
    padding: 60px 20px;

    text-align: center;

    border: 1px dashed #cccccc;
    border-radius: 10px;
}

.empty-state h2 {
    margin-top: 0;
}


.story-page {
    padding: 70px 20px;
}

.story {
    max-width: 760px;
    margin: 0 auto;
}

.story-header {
    margin-bottom: 45px;
}

.story-header h1 {
    margin: 25px 0 15px;

    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.story-author {
    color: #666666;
}

.story-author a {
    color: #171717;
    font-weight: 600;
}

.story-date {
    margin: 0;

    color: #888888;
    font-size: 14px;
}

.story-content,
.story-preview {
    font-family: Georgia, "Times New Roman", serif;

    font-size: 1.2rem;
    line-height: 1.9;

    white-space: normal;
}

.subscriber-story {
    position: relative;
}

.story-preview {
    margin-bottom: 40px;
}

.story-lock {
    position: relative;
    z-index: 2;

    max-width: 550px;
    margin: 0 auto 30px;
    padding: 35px;

    text-align: center;

    border: 1px solid #dddddd;
    border-radius: 12px;

    background: white;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.lock-icon {
    font-size: 30px;
}

.story-lock h2 {
    margin: 12px 0;
}

.story-lock p {
    color: #666666;
    line-height: 1.6;
}


.story-lock form {
    margin: 20px 0 0;
}

.story-lock button {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
}

.discover-page {
    max-width: 1200px;
    margin: 0 auto;

    padding: 70px 25px 100px;
}

.discover-header {
    max-width: 700px;

    margin-bottom: 50px;
}

.discover-header h1 {
    margin: 0 0 12px;

    font-size: clamp(2.5rem, 6vw, 4rem);

    line-height: 1;

    letter-spacing: -0.05em;
}

.discover-header p {
    margin: 0;

    color: #666666;

    font-size: 1.15rem;

    line-height: 1.6;
}


/*
|--------------------------------------------------------------------------
| Story grid
|--------------------------------------------------------------------------
*/

.story-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 22px;
}


/*
|--------------------------------------------------------------------------
| Story card
|--------------------------------------------------------------------------
*/

.story-card {
    min-height: 320px;

    padding: 25px;

    display: flex;
    flex-direction: column;

    border: 1px solid #e5e5e5;

    border-radius: 12px;

    background: #ffffff;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.story-card:hover {
    transform: translateY(-3px);

    border-color: #d5d5d5;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.07);
}


/*
|--------------------------------------------------------------------------
| Badge
|--------------------------------------------------------------------------
*/

.story-card-top {
    margin-bottom: 20px;
}

.story-badge {
    display: inline-block;

    padding: 5px 9px;

    border-radius: 5px;

    font-size: 12px;

    font-weight: 700;
}

.free-badge {
    background: #f1f1f1;

    color: #555555;
}

.subscriber-badge {
    background: #fff5df;

    color: #805500;
}


/*
|--------------------------------------------------------------------------
| Story title
|--------------------------------------------------------------------------
*/

.story-card h2 {
    margin: 0 0 10px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 1.45rem;

    line-height: 1.25;

    letter-spacing: -0.02em;
}


/*
|--------------------------------------------------------------------------
| Author
|--------------------------------------------------------------------------
*/

.story-card-author {
    margin-bottom: 18px;

    color: #777777;

    font-size: 14px;
}

.story-card-author a {
    color: #222222;

    font-weight: 600;
}


/*
|--------------------------------------------------------------------------
| Excerpt
|--------------------------------------------------------------------------
*/

.story-card-excerpt {
    margin: 0;

    color: #555555;

    line-height: 1.6;

    font-size: 15px;
}


/*
|--------------------------------------------------------------------------
| Bottom
|--------------------------------------------------------------------------
*/

.story-card-bottom {
    margin-top: auto;

    padding-top: 25px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    border-top: 1px solid #eeeeee;
}

.story-card-date {
    color: #999999;

    font-size: 13px;
}

.story-card-link {
    color: #171717;

    font-size: 14px;

    font-weight: 700;
}


/*
|--------------------------------------------------------------------------
| Empty state
|--------------------------------------------------------------------------
*/

.discover-empty {
    padding: 70px 20px;

    text-align: center;

    border: 1px dashed #cccccc;

    border-radius: 12px;
}

.discover-empty h2 {
    margin-top: 0;
}

.discover-empty p {
    margin-bottom: 25px;

    color: #666666;
}


/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 900px) {

    .story-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 600px) {

    .discover-page {
        padding-top: 50px;
    }

    .story-grid {
        grid-template-columns: 1fr;
    }

    .story-card {
        min-height: 280px;
    }

}

.unlocked-badge {
    background: #e8f7ee;
    color: #187a45;
}

/* =========================================================
   Navigation Search
   ========================================================= */

.nav-search {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 8px;
}

.nav-search input {
    width: 170px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
    background: #fff;
    color: #222;
}

.nav-search input:focus {
    outline: none;
    border-color: #555;
}

.nav-search-button {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #222;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.nav-search-button:hover {
    background: #444;
}


/* =========================================================
   Search Page
   ========================================================= */

.search-page {
    width: 100%;
    padding: 40px 20px;
    box-sizing: border-box;
}

.search-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}


/* Search heading */

.search-container h1 {
    margin-bottom: 10px;
}


/* Main search form */

.search-form {
    display: flex;
    gap: 10px;
    margin: 25px 0 35px;
}

.search-form input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
    background: #fff;
    color: #222;
}

.search-form input:focus {
    outline: none;
    border-color: #555;
}


/* Results heading */

.search-results-header {
    margin-bottom: 20px;
}


/* Individual results */

.search-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-result {
    padding: 24px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.search-result h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.search-result h3 a {
    color: inherit;
    text-decoration: none;
}

.search-result h3 a:hover {
    text-decoration: underline;
}

.search-result-meta {
    margin-bottom: 12px;
    color: #666;
    font-size: 0.9rem;
}

.search-result p {
    line-height: 1.6;
}

.search-result-label {
    margin: 15px 0;
    color: #666;
    font-size: 0.9rem;
}


/* =========================================================
   Profile Page
   ========================================================= */

.profile-page {
    width: 100%;
    padding: 40px 20px;
    box-sizing: border-box;
}

.profile-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}


/* =========================================================
   Profile Header
   ========================================================= */

.profile-header {
    text-align: center;
    margin-bottom: 35px;
}

.profile-header h1 {
    margin-bottom: 6px;
}

.profile-username {
    margin-top: 0;
    color: #666;
    font-size: 0.95rem;
}

.profile-role {
    margin-top: 8px;
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
}


/* =========================================================
   Profile Avatar
   ========================================================= */

.profile-avatar {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 20px;
}


/* =========================================================
   Profile Bio
   ========================================================= */

.profile-bio {
    max-width: 650px;
    margin: 20px auto 0;
    line-height: 1.7;
    color: #444;
}


/* =========================================================
   Profile Panel
   ========================================================= */

.profile-container .dashboard-panel {
    margin-bottom: 25px;
}


/* =========================================================
   Profile Actions
   ========================================================= */

.profile-container .dashboard-actions {
    justify-content: center;
}





