/* Minimal Coder Style - Japanese-inspired minimal aesthetic */

/* Maple Mono font from GitHub CDN */
@import url('https://cdn.jsdelivr.net/gh/subframe7536/maple-font@v7/dist/MapleMono-woff2/MapleMono.css');
@import url('https://cdn.jsdelivr.net/gh/subframe7536/maple-font@v7/dist/MapleMono-woff2-CN/MapleMono-CN.css');

/* Default dark mode (Monokai Pro) */
:root {
    --bg: #2d2a2e;
    --text: #fcfcfa;
    --accent: #ff6188;
    --green: #a9dc76;
    --yellow: #ffd866;
    --orange: #fc9867;
    --purple: #ab9df2;
    --cyan: #78dce8;
    --gray: #939293;
    --light-gray: #403e41;
    --border: #5b595c;
    --code-bg: #221f22;
}

/* Light mode colors - Vibrant Japanese Neon */
body.light-mode {
    --bg: #ffffff !important;
    --text: #0a0a0a !important;
    --accent: #ff0066 !important;  /* Hot pink neon */
    --green: #00ff88 !important;    /* Electric mint green */
    --yellow: #ffcc00 !important;   /* Bright golden yellow */
    --orange: #ff6600 !important;   /* Vibrant orange */
    --purple: #9945ff !important;   /* Electric purple */
    --cyan: #00ccff !important;     /* Bright cyan */
    --gray: #4a4a5e !important;
    --light-gray: #f0f3f7 !important;
    --border: #c0c8d0 !important;
    --code-bg: #e8ecf2 !important;
}

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

html {
    height: 100%;
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    font-family: 'Maple Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
    background: var(--bg);
    color: var(--text);
    font-weight: 400;
    letter-spacing: -0.2px;
    font-feature-settings: "liga" 1, "calt" 1; /* Enable ligatures */
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Ensure light mode applies properly */
html.light-mode {
    background: #ffffff !important;
}

body.light-mode {
    background: #ffffff !important;
    color: #1a1a1a !important;
}

/* Terminal cursor effect */
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Terminal typing animation */
.terminal-line {
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    display: inline-block;
    position: relative;
    border-right: 2px solid transparent;
}

.terminal-line.typing {
    animation: typewriter var(--typing-duration, 2s) steps(var(--typing-steps, 30), end) forwards;
    border-right-color: var(--accent);
}

.terminal-line.typed {
    width: 100%;
}

/* Cursor that rides the animation edge */
.terminal-line.typing::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 0;
    width: 2px;
    height: 1.2em;
    background: var(--accent);
    animation: blink 1s infinite;
}

body.light-mode .terminal-line.typing::after {
    background: var(--accent);
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}


/* Hide nav and social initially */
.terminal-nav,
.terminal-social {
    opacity: 0;
}

.terminal-nav.show,
.terminal-social.show {
    opacity: 1;
    animation: fadeIn 0.5s ease-in;
}

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

.terminal-link,
.terminal-icon {
    opacity: 0;
    animation: none;
}

.terminal-link.show,
.terminal-icon.show {
    opacity: 1;
    animation: fadeIn 0.3s ease-in;
}

/* Header with terminal aesthetic */
.full-header {
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 60px;
    position: relative;
    background: transparent;
}

body.light-mode .full-header {
    background: transparent;
}

.terminal-prompt {
    position: absolute;
    left: 25px;
    color: var(--accent);
    font-size: 20px;
    opacity: 0;
    transition: none;
    z-index: 1;
    top: 50%;
    transform: translateY(-50%);
}

.terminal-prompt.active {
    opacity: 1;
    animation: blink 1s infinite;
}

body.light-mode .terminal-prompt {
    color: var(--accent);
}

.header-content {
    max-width: 700px;
    padding-left: 40px;
    position: relative;
}

.full-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.full-header h1::before {
    content: '';
}

.full-header h2 {
    font-size: 14px;
    font-weight: 400;
    color: var(--gray);
    margin-bottom: 4px;
}

