/* =========================================================
   Rastko Perišić — 2026
   dark · tech · linear/vercel ish · geist · gradient accents
   ========================================================= */

:root {
    --bg:        #07080e;
    --bg-2:      #0c0e18;
    --bg-3:      #11142a;
    --bg-card:   #0e1120;

    --line:      #1c1f33;
    --line-2:    #2a2e44;

    --text:      #f0f1f5;
    --text-2:    #a4a8bb;
    --text-3:    #6a6f88;
    --text-4:    #43475a;

    --blue:      #6082ff;
    --blue-2:    #8aa4ff;
    --purple:    #b388ff;
    --pink:      #ec80ff;
    --cyan:      #5ddff0;
    --green:     #4ade80;

    --gradient:  linear-gradient(135deg, #6082ff 0%, #b388ff 55%, #ec80ff 100%);
    --gradient-2:linear-gradient(180deg, rgba(96,130,255,.18) 0%, rgba(179,136,255,.06) 100%);

    --display: "Geist", "Inter Tight", system-ui, -apple-system, sans-serif;
    --sans:    "Geist", "Inter Tight", system-ui, sans-serif;
    --mono:    "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

    --gut: clamp(20px, 4vw, 60px);
    --max: 1280px;

    --rad: 14px;
    --rad-lg: 22px;

    --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* dotted grid overlay (fixed, very subtle) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 80%);
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--blue); color: var(--bg); }

main { position: relative; z-index: 1; }

/* ============== TOPBAR ============== */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px var(--gut);
    background: rgba(7,8,14,.7);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 13px;
}
.logo {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--display);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -.01em;
}
.logo-mark {
    width: 22px; height: 22px;
    border-radius: 7px;
    background: var(--gradient);
    box-shadow: 0 0 14px rgba(96,130,255,.45);
    flex-shrink: 0;
}
.top-right {
    display: inline-flex; align-items: center; gap: 14px;
    color: var(--text-2);
    font-size: 12px;
}
.lang-switch {
    display: inline-flex; gap: 2px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,.02);
}
.lang-switch a {
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--text-3);
    font-size: 11px;
    transition: background .25s, color .25s;
}
.lang-switch a.is-active {
    background: var(--text);
    color: var(--bg);
}
.lang-switch a:hover:not(.is-active) { color: var(--text); }

.clock {
    display: inline-flex; align-items: center; gap: 8px;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
}
.clock::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
    animation: pulse-soft 2.4s ease-in-out infinite;
}
@keyframes pulse-soft {
    0%,100% { opacity: .6; }
    50%     { opacity: 1; }
}
@media (max-width: 600px) { .clock .label { display: none; } }

/* ============== LAYOUT ============== */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

main { padding-top: 56px; }

.section {
    padding: clamp(80px, 12vw, 160px) 0;
}

.section-head {
    margin-bottom: clamp(40px, 6vw, 70px);
}
.section-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .14em;
    padding: 5px 11px 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,.02);
    margin-bottom: 22px;
}
.section-eyebrow::before {
    content: "";
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 8px var(--blue);
}
.section-title {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(36px, 5vw, 60px);
    line-height: 1.05;
    letter-spacing: -.025em;
    color: var(--text);
    max-width: 24ch;
}
.section-title .grad {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.section-sub {
    font-size: clamp(15px, 1.4vw, 17px);
    color: var(--text-2);
    margin-top: 18px;
    max-width: 56ch;
    line-height: 1.6;
}

/* ============== HERO ============== */
.hero {
    position: relative;
    min-height: 92svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(60px, 14vh, 140px) 0 clamp(60px, 10vh, 100px);
    overflow: hidden;
}
/* aurora mesh */
.hero::before, .hero::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .55;
    z-index: -1;
}
.hero::before {
    width: 720px; height: 720px;
    top: -260px; left: -200px;
    background: radial-gradient(circle, rgba(96,130,255,.7), transparent 60%);
    animation: float-1 14s ease-in-out infinite alternate;
}
.hero::after {
    width: 600px; height: 600px;
    top: 20%; right: -180px;
    background: radial-gradient(circle, rgba(179,136,255,.65), transparent 60%);
    animation: float-2 18s ease-in-out infinite alternate;
}
@keyframes float-1 { from { transform: translate(0,0); } to { transform: translate(80px, 60px); } }
@keyframes float-2 { from { transform: translate(0,0); } to { transform: translate(-60px, 40px); } }

.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-2);
    padding: 6px 12px 6px 10px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: rgba(255,255,255,.04);
    backdrop-filter: blur(8px);
    margin-bottom: 28px;
    width: max-content;
}
.hero-eyebrow .new {
    color: var(--bg);
    background: var(--gradient);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: .04em;
}

