/* =============================================================
   Mark D. Albin - Portfolio 2024
   Fresh modern redesign. Dark-first, cyan/indigo accent system,
   glassmorphism, animated timeline, skill bars.
   ============================================================= */

/* ---------- Design tokens ---------- */
:root {
    --accent: #22d3ee;
    --accent-2: #6366f1;
    --accent-grad: linear-gradient(135deg, #22d3ee 0%, #6366f1 100%);
    --accent-soft: rgba(34, 211, 238, 0.14);

    --bg: #0a0e17;
    --bg-2: #0e1420;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-2: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text: #e6eaf2;
    --text-muted: #9aa4b8;
    --text-dim: #6b768c;

    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.65);
    --radius: 16px;
    --radius-sm: 10px;

    --ff-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ff-head: "Sora", "Inter", sans-serif;
    --ff-mono: "JetBrains Mono", ui-monospace, monospace;

    --nav-h: 72px;
    --maxw: 1180px;
}

/* ---------- Light theme ---------- */
html[data-theme="light"] {
    --bg: #f5f7fb;
    --bg-2: #ffffff;
    --surface: rgba(10, 14, 23, 0.02);
    --surface-2: rgba(10, 14, 23, 0.04);
    --border: rgba(10, 14, 23, 0.09);
    --border-strong: rgba(10, 14, 23, 0.16);
    --text: #16202e;
    --text-muted: #4a5568;
    --text-dim: #7b8798;
    --shadow: 0 20px 50px -24px rgba(20, 40, 80, 0.28);
    --accent-soft: rgba(99, 102, 241, 0.10);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
    margin: 0;
    font-family: var(--ff-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 { font-family: var(--ff-head); font-weight: 700; line-height: 1.2; }

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-2); }

img { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* ---------- Scroll progress ---------- */
#scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: var(--accent-grad); z-index: 10000; transition: width .1s linear;
}

/* ---------- Navigation ---------- */
#site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9990;
    height: var(--nav-h); display: flex; align-items: center;
}

.navbar-glass {
    max-width: var(--maxw); margin: 12px auto 0; width: calc(100% - 32px);
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 18px; border-radius: 100px;
    background: rgba(10, 14, 23, 0.55);
    border: 1px solid var(--border);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-shadow: 0 8px 30px -12px rgba(0, 0, 0, 0.6);
    transition: background .3s, box-shadow .3s;
}

