@keyframes hueShift {
    0% {
        --hue-offset: 0;
    }
    50% {
        --hue-offset: 180;
    }
    100% {
        --hue-offset: 0;
    }
}

@keyframes colorShift {
    0% {
        color: var(--color1);
    }
    25% {
        color: var(--color2);
    }
    50% {
        color: var(--color3);
    }
    75% {
        color: var(--color4);
    }
    100% {
        color: var(--color1);
    }
}

@keyframes triangle-lift {
    0% {
        transform: scale(1);
        filter: drop-shadow(0px 0px 0px rgba(32,32,32,0));
    }
    10%, 70% {
        transform: scale(1.2);
        filter: drop-shadow(10px 10px 10px #222);
    }
    90%, 100% {
        transform: scale(1);
        filter: drop-shadow(0px 0px 0px rgba(32,32,32,0));
    }
}

@keyframes triangle-rotate120 {
    
    0%, 10% {
        transform: rotate(0deg);
        animation-timing-function: ease-in-out;
    }
    60% {
        transform: rotate(120deg);
        animation-timing-function: ease-in-out;
    }
    70%, 100% {
        transform: rotate(120deg);        
    }
}

@keyframes triangle-rotate240 {
    
    0%, 10% {
        transform: rotate(0deg);
        animation-timing-function: ease-in-out;
    }
    60% {
        transform: rotate(240deg);
        animation-timing-function: ease-in-out;
    }
    70%, 100% {
        transform: rotate(240deg);        
    }
}

@keyframes triangle-reflect{
    
    0%, 10% {
        transform: scale(1, 1);
        animation-timing-function: cubic-bezier(0.445, 0.050, 0.550, 0.950);
    }
    60% {
        transform: scale(-1, 1);
        animation-timing-function: cubic-bezier(0.445, 0.050, 0.550, 0.950);
    }
    70%, 100% {
        transform: scale(-1, 1);
    }
}

@keyframes triangle-reflectRotate120{
    
    0%, 10% {
        transform: scale(1, 1) rotate(0deg);
        animation-timing-function: cubic-bezier(0.445, 0.050, 0.550, 0.950);
    }
    60% {
        transform: scale(-1, 1) rotate(120deg);
        animation-timing-function: cubic-bezier(0.445, 0.050, 0.550, 0.950);
    }
    70%, 100% {
        transform: scale(-1, 1) rotate(120deg);
    }
}

@keyframes triangle-reflectRotate240{
    
    0%, 10% {
        transform: scale(1, 1) rotate(0deg);
        animation-timing-function: cubic-bezier(0.445, 0.050, 0.550, 0.950);
    }
    60% {
        transform: scale(-1, 1) rotate(-120deg);
        animation-timing-function: cubic-bezier(0.445, 0.050, 0.550, 0.950);
    }
    70%, 100% {
        transform: scale(-1, 1) rotate(-120deg);
    }
}

@keyframes pulse {
    0% {
        filter: drop-shadow(0 0 0px #f0e442);
    }
    10% {
        filter: drop-shadow(0 0 10px #f0e442);
    }
    20%, 100% {
        filter: drop-shadow(0 0 0px #f0e442);
    }
}

@property --hue-offset {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

:root {
    --lightness: 50%;
    --chroma: 0.4;
    
    /* --color1: oklch(70% 0.35 100);
    --color2: oklch(60% 0.30 150);
    --color3: oklch(80% 0.25 200);
    --color4: oklch(60% 0.20 250);
    --color5: oklch(50% 0.25 300); */

    /* https://davidmathlogic.com/colorblind/#%23DFD072-%23E87DE8-%23E36400-%231078B9-%2329A38D */

    --color0: oklch(85.031% 0 calc(var(--hue-offset) + 100.402));
    --color0-dark: oklch(22% 0 calc(var(--hue-offset) + 100.402));
    --color0-light: oklch(90% 0 calc(var(--hue-offset) + 100.402));
    --color1: oklch(85.031% 0.11661 calc(var(--hue-offset) + 100.402));
    --color1-mid: oklch(72.5% 0.11661 calc(var(--hue-offset) + 100.402));
    --color1-dark: oklch(22% 0.11661 calc(var(--hue-offset) + 100.402));
    --color1-light: oklch(90% 0.11661 calc(var(--hue-offset) + 100.402));
    --color2: oklch(64.508% 0.1088 calc(var(--hue-offset) + 177.536));
    --color2-dark: oklch(24% 0.1088 calc(var(--hue-offset) + 177.536));
    --color2-light: oklch(80% 0.1088 calc(var(--hue-offset) + 177.536));
    --color3: oklch(55.21% 0.132 calc(var(--hue-offset) + 244.306));
    --color3-dark: oklch(14% 0.132 calc(var(--hue-offset) + 244.306));
    --color3-light: oklch(70% 0.132 calc(var(--hue-offset) + 244.306));
    --color4: oklch(74.514% 0.18518 calc(var(--hue-offset) + 327.213));
    --color4-dark: oklch(21% 0.18518 calc(var(--hue-offset) + 327.213));
    --color4-light: oklch(80% 0.18518 calc(var(--hue-offset) + 327.213));
    --color5: oklch(65.08% 0.17929 calc(var(--hue-offset) + 47.238));
    --color5-dark: oklch(18% 0.17929 calc(var(--hue-offset) + 47.238));
    --color5-light: oklch(80% 0.17929 calc(var(--hue-offset) + 47.238));

    --hue-offset: 0;
    /* animation: hueShift ease-in-out 4s infinite; */
/* 
    --color1: oklch(35% 0.1 calc(var(--hue-offset) + 0));
    --color2: oklch(40% 0.15 calc(var(--hue-offset) + 30));
    --color3: oklch(48% 0.05 calc(var(--hue-offset) + 60));
    --color4: oklch(60% 0.2 calc(var(--hue-offset) + 90));
    --color5: oklch(70% 0.05 calc(var(--hue-offset) + 100));

    --color1-dark: oklch(20% 0.05 calc(var(--hue-offset) + 0));
    --color2-dark: oklch(25% 0.1 calc(var(--hue-offset) + 30));
    --color3-dark: oklch(30% 0.05 calc(var(--hue-offset) + 60));
    --color4-dark: oklch(32.5% 0.1 calc(var(--hue-offset) + 90));
    --color5-dark: oklch(35% 0.1 calc(var(--hue-offset) + 100));

    --color1-light: oklch(45% 0.1 calc(var(--hue-offset) + 0));
    --color2-light: oklch(65% 0.1 calc(var(--hue-offset) + 30));
    --color3-light: oklch(75% 0.05 calc(var(--hue-offset) + 60));
    --color4-light: oklch(85% 0.1 calc(var(--hue-offset) + 90));
    --color5-light: oklch(95% 0.05 calc(var(--hue-offset) + 100)); */

    --bg-color: #444;
}

.in-cycle {
    stroke-dasharray: 0,15;
}

line.outline[data-id='-1'] {
    stroke: var(--color2-dark);
}

.center-lines>line[data-id] {
    stroke-width: 5;
}

.lines>.duad>.line>.duad-line.in-cycle {
    stroke-dasharray: 0,15;
}

.background-path {
    fill: var(--bg-color);
}

.bgLine {
    fill:none;
}

.duad-line {
    stroke-width: 10;
    fill: none;
    stroke-linecap: round;
}

.mystic-line {
    stroke-width: 10;
    fill: none;
    stroke-linecap: round;
}

*[data-id] {
    stroke-linecap: round;
}

*[data-id='1'] { stroke: var(--color1); color: var(--color1);}
*[data-id='2'] { stroke: var(--color2); color: var(--color2);}
*[data-id='3'] { stroke: var(--color3); color: var(--color3);}
*[data-id='4'] { stroke: var(--color4); color: var(--color4);}
*[data-id='5'] { stroke: var(--color5); color: var(--color5);}

/* .mystic-line[data-id='1'] { stroke: var(--color1); }
.mystic-line[data-id='2'] { stroke: var(--color2); }
.mystic-line[data-id='3'] { stroke: var(--color3); }
.mystic-line[data-id='4'] { stroke: var(--color4); }
.mystic-line[data-id='5'] { stroke: var(--color5); } */

.outline {
    fill: none;
    stroke-width: 20;
}

.outline[data-id='1'] { stroke: var(--color1-dark); }
.outline[data-id='2'] { stroke: var(--color2-dark); }
.outline[data-id='3'] { stroke: var(--color3-dark); }
.outline[data-id='4'] { stroke: var(--color4-dark); }
.outline[data-id='5'] { stroke: var(--color5-dark); }

.node {
    cursor: pointer;
}

.node-0 .node-syntheme-line { stroke: var(--color1-light); }
.node-1 .node-syntheme-line { stroke: var(--color2-light); }
.node-2 .node-syntheme-line { stroke: var(--color3-light); }
.node-3 .node-syntheme-line { stroke: var(--color4-light); }
.node-4 .node-syntheme-line { stroke: var(--color5-light); }

.node>.syntheme>.duad>path {
    stroke-width: 0.2;
}

#background-layer>.outline {
    stroke-width: 2.5;
    fill: none;
}

body {
    font-family: "Helvetica Neue", Helvetica, sans-serif;
    background-color: var(--bg-color);
    margin: 0 auto 4em auto;
    tab-size: 2;
    -webkit-text-size-adjust: none;
    color: #ddd;
    font-size: 1.2rem;
  }

p, li {
    line-height: 1.6rem;
}

a {
    color: var(--color4);
    text-decoration: none;
}

.column {
    max-width: 960px;
    position: relative;
    display: block;
    margin: 0 auto;
    padding: 0 10px;
}

h1 {
    font-size: 46px;
    font-weight: 500;
    letter-spacing: -1px;
    margin: 0.1em 0;
    color: var(--color1);
} 

h2 {
    margin-top: 2em;
    color: var(--color2);
}
  
h1, h2, p {
    text-rendering: optimizeLegibility;
}

h2.subhead {
    margin-top: 0.5rem;
    color: var(--color1-mid);
}

figure {
    display: flex;
    flex-flow: column;
    margin:auto;
}

figure> * > svg {
    display: block;
    margin: auto;
    max-height: min(90vh, 90vw);
}

figcaption {
    /* background-color: #222; */
    color: #999;
    font-style: italic;
    text-align: center;
    padding: .5rem;
}

#main {
    max-height: 100vh;
    display: block;
    margin: auto;
}

.selected {
    stroke: #fff;
    stroke-width: 2.5;
}

.selected.glow {
    filter: drop-shadow(0 0 5px #fff);
}

.foreground-star .outline.highlight {
    animation: pulse ease-in-out 4s infinite;
}

.background-star .outline.highlight {
    animation: 4s pulse ease-in-out 1s infinite;
}

.node.highlight {
    animation: 4s pulse ease-in-out 2s infinite;
}

.center {
    margin:auto;
    display:block;
}


.star-label {
    text-anchor: middle;
    font-size: 35px;
    dominant-baseline: central;
    cursor: pointer;
    stroke: none;
}

.mystic-star-label {
    text-anchor: middle;
    font-size: 30px;
    dominant-baseline: central;
    cursor: pointer;
    stroke: none;
}

.pentad-label {
    text-anchor: middle;
    font-size: 40px;
    dominant-baseline: central;
    transform: translate(0,-150px);
    stroke: none;
    fill: #333;
}

.syntheme-label {
    text-anchor: middle;
    font-size: 40px;
    dominant-baseline: central;
    stroke: none;
}

text.duad {
    text-anchor: middle;
    font-size: 25px;
    dominant-baseline: central;
}

.permutation-node {
    cursor: pointer;
}

.permutation-node>text {
    stroke: none;
}

.node>.syntheme>.duad>.arc>path {
    fill: none;
    stroke-width: 2.5;
}

.pentad>.syntheme {
    cursor: pointer;
}

.pentad>.syntheme.selected>*>rect.border {
    stroke: white;
}

.pentad>.syntheme>*>.duad {
    stroke: none;
}

figure>.shadowbox {
    filter: drop-shadow(1px 1px 3px #333);

}

svg {
    border: 1px solid var(--bg-color);
    background: var(--bg-color);
}

.table-3-col {
    display: grid;         
    grid-template-columns: 1fr 1fr 1fr;
    font-size: 2rem; 
    margin: auto; 
    max-width: 80%;
    gap: 1rem;
}

.table-3-col.responsive{
    @media screen and (max-aspect-ratio: 1/1) {
        grid-template-columns: 1fr 1fr;
        font-size: 1.3rem;   
    }

}


.table-3-col>div {
    text-align: center;
}

.triangle-group.animated {
    animation: triangle-lift ease-in-out 2s infinite;
}

.triangle.rotate120 {
    animation: triangle-rotate120 ease-in-out 2s infinite;
}

.triangle.rotate240 {
    animation: triangle-rotate240 ease-in-out 2s infinite;
}

.triangle.reflect {
    animation: triangle-reflect ease-in-out 2s infinite;
}

.triangle.reflectRotate120 {
    animation: triangle-reflectRotate120 ease-in-out 2s infinite;
}

.triangle.reflectRotate240 {
    animation: triangle-reflectRotate240 ease-in-out 2s infinite;
}

highlight {
    color: var(--color5-light);
}

highlight.animated {
    animation: colorShift linear 3s infinite;
}

.thanks {
    text-align: center;
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: -1rem;
    color: #aaa;
}

.coffee {  
    margin-top: 2rem;
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    gap: 20px;
}