@import url('https://fonts.googleapis.com/css2?family=Audiowide&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Squada+One&display=swap');

.marlotron-duo {
    position: relative;
    background: rgb(0, 38, 74);
    color: rgb(255,255,255);
    border-left: 20px solid rgb(0,0,0);
    border-right: 20px solid rgb(0,0,0);
    font-family: "Inter", sans-serif;
    font-weight: 700;
    font-style: normal;
    font-size: 13px;
    text-transform: uppercase;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    width: 700px;
    height: 450px;
    margin: 0 auto;
    display: grid;
    grid-template-rows: 130px 1fr 1fr;
    gap: 0;
}

.marlotron-duo #status {
    position: absolute;
    top: -5px;
    left: 60%;
    width: 250px;
    height: 80px;
    content: "log";
    color: transparent;
    clip-path: polygon(
        /* Top spike */
        50% 0%,
        60% 20%,
        /* Top right spikes */
        75% 0%,
        75% 25%,
        /* Right spike */
        100% 45%,
        75% 25%,
        /* Bottom right spikes */
        85% 65%,
        75% 65%,
        /* Bottom spike */
        60% 100%,
        40% 80%,
        /* Bottom left spikes */
        25% 100%,
        25% 75%,
        /* Left spike */
        0% 50%,
        25% 35%,
        /* Top left spikes */
        15% 5%,
        40% 20%
    );
    z-index: 99;
    transform: rotate(8deg);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: marlotron-status-alert 2s ease-in-out 1;
}

/* Synth Header Styles */
.marlotron-duo #synth-header {
    margin: 0 30px;
    grid-row-start: 1;
    grid-row-end: 2;
    display: grid;
    grid-template-columns: 56% auto;
    gap: 0;
}

.marlotron-duo #synth-header .branding {
    margin-top:40px;
    grid-column-start: 1;
    grid-column-end: 2;
    border-bottom: 2px solid #fff;
}

.marlotron-duo #synth-header .branding .logo {
    position: absolute;
    font-family: "Squada One", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 2.4rem;
    text-transform: uppercase;
}

.marlotron-duo #synth-header .branding .title {
    width: 265px;
    margin-top: 6px;
    font-family: "Audiowide", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 2.75rem;
    text-transform: lowercase;
    letter-spacing: 0.15rem;
    line-height: 0.75;
    text-align: right;
}

.marlotron-duo #synth-header .branding .title::first-letter {
    text-transform: uppercase;
    font-style: italic;
}

.marlotron-duo #synth-header .branding .description {
    width: 265px;
    margin: 2px 0 5px 0;
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.15rem;
    text-align: right;
}

.marlotron-duo #synth-header .speaker {
    grid-column-start: 2;
    grid-column-end: 3;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 30% 100%);
    width: 130%;
    margin: 20px 0 0 -30%;
    background: repeating-linear-gradient(
        -55deg,
        rgb(0, 38, 74),
        rgb(0, 38, 74) 9px,
        rgb(0, 3, 10) 9px,
        rgb(0, 3, 10) 18px
    );
}

.marlotron-duo #synth-header .ribbon-mode-switch {
    position: relative;
}

.marlotron-duo #synth-header .ribbon-mode-switch input[type="radio"],
.marlotron-duo #synth-header .ribbon-mode-switch label {
    position: absolute;
    display: none;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    white-space: nowrap;
    border: 0;
}

.marlotron-duo #synth-header .ribbon-mode-switch .ribbon-mode-button {
    position: absolute;
    top: -12px;
    left: 0px;
    width: 30px;
    height: 12px;
    background: #ff0000;
    border-top-left-radius: 20%;
    border-top-right-radius: 20%;
    border: none;
    cursor: pointer;
    box-shadow: 
        inset 0 1px 2px rgba(0,0,0,0.4),
        0 1px 1px rgba(255,255,255,0.1);
}

.marlotron-duo #synth-header .ribbon-mode-switch .ribbon-mode-button:active {
    box-shadow: 
        inset 0 2px 3px rgba(0,0,0,0.6);
    transform: translateY(1px);
    height: 11px;
}

/* Synth Control Styles */
.marlotron-duo #synth-controls {
    grid-row-start: 2;
    grid-row-end: 3;
    align-items: center;
    display: grid;
    grid-template-rows: 1fr;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 0;
    height: 100%;
    margin: 0 30px;
    border-bottom: 15px solid rgb(0, 20, 45);
}

.marlotron-duo #synth-controls .dial-title {
    font-size: 1.2rem;
}

.marlotron-duo #synth-controls .synth-mode-controls {
    grid-column-start: 1;
    grid-column-end: 2;
    height: 80%;
    align-content: center;
    border-right: 2px solid white;
}

