
    :root {
      --paper: #fbfaf8;
      --ink: #272522;
      --muted: #85817d;
      --line: #e8e4df;
      --accent: #5d2739;
      --accent-soft: #efe5e8;
      --content: 720px;
      --wide: 1040px;
    }

    #story-wrapper { max-width: var(--wide); margin: 20px auto; padding: 0 20px; font-family: Georgia, serif; font-size: 18px; line-height: 1.6; }
    #chapter-content img { max-width: 100%; height: auto; display: block; margin: 20px auto; margin-bottom: 40px; }
    
        .pagination-nav { 
      		width: 100%;
      		height: auto;
      		display: flex;
      		justify-content: space-between;
      		align-items: center;
      		gap: 20px;
      		margin: 0 auto;
        	margin-top: 40px; 
        	text-align: center;
        }
        .nav-btn, .nav-btn-disabled { 
        	padding: 10px 20px; 
        	font-family: sans-serif; 
        	cursor: pointer; 
        	background: var(--accent);
        	color: white; 
        	border: none; 
        	border-radius: 4px; 
        	margin-bottom: 30px; 
        	
        }
        .nav-btn:disabled { background: #ccc; cursor: not-allowed; }
        
        .nav-btn.disabled { pointer-events: none; opacity: 0.3; cursor: not-allowed; }
        
        .pagination-nav a {
        	padding: 8px 20px; 
        	font-size: 13px;
        	font-weight: 400;
        }
        .pagination-nav a:hover {
    		color: white;
		}

.hero-image { display:block; width:260px; }

.story-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    padding: 15px 30px;
    margin-top: 30px; 
    
    background: #5d2739;
    color: #fbfaf8;
    border: 1px solid #5d2739;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .17em;
    text-transform: uppercase;
    
    cursor: pointer;

    text-decoration: none;
    transition: background .25s ease,
                color .25s ease,
                border-color .25s ease;
}

.story-button span {
    font-size: 14px;
    transition: transform .25s ease;
}

.story-button:hover {
    background: transparent;
    color: #5d2739;
}

.story-button:hover span {
    transform: translateX(4px);
}

.story-button:focus-visible {
    outline: 2px solid #5d2739;
    outline-offset: 4px;
}

.kicker{color:var(--accent);font:600 10px/1.8 Arial,sans-serif;letter-spacing:.23em;text-transform:uppercase;margin:0 0 16px}
h1{font-size:clamp(42px,7vw,66px);font-weight:400;letter-spacing:-.045em;line-height:1.05;margin:0}
.lead{font-size:17px;font-style:italic;color:var(--muted);margin:14px 0 0;line-height:1.65}
.section{margin-top:74px;padding-top:28px;border-top:1px solid var(--line)}
h2{margin:0;color:var(--ink);font-size:32px;font-weight:400;letter-spacing:-.025em;line-height:1.2}
h2:after{content:"";display:block;width:42px;height:1px;background:var(--accent);margin-top:17px}
h3{margin:32px 0 12px;color:var(--accent);font-size:21px;font-weight:400;font-style:italic;line-height:1.35}
h4{margin:28px 0 10px;color:var(--accent);font:600 10px/1.8 Arial,sans-serif;letter-spacing:.19em;text-transform:uppercase}

