/* catppuccin mocha theme
	https://github.com/catppuccin/catppuccin */
:root {
	--rosewater: #f5e0dc;
	--flamingo: #f2cdcd;
	--pink: #f5c2e7;
	--mauve: #cba6f7;
	--red: #f38ba8;
	--maroon: #eba0ac;
	--peach: #fab387;
	--yellow: #f9e2af;
	--green: #a6e3a1;
	--teal: #94e2d5;
	--sky: #89dceb;
	--sapphire: #74c7ec;
	--blue: #89b4fa;
	--lavender: #b4befe;
	--text: #cdd6f4;
	--subtext1: #bac2de;
	--subtext0: #a6adc8;
	--overlay2: #9399b2;
	--overlay1: #7f849c;
	--overlay0: #6c7086;
	--surface2: #585b70;
	--surface1: #45475a;
	--surface0: #313244;
	--base: #1e1e2e;
	--mantle: #181825;
	--crust: #11111b;
}

/* Reset and base styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

@font-face {
    font-family: 'Unifont';
    src: url(/fonts/unifont.woff) format('woff');
}

body {
    font-family: 'Unifont', 'Fira Mono', 'JetBrains Mono', 'IBM Plex Mono', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', monospace;
	background: transparent;
	color: var(--text);
	line-height: 1.2;
    font-size: clamp(0.3rem, 1vw + 0.5rem, 1rem);
}

pre {
    display: inline-block;
    line-height: 1.0;
    max-width: 100%;
    overflow: visible;
    margin: 0;
    padding: 0;
}

p {
    margin-top: 0.7em;
    margin-bottom: 0.7em;
    padding: 0;
}

.contentcontainer, .header, .twocolumnlayout, .leftcolumn, .rightcolumn {
    position: relative;
    z-index: 1;
}

.skeletonbox {
    margin: 0 !important;
    padding: 0 !important;
}

/* Text size decorator classes (relative to 0.9rem base) */
.text-xs    { font-size: 0.7rem !important; }
.text-sm    { font-size: 0.8rem !important; }
.text-md    { font-size: 0.9rem !important; }   /* default */
.text-lg    { font-size: 1.1rem !important; }
.text-xl    { font-size: 1.3rem !important; }
.text-2xl   { font-size: 1.6rem !important; }
.text-3xl   { font-size: 2.0rem !important; }

/* Accent colors for different elements */
.accent-subtext0 { color: var(--subtext0) !important; }
.accent-subtext1 { color: var(--subtext1) !important; }
.accent-lavender { color: var(--lavender) !important; }
.accent-sapphire { color: var(--sapphire) !important; }
.accent-sky { color: var(--sky) !important; }
.accent-mauve { color: var(--mauve) !important; }  
.accent-blue { color: var(--blue) !important; }
.accent-green { color: var(--green) !important; }
.accent-red { color: var(--red) !important; }
.accent-yellow { color: var(--yellow) !important; }
.accent-pink { color: var(--pink) !important; }
.accent-teal { color: var(--teal) !important; }

/* Text decorator classes */
.text-bold {
    font-weight: bold !important;
}

.text-italic {
    font-style: italic !important;
}

.text-underline {
    text-decoration: underline !important;
}

.text-strike {
    text-decoration: line-through !important;
}

.text-uppercase {
    text-transform: uppercase !important;
}

.text-lowercase {
    text-transform: lowercase !important;
}

.text-smallcaps {
    font-variant: small-caps !important;
}

.text-shadow {
    text-shadow: 1px 1px 2px var(--surface2), 0 0 1em var(--mauve);
}

.text-outline {
    -webkit-text-stroke: 1px var(--surface2);
    color: transparent;
}

.text-glow {
    text-shadow: 0 0 8px var(--sky), 0 0 16px var(--blue);
}

