*,
::before,
::after {
    box-sizing: border-box;
}

:root {

    --color-brand-50:  #cad2c5;
    --color-brand-100: #a4bfa1;
    --color-brand-500: #4a6d56;
    --color-brand-700: #354f52;
    --color-brand-900: #2f3e46;

    /* Accent Palette */
    --color-accent-blue:   #a1b3bf;
    --color-accent-purple: #bca1bf;
    --color-accent-warm:   #bfada1;

    /* Surface */
    --surface-1: #ffffff;
    --surface-2: #f8f9fa;
    --surface-3: #eef1ee;
    --surface-dark: #212529;

    /* Text */
    --text-1: #2f3e46;
    --text-2: #5c6b73;
    --text-inverse: #ffffff;

    /* Semantic */
    --primary: var(--color-brand-500);
    --primary-hover: var(--color-brand-700);
    --primary-subtle: var(--color-brand-50);

    --background: var(--surface-1);
    --foreground: var(--text-1);

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.625rem;
    --radius-lg: 1rem;

    /* Spacing */
    --space-xs: .25rem;
    --space-sm: .5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;

    /* Shadow */
    --shadow-sm: 0 2px 8px rgb(0 0 0 / 0.08);
    --shadow-md: 0 8px 24px rgb(0 0 0 / 0.12);
    --shadow-lg: 0 16px 48px rgb(0 0 0 / 0.18);

}

:root[data-theme="dark"] {
    /* Surface */
    --surface-1: #11161d;
    --surface-2: #1a222d;
    --surface-3: #222c38;
    --surface-dark: #000000;

    /* Text */
    --text-1: #f1f4f8;
    --text-2: #acb5c0;
    --text-inverse: #11161d;

    /* Semantic */
    --background: var(--surface-1);
    --foreground: var(--text-1);

    --primary: var(--color-brand-500);
    --primary-hover: var(--color-brand-100);
    --primary-subtle: var(--color-brand-700);

    /* Borders */
    --border: #3e4855;
    --border-subtle: rgb(164 180 201 / 30%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgb(0 0 0 / 0.35);
    --shadow-md: 0 8px 24px rgb(0 0 0 / 0.45);
    --shadow-lg: 0 16px 48px rgb(0 0 0 / 0.6);

    --text-on-media: #ffffff;
}

html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif, Apple Color Emoji, "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

#nav-bar {
position: sticky;
top: 0;
z-index: 9999;

display: flex;
align-items: center;
justify-content: space-between;

padding: 0.75rem 1.5rem;

background: var(--color-brand-100); /* var(--color-brand-700) with transparency */
backdrop-filter: blur(14px);
-webkit-backdrop-filter: blur(14px);

border-bottom: 1px solid rgb(255 255 255 / 0.08);

box-shadow: var(--shadow-md);
}

#nav-bar p {
margin: 0;
font-size: 1.1rem;
font-weight: 700;
color: var(--text-inverse);
letter-spacing: 0.02em;
}

#nav-bar nav,
#nav-bar .nav-links {
display: flex;
align-items: center;
gap: 0.5rem;
}

#nav-bar a {
position: relative;
display: inline-flex;
align-items: center;

padding: 0.65rem 1rem;
border-radius: var(--radius-md);

color: var(--text-1);
text-decoration: none;
font-weight: 500;

transition:
background-color 0.25s ease,
color 0.25s ease,
transform 0.2s ease;
}

#nav-bar a::after {
content: "";
position: absolute;

left: 16px;
right: 16px;
bottom: 8px;

height: 2px;
border-radius: 999px;

background: var(--color-brand-100);

transform: scaleX(0);
transform-origin: center;
transition: transform 0.25s ease;
}

#nav-bar a:hover,
#nav-bar a:focus-visible {
color: var(--text-inverse);
background: rgb(255 255 255 / 0.08);
transform: translateY(-1px);
}

#nav-bar a:hover::after,
#nav-bar a:focus-visible::after,
#nav-bar a.active::after {
transform: scaleX(1);
}

#nav-bar a.active {
color: var(--text-inverse);
background: rgb(255 255 255 / 0.12);
}

#nav-bar a:focus-visible {
outline: 2px solid var(--color-brand-100);
outline-offset: 3px;
}


dialog {
    border: dotted;
    border-radius: 1rem;
    background-color: var(--color-brand-50);
    max-width: min(90vw, 700px);
    width: 100%;
    box-shadow:
    0 20px 60px rgb(0 0 0 / 0.25),
    0 8px 24px rgb(0 0 0 / 0.15);
    animation: dialog-in 180ms ease-out;
}


dialog::backdrop {
    background: rgb(0 0 0 / 0.5);
    backdrop-filter: blur(6px);
    animation: backdrop-in 180ms ease-out;
}


dialog > * {
    padding: 1.5rem;
}

dialog button {
    padding: 0.65rem 1.2rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--color-brand-700);
    color: white;
    font: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

dialog button:hover {
    background: var(--color-brand-900);
}

dialog button:active {
    transform: scale(0.97);
}


@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translateY(1rem) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes backdrop-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


.image-block {
    margin: 2rem 0;
}

.image-block__image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0.75rem;
}


