@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&family=Inter:wght@300;400;500;600;700&display=swap");

:root {
    /* Ghost of Tsushima / Cherry Blossom Palette */
    --bg-primary: #1d1b1c;
    --bg-secondary: #2d2a2b;
    --bg-tertiary: #3d3839;
    --text-primary: #d4c7c3;
    --text-secondary: #a89a9b;
    --text-muted: #7d7172;
    --accent-coral: #ea7c5a;
    --accent-leaf: #e25f36;
    --accent-cherry: #d97b8f;
    --accent-rose: #c89aa3;
    --accent-deep-rose: #c76b7e;
    --accent-peach: #e8b89e;
    --accent-mauve: #c89aa3;
    --border-subtle: rgba(212, 199, 195, 0.1);
    --border-active: rgba(234, 124, 90, 0.3);
    --shadow-glow: 0 0 20px rgba(234, 124, 90, 0.15);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-coral), var(--accent-cherry));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--accent-rose);
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--accent-coral);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent-coral);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

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

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-coral), var(--accent-cherry));
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

/* Layout */
.wrap {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 0;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .wrap {
        grid-template-columns: 1fr;
    }
}

/* Header / Sidebar */
.main-pane {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

@media (max-width: 900px) {
    .main-pane {
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
}

.header {
    text-align: left;
    margin-bottom: 3rem;
}

.header h1 {
    text-align: left;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.header img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin: 1rem 0;
    border: 3px solid var(--border-active);
    box-shadow: var(--shadow-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(234, 124, 90, 0.25);
}

.header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Navigation */
.content {
    flex: 1;
}

.content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.content ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

.content li {
    margin-bottom: 0.75rem;
}

.content a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.content a:hover {
    background: var(--border-active);
    border-color: var(--accent-coral);
    color: var(--text-primary);
    transform: translateX(4px);
}

.content a::after {
    display: none;
}

/* Secondary Pane - Content Area */
.secondary-pane {
    padding: 3rem 2rem;
    background: var(--bg-primary);
    overflow-y: auto;
    height: 100vh;
}

@media (max-width: 900px) {
    .secondary-pane {
        height: auto;
        min-height: 100vh;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-coral);
}

/* Selection */
::selection {
    background: var(--accent-coral);
    color: var(--bg-primary);
}

/* Loading indicator */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Modal System */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1000;
    background-color: transparent;
    animation: modal-fade-in 0.3s ease;
}

.modal-open {
    display: block;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(29, 27, 28, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), var(--shadow-glow);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    border: 1px solid var(--border-subtle);
}

.modal-close:hover {
    background: var(--accent-coral);
    color: var(--bg-primary);
    transform: scale(1.1);
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modal-slide-up {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Keyboard navigation styles */
.keyboard-nav *:focus {
    outline: 2px solid var(--accent-coral);
    outline-offset: 2px;
}

/* Smooth transitions for interactive elements */
button, a, input, textarea, select {
    transition: all 0.2s ease;
}

/* Decorative elements */
.decorative-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-coral), var(--accent-cherry), transparent);
    margin: 2rem 0;
    opacity: 0.5;
}

/* Status indicators */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background: rgba(217, 123, 143, 0.2);
    color: var(--accent-cherry);
    border: 1px solid rgba(217, 123, 143, 0.3);
}

.status-learning {
    background: rgba(232, 184, 158, 0.2);
    color: var(--accent-peach);
    border: 1px solid rgba(232, 184, 158, 0.3);
}

/* Modal System */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1000;
    background-color: transparent;
    animation: modal-fade-in 0.3s ease;
}

.modal-open {
    display: block;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(29, 27, 28, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    border: 1px solid var(--border-subtle);
}

.modal-close:hover {
    background: var(--accent-coral);
    color: var(--bg-primary);
    transform: scale(1.1);
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Gallery container */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Hover effect removed - arrow and zoom provide sufficient feedback */

/* Image Maximizer - transparent overlay, blends with background */
.img-maximized-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: rgba(29, 27, 28, 0.1); /* Very subtle darkening */
    opacity: 0;
    transition: opacity 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.img-maximized-overlay.active {
    opacity: 1;
}

.img-maximized-canvas {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.img-maximized-canvas:active {
    cursor: grabbing;
}

.img-maximized-content {
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    transition: transform 0.05s ease-out;
}

.img-maximized {
    display: block;
    max-width: none;
    max-height: none;
    object-fit: contain;
    border-radius: 8px;
    overflow: hidden;
}

/* Image wrapper with expand icon */
.img-wrapper {
    position: relative;
    display: block;
    max-width: 100%;
    cursor: zoom-in;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.img-wrapper img:not(.gallery-item),
.img-wrapper svg:not(.gallery-item) {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
}

.img-wrapper:hover {
    transform: scale(1.02);
}

.img-wrapper:hover .img-expand-icon {
    opacity: 1;
}

/* SVG display rules - ensure SVGs render properly */
svg {
    max-width: 100%;
    height: auto;
}

/* Block display for standalone SVGs */
body > svg,
p > svg,
div > svg:only-child,
details > svg,
details svg:not(.img-wrapper svg) {
    display: block;
}

.img-expand-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    pointer-events: none;
    background: rgba(29, 27, 28, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
}

.img-wrapper:hover .img-expand-icon {
    opacity: 1;
}

/* Maximized controls */
.img-maximized-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.img-maximized-overlay.active .img-maximized-controls {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.img-zoom-indicator {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: center;
}

.img-control-btn,
.img-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    border: 1px solid var(--border-subtle);
}

.img-control-btn:hover,
.img-close-btn:hover {
    background: var(--accent-coral);
    color: var(--bg-primary);
    transform: scale(1.1);
}

.img-close-btn {
    background: var(--accent-cherry);
    margin-left: 0.5rem;
}

/* Decorative gap for HTML content */
.decorative-gap {
    margin-top: 2rem;
    margin-bottom: 2rem;
}
