/* ============================================================
   Karl P. Cabalquinto — Portfolio v4
   Dark Navy · Blue Accent · Star Particles
   ============================================================ */

/* ── Tokens ──────────────────────────────────────────────── */
:root {
    --bg:     #0d1117;
    --bg-2:   #161b22;
    --bg-3:   #21262d;
    --blue:   #4d9fff;
    --blue-d: #1f6feb;
    --blue-dim: rgba(77,159,255,0.12);
    --green:  #3fb950;
    --orange: #f0883e;
    --text:   #e6edf3;
    --text-2: #8b949e;
    --text-3: #484f58;
    --border: rgba(255,255,255,0.08);
    --border-b: rgba(77,159,255,0.28);
    --radius: 12px;
    --radius-lg: 16px;
    --t: all 0.22s cubic-bezier(0.4,0,0.2,1);
    --font-sans: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; overflow-x:hidden; }
body {
    background: var(--bg); color: var(--text);
    font-family: var(--font-body); line-height:1.6;
    overflow-x:hidden;
}

/* ── Stars canvas ────────────────────────────────────────── */
#starsCanvas {
    position: fixed; top:0; left:0;
    width:100%; height:100%;
    pointer-events:none; z-index:0;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width:5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-d); }

/* ── Selection ───────────────────────────────────────────── */
::selection { background: rgba(77,159,255,0.25); color: var(--text); }

/* ── Layout ──────────────────────────────────────────────── */
.container { max-width:1120px; margin:0 auto; padding:0 1.75rem; position:relative; z-index:1; }

/* ── Utility ─────────────────────────────────────────────── */
.blue { color: var(--blue); }

/* Section shared */
.stag {
    display:inline-block;
    font-size:.7rem; font-weight:700; letter-spacing:.2em;
    text-transform:uppercase; color: var(--blue);
    margin-bottom:.875rem;
}
.sheading {
    font-family: var(--font-sans);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight:700; line-height:1.15; color: var(--text);
    margin-bottom:.875rem;
}
.ssub {
    font-size:.975rem; color: var(--text-2);
    line-height:1.75;
}
.section-head { margin-bottom:2.75rem; }
.section-head.center { text-align:center; }

.section { padding:6rem 0; position:relative; z-index:1; }

/* ── Scroll Reveal ───────────────────────────────────────── */
.reveal {
    opacity:0; transform:translateY(20px);
    transition:opacity .55s ease, transform .55s ease;
}
.reveal-left {
    opacity:0; transform:translateX(-28px);
    transition:opacity .55s ease, transform .55s ease;
}
.reveal-right {
    opacity:0; transform:translateX(28px);
    transition:opacity .55s ease, transform .55s ease;
}
.reveal.in, .reveal-left.in, .reveal-right.in {
    opacity:1; transform:none;
}

/* ── NAVBAR ──────────────────────────────────────────────── */
.navbar {
    position:fixed; top:0; left:0; right:0;
    z-index:200; padding:1.2rem 0;
    transition: var(--t);
}
.navbar.scrolled {
    background: rgba(13,17,23,0.9);
    backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
    border-bottom:1px solid var(--border);
    padding:.85rem 0;
}
.nav-inner {
    display:flex; align-items:center; justify-content:space-between; gap:2rem;
}

/* Logo */
.nav-logo {
    font-family: 'Courier New', 'Space Grotesk', monospace;
    font-size:1.25rem; font-weight:700;
    text-decoration:none; color: var(--text);
    letter-spacing:-.01em; white-space:nowrap;
}
.nav-logo .lb { color: var(--blue); }

/* Links */
.nav-links {
    display:flex; gap:2rem; list-style:none;
    align-items:center; flex:1; justify-content:center;
}
.nav-links a {
    color: var(--text-2); text-decoration:none;
    font-size:.875rem; font-weight:500; transition:color .2s;
}
.nav-links a:hover { color: var(--text); }

