Files
portfolio/src/shared/styles/theme.css
T

414 lines
9.5 KiB
CSS
Raw Normal View History

:root {
/* === TYPOGRAPHY SCALE (Augmented Fourth 1.414) === */
--font-size: 16px;
--text-xs: 0.707rem;
--text-sm: 0.84rem;
--text-base: 1rem;
--text-lg: 1.414rem;
--text-xl: 2rem;
--text-2xl: 2.828rem;
--text-3xl: 4rem;
--text-4xl: 5.657rem;
--text-5xl: 8rem;
/* === FONT FAMILIES (set by next/font CSS vars in layout.tsx) === */
--font-heading: var(--font-fraunces), serif;
--font-body: var(--font-public-sans), sans-serif;
/* === FONT WEIGHTS === */
--font-weight-heading: 900;
--font-weight-body: 600;
--font-weight-normal: 400;
/* Fluid section title: scales from 2rem at ~267px to 8rem at ~1707px */
--text-section-title: clamp(2rem, 7.5vw, 8rem);
/* === LINE HEIGHT === */
--line-height-tight: 1.2;
--line-height-normal: 1.5;
--line-height-relaxed: 1.65;
/* === FRAUNCES VARIABLE AXES === */
--fraunces-wonk: 1;
--fraunces-soft: 0;
/* === COLOR PALETTE: 2-color system === */
--cream: #f4f0e8;
--blue: #041cf3;
/* === SEMANTIC COLORS === */
--background: var(--cream);
--foreground: var(--blue);
--card: var(--cream);
--card-foreground: var(--blue);
--primary: var(--blue);
--primary-foreground: var(--cream);
--secondary: var(--cream);
--secondary-foreground: var(--blue);
--muted: var(--cream);
--muted-foreground: rgba(4, 28, 243, 0.5);
--accent: var(--blue);
--accent-foreground: var(--cream);
--destructive: var(--blue);
--border: var(--blue);
--ring: var(--blue);
/* === SPACING (8pt Linear Scale) === */
--space-0: 0;
--space-1: 0.5rem;
--space-2: 1rem;
--space-3: 1.5rem;
--space-4: 2rem;
--space-5: 2.5rem;
--space-6: 3rem;
--space-7: 3.5rem;
--space-8: 4rem;
--space-10: 5rem;
--space-12: 6rem;
--space-16: 8rem;
--space-20: 10rem;
/* === BORDERS === */
--border-width: 3px;
--radius: 0px;
/* === BRUTALIST SHADOWS === */
--shadow-brutal-xs: 1px 1px 0 var(--blue);
--shadow-brutal-sm: 3px 3px 0 var(--blue);
--shadow-brutal: 5px 5px 0 var(--blue);
--shadow-brutal-md: 7px 7px 0 var(--blue);
--shadow-brutal-lg: 8px 8px 0 var(--blue);
--shadow-brutal-xl: 10px 10px 0 var(--blue);
--shadow-brutal-2xl: 12px 12px 0 var(--blue);
/* === GRID === */
--grid-gap: var(--space-3);
--section-content-width: 72rem;
/* === ANIMATION === */
--ease-default: ease;
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
--ease-decelerate: cubic-bezier(0.25, 0, 0, 1);
--ease-micro: cubic-bezier(0.22, 1, 0.36, 1);
--duration-fast: 100ms;
--duration-normal: 150ms;
--duration-slow: 350ms;
--duration-spring: 220ms;
--delay-normal: 200ms;
}
@theme inline {
--font-heading: var(--font-fraunces);
--font-body: var(--font-public-sans);
--color-cream: var(--cream);
--color-blue: var(--blue);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-ring: var(--ring);
--color-border: var(--border);
--radius-sm: var(--radius);
--radius-md: var(--radius);
--radius-lg: var(--radius);
--container-section: var(--section-content-width);
--spacing-footer: 5rem;
--spacing-footer-wide: 4rem;
--text-section-title: var(--text-section-title);
--shadow-brutal-xs: var(--shadow-brutal-xs);
--shadow-brutal-sm: var(--shadow-brutal-sm);
--shadow-brutal: var(--shadow-brutal);
--shadow-brutal-md: var(--shadow-brutal-md);
--shadow-brutal-lg: var(--shadow-brutal-lg);
--shadow-brutal-xl: var(--shadow-brutal-xl);
--shadow-brutal-2xl: var(--shadow-brutal-2xl);
}
@layer base {
* {
@apply border-border;
}
::selection {
background-color: var(--blue);
color: var(--cream);
}
:focus-visible {
outline: var(--border-width) solid var(--blue);
outline-offset: 2px;
}
html {
font-size: var(--font-size);
}
body {
@apply bg-background text-foreground;
font-family: var(--font-body);
font-weight: var(--font-weight-body);
line-height: var(--line-height-tight);
overflow-x: hidden;
}
/* Subtle blue-tinted grain on parchment */
body::before {
content: "";
position: fixed;
inset: 0;
background-image:
repeating-linear-gradient(
0deg,
transparent,
transparent 2px,
rgba(4, 28, 243, 0.015) 2px,
rgba(4, 28, 243, 0.015) 4px
),
repeating-linear-gradient(
90deg,
transparent,
transparent 2px,
rgba(4, 28, 243, 0.015) 2px,
rgba(4, 28, 243, 0.015) 4px
);
opacity: 0.6;
display: block;
pointer-events: none;
z-index: 1;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: var(--font-heading);
font-weight: var(--font-weight-heading);
line-height: var(--line-height-tight);
font-variation-settings:
"WONK" var(--fraunces-wonk),
"SOFT" var(--fraunces-soft);
color: var(--blue);
}
h1 {
font-size: var(--text-4xl);
}
h2 {
font-size: var(--text-3xl);
}
h3 {
font-size: var(--text-2xl);
}
h4 {
font-size: var(--text-xl);
}
h5 {
font-size: var(--text-lg);
}
p {
font-family: var(--font-body);
font-size: var(--text-base);
font-weight: var(--font-weight-body);
color: var(--blue);
}
a {
color: var(--blue);
text-decoration: none;
}
blockquote {
font-family: var(--font-heading);
font-size: var(--text-xl);
border-left: var(--border-width) solid var(--blue);
padding-left: var(--space-4);
margin: var(--space-6) 0;
}
}
/* Button elevation transition — only transform animates; shadow snaps instantly */
.btn-transition {
transition: transform 0.13s var(--ease-micro);
}
/* Brutalist utility classes */
.brutal-shadow {
box-shadow: var(--shadow-brutal);
}
.brutal-shadow-sm {
box-shadow: var(--shadow-brutal-sm);
}
.brutal-shadow-lg {
box-shadow: var(--shadow-brutal-lg);
}
@utility brutal-border {
border: var(--border-width) solid var(--blue);
}
@utility brutal-border-top {
border-top: var(--border-width) solid var(--blue);
}
@utility brutal-border-bottom {
border-bottom: var(--border-width) solid var(--blue);
}
@utility brutal-border-left {
border-left: var(--border-width) solid var(--blue);
}
@utility brutal-border-right {
border-right: var(--border-width) solid var(--blue);
}
/* Apply Fraunces variable axes to non-heading elements using the heading font */
.font-wonk {
font-variation-settings:
"WONK" var(--fraunces-wonk),
"SOFT" var(--fraunces-soft);
}
/* Sidebar divider: bottom border on mobile, right border on desktop */
.brutal-border-sidebar {
border-bottom: var(--border-width) solid var(--blue);
}
@media (min-width: 1024px) {
.brutal-border-sidebar {
border-bottom: none;
border-right: var(--border-width) solid var(--blue);
}
}
/* Editorial rich-text typography */
.rich-text {
max-width: 65ch;
line-height: var(--line-height-relaxed);
font-feature-settings: "onum";
hanging-punctuation: first last;
text-wrap: pretty;
}
.rich-text a {
border-bottom: var(--border-width) solid var(--blue);
opacity: 1;
transition: opacity var(--duration-normal);
}
.rich-text a:hover {
opacity: 0.6;
}
.rich-text p + p {
margin-top: 1.2em;
}
.rich-text ul {
list-style: none;
padding-left: 0;
margin: 1em 0;
}
.rich-text ul li {
display: grid;
grid-template-columns: auto 1fr;
gap: 0.65em;
align-items: start;
margin-top: 0.5em;
}
.rich-text ul li:first-child {
margin-top: 0;
}
.rich-text ul li::before {
content: "◆";
color: var(--blue);
font-size: 0.55em;
/* line-height matches parent so diamond centers within the first line box */
line-height: calc(var(--line-height-relaxed) / 0.55);
}
/* Cross-section view transition (navigation between sections) */
::view-transition-old(section-content) {
animation-name: section-fade-out;
animation-duration: var(--duration-normal);
animation-timing-function: var(--ease-default);
animation-fill-mode: both;
}
::view-transition-new(section-content) {
animation-name: section-fade-in;
animation-duration: var(--duration-spring);
animation-timing-function: var(--ease-spring);
animation-fill-mode: both;
}
@keyframes section-fade-out {
from {
opacity: 1;
transform: translateY(0);
}
to {
opacity: 0;
transform: translateY(-8px);
}
}
@keyframes section-fade-in {
from {
opacity: 0;
transform: translateY(12px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Section body slide-in from right */
::view-transition-old(section-body) {
animation-name: section-body-out;
animation-duration: var(--duration-normal);
animation-timing-function: var(--ease-default);
animation-fill-mode: both;
}
::view-transition-new(section-body) {
animation-name: section-body-in;
animation-duration: var(--duration-spring);
animation-timing-function: var(--ease-spring);
animation-fill-mode: both;
animation-delay: var(--delay-normal);
}
@keyframes section-body-out {
from {
opacity: 1;
transform: translateX(0) scale(1);
}
to {
opacity: 0;
transform: translateX(-12px) scale(0.98);
}
}
@keyframes section-body-in {
from {
opacity: 0;
transform: translateX(48px) scale(0.98);
}
to {
opacity: 1;
transform: translateX(0) scale(1);
}
}