/* ==========================================================
   Andreas Paraskeva portfolio
   Palette: crimson #cf0f37, rose #ff4f87, blush paper #fff0f3,
            petal #ffe0e8, wine ink #3a0714
   ========================================================== */

:root {
    --crimson: #cf0f37;
    --rose: #ff4f87;
    --on-crimson: #fff0f3;

    --paper: #fff0f3;
    --paper-2: #ffe0e8;
    --surface: #ffffff;
    --ink: #3a0714;
    --muted: #7d4452;
    --line: #f3b9c8;
    --accent: #cf0f37;

    --font-display: 'Anybody', 'Arial Black', Impact, sans-serif;
    --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

    --wrap: 76rem;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --bar-h: 4rem;
}

[data-theme='dark'] {
    --paper: #1c0710;
    --paper-2: #2a0c18;
    --surface: #240a15;
    --ink: #ffe6ed;
    --muted: #d3a1b0;
    --line: #4a1727;
    --accent: #ff6a8d;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--bar-h) + 1rem);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}
.on-crimson :focus-visible,
.bar :focus-visible,
.hero :focus-visible {
    outline-color: var(--on-crimson);
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: .6rem 1rem;
    background: var(--ink);
    color: var(--paper);
    border-radius: 6px;
}
.skip:focus { top: 1rem; }

/* ---------- Top bar ---------- */

.bar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--bar-h);
    background: var(--crimson);
    color: var(--on-crimson);
}
.bar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.brand {
    font-family: var(--font-display);
    font-weight: 900;
    font-stretch: 130%;
    font-size: 1.35rem;
    letter-spacing: .02em;
    text-decoration: none;
    padding: .15rem .55rem;
    border: 2px solid var(--on-crimson);
    border-radius: 8px;
}
.nav {
    display: flex;
    gap: .25rem;
    margin-left: auto;
}
.nav a {
    text-decoration: none;
    font-weight: 500;
    font-size: .98rem;
    padding: .4rem .75rem;
    border-radius: 999px;
    transition: background-color .15s;
}
.nav a:hover { background: rgba(255, 240, 243, .16); }
.nav a.is-active { background: var(--on-crimson); color: var(--crimson); }

.bar-tools { display: flex; gap: .25rem; }
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background-color .15s;
}
.icon-btn:hover { background: rgba(255, 240, 243, .16); }
.menu-btn { display: none; }

.i-sun { display: none; }
[data-theme='dark'] .i-sun { display: block; }
[data-theme='dark'] .i-moon { display: none; }

/* ---------- Hero ---------- */

.hero {
    background: var(--crimson);
    color: var(--on-crimson);
    padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem, 5vw, 4rem);
    overflow: hidden;
}

.now {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    font-weight: 500;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.now-tag {
    background: var(--rose);
    color: #3a0714;
    font-weight: 600;
    font-size: .9rem;
    padding: .15rem .75rem;
    border-radius: 999px;
}

.name {
    font-family: var(--font-display);
    font-weight: 900;
    font-stretch: 125%;
    font-size: clamp(2.6rem, 11.5vw, 9.5rem);
    line-height: .92;
    letter-spacing: -.02em;
}
.name .line {
    display: block;
    overflow: hidden;
    padding-bottom: .08em;
}
.name .line > span {
    display: inline-block;
    transform: translateY(105%);
    animation: rise .9s cubic-bezier(.2, .8, .2, 1) forwards;
}
.name .line:nth-child(2) > span { animation-delay: .12s; }
.name .line:nth-child(2) { color: var(--rose); }

@keyframes rise { to { transform: translateY(0); } }

.lede {
    max-width: 34rem;
    margin-top: clamp(1.5rem, 3vw, 2.25rem);
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    line-height: 1.5;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: .9rem;
    margin-top: 2rem;
}

.btn {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    padding: .8rem 1.5rem;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .15s, background-color .15s, color .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-paper { background: var(--on-crimson); color: var(--crimson); }
.btn-outline { border-color: var(--on-crimson); color: var(--on-crimson); }
.btn-outline:hover { background: var(--on-crimson); color: var(--crimson); }
.btn-pink { background: var(--rose); color: #3a0714; }
.btn-pink:hover { background: #ff7aa3; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 2rem;
    margin-top: clamp(2.5rem, 6vw, 4.5rem);
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 240, 243, .4);
    font-size: .98rem;
}

/* ---------- Sections (ledger layout) ---------- */

.section {
    padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}
.section + .section:not(.contact) { border-top: 1px solid var(--line); }

.ledger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr);
    gap: 1.5rem clamp(2rem, 6vw, 5rem);
    align-items: start;
}
.ledger > h2 {
    position: sticky;
    top: calc(var(--bar-h) + 1.5rem);
    font-family: var(--font-display);
    font-weight: 800;
    font-stretch: 115%;
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    line-height: 1.05;
    letter-spacing: -.01em;
}