.hero h1 {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(44px, 7.6vw, 116px);
    line-height: .98;
    letter-spacing: -.04em;
    max-width: 16ch;
    margin-bottom: 28px;
}
.hero h1 .grad {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    font-size: clamp(16px, 1.5vw, 19px);
    color: var(--text-2);
    max-width: 54ch;
    line-height: 1.55;
    margin-bottom: 36px;
}

.hero-cta {
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
}
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--display);
    font-size: 14px;
    font-weight: 500;
    padding: 11px 20px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    color: var(--text);
    background: rgba(255,255,255,.03);
    transition: background .25s, border-color .25s, transform .25s, box-shadow .3s;
    backdrop-filter: blur(6px);
}
.btn:hover {
    background: rgba(255,255,255,.06);
    border-color: #3a3f56;
}
.btn-primary {
    background: var(--text);
    color: var(--bg);
    border-color: transparent;
    position: relative;
}
.btn-primary::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: 999px;
    background: var(--gradient);
    z-index: -1;
    filter: blur(18px);
    opacity: .5;
    transition: opacity .3s;
}
.btn-primary:hover { transform: translateY(-1px); background: var(--text); }
.btn-primary:hover::after { opacity: .9; }

.btn .arr { display: inline-block; transition: transform .25s; }
.btn:hover .arr { transform: translate(2px, -2px); }

/* hero footer mini-stats */
.hero-stats {
    margin-top: clamp(48px, 8vw, 80px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--rad);
    background: rgba(255,255,255,.015);
    overflow: hidden;
}
.stat {
    padding: 18px 20px;
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 4px;
}
.stat:last-child { border-right: 0; }
.stat dt {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .1em;
}
.stat dd {
    font-family: var(--display);
    font-weight: 500;
    font-size: 18px;
    color: var(--text);
    letter-spacing: -.01em;
}
.stat dd .ok {
    display: inline-flex; align-items: center; gap: 6px;
}
.stat dd .ok::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: var(--green); box-shadow: 0 0 8px var(--green);
}
@media (max-width: 720px) {
    .hero-stats { grid-template-columns: 1fr 1fr; }
    .stat { border-bottom: 1px solid var(--line); }
    .stat:nth-child(2n) { border-right: 0; }
    .stat:nth-last-child(-n+2) { border-bottom: 0; }
}

/* ============== SYSTEM STATUS PANEL ============== */
.status-panel {
    border: 1px solid var(--line);
    border-radius: var(--rad-lg);
    background: linear-gradient(180deg, rgba(255,255,255,.025), transparent);
    overflow: hidden;
}
.status-head {
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-2);
}
.status-head .left { display: inline-flex; align-items: center; gap: 10px; }
.status-head .dotg {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--green); box-shadow: 0 0 10px var(--green);
}
.status-rows {
    list-style: none;
}
.status-rows li {
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 130px 1fr auto;
    gap: 16px;
    align-items: center;
    font-size: 14px;
}
.status-rows li:last-child { border-bottom: 0; }
.status-rows .k {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.status-rows .v { color: var(--text); }
.status-rows .v em { color: var(--blue-2); font-style: normal; }
.status-rows .meta {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-3);
}
@media (max-width: 600px) {
    .status-rows li { grid-template-columns: 1fr; gap: 4px; }
    .status-rows .meta { justify-self: start; }
}

/* ============== WORK / PROJECT CARDS ============== */
.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}
.project {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--rad-lg);
    overflow: hidden;
    background: var(--bg-card);
    transition: transform .35s var(--ease), border-color .3s;
    color: var(--text);
}
.project::before {
    content: "";
    position: absolute; inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(96,130,255,.4), rgba(179,136,255,.0) 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity .35s;
    pointer-events: none;
}
.project:hover {
    transform: translateY(-3px);
    border-color: var(--line-2);
}
.project:hover::before { opacity: 1; }
.project-cover {
    aspect-ratio: 16 / 10;
    background: var(--bg-3);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-body {
    padding: 22px 24px 24px;
}
.project-meta {
    display: flex; justify-content: space-between;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 12px;
}
.project-title {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(22px, 2vw, 26px);
    letter-spacing: -.02em;
    margin-bottom: 8px;
}
.project-desc {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-2);
    margin-bottom: 18px;
}
.project-foot {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 14px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-3);
}
.project-foot .read { color: var(--text); display: inline-flex; gap: 6px; }
.project:hover .project-foot .read { color: var(--blue-2); }
.project:hover .read .arr { transform: translate(3px, -3px); }
.read .arr { display: inline-block; transition: transform .25s; }

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

