Files
MyWebsite/css/styles.css
T
itziarZG 29d215495d perf(carbon): replace Material Symbols with inline SVGs and self-host WebP images
- Remove fonts/material-symbols-outlined.woff2 (4MB external font eliminated)
- Inline 38 Material Symbols as SVG paths (extracted to icon-paths.json)
- Convert 5 Google-hosted images to self-hosted WebP
- Add favicon.svg (adaptive auto_awesome icon, light + dark)
- Add scrollbar-gutter: stable + body.modal-open to prevent modal jumps
- Clean up preload links to fonts no longer used

Net reduction: ~3.9MB external dependencies, zero CLS on icon swap
2026-07-28 19:32:15 +02:00

132 lines
3.3 KiB
CSS

/* ==========================================================================
Layout Stability
========================================================================== */
/* Reserve scrollbar gutter to prevent layout shift when body.overflow
toggles between auto and hidden (openModal/closeModal). This stops
the page from "jumping" when the user opens or closes a project modal. */
html {
scrollbar-gutter: stable;
}
/* When a modal is open, prevent background scroll without causing the
scrollbar to disappear (which would shift the layout). */
body.modal-open {
overflow: hidden;
/* Compensate for any scrollbar difference on platforms where
scrollbar-gutter isn't fully respected. */
padding-right: var(--scrollbar-width, 0px);
}
/* ==========================================================================
Self-Hosted Fonts & Icons
========================================================================== */
/* Space Grotesk */
@font-face {
font-display: swap;
font-family: 'Space Grotesk';
font-style: normal;
font-weight: 300;
src: url('../fonts/space/space-grotesk-v22-latin-300.woff2') format('woff2');
}
@font-face {
font-display: swap;
font-family: 'Space Grotesk';
font-style: normal;
font-weight: 400;
src: url('../fonts/space/space-grotesk-v22-latin-regular.woff2') format('woff2');
}
@font-face {
font-display: swap;
font-family: 'Space Grotesk';
font-style: normal;
font-weight: 500;
src: url('../fonts/space/space-grotesk-v22-latin-500.woff2') format('woff2');
}
@font-face {
font-display: swap;
font-family: 'Space Grotesk';
font-style: normal;
font-weight: 600;
src: url('../fonts/space/space-grotesk-v22-latin-600.woff2') format('woff2');
}
@font-face {
font-display: swap;
font-family: 'Space Grotesk';
font-style: normal;
font-weight: 700;
src: url('../fonts/space/space-grotesk-v22-latin-700.woff2') format('woff2');
}
/* Instrument Serif */
@font-face {
font-display: swap;
font-family: 'Instrument Serif';
font-style: normal;
font-weight: 300 400;
src: url('../fonts/instrument/instrument-serif-v5-latin-regular.woff2') format('woff2');
}
@font-face {
font-display: swap;
font-family: 'Instrument Serif';
font-style: italic;
font-weight: 300 400;
src: url('../fonts/instrument/instrument-serif-v5-latin-italic.woff2') format('woff2');
}
/* Material Symbols replaced by inline SVGs (see .icon below) */
/* Inline icon (replaces Material Symbols font) */
.icon {
width: 1em;
height: 1em;
fill: currentColor;
flex-shrink: 0;
vertical-align: middle;
display: inline-block;
}
/* Glass Morphism Effect */
.glass {
background: rgba(255, 255, 255, 0.4);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.3);
}
.dark .glass {
background: rgba(30, 20, 40, 0.4);
border: 1px solid rgba(255, 255, 255, 0.1);
}
/* Iridescent Background Gradient */
.iridescent-bg {
background:
radial-gradient(
circle at 0% 0%,
rgba(140, 43, 238, 0.15) 0%,
transparent 50%
),
radial-gradient(
circle at 100% 100%,
rgba(255, 182, 255, 0.2) 0%,
transparent 50%
),
radial-gradient(
circle at 50% 50%,
rgba(140, 43, 238, 0.05) 0%,
transparent 100%
);
}
/* Fluid Blob Shapes */
.fluid-shape {
border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}