rmcg.dev/projects/random/intersectional-observation/style.css

308 lines
5.6 KiB
CSS

*,
*::after,
*::before {
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root {
--bkg: linear-gradient(to top, #0f0915, #050307);
/* --dark: #050307; */
--dark: #050307;
--text: #f9f6fe;
--accent: #4233e4;
}
body {
font-family: "Nunito Sans", sans-serif;
font-size: clamp(1.1rem, 2vw + 1rem, 1.4rem);
line-height: 1.55;
background: var(--bkg);
color: var(--text);
}
nav {
position: fixed;
z-index: 10;
width: 100%;
padding-block: 1.2rem;
background-color: transparent;
transition: background-color 800ms cubic-bezier(0.64, 0.04, 0.26, 0.87);
}
nav.active {
background-color: var(--dark);
}
.nav-link[aria-current="page"] {
text-decoration: underline wavy #f8c348 0.15rem;
text-underline-offset: 0.5rem;
}
.nav-container {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
color: var(--accent);
margin-inline: 0.5rem;
width: clamp(3rem, 10vw, 7.5rem);
display: grid;
place-items: center;
}
.logo-link:focus-visible,
.nav-link:focus-visible {
outline: 4px solid var(--accent);
outline-offset: 0.2em;
border-radius: 0.5rem;
}
.nav-links {
display: flex;
align-items: center;
flex-direction: column;
gap: 1.5rem;
transform: translate3d(0, -200%, 0);
position: absolute;
z-index: -1;
top: 3rem;
left: 0;
right: 0;
background-color: var(--dark);
padding: 1.5rem;
border-bottom: 4px solid var(--accent);
text-align: center;
}
.nav-links.activated {
transition: transform 0.4s cubic-bezier(0.64, 0.04, 0.26, 0.87);
}
.btn {
color: var(--text);
text-decoration: none;
padding: 0.3rem 1.5rem;
cursor: pointer;
border-radius: 0.5rem;
}
.btn--accent {
background-color: var(--accent);
padding: 0.3rem 2rem;
}
.btn--menu {
color: var(--accent);
background-color: transparent;
border: none;
display: grid;
place-items: center;
padding-inline: 1rem;
transition: transform 0.3s cubic-bezier(0.64, 0.04, 0.26, 0.87);
}
li[role="none"],
.nav-link {
width: 100%;
display: block;
font-size: 1.1rem;
text-transform: uppercase;
}
.btn--menu[aria-expanded="true"] {
transform: rotate(-180deg);
}
.btn--menu[aria-expanded="true"] + .nav-links {
transform: translate3d(0, 0, 0);
}
@media (min-width: 768px) {
.btn--menu {
display: none;
}
.nav-links {
position: static;
transform: translate3d(0, 0, 0);
flex-direction: row;
border: 0;
z-index: 0;
padding: 0;
inset: 0;
background-color: transparent;
}
li[role="none"],
.nav-link {
width: initial;
}
}
main {
display: grid;
gap: clamp(4rem, 1.45454537rem + 11.636364vw, 8rem);
position: relative;
top: -10vh;
}
h1 {
font-size: clamp(2.5rem, 5vw + 1rem, 8rem);
font-size: bolder;
line-height: 1.1;
letter-spacing: 0.02em;
}
.h2 {
font-size: clamp(1.8rem, 4vw + 1rem, 3.5rem);
font-size: bolder;
line-height: 1.1;
color: var(--accent);
}
.h3 {
font-size: clamp(1.2rem, 3vw + 1rem, 2.2rem);
line-height: 1.1;
color: var(--accent);
}
.subheading {
color: var(--text);
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
header {
min-height: 100vh;
display: grid;
place-items: center;
text-align: center;
position: relative;
}
.header__img {
position: absolute;
height: 100%;
width: 100%;
object-fit: cover;
}
.container {
margin-inline: max((100% - 90rem) / 2, 1rem);
}
.container--sm {
margin-inline: max((100% - 70rem) / 2, 2rem);
}
.rise {
opacity: 0;
animation: rise 0.8s ease-in-out forwards;
}
.rise.subheading {
animation: rise 1.2s ease-in-out forwards 0.5s;
}
@keyframes rise {
0% {
transform: translateY(2rem);
opacity: 0;
}
100% {
transform: translateY(0);
opacity: 1;
}
}
.header-container {
display: grid;
gap: 1rem;
position: relative;
top: -5vh;
}
.stars {
padding: clamp(1.2rem, 3.5vw, 2.5rem) clamp(1.2rem, 5vw, 3rem) 0;
background-color: var(--dark);
display: grid;
border-radius: 0.5rem;
gap: 1rem;
}
.moons {
display: grid;
gap: 1rem;
}
#stars {
text-align: center;
}
.card-container {
display: flex;
flex-wrap: wrap;
gap: 2.5rem 3.5rem;
}
.card {
flex: 1 1 100%;
display: grid;
place-items: center;
gap: 1.5rem;
padding: 2.5rem 1.5rem 1.5rem;
border: 5px solid var(--accent);
border-radius: 0.5rem;
}
@media (min-width: 768px) {
.card {
flex: 1 1 28%;
}
}
.card__image {
width: clamp(4rem, 10vw, 8rem);
}
/* default transform was 1 second, I prefer a lower figure */
.fade-up {
opacity: 0;
transform: translate3d(0, 5rem, 0);
transition: transform 0.4s cubic-bezier(0.64, 0.04, 0.26, 0.87),
opacity 0.8s cubic-bezier(0.64, 0.04, 0.26, 0.87);
}
.fade-up.faded {
opacity: 1;
transform: translate3d(0, 0, 0);
}
/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
html:focus-within {
scroll-behavior: auto;
}
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}