/* ============================================
   SEBASTIAN RICHARDS — PORTFOLIO
   Design System & Styles
   ============================================ */

/* --- Design Tokens --- */
:root {
    /* Colours */
    --bg: #0a0a0a;
    --bg-elevated: #111111;
    --bg-card: #151515;
    --bg-card-hover: #1a1a1a;
    --text: #f0f0f0;
    --text-secondary: #999999;
    --text-muted: #666666;
    --accent: #4f8cff;
    --accent-hover: #6ba0ff;
    --accent-glow: rgba(79, 140, 255, 0.12);
    --accent-glow-strong: rgba(79, 140, 255, 0.25);
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.14);
    --glass: rgba(15, 15, 15, 0.8);
    --glass-border: rgba(255, 255, 255, 0.06);

    /* Typography */
    --font-heading: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* Spacing */
    --section-pad: clamp(80px, 10vw, 140px);
    --container-max: 1200px;
    --container-pad: clamp(20px, 4vw, 40px);

    /* Motion */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 0.5s;
    --duration-fast: 0.3s;

    /* Radius */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* --- Container --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

/* --- Section --- */
.section {
    padding: var(--section-pad) 0;
}

.section__header {
    margin-bottom: clamp(40px, 6vw, 72px);
}

.section__label {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
    position: relative;
    padding-left: 28px;
}

.section__label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 18px;
    height: 1px;
    background: var(--accent);
}

.section__title {
    font-family: var(--font-heading);
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text);
}

.section__subtitle {
    font-size: clamp(16px, 2vw, 18px);
    color: var(--text-secondary);
    max-width: 560px;
    margin-top: 16px;
    line-height: 1.7;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
    white-space: nowrap;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 0 var(--accent-glow);
}

.btn--primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 24px var(--accent-glow-strong);
    transform: translateY(-2px);
}

.btn--outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-hover);
}

.btn--outline:hover {
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

.btn--full {
    width: 100%;
}

/* --- Scroll Animations --- */
.animate-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 var(--container-pad);
    transition: all var(--duration-fast) var(--ease);
}

.nav.scrolled {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--glass-border);
}

.nav__container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    transition: color var(--duration-fast) var(--ease);
}

.nav__logo:hover {
    color: var(--accent);
}

.nav__logo-mark {
    width: 44px;
    height: 36px;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav__link {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease);
}

.nav__link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav__link--cta {
    color: var(--accent);
    border: 1px solid rgba(79, 140, 255, 0.3);
    margin-left: 8px;
}

.nav__link--cta:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
}

/* Hamburger */
.nav__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.nav__hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--duration-fast) var(--ease);
    transform-origin: center;
}

.nav__hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav__hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nav__hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   HERO
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-top: 72px;
}

.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero__gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 60%, rgba(79, 140, 255, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 80% 30%, rgba(79, 140, 255, 0.04) 0%, transparent 60%);
}

.hero__grain {
    position: absolute;
    inset: 0;
    opacity: 0.3;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px;
    pointer-events: none;
}

.hero__content {
    position: relative;
    z-index: 1;
    padding: clamp(40px, 8vw, 80px) 0;
}

.hero__eyebrow {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 24px;
}

.hero__title {
    font-family: var(--font-heading);
    font-size: clamp(40px, 7vw, 80px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
}

.hero__title-accent {
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero__subtitle {
    font-size: clamp(16px, 2vw, 19px);
    color: var(--text-secondary);
    max-width: 580px;
    line-height: 1.7;
    margin-bottom: 40px;
}

.hero__cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 64px;
}

.hero__stats {
    display: flex;
    gap: clamp(32px, 5vw, 64px);
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.hero__stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero__stat-number {
    font-family: var(--font-heading);
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.hero__stat-label {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Scroll indicator */
.hero__scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero__scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
    animation: scrollLine 2s var(--ease) infinite;
}

@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; opacity: 1; }
    50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
    51% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
    100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ============================================
   ABOUT
   ============================================ */
.about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    margin-bottom: clamp(48px, 6vw, 72px);
}

.about__lead {
    font-size: clamp(18px, 2.2vw, 22px);
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 20px;
}

.about__text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.about__experience-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: linear-gradient(to bottom, var(--accent), var(--border));
}

