.bar {
    text-decoration: overline;
}

i {
    font-style: italic;
}

section.smaller>*:not(:first-child) {
    font-size: 90%;
}

section.xx-smaller .code {
    font-size: 60%;
}

li {
    margin-top: 2rem;
}

section:not(.bullet-unshift) ul ul li, ul.smaller li {
    margin-top: 0.5rem;
}

.reveal .slides section.centered {
    text-align: center;
}
.bullet-unshift>ul {
    list-style-type: none;
}
.bullet-unshift>ul>li>ul {
    list-style-type: disc;
}
.bullet-unshift>ul>li>ul>li>ul {
    list-style-type: square;
}

/* centering */
.center-v, .center, section:has(h1) {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.center-h, .center {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.center-self{
    align-self: center;
    margin: auto;
}

/* columns */
.columns {
    width: 100%;
    display: flex;
    gap: 1rem;
    align-items: stretch;
}
.columns>div {
    flex: 1 1 0;
}

/* memory */
.oval, .straight {
    position: absolute;
    background-color: #eee;
    border: 0.125rem solid #555;
}
.oval {
    height: 20cqh;
    width: 100cqw;
    border-radius: 50%;
}
.straight {
    top: 10cqh;
    height: 70cqh;
    width: 100cqw;
    padding-top: 10cqh;
    border-top: none;
    border-bottom: none;
}

/* buffer */
.fifo-box {
    background: var(--uu-se-red);
    height: var(--h);
    border-radius: var(--r);
    clip-path: shape(
        from 0 100%,
        hline   by calc(100% - var(--h)/2),
        arc     by calc(var(--r)*0.7071)        calc(var(--r)*-0.2929)          of var(--r),
        line    by calc(var(--h)/2 - var(--r))  calc(var(--r) - var(--h)/2),
        arc     by 0                            calc(var(--r)*-1.4142)          of var(--r),
        line    by calc(var(--r) - var(--h)/2)  calc(var(--r) - var(--h)/2),
        arc     by calc(var(--r)*-0.7071)       calc(var(--r)*-0.2929)          of var(--r),
        line to 0 0
    );
}
.fifo-box.back {
    clip-path: shape(
        from 100% 0,
        hline   by calc(var(--h)/2 - 100%),
        arc     by calc(var(--r)*-0.7071)       calc(var(--r)*0.2929)           of var(--r),
        line    by calc(var(--r) - var(--h)/2)  calc(var(--h)/2 - var(--r)),
        arc     by 0                            calc(var(--r)*1.4142)           of var(--r),
        line    by calc(var(--h)/2 - var(--r))  calc(var(--h)/2 - var(--r)),
        arc     by calc(var(--r)*0.7071)        calc(var(--r)*0.2929)           of var(--r),
        line to 100% 100%
    );
}
.fifo-box.outer {
    --h: 6rem;
    --r: 1rem;
    padding: 0.5rem;
    box-sizing: border-box;
    container-type: size;
}
.fifo-box.inner {
    --h: 100cqh;
    --r: 0.5rem;
    background: #eee;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding-right: 50cqh;
}
.fifo-box.inner.back {
    flex-direction: row-reverse;
    justify-content: flex-end;
    padding-left: 50cqh;
    padding-right: inherit;
}

/* animation */
@keyframes highlightPop {
    0% {
        transform: scale(1);
        color: inherit;
    }
    50% {
        transform: scale(1.5);
        color: var(--uu-se-red);
    }
    100% {
        transform: scale(1);
        color: inherit;
    }
}
.highlight-animate {
    animation: highlightPop 1s ease-in-out;
}

@keyframes vanish {
  0% {
    font-size: inherit;
  }
  100% {
    font-size: 0;
  }
}
.vanish {
    animation: vanish 1s forwards;
}

/* RDMA file icon */
.file {
    width: 4rem;
    height: 4rem;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 1s ease;
    display: none;
}

#file0 {
    transform: translateX(20cqw) translateY(14cqw);
    display: inherit;
}

#file1 {
    left: 20cqw;
    top: 14cqw;
}

#file2 {
    left: 20cqw;
    top: 28cqw;
}

#file3 {
    left: 70cqw;
    top: 28cqw;
}

#file4 {
    left: 70cqw;
    top: 14cqw;
}

/* RDMA queue pairs */
.queue-pair {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

#event-sequence {
    display: flex;
    gap: 3rem;
}

/* code */
.code {
    font-family: "Courier New", Courier, monospace;
    background-color: #aaa;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    counter-reset: lineNumber;
}
.code>div {
    line-height: 1.5;
    background-color: #eee;
    counter-increment: lineNumber;
    white-space: pre;
}
.code>div::before {
    white-space: pre;
    content: counter(lineNumber) ":   ";
    color: gray;
}
.code>div.active::before {
    content: counter(lineNumber) ": ▶ ";
}
.comment {
    color: gray;
}

/* programs */
.program .threads {
    flex: 4;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}
.program .threads .thread {
    align-items: center;
}
.program .threads .thread .code {
    flex: 3;
}
.program .threads .thread .buffer {
    flex: 2;
}
.program .memory {
    position: relative;
    container-type: size;
}
.program .memory .bottom {
    top: 80cqh;
}
.program .memory .main {
    display: flex;
    gap: 2rem;
}
.program .memory .top {
    top: 0;
}