/* ============== SERVICES ============== */
.services {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.service {
    border: 1px solid var(--line);
    border-radius: var(--rad-lg);
    background: var(--bg-card);
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: border-color .25s, transform .25s;
}
.service:hover { border-color: var(--line-2); transform: translateY(-2px); }

.service-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--gradient);
    display: grid; place-items: center;
    margin-bottom: 24px;
    color: var(--bg);
    font-family: var(--display);
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 0 28px rgba(96,130,255,.35);
}
.service-name {
    font-family: var(--display);
    font-weight: 500;
    font-size: 22px;
    letter-spacing: -.02em;
    margin-bottom: 10px;
}
.service-lead {
    color: var(--text-2);
    font-size: 14.5px;
    line-height: 1.55;
    margin-bottom: 22px;
}
.service-list {
    list-style: none;
    display: flex; flex-wrap: wrap; gap: 6px;
}
.service-list li {
    font-family: var(--mono);
    font-size: 11px;
    padding: 5px 9px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    color: var(--text-2);
    background: rgba(255,255,255,.02);
}

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

/* ============== ABOUT ============== */
.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: clamp(28px, 4vw, 60px);
    align-items: start;
}
.about-lead {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--text);
    margin-bottom: 24px;
    max-width: 22ch;
}
.about-lead em {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-style: normal;
}
.about-body p {
    color: var(--text-2);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 16px;
    max-width: 56ch;
}

.about-card {
    border: 1px solid var(--line);
    border-radius: var(--rad-lg);
    background: var(--bg-card);
    overflow: hidden;
}
.about-card-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .1em;
}
.about-card-head .badge {
    color: var(--green);
    display: inline-flex; align-items: center; gap: 6px;
}
.about-card-head .badge::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: var(--green); box-shadow: 0 0 8px var(--green);
}
.about-card dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.about-card .fact {
    padding: 16px 20px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.about-card .fact:nth-child(2n) { border-right: 0; }
.about-card .fact:nth-last-child(-n+2) { border-bottom: 0; }
.about-card dt {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 6px;
}
.about-card dd {
    font-family: var(--display);
    font-weight: 500;
    font-size: 16px;
    color: var(--text);
    letter-spacing: -.01em;
}

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

/* ============== CONTACT ============== */
.contact-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--rad-lg);
    background: var(--bg-card);
    padding: clamp(40px, 6vw, 80px);
    overflow: hidden;
    isolation: isolate;
}
.contact-card::before {
    content: "";
    position: absolute;
    top: -200px; right: -200px;
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(96,130,255,.4), transparent 60%);
    filter: blur(60px);
    z-index: -1;
}
.contact-card::after {
    content: "";
    position: absolute;
    bottom: -180px; left: -100px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(236,128,255,.32), transparent 60%);
    filter: blur(80px);
    z-index: -1;
}
.contact-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-2);
    margin-bottom: 22px;
}
.contact-eyebrow::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: var(--green); box-shadow: 0 0 10px var(--green);
}
.contact-title {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(36px, 5.5vw, 72px);
    line-height: 1.05;
    letter-spacing: -.03em;
    margin-bottom: 18px;
    max-width: 18ch;
}
.contact-title .grad {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.contact-sub {
    color: var(--text-2);
    font-size: 17px;
    line-height: 1.55;
    margin-bottom: 36px;
    max-width: 50ch;
}
.contact-actions {
    display: flex; flex-wrap: wrap; gap: 12px;
    margin-bottom: 36px;
}
.contact-mail {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--display);
    font-size: 16px;
    font-weight: 500;
    padding: 13px 22px;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    position: relative;
    transition: transform .25s, box-shadow .35s;
    z-index: 1;
}
.contact-mail::after {
    content: "";
    position: absolute; inset: -1px;
    border-radius: 999px;
    background: var(--gradient);
    z-index: -1;
    filter: blur(20px);
    opacity: .55;
    transition: opacity .3s;
}
.contact-mail:hover { transform: translateY(-2px); }
.contact-mail:hover::after { opacity: 1; }

.socials {
    display: flex; flex-wrap: wrap; gap: 12px;
}
.socials a {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: rgba(255,255,255,.03);
    color: var(--text);
    font-family: var(--mono);
    font-size: 12px;
    transition: border-color .25s, color .25s;
}
.socials a:hover { border-color: var(--blue); color: var(--blue-2); }

/* ============== FOOTER ============== */
.foot {
    padding: 28px var(--gut);
    border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-3);
    background: linear-gradient(180deg, transparent, rgba(96,130,255,.04));
}
.foot a { transition: color .2s; }
.foot a:hover { color: var(--text); }

/* gradient line above footer */
.foot::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--blue), var(--purple), transparent);
    opacity: .5;
}
.foot { position: relative; }

/* ============== ACCESSIBILITY ============== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}
