/* --------------------------------------------------
   1. Design Tokens & Core Setup
-------------------------------------------------- */
:root {
    --bg-primary: #07080b;
    --bg-secondary: #0e1118;
    --bg-tertiary: #161a24;
    --accent-cyan: #00ffea;
    --accent-blue: #0072ff;
    --accent-purple: #9b51e0;
    --accent-green: #39ff14;
    --accent-red: #ff3366;
    --accent-yellow: #ffb800;
    --accent-gradient: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
    
    --text-primary: #f5f6f8;
    --text-secondary: #a0aec0;
    --text-muted: #6272a4;
    
    --border-color: rgba(0, 255, 234, 0.1);
    --border-glow: 0 0 12px rgba(0, 255, 234, 0.2);
    --glow-cyan: 0 0 20px rgba(0, 255, 234, 0.4);
    --glow-green: 0 0 20px rgba(57, 255, 20, 0.4);
    --glow-red: 0 0 20px rgba(255, 51, 102, 0.4);
    
    --font-sans: 'Inter', 'IBM Plex Sans Thai', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition-speed: 0.3s;
}

/* --------------------------------------------------
   Light Theme Override Variables & Classes
-------------------------------------------------- */
body.light-theme {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e4e8f0;
    --accent-cyan: #0088cc;
    --accent-blue: #0055ff;
    --accent-purple: #7b2cbf;
    --accent-green: #00aa00;
    --accent-red: #d90429;
    --accent-yellow: #f77f00;
    --accent-gradient: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
    
    --text-primary: #1a1e26;
    --text-secondary: #5e697a;
    --text-muted: #8d9bb0;
    
    --border-color: rgba(0, 136, 204, 0.15);
    --border-glow: 0 0 12px rgba(0, 136, 204, 0.1);
    --glow-cyan: 0 0 20px rgba(0, 136, 204, 0.2);
    --glow-green: 0 0 20px rgba(0, 170, 0, 0.15);
    --glow-red: 0 0 20px rgba(217, 4, 41, 0.15);
}

body.light-theme .tech-grid {
    background-image: 
        linear-gradient(rgba(0, 136, 204, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 136, 204, 0.04) 1px, transparent 1px);
}

body.light-theme .glow-bg-1 {
    background: radial-gradient(circle, rgba(0, 85, 255, 0.05) 0%, transparent 70%);
}

body.light-theme .glow-bg-2 {
    background: radial-gradient(circle, rgba(0, 136, 204, 0.04) 0%, transparent 70%);
}

body.light-theme .toggle-item,
body.light-theme .skill-badge,
body.light-theme .tech-tag,
body.light-theme .interest-item {
    background: rgba(240, 242, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.03);
}

