

:root{
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #111827;        
  --muted: #6b7280;       
  --muted2: #9ca3af;      
  --line: rgba(17, 24, 39, 0.10);
  --line2: rgba(17, 24, 39, 0.06);
  --accent: #0ea5e9;      
  --accent2: #7c3aed;     

  --shadow-sm: 0 6px 18px rgba(17, 24, 39, 0.06);
  --shadow:    0 18px 50px rgba(17, 24, 39, 0.10);
  --radius: 18px;

  --maxw: 1320px;         
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  color: var(--text);
  background: var(--bg);

  font-family: "Roboto", system-ui, -apple-system, 
               Segoe UI, Roboto, Arial, sans-serif;

  font-weight: 300;
  font-size: 18px;

  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

.container{
  width: min(var(--maxw), calc(100% - 56px));
  margin: 0 auto;
}

.skip-link{
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  z-index: 10;
}
.skip-link:focus{ left: 24px; top: 20px; }

.site-header{
  padding: 54px 0 26px;
  border-bottom: 1px solid var(--line2);
  background:
    radial-gradient(1100px 460px at 15% 0%, rgba(14,165,233,0.08), transparent 60%),
    radial-gradient(900px 380px at 85% 0%, rgba(124,58,237,0.07), transparent 62%),
    #fff;
}
.site-header h1{
  margin: 0 0 10px;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.subtitle{
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.01em;
}
.site-header p{
  margin: 10px 0 0;
  color: var(--text);
  max-width: 78ch;
}

.layout{
  padding: 34px 0 70px;
}

.toc{
  position: sticky;
  top: 18px;
}
.toc-inner{
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 16px;
  backdrop-filter: blur(10px);
}
.toc h2{
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.toc ol{
  margin: 0;
  padding-left: 18px;
}
.toc ol ol{ margin-top: 6px; }
.toc a{
  display: inline-block;
  padding: 2px 0;
  color: var(--text);
  border-bottom: 1px solid transparent;
}
.toc a:hover{
  color: var(--accent);
  border-bottom-color: rgba(14,165,233,0.30);
}
.toc a.active{
  color: var(--accent2);
  border-bottom-color: rgba(124,58,237,0.28);
}

.content article{
  background: #fff;
  border: 1px solid var(--line2);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 28px 30px 14px;
}

h2{
  margin: 28px 0 12px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h3{
  margin: 18px 0 8px;
  font-size: 18px;
  line-height: 1.35;
}
h4{
  margin: 14px 0 6px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
  font-weight: 600;
}

p{
  margin: 12px 0;
  color: var(--text);
}
ul, ol{ margin: 10px 0 16px; }
li{ margin: 6px 0; }
strong{ color: var(--text); }

.site-footer{
  margin-top: 22px;
  padding: 16px 6px 0;
  border-top: 1px solid var(--line2);
  color: var(--muted);
  font-size: 13px;
}


.segments{
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: start;
  margin: 14px 0 22px;
  padding: 14px;
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(17,24,39,0.02), rgba(17,24,39,0.00));
}

.segments__media{
  margin: 0;
  position: sticky;
  top: 96px;
}

.segments__media img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line2);
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.segments__body{
  min-width: 0;
}

.segments__body ol{
  margin: 0;
  padding-left: 22px;
}


.content article ul,
.content article ol{
  padding-left: 22px;
}
.content article li{
  padding-left: 2px;
}


@media (max-width: 1100px){
  .layout{ grid-template-columns: 300px 1fr; }
  .content article{ padding: 24px 22px 12px; }
}

@media (max-width: 900px){
  .layout{ grid-template-columns: 1fr; }
  .toc{ position: relative; top: 0; }
  .toc-inner{ box-shadow: var(--shadow-sm); }
}
@media (max-width: 900px){
  .toc-inner{
    max-width: 100%;
    overflow-x: hidden;
  }

  .toc a{
    display: block;             
    overflow-wrap: anywhere;     
    word-break: break-word;     
  }
}
@media (max-width: 760px){
  .container{ width: min(var(--maxw), calc(100% - 30px)); }
  .site-header{ padding: 42px 0 18px; }
  .content article{ padding: 18px 16px 10px; }

  .segments{
    grid-template-columns: 1fr;
  }
  .segments__media{
    position: relative;
    top: 0;
  }
}