/* ==========================================================================
   Mohamad Helli — Portfolio Homepage v4
   Design system: dark luxury — onyx black + antique gold, editorial serif.
   Type: Playfair Display (display) · Jost (body/labels)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;0,700;0,800;1,500;1,600&family=Jost:wght@300;400;500;600&display=swap');

:root {
    --onyx: #0a0a0c;
    --onyx-2: #131317;
    --onyx-3: #1a1a1f;
    --cream: #f4eee0;
    --muted: #9a9488;
    --gold: #c9a24b;
    --gold-light: #e8cd8a;
    --gold-dim: rgba(201, 162, 75, 0.18);
    --line: rgba(201, 162, 75, 0.22);

    --font-display: 'Playfair Display', serif;
    --font-body: 'Jost', sans-serif;

    --maxw: 1180px;
    --gap: clamp(1.25rem, 3vw, 2.5rem);
    --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
    margin: 0;
    background: var(--onyx);
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(1200px 700px at 82% -10%, rgba(201,162,75,.08), transparent 60%),
                       radial-gradient(900px 600px at -10% 90%, rgba(201,162,75,.06), transparent 60%);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; }
p { margin: 0; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }
::selection { background: var(--gold); color: var(--onyx); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Shared utilities ---------- */
.section__inner, .nav__inner { max-width: var(--maxw); margin: 0 auto; padding-left: var(--gap); padding-right: var(--gap); }
.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0; }

.eyebrow {
    display: flex; align-items: center; gap: .8rem;
    font-family: var(--font-body); font-size: .76rem; font-weight: 500;
    letter-spacing: .28em; text-transform: uppercase; color: var(--gold);
    margin-bottom: 1.3rem;
}
.eyebrow .rule { width: 34px; height: 1px; background: var(--gold); flex: 0 0 auto; }

.section__title { font-size: clamp(2rem, 3.6vw, 2.9rem); font-weight: 600; letter-spacing: .005em; margin-bottom: clamp(2rem, 4.5vw, 3rem); color: var(--cream); }
.section__title em { font-style: italic; color: var(--gold); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

.panel { border: 1px solid var(--line); background: linear-gradient(180deg, rgba(201,162,75,.035), transparent 45%); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .95rem 2rem; font-weight: 500; font-size: .82rem;
    letter-spacing: .14em; text-transform: uppercase;
    border: 1px solid var(--gold);
    color: var(--gold);
    transition: color .35s var(--ease), background .35s var(--ease), transform .3s var(--ease), box-shadow .35s var(--ease);
    white-space: nowrap;
}
.btn--solid { background: var(--gold); color: var(--onyx); }
.btn--solid:hover { background: var(--gold-light); border-color: var(--gold-light); transform: translateY(-2px); box-shadow: 0 16px 32px -16px rgba(201,162,75,.5); }
.btn--outline:hover { background: var(--gold-dim); transform: translateY(-2px); }
.btn--ghost { border: none; padding: .5rem 0; font-size: .76rem; letter-spacing: .12em; position: relative; }
.btn--ghost::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.btn--ghost:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Nav ---------- */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(10, 10, 12, 0.86);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    transition: transform .4s var(--ease);
}
.nav.nav--hidden { transform: translateY(-100%); }
.nav__inner { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem); height: 82px; }
.nav__mark { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; letter-spacing: .02em; margin-right: auto; color: var(--cream); }
.nav__mark em { font-style: italic; color: var(--gold); }
.nav__links { display: flex; gap: clamp(1.1rem, 2.4vw, 2.1rem); }
.nav__link { font-size: .78rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); position: relative; padding: 4px 0; transition: color .3s var(--ease); }
.nav__link::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav__link:hover, .nav__link.is-active { color: var(--cream); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); }
.nav__cv--mobile { display: none; }
.nav__toggle { display: none; width: 28px; height: 18px; position: relative; }
.nav__toggle span, .nav__toggle::before, .nav__toggle::after { content: ''; position: absolute; left: 0; right: 0; height: 1px; background: var(--gold); transition: transform .3s var(--ease), opacity .3s var(--ease), top .3s var(--ease); }
.nav__toggle::before { top: 0; }
.nav__toggle span { top: 8px; }
.nav__toggle::after { top: 16px; }
.nav__toggle.is-open::before { top: 8px; transform: rotate(45deg); }
.nav__toggle.is-open span { opacity: 0; }
.nav__toggle.is-open::after { top: 8px; transform: rotate(-45deg); }

