:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --accent-primary: #ff00ff;
    --accent-secondary: #00ffff;
    --accent-success: #00ff88;
    --accent-danger: #ff0066;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --border-color: #222222;
    --glow-primary: rgba(255, 0, 255, 0.4);
    --glow-secondary: rgba(0, 255, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Animated Background */
.bg-graphics {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-graphics::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
            radial-gradient(circle at 30% 20%, rgba(255, 0, 255, 0.15) 0%, transparent 50%),
            radial-gradient(circle at 70% 80%, rgba(0, 255, 255, 0.15) 0%, transparent 50%);
    animation: pulseGlow 8s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.wave-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
    transparent 0%,
    var(--accent-primary) 50%,
    transparent 100%);
    opacity: 0.3;
    animation: waveScan 6s linear infinite;
}

.wave-line:nth-child(1) { top: 20%; animation-delay: 0s; }
.wave-line:nth-child(2) { top: 50%; animation-delay: 2s; }
.wave-line:nth-child(3) { top: 80%; animation-delay: 4s; }

@keyframes waveScan {
    0%   { transform: translateY(-100vh); opacity: 0; }
    10%  { opacity: 0.3; }
    90%  { opacity: 0.3; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.6s ease both;
}

header h1 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px var(--glow-primary));
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 20px var(--glow-primary)); }
    50%       { filter: drop-shadow(0 0 40px var(--glow-secondary)); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* nav bar*/
nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--accent-secondary);
    animation: fadeIn 0.7s ease 0.1s both;
}

nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;          /* sit on top of nav border-bottom */
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.25s ease;
    position: relative;
}

nav a:hover {
    color: var(--accent-secondary);
    border-bottom-color: var(--accent-secondary);
    text-shadow: 0 0 12px var(--glow-secondary);
}

nav a.active {
    color: var(--accent-secondary);
    background: rgba(0, 255, 255, 0.06);
    border-left:  2px solid var(--accent-secondary);
    border-right: 2px solid var(--accent-secondary);
    border-bottom: 2px solid var(--bg-primary);
    box-shadow:
            -4px 0 12px rgba(0, 255, 255, 0.15),
            4px 0 12px rgba(0, 255, 255, 0.15);
    text-shadow: 0 0 14px var(--glow-secondary);
}

/* Select label*/
label {
    display: block;
    margin-top: 1.2rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

/* Select containers */
.select-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.select-wrapper label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    margin: 0;
}

.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    background-color: var(--bg-secondary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300ffff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
}

.select-wrapper select:hover {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 12px var(--glow-secondary);
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 16px var(--glow-primary);
}

/* highlight the selected option text in cyan */
.select-wrapper select option:checked {
    background: var(--bg-tertiary);
    color: var(--accent-secondary);
}

.select-wrapper select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.4rem;
}

.select-wrapper select option:disabled {
    color: var(--accent-success);
    font-weight: 700;
    letter-spacing: 0.1em;
}

option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.option-break {
    background: var(--bg-secondary);
    color: var(--accent-success);
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: default;
}

/* button */
button {
    margin: 0.8rem 0;
    padding: 0.7rem 1.8rem;
    border: 2px solid var(--accent-primary);
    border-radius: 8px;
    background: transparent;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,0,255,0.15), transparent);
    transition: left 0.4s ease;
}

button:hover::before { left: 100%; }

button:hover {
    background: rgba(255, 0, 255, 0.1);
    box-shadow: 0 0 20px var(--glow-primary);
    transform: translateY(-2px);
}

button:active { transform: translateY(0); }

/* output div */
#result {
    margin: 1rem 0;
    padding: 0.8rem 1.2rem;
    border-left: 3px solid var(--accent-secondary);
    background: rgba(0, 255, 255, 0.04);
    border-radius: 0 8px 8px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--accent-success);
    letter-spacing: 0.05em;
    min-height: 2.5rem;
    animation: fadeIn 0.4s ease;
}