html[data-theme="light"] .navbar-glass { background: rgba(255, 255, 255, 0.7); }

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-strong); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--ff-head); font-weight: 700; font-size: 15px; color: var(--text); }
.brand-role { font-size: 11px; color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-link {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 100px; color: var(--text-muted);
    font-size: 14px; font-weight: 500; transition: all .2s;
}
.nav-link i { font-size: 15px; }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: #fff; background: var(--accent-grad); box-shadow: 0 6px 18px -6px var(--accent); }
html[data-theme="light"] .nav-link.active { color: #fff; }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle, .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); cursor: pointer; transition: all .2s; font-size: 17px;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.nav-toggle { display: none; flex-direction: column; gap: 4px; }
.nav-toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 100px;
    font-family: var(--ff-head); font-weight: 600; font-size: 14px; border: 1px solid transparent;
    cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent-grad); color: #fff; box-shadow: 0 10px 26px -10px var(--accent); }
.btn-accent:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 32px -10px var(--accent); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

/* ---------- Sections ---------- */
.section { padding: 100px 0; position: relative; }
.section-alt { background: var(--bg-2); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.eyebrow { display: inline-block; font-family: var(--ff-mono); font-size: 13px; letter-spacing: .12em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.section-title { font-size: clamp(28px, 4vw, 40px); margin: 0 0 16px; letter-spacing: -.02em; }
.title-underline { width: 64px; height: 4px; border-radius: 4px; background: var(--accent-grad); margin: 0 auto; }

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; position: relative; overflow: hidden; padding: 120px 20px 80px;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
    opacity: .6;
}
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; animation: float 14s ease-in-out infinite; }
.orb-1 { width: 380px; height: 380px; background: #22d3ee; top: -60px; left: 8%; }
.orb-2 { width: 420px; height: 420px; background: #6366f1; bottom: -80px; right: 6%; animation-delay: -4s; }
.orb-3 { width: 300px; height: 300px; background: #8b5cf6; top: 30%; right: 30%; animation-delay: -8s; opacity: .35; }
@keyframes float { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-40px) translateX(20px); } }

.hero-content { position: relative; z-index: 1; }
.hero-avatar-wrap { position: relative; display: inline-block; margin-bottom: 28px; }
.hero-avatar {
    width: 150px; height: 150px; border-radius: 50%; object-fit: cover; margin: 0 auto;
    border: 4px solid var(--bg-2); box-shadow: 0 0 0 2px var(--accent), 0 20px 50px -12px rgba(0,0,0,.7);
}
.hero-status {
    position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 100px;
    background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
}
.hero-status i { color: #22c55e; font-size: 8px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.hero-name {
    font-size: clamp(40px, 8vw, 76px); margin: 0 0 10px; letter-spacing: -.03em;
    background: linear-gradient(180deg, var(--text), var(--text-muted));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-typed { font-size: clamp(18px, 3vw, 24px); color: var(--text-muted); font-weight: 500; min-height: 1.6em; margin: 0 0 32px; }
.typed { color: var(--accent); font-weight: 600; }
.typed-cursor { color: var(--accent); }

.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 34px; }
.hero-social { display: flex; gap: 14px; justify-content: center; }
.hero-social a {
    width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
    font-size: 18px; transition: all .25s;
}
.hero-social a:hover { color: #fff; background: var(--accent-grad); transform: translateY(-3px); border-color: transparent; }

.hero-scroll { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 1;
    color: var(--text-muted); font-size: 26px; animation: bob 2s infinite; }
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* ---------- Stats ---------- */
.stats { padding: 0 0 20px; margin-top: -50px; position: relative; z-index: 2; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px 20px; text-align: center; backdrop-filter: blur(10px);
}
.stat-num { font-family: var(--ff-head); font-size: 44px; font-weight: 800;
    background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-plus { font-family: var(--ff-head); font-size: 30px; font-weight: 800; color: var(--accent); }
.stat-label { display: block; margin-top: 6px; color: var(--text-muted); font-size: 14px; }

/* ---------- About ---------- */
.lead-text { font-size: 18px; color: var(--text); }
.about-card { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.about-img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.about-badges { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.badge-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
    padding: 6px 12px; border-radius: 100px; background: rgba(10,14,23,.7); border: 1px solid var(--border-strong);
    color: #fff; backdrop-filter: blur(6px); }
.badge-chip i { color: var(--accent); }
.about-facts { list-style: none; padding: 0; margin: 20px 0 0; }
.about-facts li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; color: var(--text-muted); }
.about-facts i { color: var(--accent); margin-top: 4px; }

/* ---------- Skills ---------- */
.skills-grid { columns: 2; column-gap: 44px; }
.skills-grid .skill-item { -webkit-column-break-inside: avoid; break-inside: avoid; }
@media (max-width: 900px) { .skills-grid { columns: 1; } }
.skill-item { margin-bottom: 22px; }
.skill-row { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.skill-row span:last-child { color: var(--accent); font-family: var(--ff-mono); }
.skill-bar { height: 9px; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.skill-fill { height: 100%; width: 0; border-radius: 100px; background: var(--accent-grad);
    transition: width 1.4s cubic-bezier(.16,1,.3,1); box-shadow: 0 0 12px -2px var(--accent); }

.tech-tags { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 48px; }
.tech-tags span {
    font-size: 13px; font-weight: 500; font-family: var(--ff-mono);
    padding: 7px 14px; border-radius: 100px; background: var(--surface);
    border: 1px solid var(--border); color: var(--text-muted); transition: all .2s;
}
.tech-tags span:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 860px; margin: 0 auto; padding-left: 8px; }
.timeline::before { content: ""; position: absolute; left: 20px; top: 6px; bottom: 6px; width: 2px;
    background: linear-gradient(var(--accent), var(--accent-2), transparent); }
.timeline-item { position: relative; padding-left: 60px; margin-bottom: 34px; }
.timeline-dot { position: absolute; left: 12px; top: 8px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--bg); border: 3px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 26px 28px; transition: transform .25s, border-color .25s, box-shadow .25s;
}
.timeline-card:hover { transform: translateX(4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.timeline-date { display: inline-block; font-family: var(--ff-mono); font-size: 12px; font-weight: 500;
    color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 100px; margin-bottom: 12px; }
.timeline-card h3 { font-size: 21px; margin: 0 0 4px; }
.timeline-org { font-size: 15px; color: var(--text-muted); font-weight: 500; margin: 0 0 14px; }
.timeline-sub { font-family: var(--ff-head); font-weight: 600; font-size: 13px; text-transform: uppercase;
    letter-spacing: .06em; color: var(--accent-2); margin: 16px 0 6px; }
.timeline-card ul { margin: 0 0 6px; padding-left: 18px; }
.timeline-card li { color: var(--text-muted); margin-bottom: 5px; }
.timeline-card p { color: var(--text-muted); }

/* ---------- Education ---------- */
.edu-card { text-align: center; padding: 40px 28px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); height: 100%; transition: transform .25s, border-color .25s; }
.edu-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.edu-icon { width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: #fff; background: var(--accent-grad); box-shadow: 0 12px 28px -10px var(--accent); }
.edu-year { display: inline-block; font-family: var(--ff-mono); font-size: 13px; color: var(--accent); margin-bottom: 8px; }
.edu-card h3 { font-size: 20px; margin: 0 0 8px; }
.edu-card p { color: var(--text-muted); margin: 0; }
.edu-note { font-size: 13px; color: var(--text-dim); }

/* ---------- Contact ---------- */
.contact-info { padding: 8px 0; }
.contact-line { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.contact-ic { width: 48px; height: 48px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--border); }
.contact-k { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.contact-v { display: block; font-weight: 600; color: var(--text); }
a.contact-v:hover { color: var(--accent); }
.contact-note { color: var(--text-muted); margin-top: 26px; }

.contact-form-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
    width: 100%; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    color: var(--text); padding: 12px 14px; font-family: var(--ff-body); font-size: 15px; transition: border-color .2s, box-shadow .2s;
}
.form-control::placeholder { color: var(--text-dim); }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.form-control { resize: vertical; }
.field-error { display: block; color: #f87171; font-size: 13px; margin-top: 5px; }
.form-status { font-weight: 600; font-size: 14px; }
.form-status.success { color: #34d399; }
.form-status.error { color: #f87171; }

/* ---------- Footer ---------- */
#site-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 40px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer-name { font-family: var(--ff-head); font-weight: 700; display: block; }
.footer-tag { font-size: 13px; color: var(--text-muted); }
.footer-social { display: flex; gap: 12px; }
.footer-social a { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); transition: all .25s; }
.footer-social a:hover { color: #fff; background: var(--accent-grad); border-color: transparent; transform: translateY(-3px); }
.footer-credits { font-size: 13px; color: var(--text-muted); text-align: right; }
.footer-credits a { color: var(--accent); }
#siteseal { display: block; margin-top: 6px; }

/* ---------- Back to top ---------- */
.back-to-top {
    position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; z-index: 9980;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
    background: var(--accent-grad); color: #fff; font-size: 26px; opacity: 0; visibility: hidden;
    transform: translateY(12px); transition: all .3s; box-shadow: 0 12px 28px -10px var(--accent);
}
.back-to-top:hover { color: #fff; transform: translateY(-2px); }
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-toggle { display: inline-flex; }
    .nav-links {
        position: absolute; top: calc(100% + 10px); right: 0; left: 0;
        flex-direction: column; align-items: stretch; gap: 4px; padding: 14px;
        background: var(--bg-2); border: 1px solid var(--border); border-radius: 20px;
        box-shadow: var(--shadow); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all .25s;
    }
    .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .nav-link { justify-content: flex-start; }
}
@media (max-width: 560px) {
    .stats-grid { grid-template-columns: 1fr; }
    .section { padding: 70px 0; }
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-credits { text-align: center; }
    .brand-text { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}
