/* ==========================================================
   antoni.us — one-page portfolio
   Sections: hero / recently / art / tech / education / about
   ========================================================== */

/* =============================
   ROOT VARIABLES
   ============================= */
:root {
    --dark: #1f1f1f;
    --dark-text: #f0f0f0;
    --light: #fafafa;
    --text: #222;
    --muted: #888;

    --accent-recently: #e05c00;
    --accent-art: #f0c030;
    --accent-tech: #c880e8;
    --accent-education: #70d882;
    --accent-about: #999999;

    /* live accent — swapped by JS as sections scroll into view */
    --live: var(--accent-recently);

    --font: 'Roboto', Arial, sans-serif;
    --font-heading: 'Raleway', Arial, sans-serif;

    --nav-height: 56px;
}

/* =============================
   RESET & BASE
   ============================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
    scroll-snap-type: y proximity;
}

body {
    font-family: var(--font);
    background: var(--light);
    color: var(--text);
}

img {
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =============================
   REVEAL-ON-SCROLL ANIMATION
   ============================= */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--d, 0s);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; scroll-snap-type: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* =============================
   TOP NAV
   ============================= */
.topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 32px;
    background: rgba(31, 31, 31, 0.96);
    backdrop-filter: blur(8px);
    z-index: 100;
    transform: translateY(-100%);
    transition: transform 0.35s ease;
}

.topnav.show {
    transform: translateY(0);
}

.topnav-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.topnav-links {
    display: flex;
    gap: 4px;
    margin-left: auto;
    overflow-x: auto;
    scrollbar-width: none;
}

.topnav-links::-webkit-scrollbar { display: none; }

.topnav-link {
    font-size: 0.82rem;
    color: #999;
    padding: 8px 10px;
    border-radius: 4px;
    white-space: nowrap;
    transition: color 0.25s;
}

.topnav-link:hover {
    color: #fff;
}

.topnav-link.active {
    color: var(--live);
    font-weight: 500;
}

/* =============================
   PANELS (sections)
   ============================= */
.panel {
    min-height: 100vh;
    min-height: 100svh;
    scroll-snap-align: start;
    padding: 96px max(6vw, 24px) 80px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* subtle accent-tinted backgrounds separate the sections */
#recently  { background: #fbf4ee; }
#art       { background: #fbf7ea; }
#tech      { background: #f7f2fa; }
#education { background: #f0f8f1; }
#about     { background: #f4f4f4; }

.panel-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--panel-accent);
    margin-bottom: 40px;
}

.panel-title .domain {
    opacity: 0.6;
}

.panel-intro {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #666;
    max-width: 560px;
    margin: -24px 0 36px;
}

/* =============================
   HERO
   ============================= */
.hero-panel {
    background: var(--dark);
    color: var(--dark-text);
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    padding: 0;
    scroll-snap-align: start;
}

.hero-inner {
    padding: clamp(40px, 9vh, 90px) max(6vw, 24px);
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

.hero-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2rem, 5.5vw, 3.4rem);
    color: #fff;
    letter-spacing: -1px;
    display: block;
    animation: heroFade 1s ease both;
}

.hero-tagline {
    font-size: clamp(1.1rem, 2.6vw, 1.45rem);
    color: #ccc;
    font-style: italic;
    margin-top: 14px;
    line-height: 1.5;
    animation: heroFade 1s ease 0.25s both;
}

.hero-tagline #tagline-cycle {
    transition: opacity 0.5s ease;
    color: #fff;
}

.hero-intro {
    font-size: clamp(1.05rem, 2.1vw, 1.25rem);
    line-height: 1.8;
    color: #aaa;
    max-width: 480px;
    margin-top: 36px;
    animation: heroFade 1s ease 0.5s both;
}

@keyframes heroFade {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

.hero-scroll-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: heroFade 1s ease 1.2s both;
}

.hero-scroll-hint::after {
    content: "↓";
    font-size: 1.4rem;
    animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
}

/* =============================
   RECENTLY
   ============================= */