/* ── Piano ── */
.piano-container {
    margin: 3rem 0;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.piano-wrapper {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.piano {
    list-style-type: none;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2px;
    padding: 0;
    min-width: max-content;
}

.key {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.white-key {
    display: block;
    width: 50px;
    height: 200px;
    background: linear-gradient(180deg, #fefefe 0%, #e8e8e8 100%);
    border: 2px solid #000;
    border-radius: 0 0 8px 8px;
    box-shadow:
            0 4px 8px rgba(0,0,0,0.4),
            inset 0 -8px 8px rgba(0,0,0,0.1),
            inset 0 1px 0 rgba(255,255,255,0.9);
    transition: all 0.1s ease;
    position: relative;
}

.white-key:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
    box-shadow:
            0 2px 4px rgba(0,0,0,0.4),
            inset 0 -8px 8px rgba(0,0,0,0.15),
            0 0 20px var(--glow-secondary);
}

.white-key:active,
.white-key.active {
    transform: translateY(4px);
    height: 196px;
    box-shadow:
            inset 0 4px 8px rgba(0,0,0,0.3),
            0 0 30px var(--accent-secondary);
    background: linear-gradient(180deg, #e0e0e0 0%, #d0d0d0 100%);
}

.white-key.active-note {
    background: yellow !important;
    box-shadow:
            0 4px 8px rgba(0,0,0,0.4),
            0 0 16px var(--glow-secondary);
}

.black-key {
    display: block;
    width: 32px;
    height: 120px;
    background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
    border: 2px solid #000;
    border-radius: 0 0 6px 6px;
    box-shadow:
            0 6px 12px rgba(0,0,0,0.8),
            inset 0 -4px 4px rgba(0,0,0,0.5),
            inset 0 1px 0 rgba(255,255,255,0.1);
    position: absolute;
    top: 0;
    right: -16px;
    z-index: 10;
    transition: all 0.1s ease;
}

.black-key:hover {
    background: linear-gradient(180deg, #2a2a2a 0%, #0a0a0a 100%);
    box-shadow:
            0 4px 8px rgba(0,0,0,0.8),
            inset 0 -4px 4px rgba(0,0,0,0.5),
            0 0 20px var(--glow-primary);
}

.black-key:active,
.black-key.active {
    transform: translateY(4px);
    height: 116px;
    box-shadow:
            inset 0 4px 8px rgba(0,0,0,0.9),
            0 0 30px var(--accent-primary);
}

.black-key.active-note {
    background: yellow !important;
    box-shadow:
            0 6px 12px rgba(0,0,0,0.8),
            0 0 16px var(--glow-secondary);
}

footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid transparent;
    transition: all 0.25s ease;
}

.social-links a:hover {
    color: var(--accent-secondary);
    border-bottom-color: var(--accent-secondary);
    text-shadow: 0 0 10px var(--glow-secondary);
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 38vh;
    padding: 3rem 0 2rem;
    animation: fadeInDown 0.7s ease both;
}

.hero-eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--accent-primary);
    text-shadow: 0 0 12px var(--glow-primary);
    margin-bottom: 0.8rem;
}

.hero h1 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2.8rem, 8vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite;
    margin-bottom: 1rem;
}

.hero-sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.8;
    letter-spacing: 0.02em;
}

.hero-sub span {
    color: var(--accent-secondary);
}

/* Card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
    margin: 2.5rem 0;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.6rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.card:hover::before { transform: scaleX(1); }

.card:hover {
    border-color: var(--accent-secondary);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 255, 255, 0.12);
    background: var(--bg-tertiary);
}

.card-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.card-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.7;
    letter-spacing: 0.02em;
}

.card-arrow {
    margin-top: auto;
    padding-top: 0.8rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-secondary);
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.25s ease;
}

.card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.card.featured {
    border-color: rgba(255, 0, 255, 0.4);
    background: linear-gradient(135deg, rgba(255,0,255,0.06) 0%, rgba(0,255,255,0.04) 100%);
}

.card.featured:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 12px 32px rgba(255, 0, 255, 0.15);
}

.card.featured .card-arrow { color: var(--accent-primary); }

.section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--text-secondary);
    margin: 2.5rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .piano { gap: 1px; }
    .white-key { width: 45px; height: 180px; }
    .white-key:active, .white-key.active { height: 176px; }
    .black-key { width: 28px; height: 110px; right: -14px; }
    .black-key:active, .black-key.active { height: 106px; }
}

@media (max-width: 768px) {
    .container { padding: 1rem; }
    nav { gap: 0; }
    nav a { font-size: 0.7rem; padding: 0.4rem 0.7rem; }
    .piano { gap: 0; }
    .white-key { width: 35px; height: 150px; }
    .white-key:active, .white-key.active { height: 146px; }
    .black-key { width: 24px; height: 90px; right: -12px; }
    .black-key:active, .black-key.active { height: 86px; }
}

@media (max-width: 480px) {
    .white-key { width: 28px; height: 120px; }
    .white-key:active, .white-key.active { height: 116px; }
    .black-key { width: 18px; height: 72px; right: -9px; }
    .black-key:active, .black-key.active { height: 68px; }
}