/* Content container */
.contentcontainer {
	display: block;
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

/* Header */
.header {
	display: block;
	width: 100%;
	text-align: center;
	margin-bottom: 1rem;
}

.slogan {
	font-size: 1.1rem;
	color: var(--overlay1);
}

.sm-logo {
    display: none;
    overflow: visible;
}

.lg-logo {
    overflow: visible;
}

/* Navbar styles */
.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
    padding: 0.5rem 0;
    background: var(--mantle);
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.navbar a {
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.navbar a:hover {
    color: var(--yellow);
    text-decoration: underline;
}

.navbar-delim {
    font-weight: bold;
    opacity: 0.7;
    font-size: 1.1em;
}


/* Two column layout */
.twocolumnlayout {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 30px;
}

.leftcolumn, .rightcolumn {
	display: block;
	flex: 1;
	min-width: 300px;
}

/* Styled boxes */
.blankbox {
    display: block;
    padding: 0;
    margin-bottom: 1.25rem;
    width: 100%;
}

.blankbox.left-align {
    display: flex;
    justify-content: flex-start;
    text-align: left;
}

.blankbox.center-align {
    display: flex;
    justify-content: center;
    text-align: center;
}

.blankbox.right-align {
    display: flex;
    justify-content: flex-end;
    text-align: right;
}

.blankbox pre {
    text-align: left;
    margin: 0;
}

.styledbox {
    display: block;
    background-color: var(--crust);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.border-single {
    border: 2px solid var(--surface2);
    border-radius: 0;
    box-shadow: none;
}

.border-double {
    border: 4px double var(--surface2);
    border-radius: 0;
    box-shadow: none;
}

.styledbox h2 {
	color: var(--mauve);
	font-size: 1.25rem;
	margin-bottom: 0.8rem;
	border-bottom: 1px solid var(--surface2);
	padding-bottom: 8px;
}

.styledbox h3 {
    color: var(--lavender);
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px dashed var(--surface1);
    padding-bottom: 6px;
    font-weight: normal;
}

.styledbox p {
	color: var(--text);
	margin-bottom: 0.5rem;
}

.styledbox a {
	color: var(--blue);
	text-decoration: none;
}

.styledbox a:hover {
	color: var(--sky);
	text-decoration: underline;
}

.styledbox .keyvalue {
	display: grid;
	grid-template-columns: auto 1fr;
    gap: 0.25rem;
	align-items: center;
}

.styledbox .keyvalue .key {
	color: var(--subtext1);
	font-weight: bold;
    display: inline-flex;
    align-items: center;
    margin-right: 1.5rem;
}

.styledbox .keyvalue .value {
	color: var(--text);
    display: inline-flex;
    align-items: center;
}

.styledbox .right-align {
    text-align: right;
}

.styledbox .center-align {
    text-align: center;
}

/* List styling */
.styledbox ul {
	margin: 10px 0;
	padding-left: 20px;
}

.styledbox li {
	color: var(--text);
	margin-bottom: 5px;
}

.styledbox li::marker {
	color: var(--mauve);
}

/* stats box */
pre.stats {
    display: inline-block;
    line-height: 1.2 !important;
}

/* Code block styling for pre.code */
pre.code {
    font-weight: normal !important;
    font-size: 0.7rem !important;
    display: block;
    background-color: var(--mantle);
    color: var(--text);
    border: 1px solid var(--surface2);
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    line-height: 1.4;
    white-space: pre;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.styledbox pre.code {
    background-color: var(--base);
    border-color: var(--surface1);
    margin: 0.5rem 0;
}



/* Footer */
.footer {
    color: var(--surface2);
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	text-align: left;
	padding: 1em;
	z-index: 0;
    background: transparent;
}

/* Frequency Table Styles */
.freqtable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5em;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--lavender, #a6adc8);
}

.freqtable th,
.freqtable td {
    padding: 0.3em 0.7em;
    border-right: 1px solid var(--surface2, #494d64);
    border-bottom: 1px solid var(--surface2, #494d64);
    text-align: left;
    vertical-align: middle;
    min-width: 0;
    word-break: break-word;
}

.freqtable th:last-child,
.freqtable td:last-child {
    border-right: none;
}

.freqtable thead th {
    font-weight: bold;
    color: var(--lavender, #a6adc8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--lavender, #a6adc8);
    background: none;
    white-space: nowrap;
}

.section-title {
    font-weight: bold;
    color: var(--sky, #89dceb);
    letter-spacing: 0.05em;
    background: none;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--sky, #89dceb);
    border-right: none;
}

.freqtable-note {
    color: var(--text, #cdd6f4);
    opacity: 0.7;
    margin-left: 0.5em;
}


/* Special elements */
/* Responsive font size for #funnybunny */
#funnybunny {
    font-size: clamp(0.6rem, 2.5vw, 1.2rem);
}

.asciiart {
    line-height: 1.0 !important;
}

.hamalert {
    display: block;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
}

canvas#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

@keyframes cursor {
    0% {
        opacity: 0;
    }
    40% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}


/* Responsive design for narrow displays */
@media (max-width: 768px) {
	.twocolumnlayout {
		flex-direction: column;
	}
	
	.leftcolumn, .rightcolumn {
		width: 100%;
	}
	
    .header {
        margin-bottom: 1rem !important;
    }

    .slogan {
        font-size: 0.8rem !important;
    }

	.contentcontainer {
		padding: 10px;
	}

    .navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.05rem; /* less gap */
        padding: 0.1rem 0; /* less padding */
        background: var(--mantle);
    }

    .navbar a {
        padding: 0.4em 0.3em; /* less padding */
        font-size: 0.85em;    /* smaller font */
        border-radius: 0;     /* no border radius */
        border-bottom: 1px solid var(--surface1); /* subtle divider */
        transition: background 0.2s;
    }

    .navbar a:last-child {
        border-bottom: none;
    }
    
    .navbar a:hover {
        background: var(--surface1); /* subtle background on hover */
        color: var(--yellow);
        text-decoration: underline;
    }
    
    .navbar-delim {
        display: none;
    }
	
    .sm-logo {
        font-size: 1rem !important;
        display: block;
    }

    .lg-logo {
        visibility: hidden;
        display: none;
    }

	.styledbox pre {
		display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        white-space: pre;
        padding: 0.5em 0;
        box-sizing: border-box;
	}
}

/* Print-friendly styles */
@media print {
    body, .lg-logo, .contentcontainer, .styledbox, .blankbox, .header, .slogan {
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
        font-size: 0.7rem !important;
    }

    a, a:visited {
        color: #000 !important;
        text-decoration: underline !important;
        font-size: 0.7rem !important;
    }

    a::after {
        content: " (" attr(href) ")";
        font-size: 0.75em;
    }

    .navbar,
    .footer,
    .bannerlinks,
    .sm-logo,
    .bannerlinks,
    #matrix,
    .hamalert {
        display: none !important;
    }

    pre.code {
        color: #000 !important;
        border: 1px solid #ccc !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        font-size: 0.65rem !important;
        padding: 0.5em 0.7em !important;
        margin: 0.5em 0 !important;
        overflow-x: auto !important;
        white-space: pre-wrap !important;
        word-break: break-word !important;
        page-break-inside: avoid !important;
    }

    .twocolumnlayout,
    .leftcolumn,
    .rightcolumn {
        display: block !important;
        width: 100% !important;
        float: none !important;
        font-size: 0.7rem !important;
    }

    .styledbox,
    .blankbox {
        border: 1px solid #aaa !important;
        border-radius: 0 !important;
        padding: 8px !important;
        margin-bottom: 12px !important;
        font-size: 0.7rem !important;
    }

    img, svg {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }

    pre, code {
        background: #f5f5f5 !important;
        color: #000 !important;
        border: 1px solid #ccc !important;
        font-size: 0.65rem !important;
    }

    /* Remove text shadows and outlines for clarity */
    .text-shadow, .text-outline, .text-glow {
        text-shadow: none !important;
        -webkit-text-stroke: 0 !important;
        color: #000 !important;
    }

    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .styledbox, .blankbox, pre, blockquote {
        page-break-inside: avoid;
    }

    /* Frequency Table Print Styles */
    .freqtable {
        border: 1px solid #aaa !important;
        border-radius: 0 !important;
        background: #fff !important;
        color: #000 !important;
        font-size: 0.7rem !important;
    }
    .freqtable th,
    .freqtable td {
        border-right: 1px solid #aaa !important;
        border-bottom: 1px solid #aaa !important;
        color: #000 !important;
        background: #fff !important;
        padding: 0.2em 0.5em !important;
        font-size: 0.7rem !important;
    }
    .freqtable th:last-child,
    .freqtable td:last-child {
        border-right: none !important;
    }
    .freqtable thead th,
    .section-title {
        color: #000 !important;
        border-bottom: 2px solid #aaa !important;
        background: #fff !important;
        text-transform: uppercase !important;
        letter-spacing: 0.04em !important;
        font-size: 0.7rem !important;
    }
    .freqtable-note {
        color: #000 !important;
        opacity: 1 !important;
        font-size: 0.7em !important;
        margin-left: 0.5em !important;
    }
}
