/* STORYLINER - Pen Sketch Design System */
/* Минималистичный дизайн в стиле рисунка черной шариковой ручкой */

:root {
    /* Только два цвета - черный и белый */
    --ink-black: #0a0a0a;
    --paper-white: #fafafa;

    /* Оттенки для штриховки */
    --sketch-light: rgba(10, 10, 10, 0.05);
    --sketch-medium: rgba(10, 10, 10, 0.15);
    --sketch-dark: rgba(10, 10, 10, 0.25);
    --sketch-heavy: rgba(10, 10, 10, 0.4);

    /* Рисованные границы */
    --sketch-border: 2px solid var(--ink-black);
    --sketch-border-thin: 1.5px solid var(--ink-black);
    --sketch-border-thick: 3px solid var(--ink-black);

    /* Анимации */
    --sketch-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* База */
body {
    font-family: 'Courier New', monospace;
    background: var(--paper-white);
    color: var(--ink-black);
    line-height: 1.6;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 27px,
            var(--sketch-light) 27px,
            var(--sketch-light) 28px
        );
    background-size: 100% 28px;
    position: relative;
}

/* Эффект рисованной линии */
@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes sketch {
    0%, 100% { transform: rotate(-0.5deg); }
    50% { transform: rotate(0.5deg); }
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

h1::after, h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ink-black);
    transform: scaleX(1.02) skew(-2deg);
}

/* Кнопки в стиле рисованных */
.sketch-btn {
    padding: 12px 28px;
    background: var(--paper-white);
    color: var(--ink-black);
    border: var(--sketch-border);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    transition: var(--sketch-transition);
    box-shadow: 4px 4px 0 var(--ink-black);
    overflow: hidden;
}

.sketch-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        var(--sketch-medium) 3px,
        var(--sketch-medium) 6px
    );
    transition: left 0.3s ease;
}

.sketch-btn:hover::before {
    left: 0;
}

.sketch-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--ink-black);
}

.sketch-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--ink-black);
}

/* Кнопка-заливка */
.sketch-btn-filled {
    background: var(--ink-black);
    color: var(--paper-white);
}

.sketch-btn-filled::before {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        rgba(250, 250, 250, 0.2) 3px,
        rgba(250, 250, 250, 0.2) 6px
    );
}

/* Карточки */
.sketch-card {
    background: var(--paper-white);
    border: var(--sketch-border);
    padding: 30px;
    position: relative;
    box-shadow: 5px 5px 0 var(--ink-black);
    transition: var(--sketch-transition);
}

.sketch-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--paper-white);
    z-index: -1;
    transform: rotate(0.2deg);
}

.sketch-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0 var(--ink-black);
}

/* Поля ввода */
.sketch-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--paper-white);
    border: none;
    border-bottom: var(--sketch-border);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--ink-black);
    transition: var(--sketch-transition);
    position: relative;
}

.sketch-input:focus {
    outline: none;
    border-bottom: var(--sketch-border-thick);
    background: var(--sketch-light);
}

.sketch-input::placeholder {
    color: var(--sketch-heavy);
    font-style: italic;
}

/* Текстовая область */
.sketch-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    background: var(--paper-white);
    border: var(--sketch-border);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--ink-black);
    resize: vertical;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 23px,
        var(--sketch-light) 23px,
        var(--sketch-light) 24px
    );
    line-height: 24px;
}

.sketch-textarea:focus {
    outline: none;
    border: var(--sketch-border-thick);
}

/* Чекбокс */
.sketch-checkbox {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Courier New', monospace;
}

.sketch-checkbox input {
    display: none;
}

.sketch-checkbox-box {
    width: 20px;
    height: 20px;
    border: var(--sketch-border);
    margin-right: 10px;
    position: relative;
    background: var(--paper-white);
}

.sketch-checkbox input:checked + .sketch-checkbox-box::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    font-size: 18px;
    font-weight: bold;
    color: var(--ink-black);
    transform: rotate(-5deg);
}

/* Радио-кнопки */
.sketch-radio {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Courier New', monospace;
}

.sketch-radio input {
    display: none;
}

.sketch-radio-circle {
    width: 20px;
    height: 20px;
    border: var(--sketch-border);
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    background: var(--paper-white);
}

.sketch-radio input:checked + .sketch-radio-circle::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    background: var(--ink-black);
    border-radius: 50%;
}

/* Табы */
.sketch-tabs {
    display: flex;
    border-bottom: var(--sketch-border);
    margin-bottom: 20px;
}

.sketch-tab {
    padding: 10px 20px;
    background: var(--paper-white);
    border: var(--sketch-border);
    border-bottom: none;
    margin-right: -2px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    transition: var(--sketch-transition);
}

.sketch-tab.active {
    background: var(--paper-white);
    border-bottom: 2px solid var(--paper-white);
    z-index: 1;
}

.sketch-tab:hover:not(.active) {
    background: var(--sketch-light);
}

/* Прогресс-бар */
.sketch-progress {
    width: 100%;
    height: 25px;
    border: var(--sketch-border);
    background: var(--paper-white);
    position: relative;
    overflow: hidden;
}

.sketch-progress-fill {
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        var(--ink-black),
        var(--ink-black) 10px,
        transparent 10px,
        transparent 20px
    );
    transition: width 0.3s ease;
    position: relative;
}

/* Разделитель */
.sketch-divider {
    border: none;
    height: 2px;
    background: var(--ink-black);
    margin: 30px 0;
    position: relative;
    transform: scaleX(1.01) skew(-1deg);
}

/* Навигация */
.sketch-nav {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: var(--sketch-border-thick);
    background: var(--paper-white);
    position: relative;
}

.sketch-nav::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ink-black);
    transform: scaleX(1.01) skew(-0.5deg);
}

/* Ссылки */
.sketch-link {
    color: var(--ink-black);
    text-decoration: none;
    position: relative;
    font-weight: bold;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: var(--sketch-transition);
}

.sketch-link:hover {
    border-bottom: 2px solid var(--ink-black);
}

/* Иконки-стрелки нарисованные */
.sketch-arrow-right::after {
    content: '→';
    margin-left: 5px;
    font-size: 1.2em;
}

.sketch-arrow-left::before {
    content: '←';
    margin-right: 5px;
    font-size: 1.2em;
}

/* Списки */
ul.sketch-list {
    list-style: none;
    padding-left: 0;
}

ul.sketch-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}

ul.sketch-list li::before {
    content: '▪';
    position: absolute;
    left: 0;
    font-size: 1.2em;
}

/* Модальное окно */
.sketch-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(250, 250, 250, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.sketch-modal-content {
    background: var(--paper-white);
    border: var(--sketch-border-thick);
    padding: 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: 10px 10px 0 var(--ink-black);
    position: relative;
}

.sketch-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: var(--paper-white);
    border: var(--sketch-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

.sketch-modal-close:hover {
    background: var(--ink-black);
    color: var(--paper-white);
}

/* Эффект рисования для текста */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

.sketch-typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 2s steps(40) forwards;
}

/* Эмуляция штриховки для фона */
.sketch-hatching {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        var(--sketch-light) 5px,
        var(--sketch-light) 10px
    );
}

/* Отзывчивость */
@media (max-width: 768px) {
    .sketch-btn {
        padding: 10px 20px;
        font-size: 12px;
    }

    .sketch-card {
        padding: 20px;
    }

    h1 { font-size: 1.8em; }
    h2 { font-size: 1.5em; }
    h3 { font-size: 1.2em; }
}