/* ===== Quillistic — beige design system ===== */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 320px;
    background: #fcf9f6;
    color: #3a332c;
    font-family: 'Segoe UI', 'Verdana', 'Arial', sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
}

:focus {
    outline: none;
}

img {
    display: block;
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 25px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #e8e8e8; }
::-webkit-scrollbar-thumb { background: #b0b0b0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #909090; }

/* ===== Header ===== */
header {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 4rem;
    border-bottom: 1px solid #dadada;
    background: #f5f1eb;
    backdrop-filter: blur(8px);
    box-shadow: #cecbcb 0 1px 9px 0;
}

header .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 25px;
}

.header_logo img {
    width: 150px;
}

header nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
}

header nav a {
    position: relative;
    padding: 10px 0;
    color: #3f3b36;
    font-size: 1rem;
}

header nav a::after,
header nav a.active::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(135deg, #fac88b, #ec5748);
    transform: rotate(-4deg) scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

header nav a:hover::after,
header nav a.active::after {
    transform: rotate(-4deg) scaleX(1);
}

.header_actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #3f3b36;
}

.header_actions a {
    padding: 10px 0;
    font-size: 1rem;
}

.header_actions .login { color: #000; }
.header_actions .register { color: #ec5748; }
.header_actions .register:hover,
.header_actions .login:hover { color: #3f3b36; }

.header_actions .user-email {
    color: #8a7a68;
    font-size: 0.85rem;
}

.lang {
    position: relative;
    user-select: none;
}

.lang__current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: #73706c;
    font-size: 0.85rem;
    font-weight: 700;
}

.lang__current:hover { color: #161514; }

.lang__current .arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lang__current .arrow::before {
    content: '';
    display: block;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #8a7a68;
    transition: transform 0.2s;
}

.lang.open .lang__current .arrow::before {
    transform: rotate(180deg);
}

.lang__dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 30;
    width: 160px;
    overflow: hidden;
    background: #fefaf5;
    border: 1px solid #ccc6bf;
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.lang.open .lang__dropdown {
    opacity: 1;
    visibility: visible;
}

.lang__dropdown a {
    display: block;
    padding: 0.45rem 1rem;
    color: #787472;
    font-size: 0.8rem;
    transition: background 0.2s, color 0.2s;
}

.lang__dropdown a:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #413d38;
}

.lang__dropdown a.selected {
    background: rgba(236, 87, 72, 0.1);
    color: #ec5748;
    font-weight: 700;
}

/* ===== Hero ===== */
.hero {
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
    background: linear-gradient(44deg, #fcf9f6 0%, #e8e8e8 100%);
}

.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(236, 87, 72, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero .container {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.hero .content { width: 48%; }
.hero .demo { width: 48%; }

.hero h1 {
    margin-bottom: 1.5rem;
    color: #3a332c;
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero h1 .gradient {
    background: linear-gradient(135deg, #fac88b, #ec5748);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero .description {
    margin-bottom: 2rem;
    color: #3a332c;
    font-size: 1rem;
    line-height: 1.5;
}

.hero .buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.6rem 2rem;
    border-radius: 40px;
    background: linear-gradient(340deg, #f7b680, #ed614e);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: filter 0.3s ease;
}

.btn:hover { filter: brightness(1.05); }

.btn--dark {
    background: #3f3b36;
    color: #fff;
}

.btn--ghost {
    background: transparent;
    border: 1px solid #3f3b36;
    color: #3f3b36;
}

.hero .note {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    color: #a89a8a;
}

.demo-editor {
    background: #fefaf5;
    border: 1px solid #e5d9ce;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.1);
}

.demo-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8a7a68;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #efe2d6;
    margin-bottom: 1.25rem;
}

.demo-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #3a332c;
    min-height: 200px;
}

.demo-hint {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #efe2d6;
    font-size: 0.7rem;
    color: #b0a090;
    text-align: center;
}

.hint-code {
    display: inline-block;
    background: #efe2d6;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.7rem;
    color: #ec5748;
}

/* ===== Features ===== */
.features {
    padding: 3rem 0 5rem;
    background: #fefaf5;
    border-top: 1px solid #e2e0df;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    margin-bottom: 0.75rem;
    font-size: 2.5rem;
    font-weight: 500;
    color: #3a332c;
}

.section-header p {
    font-size: 1rem;
    color: #a89a8a;
}

.features .grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.features .card {
    flex: 1;
    padding: 1rem 0.8rem;
    border-radius: 15px;
    transition: all 0.25s ease;
}

.features .card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
    transform: translateY(-4px);
}

.features .card .title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #3f3b36;
}

.features .card .text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #615647;
}

/* ===== Preface ===== */
.preface {
    background: #fdf5ed;
    padding: 5rem 0;
    border-bottom: 1px solid #e5d9ce;
    box-shadow: #cecbcb 0 -1px 6px 0;
}

.preface__chapter {
    text-align: center;
    margin-bottom: 2.5rem;
}

.preface__chapter span {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: #3d3d3d;
    text-transform: uppercase;
}

.preface__chapter h3 {
    font-size: 1.1rem;
    font-weight: 400;
    font-style: italic;
    color: #8a7a68;
    margin-top: 0.5rem;
    letter-spacing: 0.5px;
}

.preface-stack {
    position: relative;
    display: flex;
    justify-content: center;
    min-height: 560px;
}

.preface-leaf {
    background: #fff;
    border: 1px solid #e5d9ce;
    border-radius: 8px;
}

.preface-leaf--left {
    position: absolute;
    left: 7%;
    top: 0;
    width: 70%;
    height: 100%;
    transform: rotate(-3deg);
    z-index: 1;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    background: #fefcf8;
    pointer-events: none;
}

.preface-leaf--right {
    position: relative;
    width: 70%;
    z-index: 2;
    box-shadow: 0 24px 40px -14px rgba(0, 0, 0, 0.18);
    background: #fff;
    padding: 2.5rem 2.8rem;
    transform: rotate(1deg);
    margin-left: 183px;
}

.preface-content p {
    font-size: 1rem;
    line-height: 1.7;
    color: #3a332c;
    margin-bottom: 1.2rem;
}

.preface-content .speaker {
    font-weight: 500;
    color: #3a332c;
}

.preface-content .postscript {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5d9ce;
}

.preface-content .postscript-chapter {
    font-size: 0.8rem;
    font-style: italic;
    color: #b0a090;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.2rem;
}

.preface-content .postscript-sign {
    text-align: right;
    font-size: 0.9rem;
    color: #8a7a68;
    margin-top: 1rem;
}

/* ===== Pricing ===== */
.pricing {
    padding: 3rem 0;
    background: linear-gradient(163deg, #fefaf5, #edde4e17);
    box-shadow: #cecbcb 0 4px 6px 0;
}

.pricing .section-header h2 {
    color: #3a332c;
    font-size: 2rem;
}

.pricing .grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.pricing .card {
    position: relative;
    flex: 1;
    min-width: 260px;
    padding: 2rem 1.8rem;
    background: #fff;
    border-radius: 15px;
    transition: all 0.2s ease;
}

.pricing .card:hover {
    border-color: #ec5748;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
}

.pricing .card--popular {
    border-top: 3px solid #ec5748;
}

.pricing .badge {
    margin-top: -45px;
    margin-bottom: 1rem;
    padding: 0.2rem 0.8rem;
    background: #ec5748;
    border-radius: 30px;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
}

.pricing .title {
    margin-bottom: 0.5rem;
    color: #2c2825;
    font-size: 1.5rem;
    font-weight: 600;
}

.pricing .desc {
    margin-bottom: 1.5rem;
    color: #8a7a68;
    font-size: 0.8rem;
}

.pricing .price-block {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #efe2d6;
}

.pricing .price {
    color: #242322;
    font-size: 2rem;
    font-weight: 600;
}

.pricing .period {
    color: #8a7a68;
    font-size: 0.8rem;
}

.pricing .card__features {
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}

.pricing .card__features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0;
    color: #5c4e3f;
    font-size: 0.85rem;
    border-bottom: 1px solid #efe2d6;
}

.pricing .check {
    color: #ec5748;
    font-weight: bold;
}

.pricing .footer { text-align: center; }

.pricing .soon {
    display: block;
    padding: 0.7rem;
    color: #b0a090;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===== Blog ===== */
.blog {
    background: #fefaf5;
    padding: 3rem 0 5rem;
}

.blog__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2rem;
}

.blog__header h2 {
    font-size: 2rem;
    font-weight: 500;
    color: #3a332c;
}

.blog__all-link {
    font-size: 0.9rem;
    color: #ec5748;
}

.blog__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
}

.blog__featured {
    background: #fff;
    border: 1px solid #e5d9ce;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.blog__featured:hover {
    transform: translateY(-4px);
    border-color: #ec5748;
}

.blog__featured-image {
    display: block;
    height: 240px;
    overflow: hidden;
    background: #efe2d6;
}

.blog__featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog__featured-content { padding: 1.5rem; }

.blog__date {
    font-size: 0.7rem;
    color: #b0a090;
}

.blog__featured-title {
    margin: 0.5rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
}

.blog__featured-title a { color: #3a332c; }
.blog__featured-title a:hover { color: #ec5748; }

.blog__featured-excerpt {
    font-size: 0.9rem;
    color: #8a7a68;
    margin-bottom: 0.75rem;
}

.blog__read-time { font-size: 0.75rem; color: #b0a090; }

.blog__list { display: flex; flex-direction: column; gap: 1.5rem; }

.blog__list-item {
    display: flex;
    gap: 1rem;
    background: #fff;
    border: 1px solid #e5d9ce;
    border-radius: 16px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.blog__list-item:hover {
    transform: translateY(-4px);
    border-color: #ec5748;
}

.blog__list-image {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    background: #efe2d6;
}

.blog__list-image img { width: 100%; height: 100%; object-fit: cover; }

.blog__list-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0.25rem 0;
}

.blog__list-title a { color: #3a332c; }
.blog__list-title a:hover { color: #ec5748; }

.blog__list-excerpt {
    font-size: 0.8rem;
    color: #8a7a68;
}

/* Blog grid page */
.blog-grid {
    background: #fefaf5;
    padding: 3rem 0 5rem;
    min-height: 60vh;
}

.blog-grid__header {
    text-align: center;
    margin-bottom: 3rem;
}

.blog-grid__header h1 {
    font-size: 2rem;
    font-weight: 500;
    color: #3a332c;
    margin-bottom: 0.5rem;
}

.blog-grid__header p {
    font-size: 0.9rem;
    color: #8a7a68;
}

.blog-grid__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.blog-card {
    background: #fff;
    border: 1px solid #e5d9ce;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: #ec5748;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
}

.blog-card__image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #efe2d6;
}

.blog-card__image img { width: 100%; height: 100%; object-fit: cover; }

.blog-card__content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card__date { font-size: 0.7rem; color: #b0a090; }

.blog-card__title {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.blog-card__title a { color: #3a332c; }
.blog-card__title a:hover { color: #ec5748; }

.blog-card__excerpt {
    font-size: 0.8rem;
    color: #8a7a68;
    margin-bottom: 1rem;
    flex: 1;
}

.blog-card__link {
    font-size: 0.8rem;
    color: #ec5748;
    font-weight: 500;
}

/* Post / page body */
.article {
    background: #fff;
    border: 1px solid #e5d9ce;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 860px;
    margin: 0 auto;
}

.article h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #3a332c;
    margin-bottom: 0.5rem;
}

.article h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #3a332c;
    margin: 2rem 0 1rem;
}

.article p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: #3a332c;
}

.article ul {
    margin: 0 0 1rem 1.5rem;
    color: #3a332c;
    line-height: 1.8;
}

.article a { color: #ec5748; }

.article-meta {
    color: #8a7a68;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* ===== CTA ===== */
.cta {
    padding: 4rem 0;
    text-align: center;
    background: linear-gradient(135deg, #fac88b, #ec5748);
    color: #fff;
}

.cta h2 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.cta p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.cta .btn {
    background: #fff;
    color: #ec5748;
}

.cta .note {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ===== Auth ===== */
.auth {
    padding: 3rem 0 5rem;
    min-height: 60vh;
}

.auth-card {
    background: #fff;
    border: 1px solid #e5d9ce;
    border-radius: 24px;
    max-width: 440px;
    margin: 0 auto;
    padding: 2rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.08);
}

.auth-card h1 {
    font-size: 1.35rem;
    font-weight: 500;
    color: #3a332c;
    margin-bottom: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #3a332c;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.6rem 0.75rem;
    border: 1px solid #e5d9ce;
    border-radius: 12px;
    font-size: 0.9rem;
    background: #fff;
    transition: border 0.2s;
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #ec5748;
}

.auth-card .btn { width: 100%; }

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: #8a7a68;
}

.auth-footer a { color: #ec5748; }
.auth-footer a:hover { text-decoration: underline; }

.message {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.message--error {
    background: #fef2f2;
    color: #c2412c;
    border: 1px solid #fee2e2;
}

.message--success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #dcfce7;
}

/* ===== Footer ===== */
footer {
    margin-top: auto;
    background: #f5f1eb;
    border-top: 1px solid #dadada;
}

footer .bottom {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem 28px;
    text-align: center;
}

footer .bottom-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

footer .bottom-links a {
    color: #8a7a68;
    font-size: 0.75rem;
}

footer .bottom-links a:hover { color: #ec5748; }

footer .bottom p {
    color: #b19f8d;
    font-size: 0.7rem;
}

/* ===== Cookie consent ===== */
.cookie-consent {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 480px;
    background: #3a332c;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.cookie-consent--visible { display: block; }

.cookie-consent__content {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-consent__text {
    font-size: 0.8rem;
    color: #fefaf5;
    line-height: 1.4;
    flex: 1;
}

.cookie-consent__link { color: #fac88b; }
.cookie-consent__link:hover { color: #ec5748; text-decoration: underline; }

.cookie-consent__btn {
    padding: 0.4rem 1rem;
    background: #ec5748;
    border: 1px solid #ec5748;
    border-radius: 40px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
}

.cookie-consent__btn:hover { background: #d94a3b; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    header nav { gap: 1.5rem; }
}

@media (max-width: 900px) {
    .hero { padding: 2rem 0; }
    .hero .container { flex-direction: column; text-align: center; }
    .hero .content, .hero .demo { width: 100%; }
    .hero h1 { font-size: 2.6rem; }
    .hero .buttons { justify-content: center; }
    .hero .description { width: 80%; margin: 0 auto 2rem auto; }

    .preface-stack { min-height: auto; flex-direction: column; }
    .preface-leaf--left { display: none; }
    .preface-leaf--right { width: 100%; transform: none; padding: 1.8rem; margin-left: 0; }

    .blog__grid { grid-template-columns: 1fr; }
    .blog-grid__list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    header .container { flex-direction: column; padding: 0.75rem 20px; }
    header nav { justify-content: center; gap: 1.5rem; }
    .pricing .grid { flex-direction: column; align-items: center; }
    .pricing .card { width: 100%; max-width: 450px; }
}

@media (max-width: 600px) {
    .features { padding: 2rem 0; }
    .features .section-header h2 { font-size: 1.6rem; }
    .preface { padding: 2.5rem 0; }
    .blog-grid__list { grid-template-columns: 1fr; }
    .blog-card__image { height: 160px; }
    .article { padding: 1.5rem; }
    footer .bottom-links { gap: 1rem; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.9rem; }
    .hero .description { width: 100%; }
    .features .card { min-width: 300px; padding: 1.5rem; }
}
