/* ============================================================
   Aston Shand — Portfolio
   Fonts: Fraunces (display) + Outfit (body) + JetBrains Mono
   ============================================================ */

/* Design tokens */
:root {
    --accent: #ff7b3a;
    --accent-2: #ffb371;
    --accent-soft: rgba(255, 123, 58, 0.12);

    --radius-sm: 0.5rem;
    --radius-md: 0.9rem;
    --radius-lg: 1.4rem;
    --radius-xl: 2rem;

    --container: 1160px;
    --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);

    --font-display: 'Fraunces', 'Georgia', serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* Dark theme (default) */
[data-theme="dark"] {
    --bg: #0b0f17;
    --bg-alt: #0f1420;
    --bg-card: #141a28;
    --bg-hover: #1a2233;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #e8ecf4;
    --text-muted: #9aa5b8;
    --text-dim: #6b7689;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --grid-color: rgba(255, 255, 255, 0.04);
}

/* Light theme */
[data-theme="light"] {
    --bg: #fbfaf7;
    --bg-alt: #f3f1ec;
    --bg-card: #ffffff;
    --bg-hover: #f7f5f0;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.16);
    --text: #1a1d24;
    --text-muted: #5a6478;
    --text-dim: #8892a4;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.1);
    --grid-color: rgba(0, 0, 0, 0.04);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0;
}
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }

/* ===== Navigation ===== */
.nav {
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
.nav-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: -0.02em;
}
.brand-name { font-size: 0.95rem; }
.nav-links {
    display: flex; gap: 2rem;
}
.nav-links a {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color var(--transition);
    position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }
.theme-toggle {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition);
}
.theme-toggle:hover { background: var(--bg-card); color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ===== Hero ===== */
.hero {
    position: relative;
    padding: 5rem 0 6rem;
    overflow: hidden;
}
.hero-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 1.75rem;
}
.dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); }
    70% { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1.5rem;
    max-width: 900px;
}
.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.hero-sub {
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 2.25rem;
}
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 3.5rem; }

.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
}
.btn svg { width: 18px; height: 18px; transition: transform var(--transition); }
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: color-mix(in srgb, var(--accent) 85%, black);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
}
.btn-ghost:hover { background: var(--bg-card); border-color: var(--text-muted); }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 2rem;
    max-width: 720px;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}
.stat-num {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text);
    margin-bottom: 0.35rem;
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ===== Sections ===== */
.section { padding: 6rem 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 3.5rem; max-width: 720px; }
.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-family: var(--font-mono);
}
.section-head h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 0.75rem;
}
.section-desc { color: var(--text-muted); font-size: 1.05rem; max-width: 560px; }

/* ===== About ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    align-items: start;
}
.about-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 1.1rem;
}
.about-text strong { color: var(--text); font-weight: 600; }
.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    position: sticky;
    top: 90px;
}
.card-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.card-row:last-child { border-bottom: none; }
.card-key { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.82rem; }
.card-val { color: var(--text); text-align: right; font-weight: 500; }

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 7px; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 2.5rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
    position: absolute;
    left: -2rem; top: 6px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border-strong);
}
.timeline-item.current .timeline-marker {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    flex-wrap: wrap; margin-bottom: 0.4rem;
}
.timeline-content h3 { font-size: 1.25rem; }
.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}
.timeline-company { color: var(--accent); font-size: 0.9rem; font-weight: 500; margin-bottom: 0.85rem; }
.timeline-bullets li {
    color: var(--text-muted);
    font-size: 0.94rem;
    padding-left: 1.1rem;
    position: relative;
    margin-bottom: 0.4rem;
}
.timeline-bullets li::before {
    content: '';
    position: absolute;
    left: 0; top: 0.65em;
    width: 4px; height: 4px;
    background: var(--text-dim);
    border-radius: 50%;
}

/* ===== Projects ===== */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}
.filter {
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-size: 0.88rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.project-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 0; transition: opacity var(--transition);
}
.project-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.project-card:hover::before { opacity: 1; }
.project-card.hidden { display: none; }

.project-meta {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.project-year {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
}
.project-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--bg-hover);
    color: var(--text-muted);
}
.project-status[data-status="live"],
.project-status[data-status="deployed"],
.project-status[data-status="launched"],
.project-status[data-status="validated"],
.project-status[data-status="delivered"] {
    background: color-mix(in srgb, #22c55e 18%, transparent);
    color: #22c55e;
}
.project-status[data-status="active"],
.project-status[data-status="ready"] {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
}
.project-status[data-status="in progress"],
.project-status[data-status="research"] {
    background: color-mix(in srgb, #3b82f6 18%, transparent);
    color: #3b82f6;
}

.project-title { font-size: 1.35rem; margin-bottom: 0.35rem; }
.project-tagline { color: var(--accent); font-size: 0.88rem; font-weight: 500; margin: 0; }
.project-desc { color: var(--text-muted); font-size: 0.92rem; margin: 0; }
.project-highlights {
    display: flex; flex-direction: column; gap: 0.35rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 0;
}
.project-highlights li {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding-left: 1.1rem;
    position: relative;
    line-height: 1.5;
}
.project-highlights li::before {
    content: '→';
    position: absolute;
    left: 0; top: 0;
    color: var(--accent);
    font-weight: 600;
}
.project-foot {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    flex-wrap: wrap;
    margin-top: auto;
}
.stack { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tech {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.25rem 0.55rem;
    background: var(--bg-hover);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
}
.project-link {
    display: inline-flex; align-items: center; gap: 0.3rem;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
    transition: gap var(--transition);
}
.project-link:hover { gap: 0.5rem; }
.project-link svg { width: 14px; height: 14px; }

/* ===== Skills ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}
.skill-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: all var(--transition);
}
.skill-group:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.skill-group h3 {
    font-size: 1.05rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.skill-list li {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.35rem 0;
}

/* ===== Contact ===== */
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    position: relative;
    overflow: hidden;
}
.contact-card::before {
    content: '';
    position: absolute; top: -50%; right: -20%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
    pointer-events: none;
}
.contact-copy { position: relative; }
.contact-copy h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-bottom: 1rem; }
.contact-copy p { color: var(--text-muted); margin: 0; }
.contact-methods {
    display: flex; flex-direction: column; gap: 1rem;
    position: relative;
}
.contact-method {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
.contact-method:not(.static):hover {
    border-color: var(--accent);
    transform: translateX(4px);
}
.method-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.method-icon svg { width: 20px; height: 20px; }
.method-body { display: flex; flex-direction: column; gap: 0.15rem; }
.method-label { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-mono); }
.method-value { font-size: 0.95rem; color: var(--text); font-weight: 500; }

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.back-top { color: var(--text-muted); transition: color var(--transition); }
.back-top:hover { color: var(--accent); }

/* ===== Reveal animations ===== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 860px) {
    .nav-links { display: none; }
    .hero { padding: 3.5rem 0 4.5rem; }
    .section { padding: 4rem 0; }
    .about-grid { grid-template-columns: 1fr; gap: 2rem; }
    .about-card { position: static; }
    .contact-card { grid-template-columns: 1fr; padding: 2rem; gap: 2rem; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
    .timeline-head { flex-direction: column; gap: 0.25rem; }
}
@media (max-width: 480px) {
    .hero-title { font-size: 2.2rem; }
    .nav-inner { padding: 0.85rem 1rem; }
    .brand-name { display: none; }
    .project-grid { grid-template-columns: 1fr; }
}

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