
/* ========================================
   SHADOW — Adaptive Web Design
   Mobile First Stylesheet
======================================== */

/* 1. DESIGN TOKENS */

:root {
    color-scheme: dark;

    --bg: #111318;
    --surface: #1c1f26;
    --surface-hover: #292d36;

    --text: #f5f5f5;
    --text-muted: #b6b9c2;
    --accent: #e7e2d8;

    --border: #353943;

    --radius: 0.75rem;
    --container: 70rem;
}

/* 2. CSS RESET */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system,
                 BlinkMacSystemFont, "Segoe UI",
                 sans-serif;
    line-height: 1.7;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

/* 3. ACCESSIBILITY */

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

/* 4. TYPOGRAPHY */

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.2;
    letter-spacing: -0.03em;
}

h1 {
    font-size: clamp(3.5rem, 12vw, 8rem);
    letter-spacing: -0.07em;
}

h2 {
    font-size: clamp(2rem, 6vw, 3.5rem);
}

h3 {
    font-size: 1.3rem;
}

p {
    color: var(--text-muted);
    max-width: 65ch;
}

/* 5. GENERAL LAYOUT */

main > section {
    padding: 5rem 1.25rem;
    max-width: var(--container);
    margin-inline: auto;
}

section > h2 {
    margin-bottom: 1.5rem;
}

section > p {
    margin-bottom: 2rem;
}

/* 6. HEADER */

.site-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.06em;
}

.site-header nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;

    padding: 0;
    margin: 0;
    list-style: none;
}

.site-header nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.site-header nav a:hover {
    color: var(--text);
}

/* 7. HERO SECTION */

main > .hero {
    min-height: 85svh;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;

    position: relative;
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    z-index: -1;

    width: min(75vw, 25rem);
    aspect-ratio: 1;

    right: 0;
    top: 15%;

    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(231, 226, 216, 0.14),
        transparent 70%
    );

    pointer-events: none;
}

.hero h1 {
    margin-bottom: 1rem;
}

.hero p:first-of-type {
    color: var(--text);
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 500;
}

.hero p {
    max-width: 40rem;
}

.hero > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-top: 1.5rem;
    padding: 0.9rem 1.5rem;

    background: var(--accent);
    color: var(--bg);

    border-radius: 0.4rem;
    font-weight: 600;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.hero > a:hover {
    background: white;
    transform: translateY(-3px);
}

/* 8. CONTENT SECTIONS */

main > section:not(.hero) {
    border-top: 1px solid var(--border);
}

section h3 {
    margin-top: 2rem;
}

section article p {
    margin-bottom: 1rem;
}

/* 9. MEANING CARDS */

.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;

    margin-top: 2.5rem;
}

.card {
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.card:hover {
    background: var(--surface-hover);
    transform: translateY(-4px);
}

.card h3 {
    margin-top: 0;
}

.card p {
    margin-bottom: 0;
}

/* 10. INTERACTIVE EXPERIMENT */

#shadow-experiment {
    min-height: 20rem;
    margin-top: 2rem;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    overflow: hidden;
}

/* 11. GALLERY */

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;

    margin-top: 2rem;
}

.gallery-grid figure {
    margin: 0;
    overflow: hidden;

    background: var(--surface);
    border-radius: var(--radius);
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;

    transition: transform 0.3s ease;
}

.gallery-grid figure:hover img {
    transform: scale(1.04);
}

.gallery-grid figcaption {
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 12. BEYOND SECTION */

#beyond article {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

#beyond article:last-child {
    border-bottom: none;
}

/* 13. FOOTER */

footer {
    padding: 3rem 1.25rem;
    text-align: center;

    border-top: 1px solid var(--border);
    background: var(--surface);
}

footer h2 {
    font-size: 2rem;
}

footer p {
    margin-inline: auto;
}

footer a {
    display: inline-block;
    margin: 1rem 0;
    text-decoration: underline;
    text-underline-offset: 0.3rem;
}

/* 14. TABLET */

@media (min-width: 48rem) {

    main > section {
        padding: 6rem 2rem;
    }

    .site-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 1.5rem 2rem;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 15. DESKTOP */

@media (min-width: 64rem) {

    main > section {
        padding: 8rem 2rem;
    }

    .site-header {
        padding-inline: max(
            2rem,
            calc((100% - var(--container)) / 2)
        );
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero {
        min-height: 90svh;
    }
}

/* 16. REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}



/* ========================================
   17. INTERACTIVE SHADOW EXPERIMENT
======================================== */

.experiment-scene {
    position: relative;
    height: 18rem;
    overflow: hidden;

    background: radial-gradient(
        ellipse at center,
        #303540,
        #171a21
    );

    --light-x: 50%;
    --shadow-offset: 0px;
}

.light-source {
    position: absolute;
    z-index: 4;

    top: 2rem;
    left: var(--light-x);

    width: 1.5rem;
    height: 1.5rem;

    border-radius: 50%;
    background: #ffe6a8;

    box-shadow:
        0 0 20px #ffe6a8,
        0 0 60px rgba(255, 230, 168, 0.4);

    transform: translateX(-50%);
}

.experiment-object {
    position: absolute;
    z-index: 3;

    width: 4rem;
    height: 5rem;

    left: 50%;
    bottom: 3rem;

    transform: translateX(-50%);

    border-radius: 0.4rem;

    background: linear-gradient(
        135deg,
        #858b97,
        #343943
    );
}

.object-shadow {
    position: absolute;
    z-index: 2;

    width: 6rem;
    height: 1.5rem;

    left: 50%;
    bottom: 2rem;

    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);

    filter: blur(8px);

    transform: translateX(
        calc(-50% + var(--shadow-offset))
    );

    transition: transform 0.15s ease;
}

.experiment-ground {
    position: absolute;
    z-index: 1;

    left: 0;
    right: 0;
    bottom: 0;

    height: 3rem;

    background: #252932;
    border-top: 1px solid #484e5b;
}

.experiment-controls {
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
}

.experiment-controls label {
    font-weight: 600;
}

.experiment-controls input {
    width: 100%;
    accent-color: var(--accent);
    cursor: pointer;
}

.experiment-controls output {
    color: var(--text-muted);
}

.experiment-controls p {
    margin: 0;
    font-size: 0.9rem;
}

@media (min-width: 48rem) {
    .experiment-scene {
        height: 24rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .object-shadow {
        transition: none;
    }
}