.image-block__caption {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-inline: 0.25rem;
    font-size: 0.9rem;
    color: var(--color-text-muted, #666);
    border-top: 1px solid var(--color-border, #e5e7eb);
    padding-top: 0.5rem;
}

.image-block__text {
    font-style: italic;
    flex: 1;
}

.image-block__credit {
    white-space: nowrap;
    font-size: 0.8rem;
    opacity: 0.8;
}

@media (max-width: 640px) {
    .image-block__caption {
        flex-direction: column;
        align-items: flex-start;
    }

    .image-block__credit {
        white-space: normal;
    }
}


.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.gallery-img {
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
    display: block;
    max-height: 480px;
}
.gallery-img:hover { opacity: 0.7; }

/* The Modal (background) */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.9);
}

/* Modal Content (image) */
.modal-content {
    margin: auto;
    display: block;
    width: 75%;
}

/* Caption of Modal Image */
#caption {
margin: auto;
display: block;
width: 80%;
max-width: 700px;
text-align: center;
color: #ccc;
padding: 10px 0;
height: 150px;
}

/* Animation */
.modal-content, #caption {
    -webkit-animation-name: zoom;
    -webkit-animation-duration: 0.6s;
    animation-name: zoom;
    animation-duration: 0.6s;
}
.out {
    animation-name: zoom-out;
    animation-duration: 0.6s;
}
@-webkit-keyframes zoom {
    from { -webkit-transform: scale(1) }
    to { -webkit-transform: scale(2) }
}
@keyframes zoom {
    from { transform: scale(0.4) }
    to { transform: scale(1) }
}
@keyframes zoom-out {
    from { transform: scale(1) }
    to { transform: scale(0) }
}

/* Close Button */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}
.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
}

/* 100% Image Width on Smaller Screens */
@media only screen and (max-width: 700px) {
    .modal-content {
        width: 100%;
    }
}

portfolio {
    padding:var(--space-lg);
}

.portfolio-title {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1.25rem 2rem;

    text-align: center;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    color:var(--text-inverse);;
    background: linear-gradient(135deg,
                                var(--color-brand-500),
                                var(--color-brand-700));

    border-radius:var(--radius-lg);
    box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);

    position: relative;
    overflow: hidden;
}

.portfolio-title::before {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
                                transparent
    );

    transform: skewX(-25deg);
    transition: left 0.8s ease;
}

.portfolio-title:hover::before {
    left: 150%;
}

body {
    min-height: 100vh;
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    display: grid;
    gap: 3vw;
    grid-template-rows: min-content 1fr min-content;
    background: linear-gradient(
        180deg,
        var(--color-brand-100) 0%,
                                var(--color-brand-500) 40%,
                                var(--color-brand-700) 70%,
                                var(--color-brand-900) 100%
    );
    word-break: break-word;

}

portfolio {
    padding: 10px;
}

a {
    color: var(--text-inverse);

}

footer {
    margin-top: 4rem;
    padding: 2rem 1.5rem;

    background: linear-gradient(
        180deg,
        var(--color-brand-100),
                                var(--color-brand-500)
    );

    color: var(--text-inverse);
    text-align: center;

    border-top: 1px solid rgb(255 255 255 / 0.08);
    box-shadow: 0 -8px 24px rgb(0 0 0 / 0.12);
}

footer p {
    margin: 0;
    color: var(--text-2);
    font-size: 0.95rem;
    line-height: 1.6;
}

footer a {
    color: var(--color-brand-100);
    text-decoration: none;
    font-weight: 500;
    color: var(--text-2);
    transition: color 0.25s ease;
}

footer a:hover,
footer a:focus-visible {
    color:var(--text-inverse);;
}

footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.header {
    display: block;
    font-size: 1.5em;
    margin-top: 0.83em;
    margin-bottom: 0.83em;
    margin-left: 0;
    margin-right: 0;
    font-weight: bold;
}

.article {
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;

}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    appearance: none;
    cursor: pointer;

    padding: 0.9rem 1.8rem;
    margin: 1rem;

    border: none;
    border-radius: var(--radius-md);

    background: linear-gradient(
        135deg,
        var(--color-brand-500),
                                var(--color-brand-700)
    );

    color: var(--text-inverse);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    white-space: nowrap;

    box-shadow: var(--shadow-sm);

    transition:
    transform 0.2s ease,
    box-shadow 0.25s ease,
    background 0.25s ease,
    opacity 0.25s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);

    background: linear-gradient(
        135deg,
        var(--color-brand-700),
                                var(--color-brand-900)
    );
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn:focus-visible {
    outline: 3px solid var(--color-brand-100);
    outline-offset: 3px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


.container {
    width: min(90%, 1200px);
    margin: 2rem auto;
    padding: 2rem;

    background: var(--color-brand-50);
    border-radius: 16px;

    box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.08);

    border: 1px solid rgba(0, 0, 0, 0.06);

    box-sizing: border-box;
}
.template-homepage main {
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin: 0 auto;

}

.skip-link {
    position: absolute;
    top: -30px;
}

.skip-link:focus-visible {
    top: 5px;
}

.page-form label {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    text-align:justify

}

.page-form :is(textarea, input, select) {
    width: 100%;
    max-width: 500px;
    min-height: 40px;
    margin-top: 5px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

}

.page-form .helptext {
    font-style: italic;
}


.template-portfolio .container,
.template-portfolio .container * {
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    overflow-x: hidden;
}