.full-header h2 .terminal-line::before {
    content: '//  ';
    color: var(--gray);
    opacity: 0.7;
    display: inline-block;
    position: relative;
}

.full-header p {
    font-size: 12px;
    color: var(--gray);
    opacity: 0.8;
    margin-bottom: 20px;
}

/* Navigation with bracket hover effect */
.full-header nav {
    margin-top: 30px;
}

.full-header nav ul {
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
}

.full-header nav ul li {
    position: relative;
}

.full-header nav ul li::before {
    content: '/ ';
    color: var(--gray);
    opacity: 0.3;
    margin-right: 8px;
}

.full-header nav ul li:first-child::before {
    content: '';
    margin: 0;
}

.full-header nav ul li a {
    text-decoration: none;
    color: var(--text);
    font-size: 12px;
    position: relative;
    transition: color 0.2s;
}

.full-header nav ul li a::before {
    content: '[';
    opacity: 0;
    color: var(--yellow);
    transition: opacity 0.2s;
}

.full-header nav ul li a::after {
    content: ']';
    opacity: 0;
    color: var(--yellow);
    transition: opacity 0.2s;
}

.full-header nav ul li a:hover::before,
.full-header nav ul li a:hover::after {
    opacity: 1;
}

.full-header nav ul li a:hover {
    color: var(--accent);
}

/* Social media icons */
.social-media {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.social-media a {
    color: var(--gray);
    font-size: 16px;
    transition: color 0.2s;
    text-decoration: none;
}

.social-media a:hover {
    color: var(--accent);
}

/* Main content */
main {
    padding: 100px 60px;
    max-width: 700px;
    margin: 0 auto;
    background: transparent;
    position: relative;
}

body.light-mode main {
    background: transparent;
}

main section {
    margin-bottom: 100px;
    position: relative;
    padding-left: 20px;
    scroll-margin-top: 80px; /* Offset for smooth scroll anchor links */
}

/* Section markers */
main section::before {
    content: attr(id);
    position: absolute;
    left: -40px;
    top: 0;
    font-size: 10px;
    color: var(--purple);
    opacity: 0.4;
    text-transform: uppercase;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: transparent !important;
    z-index: -1;
}

/* Typography */
main h2 {
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

main h2::before {
    content: '## ';
    color: var(--cyan);
    font-weight: 300;
}

h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 40px 0 25px 0;
    color: var(--text);
    background: var(--light-gray);
    padding: 8px 15px;
    border-left: 3px solid var(--purple);
    position: relative;
}

h3::before {
    content: '### ';
    color: var(--purple);
    opacity: 0.9;
    font-weight: 400;
}

/* Light mode h3 styling */
body.light-mode h3 {
    background: linear-gradient(135deg, rgba(153, 69, 255, 0.05) 0%, rgba(0, 204, 255, 0.05) 100%);
    border-left: 3px solid var(--purple);
}

p {
    margin-bottom: 20px;
    color: var(--text);
    opacity: 0.9;
}

/* Links */
a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dotted var(--gray);
    transition: all 0.2s;
}

a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Papers list */
.papers-list {
    list-style: none;
    padding: 0;
}

.paper-item {
    margin-bottom: 40px;
    padding: 20px;
    background: var(--light-gray);
    border-left: 2px solid var(--green);
    position: relative;
}

body.light-mode .paper-item {
    background: #f6f8fa;
}

.paper-item::before {
    content: '>';
    position: absolute;
    left: -10px;
    top: 20px;
    color: var(--green);
    background: var(--bg);
    padding: 0 5px;
}

.paper-link {
    font-weight: 500;
    color: var(--text) !important;
    border-bottom: none !important;
}

.paper-link:hover {
    color: var(--accent) !important;
}

.publication-status {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--yellow);
    margin-top: 8px;
    margin-bottom: 0;
    padding: 2px 8px;
    background: var(--code-bg);
    border: 1px solid var(--border);
}

