/* ==========================================================
   Theme: Modern Minimalist
   Charcoal #36454f · Slate #708090 · Light Gray #d3d3d3 · White
   Type: Inter (web-equiv to DejaVu Sans)
   ========================================================== */

:root {
    --charcoal:   #36454f;
    --slate:      #708090;
    --light:      #d3d3d3;

    /* Light surface — приглушённый, не слепит */
    --bg:           #eceff3;
    --bg-elevated:  #f7f8fa;
    --bg-subtle:    #e2e6ec;

    --border:        #d8dde3;
    --border-strong: #c2c8d0;

    --text-1: #36454f;
    --text-2: #6c7782;
    --text-3: #98a0a9;

    --accent:        #36454f;
    --accent-fg:     #ffffff;
    --accent-hover:  #25313a;
    --accent-soft:   rgba(54, 69, 79, 0.06);
    --accent-ring:   rgba(54, 69, 79, 0.12);

    --shadow-sm: 0 1px 2px rgba(54, 69, 79, 0.05);
    --shadow-md: 0 1px 2px rgba(54, 69, 79, 0.05), 0 8px 24px rgba(54, 69, 79, 0.06);
    --shadow-lg: 0 1px 2px rgba(54, 69, 79, 0.05), 0 24px 48px rgba(54, 69, 79, 0.10);

    --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, "Courier New", monospace;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;

    --grid-color: rgba(112, 128, 144, 0.10);
}

:root[data-theme="dark"] {
    --bg:           #1a2129;
    --bg-elevated:  #232c36;
    --bg-subtle:    #1f2731;

    --border:        rgba(208, 208, 208, 0.10);
    --border-strong: rgba(208, 208, 208, 0.20);

    --text-1: #fafafa;
    --text-2: #d3d3d3;
    --text-3: #8a96a3;

    --accent:        #ffffff;
    --accent-fg:     #36454f;
    --accent-hover:  #e5e7eb;
    --accent-soft:   rgba(255, 255, 255, 0.05);
    --accent-ring:   rgba(255, 255, 255, 0.10);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.30), 0 8px 24px rgba(0, 0, 0, 0.30);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.30), 0 24px 48px rgba(0, 0, 0, 0.45);

    --grid-color: rgba(208, 208, 208, 0.07);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

body {
    font-family: var(--sans);
    color: var(--text-1);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01", "cv11";
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Subtle dot-grid background (modern minimalist signature) */
.bg-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(var(--grid-color) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
            mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
}

/* Topbar */
.topbar {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 32px;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
}
.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-1);
    line-height: 0;
}
.logo-img {
    display: block;
    height: 30px;
    width: auto;
}
:root[data-theme="dark"]  .logo-img--light { display: none; }
:root[data-theme="light"] .logo-img--dark  { display: none; }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 9px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-2);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--text-1); }
.theme-toggle .ic { width: 16px; height: 16px; opacity: 0.4; transition: opacity 0.15s ease; }
:root[data-theme="light"] .theme-toggle .ic-sun  { opacity: 1; color: var(--text-1); }
:root[data-theme="dark"]  .theme-toggle .ic-moon { opacity: 1; color: var(--text-1); }

/* Layout */
.container {
    position: relative;
    z-index: 2;
    flex: 1;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 32px 56px;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.footer {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--text-3);
    font-size: 12px;
    letter-spacing: 0.02em;
    padding: 24px 32px 32px;
}
.dot-sep { margin: 0 8px; opacity: 0.6; }