/* Hire Me button */
.nav-hire {
    display:inline-flex; align-items:center;
    padding:.42rem 1.15rem;
    background: var(--blue); color:#000;
    border-radius:50px; font-size:.83rem; font-weight:700;
    text-decoration:none; white-space:nowrap; transition: var(--t);
    box-shadow:0 0 18px rgba(77,159,255,0.3);
}
.nav-hire:hover {
    background: #74b6ff; transform:translateY(-1px);
    box-shadow:0 0 28px rgba(77,159,255,0.45);
}

/* Hamburger */
.nav-toggle {
    display:none; flex-direction:column; gap:5px;
    cursor:pointer; background:none; border:none; padding:.35rem;
}
.nav-toggle span {
    display:block; width:22px; height:1.5px;
    background: var(--text); border-radius:2px; transition: var(--t);
}

/* ── HERO ────────────────────────────────────────────────── */
.hero {
    min-height:100vh; display:flex; align-items:center;
    padding:8rem 0 5rem; position:relative; z-index:1;
}
.hero-inner {
    display:flex; flex-direction:column;
    align-items:center; text-align:center; gap:0;
}

/* Profile photo */
.hero-photo-wrap {
    position:relative; width:130px; height:130px;
    margin-bottom:2rem;
}
.hero-photo-ring {
    position:absolute; inset:-6px; border-radius:50%;
    background: conic-gradient(var(--blue) 0%, rgba(77,159,255,0.1) 50%, var(--blue) 100%);
    animation:spinRing 6s linear infinite; z-index:0;
}
.hero-photo-ring::before {
    content:''; position:absolute; inset:3px;
    background: var(--bg); border-radius:50%;
}
@keyframes spinRing {
    from { transform:rotate(0deg); }
    to   { transform:rotate(360deg); }
}
.hero-photo {
    position:absolute; inset:4px; border-radius:50%;
    overflow:hidden; z-index:1;
    background: var(--bg-2);
    box-shadow: 0 0 0 1px rgba(77,159,255,0.15),
                0 0 40px rgba(77,159,255,0.12);
}
.hero-img {
    width:100%; height:100%;
    object-fit:cover; object-position:center top;
    border-radius:50%;
}
/* Green status dot */
.hero-status-dot {
    position:absolute; bottom:6px; right:6px; z-index:2;
    width:16px; height:16px; border-radius:50%;
    background: var(--green);
    border:2.5px solid var(--bg);
    box-shadow:0 0 10px var(--green);
    animation:pulseGreen 2s ease-in-out infinite;
}
@keyframes pulseGreen {
    0%,100% { box-shadow:0 0 8px var(--green); }
    50%      { box-shadow:0 0 20px var(--green); }
}

/* Hero text */
.hero-headline {
    font-family: var(--font-sans);
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight:800; line-height:1.15; color: var(--text);
    margin-bottom:.75rem; letter-spacing:-.02em;
}
.hero-tagline {
    font-family: var(--font-sans);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight:500; color: var(--text-2);
    margin-bottom:1.1rem;
}
.hero-desc {
    font-size:.94rem; color: var(--text-2);
    line-height:1.8; max-width:520px;
    margin-bottom:2.25rem;
}

/* CTA buttons */
.hero-ctas { display:flex; gap:.875rem; flex-wrap:wrap; justify-content:center; margin-bottom:1.75rem; }
.cta-btn {
    display:inline-flex; align-items:center; gap:.5rem;
    padding:.72rem 1.5rem;
    background: var(--bg-2); color: var(--text);
    border:1px solid var(--border);
    border-radius: var(--radius); font-size:.875rem; font-weight:600;
    text-decoration:none; transition: var(--t);
}
.cta-btn:hover {
    border-color: var(--border-b); color: var(--blue);
    background: rgba(77,159,255,0.06); transform:translateY(-2px);
    box-shadow:0 8px 24px rgba(0,0,0,0.25);
}