#recently { --panel-accent: var(--accent-recently); }

.recent-list {
    list-style: none;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.recent-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 18px;
    border-left: 3px solid var(--panel-accent);
}

.recent-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 6px;
    background: #eee;
    margin-bottom: 10px;
}

.recent-date {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #999;
}

.recent-lead {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    color: #222;
}

a.recent-link {
    transition: color 0.2s;
}

a.recent-link:hover {
    color: var(--panel-accent);
}

a.recent-link::after {
    content: " \2197";
    font-size: 0.75em;
    color: var(--panel-accent);
    opacity: 0;
    transition: opacity 0.2s;
}

a.recent-link:hover::after {
    opacity: 1;
}

.recent-detail {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #777;
}

/* =============================
   ART
   ============================= */
#art { --panel-accent: var(--accent-art); }

.art-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 32px;
}

.art-card {
    display: block;
    cursor: pointer;
    text-align: left;
    background: none;
    border: none;
    font-family: var(--font);
    transition: transform 0.2s;
    padding: 0;
}

.art-card:hover {
    transform: translateY(-4px);
}

.art-card-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: #eee;
    margin-bottom: 12px;
}

.art-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.art-card:hover .art-card-thumb img {
    transform: scale(1.04);
}

.art-card h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #222;
}

.art-card p {
    font-size: 0.8rem;
    color: var(--muted);
}

/* =============================
   TECH
   ============================= */
#tech { --panel-accent: var(--accent-tech); }

.tech-group {
    margin-bottom: 48px;
}

.tech-group-title {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--panel-accent);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--panel-accent);
}

.tech-row {
    border-bottom: 1px solid #e6e6e6;
}

.tech-row-head {
    width: 100%;
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 14px 4px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    transition: background 0.15s;
}

.tech-row-head:hover {
    background: #f0f0f0;
}

.tech-row-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: #222;
    white-space: nowrap;
}

.tech-row-medium {
    font-size: 0.8rem;
    color: var(--muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tech-row-chevron {
    color: var(--panel-accent);
    font-size: 0.8rem;
    transition: transform 0.25s;
    flex-shrink: 0;
}

.tech-row.open .tech-row-chevron {
    transform: rotate(180deg);
}

.tech-row-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.tech-row.open .tech-row-body {
    grid-template-rows: 1fr;
}

.tech-row-body-inner {
    overflow: hidden;
}

.tech-row-photo {
    display: block;
    width: 100%;
    max-width: 680px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 6px;
    background: #eee;
    margin: 12px 4px 8px;
}

.tech-row-desc {
    font-size: 0.92rem;
    line-height: 1.75;
    color: #555;
    padding: 4px 4px 20px;
    max-width: 680px;
}

.tech-row-desc p {
    margin-bottom: 12px;
}

.tech-row-desc p:last-child {
    margin-bottom: 0;
}

/* =============================
   EDUCATION
   ============================= */
#education { --panel-accent: var(--accent-education); }

.edu-list {
    list-style: none;
    max-width: 720px;
    display: flex;
    flex-direction: column;
}

.edu-item {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 14px 4px;
    border-bottom: 1px solid #e6e6e6;
}

.edu-item h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
}

.edu-item p {
    font-size: 0.85rem;
    color: var(--muted);
}

/* =============================
   ABOUT
   ============================= */
#about { --panel-accent: var(--accent-about); }

.about-top {
    display: flex;
    gap: 48px;
    align-items: flex-start;
    margin-bottom: 64px;
    flex-wrap: wrap;
}

.about-photo {
    width: 240px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.about-text {
    flex: 1;
    min-width: 280px;
    max-width: 620px;
}

.about-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 4px;
}

.about-pronunciation {
    font-size: 0.9rem;
    color: #777;
    font-style: italic;
    margin-bottom: 24px;
}

.about-bio p {
    font-size: 1rem;
    line-height: 1.85;
    color: #222;
    margin-bottom: 16px;
}

.about-contact {
    margin-top: 8px;
    font-size: 0.95rem;
}

.about-contact a {
    border-bottom: 1px solid #999;
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
}

.about-contact a:hover {
    color: #000;
    border-color: #222;
}

/* CV */
.cv-heading-main {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #777;
    margin-bottom: 24px;
}

.cv-columns {
    columns: 2;
    column-gap: 56px;
}

.cv-section {
    break-inside: avoid;
    margin-bottom: 32px;
}

.cv-heading {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 12px;
}

.cv-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cv-list li {
    font-size: 0.85rem;
    color: #333;
    line-height: 1.5;
    display: flex;
    gap: 14px;
}

.cv-year {
    color: #999;
    min-width: 76px;
    flex-shrink: 0;
    font-size: 0.8rem;
}

/* =============================
   FOOTER
   ============================= */
.site-footer {
    background: var(--dark);
    color: #999;
    padding: 36px max(6vw, 24px);
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 0.82rem;
}

.site-footer .footer-name {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fff;
}

.site-footer .footer-links {
    margin-left: auto;
    display: flex;
    gap: 20px;
}

.site-footer a {
    transition: color 0.2s;
}

.site-footer a:hover {
    color: #fff;
}

/* =============================
   ART MODAL
   ============================= */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
}

