@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    --font: 'Space Grotesk', system-ui, sans-serif;
    --text-dark: #1a1a2e;
    --text-muted: #4a4a5c;
    --card-border: rgba(0, 0, 0, 0.08);
    --input-border: #d8d8e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* —— Shared layout: footer pinned to bottom —— */
body.page-shell {
    font-family: var(--font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

body.page-home .site-footer {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

body.page-home .site-footer a {
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.site-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    z-index: 1;
}

.site-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 1rem 1.25rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    z-index: 2;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    opacity: 0.95;
    transition: opacity 0.15s ease;
}

.site-footer a:hover {
    opacity: 1;
}

.site-footer .sep {
    margin: 0 0.35em;
    opacity: 0.6;
}

/* —— Inner pages: same energy as home, readable card —— */
body.subpage {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: subpageGradient 18s ease infinite;
    color: var(--text-dark);
    overflow-x: hidden;
}

@keyframes subpageGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.subpage .site-footer {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.subpage .site-footer a {
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.subpage .site-main {
    justify-content: flex-start;
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
}

.subpage-inner {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.25rem 2.5rem;
}

.content-card {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2rem 1.75rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

.subpage h1 {
    font-size: clamp(1.5rem, 4vw, 1.85rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.subpage .lede {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 1.75rem;
}

.subpage .content-card .lede:has(+ .about-portrait) {
    margin-bottom: 1rem;
}

.about-portrait {
    margin: 0 0 1.75rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    line-height: 0;
}

.about-portrait img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

.back-home {
    display: inline-block;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.back-home:hover {
    color: #fff;
    border-bottom-color: #fff;
}

/* —— Accordion —— */
.accordion {
    border-top: 1px solid #e8e8ee;
}

.accordion details {
    border-bottom: 1px solid #e8e8ee;
}

.accordion summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
}

.accordion summary::-webkit-details-marker {
    display: none;
}

.accordion summary::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-top: -0.25rem;
}

.accordion details[open] summary::after {
    transform: rotate(225deg);
    margin-top: 0.15rem;
}

.accordion .panel-body {
    padding: 0 0 1.15rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.accordion .panel-body p + p {
    margin-top: 0.65rem;
}

.accordion .panel-body .project-preview + p {
    margin-top: 0.65rem;
}

.accordion .panel-body a {
    font-weight: 600;
    color: #1d9bf0;
    text-decoration: none;
}

.accordion .panel-body a:hover {
    text-decoration: underline;
}

.accordion .panel-body a.project-preview {
    display: block;
    margin-top: 0.85rem;
    margin-bottom: 0;
    max-width: 500px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    color: inherit;
    font-weight: 400;
    text-decoration: none;
    line-height: 0;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.accordion .panel-body a.project-preview:hover {
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.accordion .panel-body a.project-preview:focus-visible {
    outline: 2px solid #23a6d5;
    outline-offset: 3px;
}

.accordion .panel-body a.project-preview img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

/* —— Contact form —— */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-stack label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: var(--text-dark);
}

.form-stack input,
.form-stack textarea {
    width: 100%;
    font-family: var(--font);
    font-size: 1rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-dark);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-stack input:focus,
.form-stack textarea:focus {
    outline: none;
    border-color: #23a6d5;
    box-shadow: 0 0 0 3px rgba(35, 166, 213, 0.2);
}

.form-stack textarea {
    min-height: 140px;
    resize: vertical;
}

.form-submit {
    margin-top: 0.25rem;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #e73c7e, #23a6d5);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.form-submit:disabled {
    cursor: not-allowed;
    opacity: 0.85;
    transform: none;
}

.social-block {
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e8e8ee;
}

.social-block p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 0.75rem;
}

.social-block a {
    font-weight: 600;
    color: #1d9bf0;
    text-decoration: none;
}

.social-block a:hover {
    text-decoration: underline;
}

.form-error {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #7a1530;
    background: rgba(231, 60, 126, 0.12);
    border: 1px solid rgba(231, 60, 126, 0.35);
    border-radius: 8px;
}

.form-success {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
}

.form-success-accent {
    height: 5px;
    margin: 0 auto 1.5rem;
    max-width: 12rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #e73c7e, #23a6d5);
    box-shadow: 0 2px 12px rgba(35, 166, 213, 0.35);
}

.form-success-icon {
    margin-bottom: 1.25rem;
}

.form-success-icon svg {
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.12));
}

.form-success-title {
    font-size: clamp(1.65rem, 5vw, 2.1rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.85rem;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.form-success-lead {
    font-size: 1.08rem;
    line-height: 1.55;
    color: var(--text-dark);
    font-weight: 500;
    margin-bottom: 0.75rem;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.form-success-tip {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
    max-width: 26rem;
    margin-left: auto;
    margin-right: auto;
}

@media (prefers-reduced-motion: no-preference) {
    .form-success:not([hidden]) {
        animation: formSuccessIn 0.55s ease-out both;
    }
}

@keyframes formSuccessIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}

/* —— Projects: wide layout + alternate views (internal previews) —— */
.subpage-inner--wide {
    max-width: 1280px;
}

.internal-preview-nav {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: -0.5rem 0 1.25rem;
    line-height: 1.5;
}

.internal-preview-nav a {
    font-weight: 600;
    color: #1d9bf0;
    text-decoration: none;
}

.internal-preview-nav a:hover {
    text-decoration: underline;
}

/* Carousel */
.project-carousel {
    margin-top: 0.25rem;
}

.project-carousel-viewport {
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: #fafafc;
}

.project-carousel-track {
    display: flex;
    transition: transform 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
    .project-carousel-track {
        transition: none;
    }
}

.project-carousel-slide {
    flex: 0 0 100%;
    min-width: 0;
    padding: 1.5rem 1.35rem 1.65rem;
    box-sizing: border-box;
}

.project-carousel-slide h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.65rem;
}

.project-carousel-slide p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.85rem;
}

.project-carousel-slide p:last-child {
    margin-bottom: 0;
}

.project-carousel-slide a:not(.project-preview) {
    font-weight: 600;
    color: #1d9bf0;
    text-decoration: none;
}

.project-carousel-slide a:not(.project-preview):hover {
    text-decoration: underline;
}

.project-carousel-slide .project-preview {
    display: block;
    margin: 0.85rem 0 0.65rem;
    max-width: min(500px, 100%);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    line-height: 0;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.project-carousel-slide .project-preview:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.project-carousel-slide .project-preview:focus-visible {
    outline: 2px solid #23a6d5;
    outline-offset: 3px;
}

.project-carousel-slide .project-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.project-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.1rem;
}

.project-carousel-btn {
    font-family: var(--font);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: #fff;
    color: var(--text-dark);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.project-carousel-btn:hover {
    background: #f4f4f8;
    border-color: #c8c8d4;
}

.project-carousel-btn:focus-visible {
    outline: 2px solid #23a6d5;
    outline-offset: 2px;
}

.project-carousel-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.project-carousel-counter {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 3.5rem;
    text-align: center;
}

/* Grid cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.25rem;
    margin-top: 0.25rem;
}

.project-card {
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fafafc;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.project-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.project-card-preview {
    display: block;
    line-height: 0;
    border-bottom: 1px solid var(--card-border);
    color: inherit;
    text-decoration: none;
}

.project-card-preview:focus-visible {
    outline: 2px solid #23a6d5;
    outline-offset: -2px;
}

.project-card-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.project-card-body {
    padding: 1.1rem 1.15rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-card-body h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.project-card-body p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    flex: 1;
    margin-bottom: 0.75rem;
}

.project-card-body a.project-card-link {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1d9bf0;
    text-decoration: none;
    margin-top: auto;
}

.project-card-body a.project-card-link:hover {
    text-decoration: underline;
}