.co-authors {
    font-weight: 300;
    color: var(--gray);
    font-size: 12px;
}

.paper-abstract {
    margin-top: 15px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--gray);
}

.paper-links {
    margin-top: 15px;
}

.link-wrapper {
    display: inline-block;
    margin-right: 15px;
    font-size: 11px;
    color: var(--orange);
}

/* Resources */
.resources-list {
    list-style: none;
}

.resource-item {
    margin-bottom: 40px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
}

body.light-mode .resource-item {
    background: #ffffff;
    border-color: #d1d5da;
}

.resource-item:hover {
    border-color: var(--cyan);
    background: var(--light-gray);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

body.light-mode .resource-item:hover {
    background: #f6f8fa;
    border-color: #0366d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.resource-link {
    font-weight: 500;
    color: var(--text) !important;
    border: none !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
}

.resource-link:hover {
    color: var(--accent) !important;
    text-decoration: underline;
}

.resource-description {
    margin-top: 15px;
    font-size: 12px;
    color: var(--gray);
}

.resource-description ul {
    margin-top: 10px;
    margin-left: 20px;
}

.resource-description li {
    margin-bottom: 5px;
}

/* Course links */
.course-link {
    font-family: monospace;
    font-size: 12px;
}

/* Teaching section course codes */
#teaching ul li strong {
    font-weight: 400; /* Remove bold */
    color: var(--cyan); /* Use cyan color for course codes */
    font-family: 'Maple Mono', monospace;
    font-size: 13px;
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 2px;
    margin-right: 8px;
    display: inline-block;
}

body.light-mode #teaching ul li strong {
    background: var(--code-bg);
    color: var(--cyan);
}

/* Footer */
footer {
    background: #1a1819; /* Very dark in both modes */
    color: #fcfcfa !important; /* Light text for contrast */
    text-align: center;
    padding: 40px 30px;
    font-size: 11px;
    margin-top: 100px;
    border-top: 1px solid var(--border);
}

footer p {
    color: #fcfcfa !important; /* Ensure paragraph text is white */
    opacity: 1 !important;
    margin: 0;
}

body.light-mode footer {
    background: #2d2a2e; /* Dark (matching dark mode main bg) */
    color: #fcfcfa !important;
}

body.light-mode footer p {
    color: #fcfcfa !important;
    opacity: 1 !important;
}

/* Glass-like button styling - True transparency */
.glass-button {
    position: relative;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 24px 0 rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Shimmer effect overlay - subtle */
.glass-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    mix-blend-mode: overlay;
    pointer-events: none;
    opacity: 0.4;
}

body.light-mode .glass-button {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 
        0 4px 24px 0 rgba(0, 0, 0, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.glass-button:hover {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 30px 0 rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

body.light-mode .glass-button:hover {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 
        0 6px 30px 0 rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

/* Subtle animation */
@keyframes glass-shimmer {
    0% { opacity: 0.6; }
    50% { opacity: 0.8; }
    100% { opacity: 0.6; }
}

.glass-button::before {
    animation: glass-shimmer 3s ease-in-out infinite;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .glass-button::before {
        animation: none;
    }
    .glass-button {
        transition: all 0.2s ease;
    }
}

/* Theme toggle button */
#theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    color: var(--text);
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    z-index: 1000;
    border-radius: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle .theme-icon {
    margin: 0;
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

#theme-toggle .moon-icon {
    display: block;
}

#theme-toggle .sun-icon {
    display: none;
}

body.light-mode #theme-toggle .moon-icon {
    display: none;
}

body.light-mode #theme-toggle .sun-icon {
    display: block;
}

#theme-toggle .sun-icon {
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Navigation button (mobile) */
.nav-button {
    display: none;
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1001;
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.nav-button .bar {
    width: 18px;
    height: 2px;
    background: var(--text);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 1px;
}

/* Fixed navigation */
.fixed-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 15px 60px;
    z-index: 999;
}

.fixed-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
}