@media (max-width: 860px) {
    .nav__links {
        position: fixed; top: 82px; left: 0; right: 0;
        background: var(--onyx-2); border-bottom: 1px solid var(--line);
        flex-direction: column; padding: 1.4rem var(--gap) 1.9rem; gap: 1.2rem;
        transform: translateY(-8px); opacity: 0; pointer-events: none;
        transition: opacity .3s var(--ease), transform .3s var(--ease);
    }
    .nav__links.is-open { opacity: 1; transform: none; pointer-events: auto; }
    .nav__cv { display: none; }
    .nav__cv--mobile { display: inline-flex; }
    .nav__toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-top: 118px; padding-bottom: 2rem; }
.hero__inner { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gap); display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(2.5rem, 6vw, 5rem); }
.hero__name { font-size: clamp(2.8rem, 6.6vw, 5rem); font-weight: 600; line-height: 1.06; letter-spacing: .005em; margin-bottom: 1.4rem; color: var(--cream); }
.hero__name em { font-style: italic; color: var(--gold); font-weight: 500; }
.hero__lead { max-width: 46ch; color: var(--muted); font-size: 1.03rem; margin-bottom: 2.3rem; font-weight: 300; }
.hero__lead strong { color: var(--cream); font-weight: 500; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-bottom: 2.75rem; }