/* Social text links */
.hero-socials {
    display:flex; align-items:center; gap:.75rem; flex-wrap:wrap; justify-content:center;
}
.social-txt {
    display:inline-flex; align-items:center; gap:.35rem;
    font-size:.85rem; color: var(--text-3);
    text-decoration:none; transition:color .2s;
}
.social-txt:hover { color: var(--blue); }
.social-sep { color: var(--text-3); font-size:.9rem; }

/* ── PROJECTS ────────────────────────────────────────────── */
#projects { background: var(--bg); }

/* Filter pill bar */
.filter-wrap { display:flex; justify-content:center; margin-bottom:3rem; }
.filter-bar {
    display:inline-flex; gap:3px;
    background: var(--bg-2); border:1px solid var(--border);
    border-radius:50px; padding:4px;
}
.ftab {
    padding:.4rem 1.15rem; border-radius:50px;
    border:none; background:transparent;
    color: var(--text-2); font-family: var(--font-body);
    font-size:.84rem; font-weight:500; cursor:pointer;
    transition: color .15s ease; white-space:nowrap;
}
.ftab:hover:not(.active) { color: var(--text); background: rgba(255,255,255,0.04); }
.ftab.active { background: var(--blue); color:#000; font-weight:600; }

/* Grid */
.proj-grid {
    display:grid; grid-template-columns:repeat(3,1fr); gap:1.25rem;
}

/* Card */
.proj-card {
    background: var(--bg-2); border:1px solid var(--border);
    border-radius: var(--radius-lg); overflow:hidden;
    display:flex; flex-direction:column;
    transition: var(--t);
    position:relative;
}
.proj-card:hover {
    border-color: var(--border-b);
    transform:translateY(-5px);
    box-shadow:0 16px 48px rgba(0,0,0,0.35), 0 0 24px rgba(77,159,255,0.08);
}
.card-link {
    position: absolute; inset: 0; z-index: 3;
    cursor: pointer;
}
/* Filter fade-in — no transform, no layout shift */
@keyframes cardFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Card thumb — browser mockup */
.card-thumb {
    height:188px; background: var(--tbg, var(--bg-3));
    position:relative; overflow:hidden; flex-shrink:0;
}
.thumb-bar {
    display:flex; align-items:center; gap:5px;
    padding:9px 12px;
    background: rgba(0,0,0,0.25); position:relative; z-index:2;
}
.tdot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.td-r { background:#ff5f57; }
.td-y { background:#febc2e; }
.td-g { background:#28c840; }
.thumb-img {
    position:absolute; top:0; left:0;
    width:100%; height:100%;
    object-fit:cover;
    z-index:0;
}

/* Card body */
.card-body { padding:1.4rem 1.5rem 1.5rem; display:flex; flex-direction:column; flex:1; }
.card-meta { display:flex; align-items:center; gap:.65rem; margin-bottom:.9rem; }

.cbadge {
    font-size:.68rem; font-weight:700; letter-spacing:.06em;
    text-transform:uppercase; padding:.22rem .65rem; border-radius:20px;
}
.cbadge-wp      { background:rgba(77,159,255,0.15); color: #74b6ff; border:1px solid rgba(77,159,255,0.25); }
.cbadge-laravel { background:rgba(240,136,62,0.15);  color: #f4a261; border:1px solid rgba(240,136,62,0.25); }
.cbadge-shopify { background:rgba(63,185,80,0.15);   color: #56d364; border:1px solid rgba(63,185,80,0.25); }

.cyear { font-size:.75rem; color: var(--text-3); margin-left:auto; }

.ctitle {
    font-family: var(--font-sans); font-size:.975rem; font-weight:700;
    color: var(--text); margin-bottom:.6rem; line-height:1.35;
}
.cdesc {
    font-size:.835rem; color: var(--text-2);
    line-height:1.72; flex:1; margin-bottom:1.25rem;
}
.ctags { display:flex; flex-wrap:wrap; gap:.4rem; margin-top:auto; }
.ctag {
    font-size:.68rem; font-weight:500; padding:.18rem .55rem;
    border-radius:4px;
    background: var(--bg-3); border:1px solid var(--border);
    color: var(--text-2);
}

/* ── ABOUT ───────────────────────────────────────────────── */
#about { background: var(--bg-2); }

.about-grid {
    display: grid;
    grid-template-columns: 45% 55%;
    gap: 4rem;
    align-items: center;
}

/* Left: photo */
.about-photo-card {
    position: relative;
    display: inline-block;
    width: 100%;
}
.about-photo {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    object-position: center top;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: block;
}
.about-badge {
    position: absolute;
    bottom: -1.1rem;
    right: -1.1rem;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem 1.3rem;
    text-align: center;
    box-shadow: 0 8px 28px rgba(0,0,0,.5);
}
.about-badge-pct {
    display: block;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--blue);
    line-height: 1;
}
.about-badge-label {
    display: block;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-2);
    margin-top: .3rem;
}

/* Right: info */
.about-heading {
    font-size: clamp(1.9rem, 3vw, 2.7rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--text);
    margin: 1rem 0 1.4rem;
}
.about-p { color: var(--text-2); line-height:1.82; margin-bottom:1.1rem; font-size:.97rem; }
.about-p strong { color: var(--text); font-weight:600; }
.about-p:last-of-type { margin-bottom:0; }

/* Stat cards */
.about-stats { display:flex; gap:.875rem; margin-top:2.25rem; }
.astat {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem .875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    text-align: center;
}
.astat-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--blue-dim);
    border: 1px solid var(--border-b);
    display: flex; align-items: center; justify-content: center;
    color: var(--blue);
    flex-shrink: 0;
}
.astat-n {
    font-family: var(--font-sans);
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.astat-l {
    font-size: .65rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* ── SKILLS ──────────────────────────────────────────────── */
#skills { background: var(--bg); }

.marquee-wrap {
    margin-top: 3.5rem;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.marquee-row { display: flex; margin-bottom: 24px; }
.marquee-row:last-child { margin-bottom: 0; }

.marquee-track {
    display: flex;
    flex-shrink: 0;
    width: max-content;
    gap: 16px;
    animation: marqueeLeft 25s linear infinite;
}
.marquee-track.marquee-reverse {
    animation: marqueeRight 30s linear infinite;
}

/* pause both rows when hovering anywhere over the section */
#skills:hover .marquee-track { animation-play-state: paused; }

@keyframes marqueeLeft {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@keyframes marqueeRight {
    from { transform: translateX(-50%); }
    to   { transform: translateX(0); }
}

.skill-card {
    flex-shrink: 0;
    width: 130px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    transition: border-color .22s ease, box-shadow .22s ease;
    cursor: default;
}
.skill-card:hover {
    border-color: var(--border-b);
    box-shadow: 0 0 22px rgba(77,159,255,.18), 0 8px 28px rgba(0,0,0,.28);
}
.skill-card img {
    width: 56px; height: 56px;
    object-fit: contain;
    display: block;
}
.skill-name {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    line-height: 1.3;
}

/* ── CONTACT ─────────────────────────────────────────────── */
#contact { background: var(--bg-2); }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

/* Left column */
.contact-info { display:flex; flex-direction:column; gap:0; }
.contact-heading {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 800;
    line-height: 1.18;
    margin: 1rem 0 1.1rem;
    color: var(--text);
}
.contact-sub {
    font-size: .95rem;
    color: var(--text-2);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.cdetails { display:flex; flex-direction:column; gap:1rem; margin-bottom:2rem; }
.cdetail { display:flex; align-items:center; gap:1rem; }
.cdetail-icon {
    width: 40px; height: 40px; flex-shrink:0;
    border-radius: 10px;
    background: var(--blue-dim);
    border: 1px solid var(--border-b);
    display: flex; align-items:center; justify-content:center;
    color: var(--blue);
}
.cdetail-label { font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:var(--text-3); margin-bottom:.15rem; }
.cdetail-value { font-size:.9rem; color:var(--text); font-weight:500; }

.contact-socials { display:flex; gap:.75rem; }
.csocial {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: flex; align-items:center; justify-content:center;
    color: var(--text-2);
    text-decoration: none;
    transition: var(--t);
}
.csocial:hover { border-color:var(--border-b); color:var(--blue); background:var(--blue-dim); }

/* Right column — form card */
.cform-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
}
.cform { display:flex; flex-direction:column; gap:1.25rem; }
.cform-row { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.cform-group { display:flex; flex-direction:column; gap:.4rem; }
.cform-label { font-size:.78rem; font-weight:600; color:var(--text-2); letter-spacing:.04em; }

.cform-input,
.cform-select,
.cform-textarea {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .7rem 1rem;
    color: var(--text);
    font-size: .875rem;
    font-family: inherit;
    outline: none;
    transition: border-color .18s ease;
    width: 100%;
    box-sizing: border-box;
}
.cform-input::placeholder,
.cform-textarea::placeholder { color: var(--text-3); }
.cform-input:focus,
.cform-select:focus,
.cform-textarea:focus { border-color: var(--blue); }

.cform-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
}
.cform-select option { background: var(--bg-2); color: var(--text); }

.cform-textarea { resize: vertical; min-height: 130px; }

.cform-submit {
    width: 100%;
    padding: .85rem;
    background: var(--blue);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--t);
    box-shadow: 0 0 22px rgba(77,159,255,.28);
}
.cform-submit:hover { background: #74b6ff; box-shadow: 0 0 32px rgba(77,159,255,.45); }

/* ── FOOTER ──────────────────────────────────────────────── */
.footer { padding:1.75rem 0; border-top:1px solid var(--border); position:relative; z-index:1; }
.footer-inner { display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; }
.footer-copy { font-size:.82rem; color: var(--text-3); }
.footer-icons { display:flex; gap:.6rem; }
.ficon {
    width:32px; height:32px; border:1px solid var(--border);
    border-radius:7px; display:flex; align-items:center; justify-content:center;
    color: var(--text-3); text-decoration:none; transition: var(--t);
}
.ficon:hover { border-color: var(--blue); color: var(--blue); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width:1024px) {
    .proj-grid { grid-template-columns:repeat(2,1fr); }
}

@media (max-width:768px) {
    .nav-toggle { display:flex; }
    .nav-hire   { display:none; }

    .nav-links {
        position:fixed; top:0; right:-100%;
        width:72%; max-width:280px; height:100vh;
        background: rgba(13,17,23,.98); backdrop-filter:blur(20px);
        flex-direction:column; justify-content:center; align-items:center;
        gap:2.25rem; transition:right .38s cubic-bezier(.4,0,.2,1);
        border-left:1px solid var(--border); z-index:190;
    }
    .nav-links.open { right:0; }
    .nav-links a { font-size:1.1rem; }

    .hero-headline { font-size:1.8rem; }
    .hero-desc br { display:none; }
    .section { padding:4.5rem 0; }

    .about-grid { grid-template-columns:1fr; gap:3rem; }
    .about-photo-card { max-width:380px; margin:0 auto 2rem; }

    .proj-grid { grid-template-columns:1fr; }

    .contact-grid { grid-template-columns:1fr; gap:2.5rem; }
    .footer-inner { flex-direction:column; text-align:center; }
}

@media (max-width:480px) {
    .hero-headline { font-size:1.6rem; }
    .hero-ctas { flex-direction:column; align-items:center; }
    .about-stats { gap:.5rem; }
    .astat { padding:.9rem .6rem; }
    .astat-n { font-size:1.4rem; }
    .filter-bar { flex-wrap:wrap; border-radius:12px; }
    .ftab { border-radius:8px; }
    .cform-row { grid-template-columns:1fr; }
}