.fixed-nav a {
    color: var(--text);
    font-size: 12px;
    border: none;
}

.fixed-nav a:hover {
    color: var(--accent);
}

/* ASCII decorations */
.ascii-divider {
    text-align: center;
    margin: 60px 0;
    color: var(--gray);
    opacity: 0.3;
    font-size: 10px;
    letter-spacing: 10px;
}

/* Code-like styling for certain elements */
code {
    font-family: inherit;
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 0;
    font-size: 12px;
}

/* Responsive - Mobile Devices */

/* iPad Pro (12.9" and 11") - Portrait */
@media (max-width: 1024px) {
    .full-header {
        padding: 0 40px;
    }
    
    main {
        padding: 80px 40px;
    }
}

/* iPad (10.2", 10.5", 9.7") - Portrait & iPad Mini */
@media (max-width: 834px) {
    .full-header {
        padding: 0 35px;
    }
    
    .full-header::before {
        left: 25px;
    }
    
    main {
        padding: 70px 35px;
    }
    
    main section::before {
        left: -30px;
    }
}

/* Large phones (iPhone 15 Pro Max, 14 Plus, etc.) - Landscape */
@media (max-width: 768px) {
    .full-header {
        padding: 0 30px;
    }
    
    .full-header::before {
        left: 20px;
    }
    
    main {
        padding: 60px 30px;
    }
    
    main section::before {
        display: none;
    }
    
    .nav-button {
        display: flex;
    }
    
    /* Adjust navigation for tablets */
    .full-header nav ul {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .full-header nav ul li {
        margin-bottom: 5px;
    }
}

/* Hide/show mobile vs desktop content */
.mobile-only {
    display: none;
}

/* Standard phones (iPhone 15, 14, 13, etc.) - Portrait */
@media (max-width: 430px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: inline-block !important;
    }
    
    .mobile-only.terminal-line {
        display: block !important;
        margin-bottom: 5px;
    }
    body, html {
        font-size: 12px;
    }
    
    /* Add indentation for course list items on mobile */
    #teaching ul li {
        padding-left: 70px;
        text-indent: -70px;
    }
    
    #teaching ul li strong {
        text-indent: 0;
        min-width: 60px;
        display: inline-block;
    }
    
    .full-header {
        padding: 0 20px;
        min-height: 100vh;
    }
    
    .terminal-prompt {
        display: none;  /* Hide terminal prompt on mobile */
    }
    
    .header-content {
        padding-left: 0;  /* Remove left padding to center content */
        text-align: center;  /* Center all header content */
        margin: 0 auto;
    }
    
    .full-header h1 {
        font-size: 24px;
    }
    
    .full-header h2 {
        font-size: 13px;
    }
    
    .full-header nav ul {
        flex-direction: column;
        gap: 8px;
        align-items: center;  /* Center navigation items */
    }
    
    .full-header nav ul li::before {
        display: none;  /* Hide navigation separators on mobile */
    }
    
    main {
        padding: 50px 20px;
    }
    
    main section {
        padding-left: 10px;
        margin-bottom: 60px;
    }
    
    h2 {
        font-size: 14px;
    }
    
    .paper-item, .resource-item {
        padding: 15px;
    }
    
    .social-media {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;  /* Center social media icons */
    }
    
    #theme-toggle {
        bottom: 20px;
        right: 25px;
    }
    
    .nav-button {
        top: 20px;
        right: 25px;
    }
}

/* Small phones (iPhone SE, older models) */
@media (max-width: 375px) {
    .full-header h1 {
        font-size: 22px;
    }
    
    .full-header nav ul li a {
        font-size: 11px;
    }
    
    .paper-abstract {
        font-size: 11px;
    }
    
    .resource-description {
        font-size: 11px;
    }
}

/* Print styles */
@media print {
    body {
        font-size: 11px;
    }
    
    .theme-toggle,
    .nav-button,
    .fixed-nav {
        display: none !important;
    }
}