.credits { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.credits__item { padding-left: 1.1rem; border-left: 1px solid var(--line); }
.credits__item strong { display: block; font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; color: var(--gold); margin-bottom: .1rem; }
.credits__item span { font-size: .74rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

.hero__figure { position: relative; justify-self: center; width: clamp(230px, 23vw, 300px); }
.hero__figure::before {
    content: ''; position: absolute; inset: -14px; border: 1px solid var(--gold);
    opacity: .5; pointer-events: none;
}
.portrait-frame { position: relative; width: 100%; aspect-ratio: 4/5; overflow: hidden; border: 1px solid var(--line); background: var(--onyx-2); }
.portrait-frame img {
    width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%;
    filter: grayscale(100%) sepia(35%) hue-rotate(-8deg) saturate(140%) brightness(.82) contrast(1.08);
    transform: scale(1.01);
    transition: filter .7s var(--ease), transform .7s var(--ease);
}
.hero__figure:hover .portrait-frame img, .hero__figure.is-active .portrait-frame img { filter: none; transform: scale(1.05); }
.hero__figure-caption {
    margin-top: 1rem; text-align: center;
    font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}

@media (max-width: 860px) {
    .hero__inner { grid-template-columns: 1fr; text-align: center; }
    .hero__lead { margin-left: auto; margin-right: auto; }
    .hero__actions, .credits { justify-content: center; }
    .hero__figure { order: -1; width: clamp(190px, 48vw, 250px); margin-bottom: 1.5rem; }
    .credits__item { text-align: left; }
}

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.about__bio { font-size: 1.08rem; line-height: 1.9; color: var(--cream); font-weight: 300; }
.about__bio strong { color: var(--gold); font-weight: 500; }
.about__meta { border-top: 1px solid var(--line); }
.about__meta > div { display: flex; justify-content: space-between; gap: 1rem; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.about__meta dt { color: var(--muted); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.about__meta dd { margin: 0; color: var(--cream); font-weight: 400; text-align: right; }
.about__meta dd a:hover { color: var(--gold); }

@media (max-width: 800px) { .about__grid { grid-template-columns: 1fr; } }

/* ---------- Werdegang ---------- */
.timeline { border-left: 1px solid var(--line); }
.timeline__item { position: relative; padding: 0 0 clamp(2.25rem, 5vw, 3rem) clamp(2rem, 4.5vw, 2.75rem); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
    content: ''; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px;
    background: var(--onyx); border: 1px solid var(--gold); transform: rotate(45deg);
    transition: background .3s var(--ease);
}
.timeline__item:hover::before { background: var(--gold); }
.timeline__date { font-family: var(--font-display); font-style: italic; font-size: .92rem; color: var(--gold); margin-bottom: .5rem; display: block; }
.timeline__tag {
    display: inline-block; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
    color: var(--muted); border: 1px solid var(--line); padding: .25rem .7rem; margin-bottom: .7rem;
}
.timeline__item h3 { font-size: 1.28rem; font-weight: 600; margin-bottom: .3rem; color: var(--cream); }
.timeline__item p.role { color: var(--gold); font-weight: 400; font-size: .88rem; letter-spacing: .04em; margin-bottom: .6rem; }
.timeline__item p.desc { color: var(--muted); max-width: 62ch; font-weight: 300; font-size: .95rem; }

/* ---------- Skills ---------- */
.skills__groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 2rem); }
.skills__group { padding: 1.6rem 1.6rem 1.9rem; }
.skills__group h3 { font-family: var(--font-body); font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; color: var(--gold); margin-bottom: 1.2rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.tags { display: flex; flex-wrap: wrap; gap: .55rem; }
.tags span { font-size: .8rem; font-weight: 400; padding: .5rem .9rem; border: 1px solid var(--line); color: var(--muted); transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease); }
.tags span:hover { color: var(--onyx); border-color: var(--gold); background: var(--gold); }
@media (max-width: 780px) { .skills__groups { grid-template-columns: 1fr; } }

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: clamp(2.25rem, 5vw, 3rem); }
.filter { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; padding: .6rem 1.15rem; border: 1px solid var(--line); color: var(--muted); transition: all .3s var(--ease); }
.filter:hover { color: var(--cream); border-color: var(--gold); }
.filter.active { background: var(--gold); border-color: var(--gold); color: var(--onyx); }

.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 3vw, 1.75rem); }
.project-card { position: relative; overflow: hidden; aspect-ratio: 4/3; background: var(--onyx-2); border: 1px solid var(--line); }
.project-card img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%) sepia(20%) brightness(.8) contrast(1.05); transform: scale(1.02); transition: filter .5s var(--ease), transform .6s var(--ease); }
.project-card:hover img { filter: none; transform: scale(1.08); }
.project-card__overlay {
    position: absolute; inset: 0; display: flex; align-items: flex-end; gap: .6rem; padding: 1.1rem;
    opacity: 0; background: linear-gradient(0deg, rgba(10,10,12,.9) 0%, rgba(10,10,12,.15) 55%, transparent 80%);
    transition: opacity .35s var(--ease);
}
.project-card:hover .project-card__overlay { opacity: 1; }
.project-card__overlay a {
    font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cream);
    padding: .5rem .9rem; border: 1px solid var(--gold); transition: background .3s var(--ease), color .3s var(--ease);
}
.project-card__overlay a:hover { background: var(--gold); color: var(--onyx); }
.project-card__zoom {
    position: absolute; top: .8rem; right: .8rem; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10,10,12,.75); border: 1px solid var(--gold); color: var(--gold);
    font-size: 1rem; z-index: 2; opacity: 0; transform: translateY(-6px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.project-card:hover .project-card__zoom { opacity: 1; transform: none; }
.project-card__zoom:hover { background: var(--gold); color: var(--onyx); }
.project-card.is-hidden { display: none; }

@media (max-width: 980px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .project-grid { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.kontakt__wrap { max-width: 600px; margin: 0 auto; text-align: center; padding: clamp(2.5rem, 6vw, 4rem); }
.kontakt__lead { color: var(--muted); font-size: 1.02rem; margin-bottom: 2.3rem; font-weight: 300; }
.btn--mail { padding: 1.05rem 2.1rem; font-size: .84rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: clamp(3rem, 7vw, 4rem) 0 2.25rem; }
.footer__inner { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gap); text-align: center; }
.footer__mark { font-family: var(--font-display); font-weight: 600; font-size: 1.55rem; margin-bottom: .5rem; color: var(--cream); }
.footer__mark em { font-style: italic; color: var(--gold); }
.footer__role { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2.2rem; }
.footer__social { display: flex; justify-content: center; gap: 1rem; margin-bottom: 2.5rem; }
.footer__social a { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); color: var(--muted); font-size: .95rem; transition: border-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease); }
.footer__social a:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-3px); }
.footer__bottom { font-size: .76rem; color: var(--muted); letter-spacing: .04em; }

/* ---------- Back to top ---------- */
.back-to-top {
    position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem);
    width: 44px; height: 44px; border: 1px solid var(--gold); background: var(--onyx); color: var(--gold);
    display: flex; align-items: center; justify-content: center; font-size: .95rem; z-index: 90;
    opacity: 0; pointer-events: none; transform: translateY(10px);
    transition: opacity .35s var(--ease), transform .35s var(--ease), background .35s var(--ease), color .35s var(--ease);
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top:hover { background: var(--gold); color: var(--onyx); }