h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-stretch: 100%;
    font-size: 1.3rem;
    line-height: 1.2;
}

.prose { display: grid; gap: 1.1rem; max-width: 40rem; }
.prose .big, .big {
    font-size: clamp(1.25rem, 2.2vw, 1.6rem);
    line-height: 1.45;
    font-weight: 500;
}
.prose p:not(.big) { color: var(--muted); }

.plain { display: grid; gap: .45rem; }
.plain li { max-width: 42rem; }

/* ---------- Experience timeline ---------- */

.timeline {
    position: relative;
    display: grid;
    gap: 2.5rem;
    padding-left: 1.75rem;
    border-left: 2px solid var(--line);
}
.job { position: relative; }
.job::before {
    content: '';
    position: absolute;
    left: calc(-1.75rem - 7px);
    top: .45rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--paper);
    border: 3px solid var(--accent);
}
.job.is-current::before {
    background: var(--rose);
    border-color: var(--crimson);
    box-shadow: 0 0 0 5px rgba(255, 79, 135, .3);
}
.job-head { margin-bottom: .75rem; }
.job-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .9rem;
    margin-top: .25rem;
    color: var(--muted);
    font-weight: 500;
}
.period { color: var(--accent); font-weight: 600; }
.job .plain li { color: var(--ink); }

.badge {
    display: inline-block;
    background: var(--rose);
    color: #3a0714;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1;
    padding: .3rem .65rem;
    border-radius: 999px;
}

/* ---------- Projects ---------- */

.projects { display: grid; }
.project {
    display: grid;
    gap: .8rem;
    padding: 1.75rem 1.25rem;
    margin-inline: -1.25rem;
    border-bottom: 1px solid var(--line);
    border-radius: 12px;
    transition: background-color .2s;
}
.project:first-child { padding-top: 1.75rem; }
.project:hover { background: var(--paper-2); }
.project-top { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.project h3 { font-size: 1.45rem; }
.project.is-featured h3 {
    font-size: clamp(1.9rem, 3.6vw, 2.7rem);
    font-weight: 800;
    font-stretch: 115%;
    letter-spacing: -.01em;
}
.project p { max-width: 38rem; color: var(--muted); }
.project.is-featured p { color: var(--ink); font-size: 1.12rem; }

.tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.tags li {
    font-size: .88rem;
    font-weight: 500;
    padding: .15rem .8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.text-link {
    justify-self: start;
    font-weight: 600;
    color: var(--accent);
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}
.text-link:hover { text-decoration-color: var(--rose); }

/* ---------- Skills ---------- */

.skill-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.25rem 2rem;
}
.skill-group h3 {
    font-size: 1.1rem;
    color: var(--accent);
    padding-bottom: .5rem;
    margin-bottom: .75rem;
    border-bottom: 2px solid var(--rose);
}

/* ---------- Education ---------- */

.edu { display: grid; gap: 2.5rem; }
.edu-main .plain { margin-top: .85rem; }
.edu-cert {
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
}

/* ---------- Contact ---------- */

.contact {
    background: var(--crimson);
    color: var(--on-crimson);
}
.contact .ledger > h2 { color: var(--on-crimson); }

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem clamp(2rem, 5vw, 4rem);
    align-items: start;
}
.contact-list { margin-top: 1.75rem; }
.contact-list a {
    font-weight: 600;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
    overflow-wrap: anywhere;
}
.contact-list a:hover { text-decoration-color: var(--rose); }