.marlotron-duo #synth-controls .synth-mode-controls .synth-mode-switch {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0px;
    padding: 0px;
    background: #000;
    border-radius: 2px;
    width: 20px;
}

.marlotron-duo #synth-controls .synth-mode-controls .synth-mode-switch input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: none;
    margin: 0;
    cursor: pointer;
    border-radius: 2px;
}

.marlotron-duo #synth-controls .synth-mode-controls .synth-mode-switch input[type="radio"]:checked {
    background: #303030;
    background-image: repeating-linear-gradient(
        0deg,
        #000,
        #000 1px,
        #303030 1px,
        #303030 3px
    );
    box-shadow: 
        inset 0 1px 1px rgba(255,255,255,0.1),
        0 1px 3px rgba(0,0,0,0.3);
}

.marlotron-duo #synth-controls .synth-mode-controls .synth-mode-switch label {
    font-size: 14px;
    position: absolute;
    left: 30px;
    white-space: nowrap;
}

.marlotron-duo #synth-controls .synth-mode-controls .synth-mode-switch label[for="mode-standby"] {
    top: 0px;
}

.marlotron-duo #synth-controls .synth-mode-controls .synth-mode-switch label[for="mode-vco1"] {
    top: 20px;
}

.marlotron-duo #synth-controls .synth-mode-controls .synth-mode-switch label[for="mode-vco1and2"] {
    top: 40px;
}

.marlotron-duo #synth-controls .vco-controls {
    grid-column-start: 2;
    grid-column-end: span 3;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
    gap: 0;
    text-align: center;
}

.marlotron-duo #synth-controls .vco-controls .vco2 {
    position: relative;
}

.marlotron-duo #synth-controls .vco-controls .vco1 {
    height: 80%;
    align-content: center;
    border-right: 2px solid white;
}

.marlotron-duo #synth-controls .vco-controls .xmod {
    background: rgb(244, 207, 105);
    width: 75%;
    margin: 0 12.5%;
}

.marlotron-duo #synth-controls .vco-controls .xmod .dial-title {
    visibility: hidden;
}

.marlotron-duo #synth-controls .vco-controls .xmod .dial-label {
    background: rgb(0, 38, 74);
}

.marlotron-duo #synth-controls .vco-controls .xmod .dial-division {
    left: -13px;
    --c:#000;
}

.marlotron-duo #synth-controls .vco-controls .vco2 {
    height: 100%;
    align-content: center;
    border-right: 2px solid white;
}

.marlotron-duo #synth-controls .vco-controls .vco2 .dial-visual {
    background: linear-gradient(145deg, rgb(200, 200, 200), #616161);
    box-shadow: inset 0 0 4px #616161, inset 0 0 4px #616161;
}

.marlotron-duo #synth-controls .vco-controls .vco2 .dial-indicator {
    background: #000;
}

.marlotron-duo #synth-controls .vco-controls .vco2-glow {
    position: absolute;
    top: 32px;
    left: 28px;
    width: 50px;
    height: 50px;
    background-color: transparent;
    border-radius: 50%;
    transition: all 0.1s ease;
    pointer-events: none;
}

.marlotron-duo #synth-controls .vco-controls .vco2-glow.active {
    background: rgba(255, 0, 0, 0.1);
    box-shadow: 
        0 0 4px #f00,
        0 0 4px #f00,
        0 0 4px #f00;
}

.marlotron-duo #synth-controls .vco-controls .vco2-glow.playing {
    animation: led-pulse var(--pulse-duration) ease-in-out infinite;
}

.marlotron-duo #synth-controls .vcf-controls {
    grid-column-start: 5;
    grid-column-end: span 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 0;
    text-align: center;
}

.marlotron-duo #synth-controls .vcf-controls .dial-title {
    grid-column-start: 1;
    grid-column-end: span 2;
}

.marlotron-duo #synth-controls .dial {
    position: relative;
    width: 100%;
    height: 100%;
}

.marlotron-duo #synth-controls .dial .dial-label {
    padding-top: 3px;
}

.marlotron-duo #synth-controls .dial .dial-input {
    position: absolute;
    opacity: 0;
    display: none;
    cursor: ns-resize;
}

.marlotron-duo #synth-controls .dial .dial-visual {
    width: 50px;
    height: 50px;
    margin: 8px auto 10px auto;
    border-radius: 50%;
    pointer-events: auto;
    cursor: grab;
    background: linear-gradient(145deg, #000, #2b2b2b);
    box-shadow: 
        inset 0 0 4px #000,
        inset 0 0 4px #000;
}

.marlotron-duo #synth-controls .dial .dial-indicator {
    position: absolute;
    top: 10%;
    left: 50%;
    width: 2px;
    height: 20%;
    background: #fff;
    transform: translateX(-50%);
}