.timeline__item {
    position: relative;
    padding-bottom: 24px;
    padding-left: 8px;
}

.timeline__item:last-child {
    padding-bottom: 0;
}

.timeline__item::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--bg);
}

.timeline__date {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.04em;
}

.timeline__role {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-top: 2px;
}

.timeline__company {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Skills */
.skills__title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

.skills__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    padding: 8px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease);
}

.skill-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* ============================================
   SERVICES
   ============================================ */
.services {
    background: var(--bg-elevated);
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(28px, 4vw, 40px);
    transition: all var(--duration) var(--ease);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, var(--accent-glow) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
}

.service-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
}

.service-card:hover::before {
    opacity: 1;
}

.service-card__icon {
    width: 48px;
    height: 48px;
    color: var(--accent);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.service-card__icon svg {
    width: 100%;
    height: 100%;
}

.service-card__title {
    font-family: var(--font-heading);
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 600;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.service-card__text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.service-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.service-card__tags li {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 100px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   PORTFOLIO
   ============================================ */
.portfolio__filters {
    display: flex;
    gap: 8px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 8px 22px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
}

.filter-btn:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.project-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--duration) var(--ease);
}

.project-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.project-card.hidden {
    display: none;
}

.project-card__image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-elevated);
}

.project-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.project-card:hover .project-card__image img {
    transform: scale(1.05);
}

.project-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease);
}

.project-card:hover .project-card__overlay {
    opacity: 1;
}

.project-card__visit {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    padding: 10px 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
}

.project-card__info {
    padding: 20px 24px 24px;
}

.project-card__title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.project-card__desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.project-card__tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ============================================
   CONTACT
   ============================================ */
.contact {
    background: var(--bg-elevated);
}

.contact__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: start;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text);
    transition: all var(--duration-fast) var(--ease);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.contact__info {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: 8px;
}

.contact__detail-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.contact__detail-value {
    font-size: 17px;
    color: var(--text);
    transition: color var(--duration-fast) var(--ease);
}

a.contact__detail-value:hover {
    color: var(--accent);
}

.contact__availability {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: #22c55e;
    margin-top: 8px;
}

.contact__availability-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

.footer__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer__copy {
    font-size: 13px;
    color: var(--text-muted);
}

.footer__links {
    display: flex;
    gap: 16px;
}

.footer__link {
    color: var(--text-muted);
    transition: color var(--duration-fast) var(--ease);
}

.footer__link:hover {
    color: var(--accent);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 968px) {
    .about__grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

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

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

@media (max-width: 768px) {
    /* Nav mobile */
    .nav__hamburger {
        display: flex;
    }

    .nav__links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100dvh;
        background: var(--bg);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: right var(--duration) var(--ease);
    }

    .nav__links.open {
        right: 0;
    }

    .nav__link {
        font-size: 22px;
        padding: 12px 24px;
    }

    .nav__link--cta {
        margin-left: 0;
        margin-top: 16px;
        font-size: 16px;
    }

    /* Hero mobile */
    .hero__stats {
        flex-direction: column;
        gap: 20px;
    }

    .hero__stat {
        flex-direction: row;
        align-items: baseline;
        gap: 12px;
    }

    .hero__scroll {
        display: none;
    }

    /* Portfolio mobile */
    .portfolio__grid {
        grid-template-columns: 1fr;
    }

    .portfolio__filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .portfolio__filters::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero__cta {
        flex-direction: column;
    }

    .hero__cta .btn {
        width: 100%;
    }
}

/* --- Selection --- */
::selection {
    background: var(--accent);
    color: #fff;
}

/* --- Focus visible --- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