body.light-theme .timeline-content {
    background: var(--bg-secondary);
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .timeline-content::before {
    background: var(--bg-secondary);
    border-left-color: rgba(0, 0, 0, 0.04);
    border-bottom-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .timeline-content:hover::before {
    border-left-color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

body.light-theme .btn-secondary {
    background: rgba(255, 255, 255, 0.8);
}

body.light-theme .contact-card-item {
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .slider {
    background-color: var(--bg-tertiary);
    border-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .slider:before {
    background-color: var(--text-secondary);
}

body.light-theme input:checked + .slider {
    background-color: rgba(0, 136, 204, 0.1);
}

body.light-theme .avatar-img-placeholder {
    background: #e4e8f0;
    border-color: var(--bg-tertiary);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.15);
}

body.light-theme .binary-stream {
    color: rgba(0, 136, 204, 0.18);
}

body.light-theme .avatar-img {
    mix-blend-mode: normal;
    opacity: 1;
}

body.light-theme .telemetry-card {
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .telemetry-graph-container {
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .contact-form-container {
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .hero-name-en {
    background: linear-gradient(180deg, #1a1e26 0%, #5e697a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .hero-info-grid {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 136, 204, 0.1);
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.05);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
    box-shadow: var(--border-glow);
}

/* --------------------------------------------------
   2. Background Decorations (Grid & Ambient Glow)
-------------------------------------------------- */
.tech-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 234, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 234, 0.015) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -3;
    pointer-events: none;
}

.glow-bg-1 {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(0, 114, 255, 0.08) 0%, transparent 70%);
    z-index: -2;
    pointer-events: none;
    filter: blur(80px);
}

.glow-bg-2 {
    position: fixed;
    bottom: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(0, 255, 234, 0.06) 0%, transparent 70%);
    z-index: -2;
    pointer-events: none;
    filter: blur(80px);
}

/* --------------------------------------------------
   3. Typography & Utility Classes
-------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all var(--transition-speed) ease;
}

.text-accent {
    color: var(--accent-cyan);
    text-shadow: var(--border-glow);
}

.text-green { color: var(--accent-green); text-shadow: 0 0 8px rgba(57, 255, 20, 0.2); }
.text-red { color: var(--accent-red); text-shadow: 0 0 8px rgba(255, 51, 102, 0.2); }
.text-yellow { color: var(--accent-yellow); text-shadow: 0 0 8px rgba(255, 184, 0, 0.2); }
.text-white { color: #ffffff; }
.text-orange { color: #f05032; }

/* Buttons styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 255, 234, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 234, 0.45);
}

.btn-secondary {
    background: rgba(22, 26, 36, 0.6);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(0, 255, 234, 0.08);
    border-color: var(--accent-cyan);
    box-shadow: var(--border-glow);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Sections */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-header {
    margin-bottom: 48px;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 8px;
    font-family: var(--font-sans);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* --------------------------------------------------
   4. Navbar Styling
-------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(7, 8, 11, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 100;
    transition: all var(--transition-speed) ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
}

.logo-bracket {
    color: var(--accent-cyan);
    text-shadow: var(--border-glow);
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 4px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-cyan);
    text-shadow: var(--border-glow);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-cyan);
    transition: width var(--transition-speed) ease;
    box-shadow: var(--border-glow);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.theme-toggle-btn:hover {
    color: var(--accent-cyan);
    background: rgba(0, 255, 234, 0.08);
    box-shadow: var(--border-glow);
    transform: rotate(15deg) scale(1.1);
}

body.light-theme .theme-toggle-btn:hover {
    color: var(--accent-cyan);
    background: rgba(0, 136, 204, 0.08);
    box-shadow: var(--border-glow);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* --------------------------------------------------
   5. Hero Section
-------------------------------------------------- */
.hero-section {
    padding: 140px 0 80px 0;
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 48px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 234, 0.08);
    border: 1px solid var(--border-color);
    color: var(--accent-cyan);
    padding: 6px 14px;
    border-radius: 30px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 24px;
    text-shadow: var(--border-glow);
    box-shadow: inset var(--border-glow);
}

.hero-name-en {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
    background: linear-gradient(180deg, #ffffff 0%, #a0aec0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-name-th {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
    background: rgba(22, 26, 36, 0.4);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
}

.info-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.hero-bio {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 600px;
}

.hero-cta {
    display: flex;
    gap: 16px;
}

/* Avatar / Visual */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-container {
    position: relative;
    width: 280px;
    height: 280px;
}

.neon-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    box-shadow: var(--glow-cyan), inset var(--glow-cyan);
    animation: rotateRing 8s linear infinite;
}

.neon-ring-outer {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 1px dashed rgba(0, 114, 255, 0.4);
    border-radius: 50%;
    animation: rotateRingOpposite 16s linear infinite;
}

.avatar-img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 3px solid var(--bg-tertiary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    opacity: 1;
    mix-blend-mode: normal;
    filter: drop-shadow(var(--border-glow));
}

.binary-stream {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(0, 255, 234, 0.15);
    white-space: pre;
    line-height: 1.1;
    overflow: hidden;
    padding: 10px;
    user-select: none;
    z-index: 1;
}

/* Animations */
@keyframes rotateRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotateRingOpposite {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

/* --------------------------------------------------
   6. Education Section (Timeline)
-------------------------------------------------- */
.education-section {
    padding: 100px 0;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 40px auto 0 auto;
}

.timeline-line {
    position: absolute;
    left: 31px;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-cyan) 0%, rgba(22, 26, 36, 0.2) 100%);
    box-shadow: var(--border-glow);
}

.timeline-item {
    position: relative;
    padding-left: 80px;
    margin-bottom: 48px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: 12px;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    box-shadow: var(--border-glow);
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-item.current .timeline-marker {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    box-shadow: var(--glow-cyan);
}

.timeline-content {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 24px 30px;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateX(6px);
    border-color: var(--accent-cyan);
    box-shadow: 0 4px 20px rgba(0, 255, 234, 0.05);
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 14px;
    width: 14px;
    height: 14px;
    background: var(--bg-secondary);
    border-left: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transform: rotate(45deg);
    transition: all 0.3s ease;
}

.timeline-content:hover::before {
    border-left-color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

.timeline-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    background: rgba(57, 255, 20, 0.1);
    color: var(--accent-green);
    margin-bottom: 12px;
}

.badge-gray {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.education-title {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.education-meta {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.education-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --------------------------------------------------
   7. Skills Section
-------------------------------------------------- */
.skills-section {
    padding: 100px 0;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    margin-top: 40px;
}

.skill-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 36px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.skill-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: var(--accent-cyan);
    transition: height 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
    box-shadow: 0 10px 30px rgba(0, 255, 234, 0.03);
}

.skill-card:hover::after {
    height: 100%;
}

.wide-card {
    grid-column: 1 / -1;
}

.card-icon {
    font-size: 2rem;
    color: var(--accent-cyan);
    margin-bottom: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 234, 0.05);
    border-radius: 12px;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Skill Badges & Progress */
.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.skill-badge {
    width: 100%;
    background: rgba(22, 26, 36, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 18px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.badge-lang {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-cyan);
}

.skill-progress-bar {
    width: 150px;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    box-shadow: var(--border-glow);
}

.tech-tag {
    background: rgba(22, 26, 36, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 8px 16px;
    border-radius: 30px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.tech-tag:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 255, 234, 0.05);
    transform: scale(1.05);
}

/* Interests Grid (Wide Card Content) */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.interest-item {
    background: rgba(7, 8, 11, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.02);
    padding: 20px;
    border-radius: 10px;
}

.interest-item h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.interest-item p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* --------------------------------------------------
   8. Interactive Tuning Lab
-------------------------------------------------- */
.tuning-section {
    padding: 100px 0;
}

.tuning-dashboard {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 30px;
    margin-top: 40px;
}

.dashboard-controls {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.dashboard-controls h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--accent-cyan);
}

.control-note {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 30px;
    line-height: 1.5;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: auto;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(7, 8, 11, 0.4);
    padding: 16px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: border-color var(--transition-speed);
}

.toggle-item:hover {
    border-color: rgba(0, 255, 234, 0.15);
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 80%;
}

.toggle-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.toggle-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Custom Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: .3s;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(0, 255, 234, 0.15);
    border-color: var(--accent-cyan);
    box-shadow: var(--border-glow);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background-color: var(--accent-cyan);
    box-shadow: var(--border-glow);
}

.dashboard-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
}

/* Telemetry Output */
.dashboard-telemetry {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.telemetry-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.telemetry-label {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.telemetry-value-container {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.telemetry-value {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    transition: color 0.3s ease;
}

.telemetry-unit {
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.telemetry-trend {
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Canvas Graph Styles */
.telemetry-graph-container {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.graph-title {
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.graph-status {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.pulsating-red {
    background-color: var(--accent-red);
    box-shadow: var(--glow-red);
    animation: pulseRed 1.5s infinite;
}

.pulsating-green {
    background-color: var(--accent-green);
    box-shadow: var(--glow-green);
    animation: pulseGreen 1.5s infinite;
}

@keyframes pulseRed {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 10px rgba(255, 51, 102, 0.7); }
    100% { transform: scale(0.9); opacity: 0.7; }
}

@keyframes pulseGreen {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 10px rgba(57, 255, 20, 0.7); }
    100% { transform: scale(0.9); opacity: 0.7; }
}

.graph-canvas-wrapper {
    width: 100%;
    height: 180px;
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

#telemetry-graph {
    width: 100%;
    height: 100%;
    display: block;
}

/* --------------------------------------------------
   9. Contact Section
-------------------------------------------------- */
.contact-section {
    padding: 100px 0;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 50px;
    margin-top: 40px;
}

.contact-info {
    display: flex;
    flex-direction: column;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #ffffff 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-intro {
    color: var(--text-secondary);
    font-size: 0.98rem;
    margin-bottom: 40px;
    line-height: 1.6;
}

.contact-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-card-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 20px 24px;
    border-radius: 12px;
}

.contact-card-item:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 4px 20px rgba(0, 255, 234, 0.05);
    transform: translateY(-2px);
}

.contact-icon-box {
    width: 50px;
    height: 50px;
    background: rgba(0, 255, 234, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    font-size: 1.3rem;
    transition: all var(--transition-speed);
}

.contact-card-item:hover .contact-icon-box {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    box-shadow: var(--glow-cyan);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-label {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
}

.contact-value {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
}

/* Contact Form */
.contact-form-container {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.form-group {
    position: relative;
    width: 100%;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 0;
    background: none;
    border: none;
    border-bottom: 2px solid var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition-speed);
}

.form-group textarea {
    resize: none;
}

.form-group label {
    position: absolute;
    left: 0;
    top: 12px;
    color: var(--text-muted);
    pointer-events: none;
    transition: all var(--transition-speed) ease;
    font-size: 0.95rem;
}

/* Floating label effect */
.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
    top: -18px;
    font-size: 0.8rem;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

.focus-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-cyan);
    box-shadow: var(--border-glow);
    transition: width 0.4s ease;
}

.form-group input:focus ~ .focus-line,
.form-group textarea:focus ~ .focus-line {
    width: 100%;
}

.form-group input:focus, .form-group textarea:focus {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.btn-submit {
    align-self: flex-start;
    padding: 14px 32px;
}

/* --------------------------------------------------
   10. Toast Notification System & Footer
-------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.toast {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-cyan);
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    transform: translateX(120%);
    animation: slideInToast 0.3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-success {
    border-left-color: var(--accent-green);
}

.toast-icon {
    font-size: 1.1rem;
}

.toast-success .toast-icon {
    color: var(--accent-green);
}

@keyframes slideInToast {
    to { transform: translateX(0); }
}

.toast.fade-out {
    animation: fadeOutToast 0.4s forwards ease-in;
}

@keyframes fadeOutToast {
    to { transform: translateY(20px); opacity: 0; }
}

/* Footer */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    background-color: var(--bg-primary);
    padding: 40px 0;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-subtext {
    font-family: var(--font-mono);
    font-size: 0.75rem !important;
    color: var(--text-muted);
    margin-top: 4px;
}

.back-to-top {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1rem;
}

.back-to-top:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: var(--border-glow);
    transform: translateY(-4px);
}

/* --------------------------------------------------
   11. Scroll Animations & Scroll reveal
-------------------------------------------------- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------
   12. Responsive Design (Media Queries)
-------------------------------------------------- */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 60px;
        text-align: center;
    }
    
    .hero-badge {
        margin: 0 auto 24px auto;
    }
    
    .hero-info-grid {
        max-width: 500px;
        margin: 0 auto 24px auto;
    }
    
    .hero-bio {
        margin: 0 auto 36px auto;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .interests-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .tuning-dashboard {
        grid-template-columns: 1fr;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-secondary);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        flex-direction: column;
        padding: 24px;
        gap: 20px;
        align-items: center;
        display: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    }
    
    .nav-menu.open {
        display: flex;
    }
    
    .hero-name-en {
        font-size: 2.8rem;
    }
    
    .hero-name-th {
        font-size: 1.8rem;
    }
    
    .timeline::before {
        left: 21px;
    }
    
    .timeline-line {
        left: 21px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-marker {
        left: 2px;
    }
    
    .interests-grid {
        grid-template-columns: 1fr;
    }
    
    .telemetry-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .contact-form-container {
        padding: 24px;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}