.marlotron-duo #synth-controls .dial .dial-division {
    --s:6px;
    --o:1px;
    --c:#fff;
    --w:2px;
    --grad:transparent calc(50% - var(--w)/2), 
          var(--c) calc(50% - var(--w)/2 + 1px) 
                   calc(50% + var(--w)/2 - 1px), 
           transparent calc(50% + var(--w)/2);
    margin: 8px 28px;
    width:50px;
    height:50px;
    border-radius:50%;
    position:absolute;
}

.marlotron-duo #synth-controls .dial .dial-division::before {
    content:"";
    position:absolute;
    z-index: 0;
    top:    calc(-1*var(--s) - var(--o));
    bottom: calc(-1*var(--s) - var(--o));
    left:   calc(-1*var(--s) - var(--o));
    right:  calc(-1*var(--s) - var(--o));
    border-radius:inherit;
    background:
        linear-gradient(0deg   ,var(--grad)),
        linear-gradient(30deg  ,var(--grad)),
        linear-gradient(60deg  ,var(--grad)),
        linear-gradient(90deg  ,var(--grad)),
        linear-gradient(-60deg ,var(--grad)),
        linear-gradient(-30deg  ,var(--grad));
}

.marlotron-duo #synth-controls .dial .dial-division::after {
    content:"";
    position:absolute;
    top:    calc(-1*var(--s) - var(--o));
    bottom: calc(-1*var(--s) - var(--o));
    left:   calc(-1*var(--s) - var(--o));
    right:  calc(-1*var(--s) - var(--o));
    border-radius:inherit;
    background:
        linear-gradient(0deg   ,var(--grad)),
        linear-gradient(30deg  ,var(--grad)),
        linear-gradient(60deg  ,var(--grad)),
        linear-gradient(90deg  ,var(--grad)),
        linear-gradient(-60deg ,var(--grad)),
        linear-gradient(-30deg  ,var(--grad));
}

.marlotron-duo #synth-controls .vco-controls .vco2 .dial-division {
    background: rgba(0, 0, 0, 1);
}

/* Ribbon Controller Styles */
.marlotron-duo #ribbon-controller {
    grid-row-start: 3;
    grid-row-end: 4;
    align-content: center;
    padding: 20px;
}

.marlotron-duo #ribbon-controller .drone-control {
    position: relative;
}

.marlotron-duo #ribbon-controller .drone-control #drone-toggle {
    position: absolute;
    left: 300px;
    z-index: 99;
    color: #fff;
    border: 1px solid #000;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.2s;
    background: linear-gradient(145deg, #000, #2b2b2b);
    box-shadow: inset 0 0 4px #000, inset 0 0 4px #000;
}

.marlotron-duo #ribbon-controller .drone-control #drone-toggle:hover {
    background: linear-gradient(145deg, #ff0000, #ff2525);
}

.marlotron-duo #ribbon-controller .drone-control #drone-toggle.active {
    background: linear-gradient(145deg, #ff0000, #ff2525);
}

.marlotron-duo #ribbon-controller .ribbon-keyboard {
    position: relative;
    width: 550px;
    height: 80px;
    margin: 0 auto;
    background: rgb(0, 20, 45);
    border-radius: 2px;
    padding: 20px 15px 15px 15px;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .keys {
    position: relative;
    height: 100%;
    display: flex;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .key {
    position: relative;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .key.diatonic {
    width: 50px;
    height: 100%;
    background: #fff;
    border: 1px solid #333;
    z-index: 1;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .key.chromatic {
    width: 30px;
    height: 65%;
    background: #000;
    position: absolute;
    z-index: 2;
    top: 0;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .key[data-note="A#3"] {
    left: 35px;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .key[data-note="C#4"] {
    left: 135px;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .key[data-note="D#4"] {
    left: 185px;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .key[data-note="F#4"] {
    left: 285px;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .key[data-note="G#4"] {
    left: 335px;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .key[data-note="A#4"] {
    left: 385px;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .key[data-note="C#5"] {
    left: 485px;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .key.diatonic:hover {
    background: #ddd;
    cursor: pointer;
}

.marlotron-duo #ribbon-controller .ribbon-keyboard .key.chromatic:hover {
    background: #333;
    cursor: pointer;
}

/* Blinking animation when audio is playing */
@keyframes led-pulse {
    0%, 100% {
        background: rgba(165, 165, 165, 0.2);
        box-shadow: none;
    }
    50% {
        background: rgba(255, 0, 0, 0.2);
        box-shadow: 
            0 0 4px #f00,
            0 0 4px #f00,
            0 0 4px #f00;
    }
}

@keyframes marlotron-status-alert {
    0%, 100% {
        background: rgba(244, 207, 105, 0);
        color: rgba(0, 0, 0, 0);
    }
    5% {
        background: rgba(244, 207, 105, 0.9);
        color: rgba(0, 0, 0, 1);
    }
}