.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; }
.field input,
.field textarea {
    width: 100%;
    font: inherit;
    color: #3a0714;
    background: var(--on-crimson);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: .75rem .9rem;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input:focus,
.field textarea:focus { outline: 3px solid var(--rose); outline-offset: 2px; border-color: #3a0714; }
.field .is-invalid { border-color: #3a0714; box-shadow: 0 0 0 3px var(--rose); }
.form .btn { justify-self: start; }

.form-status { min-height: 1.6rem; font-weight: 600; }
.form-status.is-error { background: var(--on-crimson); color: var(--crimson); padding: .5rem .8rem; border-radius: 8px; }
.form-status.is-ok { background: var(--rose); color: #3a0714; padding: .5rem .8rem; border-radius: 8px; }

/* Honeypot: hidden from people, visible to naive bots. */
.trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Footer ---------- */

.foot {
    background: var(--crimson);
    color: var(--on-crimson);
    padding: 1.5rem 0 2rem;
}
.foot-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 240, 243, .4);
    font-size: .95rem;
}
.foot a { text-underline-offset: 4px; }

/* ---------- Responsive ---------- */

@media (max-width: 62rem) {
    .ledger { grid-template-columns: 1fr; }
    .ledger > h2 { position: static; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 50rem) {
    .menu-btn { display: inline-grid; }
    .bar-tools { margin-left: auto; }
    .nav {
        position: absolute;
        top: var(--bar-h);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: .5rem var(--gutter) 1rem;
        background: var(--crimson);
        border-top: 1px solid rgba(255, 240, 243, .3);
        box-shadow: 0 12px 24px rgba(58, 7, 20, .25);
    }
    .nav.is-open { display: flex; }
    .nav a { padding: .8rem .5rem; border-radius: 8px; font-size: 1.05rem; }
    .skill-groups { grid-template-columns: 1fr; }
    .project { margin-inline: 0; padding-inline: 0; }
    .project:hover { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .name .line > span { animation: none; transform: none; }
    .btn, .nav a, .icon-btn, .project { transition: none; }
}

@media print {
    .bar, .contact, .foot, .actions { display: none; }
    .hero { background: none; color: #000; }
    .name .line:nth-child(2) { color: #000; }
}

/* ==========================================================
   Opening animation (preloader)
   Settings that change the look live at the top of .pre.
   The animation timings live in assets/js/preloader.js.
   ========================================================== */

html.is-loading { overflow: hidden; }
html.is-loading .name .line > span { animation-play-state: paused; }

.hero.has-image {
    background-color: var(--crimson);
    background-image:
        linear-gradient(rgba(207, 15, 55, .8), rgba(207, 15, 55, .8)),
        var(--hero-img);
    background-size: cover;
    background-position: center;
}

.pre {
    --pre-bg: #16060b;      /* background behind the photos */
    --tw: 23vw;             /* photo width */
    --tg: 1.9vw;            /* gap between photos */
    --th: calc(var(--tw) / 2.1);   /* photo height (2.1 : 1 landscape) */

    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow: hidden;
    background: var(--pre-bg);
    color: var(--on-crimson);
}

/* The grid is a zero-size point at the screen centre. Its columns are
   placed around that point, so scaling the grid zooms into the centre. */
.pre-grid {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    visibility: hidden;      /* shown by preloader.js when it starts */
    will-change: transform;
}

/* 7 columns; column 3 is the middle one. 7 photos per column; photo 3 is
   the middle one and sits exactly on the screen centre. */
.pre-col {
    position: absolute;
    width: var(--tw);
    left: calc((var(--i) - 3) * (var(--tw) + var(--tg)) - var(--tw) / 2);
    top: calc(-1 * (3 * (var(--th) + var(--tg)) + var(--th) / 2));
    display: flex;
    flex-direction: column;
    gap: var(--tg);
    will-change: transform;
}

.pre-tile {
    position: relative;
    flex: none;
    width: 100%;
    height: var(--th);
    overflow: hidden;
    background: #2a0c18;
}
.pre-tile img,
.pre-tile .ph {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
}

/* Colour blocks used until you add your own photos. */
.ph.tone-0 { background: linear-gradient(135deg, #ff4f87, #cf0f37); }
.ph.tone-1 { background: linear-gradient(135deg, #ffe0e8, #ff7aa3); }
.ph.tone-2 { background: linear-gradient(135deg, #5a0f24, #cf0f37); }
.ph.tone-3 { background: linear-gradient(135deg, #ff8fab, #e11d48); }
.ph.tone-4 { background: linear-gradient(135deg, #fff0f3, #ffb3c6); }
.ph.tone-5 { background: linear-gradient(135deg, #8f0b2b, #ff4f87); }
.ph.hero-ph { background: var(--crimson); }

.pre-count {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    transform: translate(-50%, -50%);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
}

.pre-skip {
    position: absolute;
    right: var(--gutter);
    bottom: 1.5rem;
    z-index: 4;
    font: inherit;
    font-size: .95rem;
    font-weight: 500;
    color: inherit;
    background: transparent;
    border: 1px solid rgba(255, 240, 243, .5);
    border-radius: 999px;
    padding: .45rem 1rem;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.pre-skip:hover { background: var(--on-crimson); color: var(--crimson); }
.pre :focus-visible { outline-color: var(--on-crimson); }

/* Portrait screens: bigger photos so a few columns fill the width. */
@media (max-aspect-ratio: 1/1) {
    .pre { --tw: 56vw; --tg: 4vw; --th: calc(var(--tw) / 1.6); }
}