.chapter_head{margin-top:50px;text-align:center;padding:36px 18px 40px;border-top:0px solid var(--line);border-bottom:0px solid var(--line)}
.chapter_head .kicker{margin-bottom:17px}
.chapter_head h2{font-size:clamp(27px,5vw,39px)}
.chapter_head h2:after{margin:18px auto 0}
.chapter_head .lead{max-width:430px;margin:17px auto 0; margin-bottom:40px}
.note{color:var(--muted);font:11px/1.7 Arial,sans-serif;letter-spacing:.08em;margin-top:45px}

    .main_sec {
      margin: 0 auto;
      min-height: 1400px;
	  height: auto;
      color: var(--ink);
      background: var(--paper);
      font-family: Georgia, "Times New Roman", serif;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
      z-index: 999999999999;
    }
    
    .main {
     height: auto;
    }

    a { color: inherit; text-decoration: none; }
    a:hover { color: var(--accent); }

    .story-header {
      width: min(var(--wide), calc(100% - 56px));
      margin: 0 auto;
      min-height: 86px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 24px;
      border-bottom: 1px solid var(--line);
      font-family: Arial, Helvetica, sans-serif;
    }

    .brand {
      color: var(--accent);
      font-size: 13px;
      font-weight: 700;
      letter-spacing: .22em;
    }

    .header-right {
      width: min(var(--content), calc(100% - 48px));
      margin: 0 auto;
	  display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 27px;
      color: var(--muted);
      font-size: 10px;
      letter-spacing: .15em;
      text-transform: uppercase;
      text-align: right;
      
    }

	.language_story {
		height: auto;
        float: none;
    	margin: 0;
    	text-align: right;
    	padding-top: 15px;
    	cursor: pointer; 
	}
    .language_story a { 
    	padding: 5px 0; 
    	text-align: right;
    }
    .language_story .active { color: var(--accent); border-bottom: 1px solid var(--accent); }

    .main_sec {
      width: min(var(--content), calc(100% - 48px));
      margin: 0 auto;
    }

    .story-intro {
      text-align: center;
      padding: 76px 0 43px;
    }

    .eyebrow {
      margin: 0 0 20px;
      color: var(--accent);
      font-family: Arial, Helvetica, sans-serif;
      font-size: 10px;
      font-weight: 600;
      letter-spacing: .23em;
      line-height: 1.8;
      text-transform: uppercase;
    }

    h1 {
      margin: 0;
      font-size: clamp(42px, 7vw, 68px);
      font-weight: 400;
      letter-spacing: -.045em;
      line-height: 1.04;
    }

    .subtitle {
      max-width: 420px;
      margin: 20px auto 0;
      color: var(--muted);
      font-size: 17px;
      font-style: italic;
      line-height: 1.65;
    }

    .chapter-meta {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 13px;
      margin-top: 34px;
      color: var(--muted);
      font-family: Arial, Helvetica, sans-serif;
      font-size: 10px;
      letter-spacing: .16em;
      text-transform: uppercase;
    }

    .chapter-meta::before,
    .chapter-meta::after {
      content: "";
      width: 28px;
      height: 1px;
      background: var(--line);
    }

    .artwork {
      position: relative;
      display: block;
      width: 100%;
      aspect-ratio: 16 / 9;
      overflow: hidden;
      margin: 0 auto 47px;
      background:
        radial-gradient(ellipse at 50% 55%, rgba(114, 91, 116, .2), transparent 33%),
        radial-gradient(ellipse at 68% 38%, rgba(157, 182, 237, .15), transparent 24%),
        linear-gradient(150deg, #11131d 0%, #202131 48%, #11131b 100%);
    }

    /* Replace this artwork block with an <img> when your illustration is ready. */
    .artwork::before {
      content: "";
      position: absolute;
      inset: 0;
      opacity: .82;
      background-image:
        radial-gradient(1px 1px at 8% 23%, #fff 98%, transparent),
        radial-gradient(1px 1px at 16% 72%, #d9d8f5 98%, transparent),
        radial-gradient(2px 2px at 23% 41%, #fff 98%, transparent),
        radial-gradient(1px 1px at 32% 17%, #fff 98%, transparent),
        radial-gradient(1px 1px at 41% 78%, #fff 98%, transparent),
        radial-gradient(1px 1px at 49% 31%, #e6e2f7 98%, transparent),
        radial-gradient(1px 1px at 57% 67%, #fff 98%, transparent),
        radial-gradient(2px 2px at 67% 21%, #fff 98%, transparent),
        radial-gradient(1px 1px at 76% 56%, #d9d8f5 98%, transparent),
        radial-gradient(1px 1px at 87% 29%, #fff 98%, transparent),
        radial-gradient(1px 1px at 92% 77%, #fff 98%, transparent),
        radial-gradient(1px 1px at 60% 10%, #fff 98%, transparent);
    }

    .artwork::after {
      content: "ILLUSTRATION";
      position: absolute;
      right: 17px;
      bottom: 15px;
      color: rgba(255,255,255,.42);
      font: 9px Arial, Helvetica, sans-serif;
      letter-spacing: .2em;
    }

    .story-body {
      width: min(590px, 100%);
      margin: 0 auto;
      font-size: 18px;
      line-height: 1.95;
    }

    .story-body p { margin: 0 0 25px; }

    .opening-line {
      margin: 0 0 34px !important;
      color: var(--accent);
      font-size: 25px;
      font-style: italic;
      line-height: 1.6;
      text-align: center;
    }

    .scene-break {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      margin: 42px 0;
      color: var(--accent);
      font-size: 14px;
    }

    .scene-break::before,
    .scene-break::after {
      content: "";
      width: 48px;
      height: 1px;
      background: var(--line);
    }

    .dialogue {
      margin: 0 0 25px;
      padding-left: 20px;
      border-left: 1px solid #d8c5cc;
    }

    .speaker {
      display: block;
      margin-bottom: 4px;
      color: var(--accent);
      font-family: Arial, Helvetica, sans-serif;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: .16em;
      text-transform: uppercase;
    }

    .image-note {
      margin: 42px 0;
      padding: 0;
      color: var(--muted);
      font-size: 13px;
      font-style: italic;
      line-height: 1.7;
      text-align: center;
    }

    .chapter-nav {
      max-width: var(--wide);
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 20px;
      margin: 67px 0 0;
      padding: 25px 0 29px;
      border-top: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
      font-family: Arial, Helvetica, sans-serif;
    }

    .nav-link {
      display: flex;
      flex-direction: column;
      gap: 8px;
      font-size: 15px;
    }

    .nav-label {
      color: var(--muted);
      font-size: 9px;
      letter-spacing: .17em;
      text-transform: uppercase;
    }

    .nav-title { color: var(--accent); }
    .next { text-align: right; }

    .progress {
      margin-top: 24px;
      color: var(--muted);
      font-family: Arial, Helvetica, sans-serif;
      font-size: 10px;
      letter-spacing: .15em;
      text-align: center;
      text-transform: uppercase;
    }

    .progress-line {
      width: 100%;
      height: 2px;
      margin-top: 13px;
      background: var(--line);
    }

    .progress-line span {
      display: block;
      width: 20%;
      height: 100%;
      background: var(--accent);
    }

    .story-footer {
      width: min(var(--wide), calc(100% - 56px));
      margin: 74px auto 0;
      padding: 25px 0 31px;
      border-top: 1px solid var(--line);
      display: flex;
      justify-content: space-between;
      gap: 18px;
      color: var(--muted);
      font-family: Arial, Helvetica, sans-serif;
      font-size: 10px;
      letter-spacing: .12em;
      text-transform: uppercase;
    }

    .footer-mark { color: var(--accent); }

    @media (max-width: 600px) {
      .story-header {
        width: calc(100% - 36px);
        min-height: 70px;
      }
      .header-right { gap: 14px; font-size: 9px; }
      .story-intro { padding: 55px 0 31px; }
      .main_sec { width: calc(100% - 36px); }
      .subtitle { font-size: 16px; }
      .artwork { aspect-ratio: 4 / 3; margin-bottom: 35px; }
      .story-body { font-size: 17px; line-height: 1.85; }
      .opening-line { font-size: 22px; }
      .chapter-nav { margin-top: 48px; }
      .story-footer { width: calc(100% - 36px); margin-top: 55px; }
    }
    
    
/* Контейнер для стрелок в правом нижнем углу */
#scroll-nav {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

/* Общие стили для обеих кнопок */
#scroll-nav button {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background-color: rgba(93, 39, 57, 0.5); /* Цвет как у кнопок навигации, но прозрачный */
    color: white;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Эффект при наведении — кнопка становится ярче */
#scroll-nav button:hover {
    background-color: rgba(93, 39, 57, 1);
    transform: scale(1.05);
}

/* Скрываем стрелку "Наверх" по умолчанию, пока пользователь не прокрутил страницу */
#scroll-to-top {
    opacity: 0;
    visibility: hidden;
}

/* Класс, который сделает стрелку видимой */
#scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* кнопка поделиться */

.share-container {
    position: relative;
    display: inline-block;
    margin-top: 15px;
	background: transparent;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border: none;
    background: transparent;
    color: #777;
    cursor: pointer;
    transition: color .2s, transform .2s;
}

.share-button:hover {
    color: #5D2739;
    transform: translateY(-1px);
}

.share-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 100;
    width: 190px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e8e5e2;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,.07);
    animation: shareAppear .18s ease;
}

.share-menu[hidden] {
    display: none;
}

.share-menu-title {
    padding: 8px 10px;
    font-size: 12px;
    color: #999;
    letter-spacing: .04em;
}

.share-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 190px;
    padding: 9px 10px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: #444;
    font: inherit;
    font-size: 13px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.share-item:hover {
    background: #f7f3f4;
    color: #5D2739;
}

.share-status {
    font-size: 11px;
    color: #5D2739;
}

@keyframes shareAppear {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}