.modal.open {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(760px, 100%);
    background: #fff;
    overflow-y: auto;
    padding: 64px 48px 80px;
    animation: slideIn 0.35s cubic-bezier(0.25, 0.8, 0.35, 1);
}

@keyframes slideIn {
    from { transform: translateX(60px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.modal-close {
    position: sticky;
    top: 0;
    float: right;
    margin: -44px -24px 0 0;
    font-size: 1.7rem;
    line-height: 1;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 5;
    padding: 8px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #222;
}

.modal-hero {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin-bottom: 28px;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
    color: var(--accent-art);
}

.modal-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 32px;
}

.modal-desc {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 24px;
}

.modal-section {
    margin-bottom: 28px;
}

.modal-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    color: var(--accent-art);
}

.modal-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-list li {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.modal-list a {
    color: var(--accent-art);
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
}

.modal-list a:hover {
    opacity: 0.7;
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 32px 0 28px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
}

.modal-gallery-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.modal-gallery-img:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

.gallery-caption {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.4;
}

.modal-ext-link {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-art);
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
    transition: opacity 0.2s;
}

.modal-ext-link:hover {
    opacity: 0.7;
}

/* =============================
   LIGHTBOX
   ============================= */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 300;
    align-items: center;
    justify-content: center;
}

.lightbox.open {
    display: flex;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 28px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    background: none;
    border: none;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    background: none;
    border: none;
    padding: 16px;
    user-select: none;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }

.lightbox-counter {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #aaa;
}

.lightbox-caption {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #ccc;
    text-align: center;
    max-width: 600px;
    padding: 0 24px;
}

/* =============================
   RESPONSIVE
   ============================= */
@media (max-width: 640px) {
    html {
        /* gentle snap fights long sections on small screens */
        scroll-snap-type: none;
    }

    .panel {
        padding: 72px 20px 56px;
        min-height: 0;
    }

    .hero-panel {
        min-height: 100svh;
    }

    .hero-inner {
        padding: 64px 24px;
    }

    .panel-title {
        font-size: 1.5rem;
        margin-bottom: 28px;
    }

    .topnav {
        padding: 0 16px;
        gap: 12px;
    }

    .topnav-name {
        font-size: 0.85rem;
    }

    .topnav.shrink {
        height: 44px;
    }

    .art-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }

    .tech-row-medium {
        display: none;
    }

    .edu-item {
        flex-direction: column;
        gap: 2px;
    }

    .edu-item h3 {
        white-space: normal;
    }

    .cv-columns {
        columns: 1;
    }

    .about-photo {
        width: 100%;
        max-width: 280px;
    }

    .modal-panel {
        padding: 56px 20px 64px;
    }

    .modal-close {
        margin: -40px 0 0 0;
    }

    .modal-title {
        font-size: 1.5rem;
    }
}