/* Hero */
.hero { text-align: center; padding: 16px 0 0; }
.hero-eyebrow {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-3);
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-elevated);
    margin-bottom: 18px;
}
.hero-title {
    font-size: clamp(34px, 5.5vw, 56px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 14px;
    color: var(--text-1);
}
.hero-sub {
    color: var(--text-2);
    max-width: 520px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.6;
}
.grad { color: var(--text-3); font-weight: 500; }

.hero--404 { padding: 80px 0 40px; }
.hero--404 .hero-title { font-size: clamp(80px, 14vw, 140px); line-height: 1; margin-bottom: 18px; letter-spacing: -0.05em; }
.hero--404 .btn { margin-top: 28px; }

/* Form */
.paste-form { display: flex; flex-direction: column; gap: 14px; }

.editor {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.editor:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-md);
}
.editor-area {
    width: 100%;
    height: clamp(340px, 56vh, 580px);
    background: transparent;
    border: 0;
    outline: 0;
    resize: vertical;
    padding: 22px 22px 48px;
    color: var(--text-1);
    font-family: var(--mono);
    font-size: 13.5px;
    line-height: 1.62;
    border-radius: 14px;
    tab-size: 4;
    -moz-tab-size: 4;
}
.editor-area::placeholder { color: var(--text-3); }
.editor-counter {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-3);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    padding: 4px 9px;
    border-radius: 999px;
    pointer-events: none;
    letter-spacing: 0.02em;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.form-hint {
    color: var(--text-3);
    font-size: 12px;
    font-family: var(--mono);
    letter-spacing: 0.02em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.10s ease;
    user-select: none;
    line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn--primary {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--ghost {
    background: var(--bg-elevated);
    color: var(--text-1);
    border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--border-strong); background: var(--bg-subtle); }

.btn.is-ok {
    background: var(--accent) !important;
    color: var(--accent-fg) !important;
    border-color: var(--accent) !important;
}

/* Стабильная ширина у кнопок копирования — текст label'а меняется,
   ширина остаётся фиксированной по самому длинному состоянию */
.copy-label {
    display: inline-block;
    text-align: center;
}
.btn-copy-all   .copy-label { min-width: 180px; }
.btn--copy-link .copy-label { min-width: 150px; }

/* Banners */
.banner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
}
.banner--success { border-left: 3px solid var(--accent); }
.banner--error   { border-left: 3px solid #b87d6d; background: var(--bg-elevated); }

.banner-icon {
    flex: 0 0 auto;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center; justify-content: center;
    background: var(--accent);
    color: var(--accent-fg);
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
}
.banner-body { flex: 1; min-width: 0; }
.banner-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-1);
    font-size: 14px;
}

.link-row {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.link-input {
    flex: 1; min-width: 200px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-1);
    outline: 0;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.link-input:focus { border-color: var(--accent); background: var(--bg-elevated); }

/* Paste view */
.paste-head { display: flex; flex-direction: column; gap: 18px; }

.action-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.paste-expires {
    font-size: 12px;
    color: var(--text-3);
    font-family: var(--mono);
    letter-spacing: 0.02em;
    margin-top: 2px;
}

/* Preview */
.preview {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.preview-notice {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    font-size: 12.5px;
    color: var(--text-2);
}
.preview-body {
    margin: 0;
    padding: 20px 22px;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.62;
    color: var(--text-1);
    white-space: pre;
    overflow: auto;
    max-height: 70vh;
    tab-size: 4;
    -moz-tab-size: 4;
    background: var(--bg-elevated);
}

/* Selection */
::selection { background: var(--accent); color: var(--accent-fg); }

/* Scrollbars (subtle) */
.preview-body::-webkit-scrollbar { width: 10px; height: 10px; }
.preview-body::-webkit-scrollbar-track { background: transparent; }
.preview-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg-elevated); }
.preview-body::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* Mono helper */
.mono { font-family: var(--mono); }

/* Mobile */
@media (max-width: 600px) {
    .topbar { padding: 16px 20px; }
    .container { padding: 16px 20px 40px; gap: 26px; }
    .hero-title { font-size: 30px; }
    .hero-sub { font-size: 14px; }
    .editor-area { font-size: 13px; padding: 16px 16px 40px; }
    .preview-body { font-size: 12.5px; padding: 14px 16px; }
    .form-actions .form-hint { display: none; }
    .btn { padding: 10px 14px; font-size: 13px; }
    .logo-img { height: 26px; }
}
