:root {
    --parchment: #f4f1e8;
    --ink: #1a1a1a;
    --ink-fade: #4a4a4a;
    --ink-light: #7a7a7a;
    --sepia: #d4c5a9;
    --gold: #c9a961;
    --wine: #6b3745;
    --sage: #4a5f5d;
    --paper-shadow: rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Courier New', 'Courier', monospace;
    background: var(--parchment);
    color: var(--ink);
    line-height: 1.5;
    font-size: 13px;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(255, 243, 205, 0.4) 0%, transparent 60%),
        radial-gradient(circle at 20% 30%, rgba(201, 169, 97, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(74, 95, 93, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse 400px 100px at 15% 25%, rgba(201, 169, 97, 0.06), transparent),
        radial-gradient(ellipse 350px 80px at 85% 65%, rgba(201, 169, 97, 0.05), transparent),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(26, 26, 26, 0.01) 2px, rgba(26, 26, 26, 0.01) 4px);
    background-attachment: fixed;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(212, 197, 169, 0.15) 100%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='paper' x='0' y='0' width='200' height='200' patternUnits='userSpaceOnUse'%3E%3Cpath d='M0 0 L200 0 L200 200 L0 200 Z' fill='none' stroke='rgba(212,197,169,0.1)' stroke-width='0.5'/%3E%3Ccircle cx='50' cy='50' r='30' fill='rgba(201,169,97,0.02)'/%3E%3Ccircle cx='150' cy='150' r='40' fill='rgba(201,169,97,0.015)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='200' height='200' fill='url(%23paper)'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: multiply;
}

.grain {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.025;
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: multiply;
}

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

header {
    border-bottom: 3px double var(--ink);
    padding: 2rem 3rem;
    background: linear-gradient(180deg, rgba(244, 241, 232, 0.9) 0%, rgba(212, 197, 169, 0.1) 100%);
    position: relative;
}

header::before {
    content: '⟡ ◈ ⟡';
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--gold);
    opacity: 0.4;
    letter-spacing: 0.5rem;
}

header::after {
    content: '⟡ ◈ ⟡';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--gold);
    opacity: 0.4;
    letter-spacing: 0.5rem;
}

.breadcrumb {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: var(--ink-light);
}

.breadcrumb a {
    color: var(--ink-fade);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--wine);
}

.separator {
    margin: 0 0.75rem;
    color: var(--gold);
}

.current {
    color: var(--wine);
    font-weight: 700;
}

.domain-header {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 2rem;
    align-items: center;
}

.domain-symbol {
    font-size: 80px;
    color: var(--gold);
    text-align: center;
    filter: drop-shadow(2px 2px 4px rgba(201, 169, 97, 0.3));
    line-height: 1;
}

.domain-info h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 0.5rem;
    font-family: Georgia, 'Times New Roman', serif;
}

.domain-subtitle {
    font-size: 13px;
    color: var(--ink-fade);
    font-style: italic;
    letter-spacing: 1px;
}

.categories {
    padding: 3rem 2rem;
}

.category-group {
    margin-bottom: 3rem;
    border-left: 3px solid var(--sepia);
    padding-left: 2rem;
    position: relative;
}

.category-group::before {
    content: '⟐';
    position: absolute;
    left: -12px;
    top: 0;
    font-size: 20px;
    color: var(--gold);
    background: var(--parchment);
}

.category-title {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--wine);
    margin-bottom: 1.5rem;
    font-family: Georgia, 'Times New Roman', serif;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category-ornament {
    color: var(--gold);
    opacity: 0.6;
    font-size: 14px;
}

.resources {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--sepia);
    border: 1px solid var(--sepia);
}

.resource {
    display: grid;
    grid-template-columns: 40px 1fr;
    background: rgba(244, 241, 232, 0.8);
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
    color: var(--ink);
}

.resource::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 243, 205, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.resource:hover {
    background: rgba(212, 197, 169, 0.4);
    transform: translateX(10px);
    box-shadow: -3px 0 0 var(--gold), 0 4px 12px rgba(201, 169, 97, 0.15);
}

.resource:hover::before {
    opacity: 1;
}

.resource-marker {
    font-size: 16px;
    color: var(--gold);
    opacity: 0.7;
    display: flex;
    align-items: flex-start;
    padding-top: 0.25rem;
    transition: all 0.3s ease;
}

.resource:hover .resource-marker {
    opacity: 1;
    transform: scale(1.2);
    color: var(--wine);
}

.resource-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resource-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--ink);
    line-height: 1.4;
}

.resource-title::first-letter {
    font-size: 1.3em;
    color: var(--wine);
    font-weight: 900;
}

.resource-desc {
    font-size: 12px;
    color: var(--ink-fade);
    line-height: 1.6;
}

.resource-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.resource-type {
    color: var(--sage);
    font-weight: 700;
}

.resource-level {
    color: var(--ink-light);
    padding-left: 1rem;
    border-left: 1px solid var(--sepia);
}

.notation-guide {
    background: rgba(212, 197, 169, 0.2);
    border: 2px solid var(--sepia);
    padding: 2rem;
    margin: 2rem 2rem 3rem 2rem;
    position: relative;
}

.notation-guide::before {
    content: '※';
    position: absolute;
    left: 50%;
    top: -15px;
    transform: translateX(-50%);
    font-size: 24px;
    color: var(--gold);
    background: var(--parchment);
    padding: 0 1rem;
}

.guide-title {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--wine);
    text-align: center;
    margin-bottom: 1.5rem;
    font-family: Georgia, 'Times New Roman', serif;
}

.notation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
}

.notation-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(244, 241, 232, 0.6);
    border: 1px solid var(--sepia);
    transition: all 0.3s ease;
}

.notation-item:hover {
    background: rgba(212, 197, 169, 0.3);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.notation-symbol {
    font-size: 32px;
    color: var(--gold);
    line-height: 1;
}

.notation-meaning {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ink-fade);
    font-weight: 700;
}

footer {
    border-top: 3px double var(--ink);
    padding: 2rem 3rem;
    background: linear-gradient(0deg, rgba(244, 241, 232, 0.9) 0%, rgba(212, 197, 169, 0.1) 100%);
    text-align: center;
    position: relative;
}

footer::before {
    content: '✤ ※ ✤';
    position: absolute;
    left: 50%;
    top: -12px;
    transform: translateX(-50%);
    font-size: 16px;
    color: var(--gold);
    background: var(--parchment);
    padding: 0 1rem;
    letter-spacing: 0.5rem;
}

.back-link {
    color: var(--ink-fade);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    transition: color 0.3s ease;
    display: inline-block;
    position: relative;
}

.back-link::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.back-link:hover {
    color: var(--wine);
}

.back-link:hover::before {
    transform: scaleX(1);
}

@media (max-width: 900px) {
    .domain-header {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }
    
    .domain-symbol {
        font-size: 60px;
    }
    
    .categories {
        padding: 2rem 1rem;
    }
    
    .category-group {
        padding-left: 1.5rem;
    }
    
    .resource {
        grid-template-columns: 30px 1fr;
        padding: 1rem;
    }
    
    .notation-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 1rem;
    }
    
    header::before,
    header::after {
        display: none;
    }
}

a:focus {
    outline: 2px solid var(--wine);
    outline-offset: 2px;
}

::selection {
    background: var(--gold);
    color: var(--parchment);
}

::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border: 2px solid var(--sepia);
}

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