@import url('tokens.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Finlandica Text', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
p { color: var(--text-secondary); line-height: 1.75; }

/* ── Nav ─────────────────────────────────────────── */
nav {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-h); z-index: 100;
    background: rgba(247,245,241,0.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1100px; margin: 0 auto;
    padding: 0 2rem; height: 100%;
    display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
    font-size: 1rem; font-weight: 700;
    letter-spacing: -0.03em; color: var(--text-primary);
}
.nav-logo span { color: var(--accent); }

.nav-logo img {
    height: 32px;
    width: auto;
}

.nav-links { display: flex; gap: 2.25rem; list-style: none; }
.nav-links a {
    font-size: 0.875rem; font-weight: 450;
    color: var(--text-secondary); transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-primary); }

.nav-cta {
    font-size: 0.85rem; font-weight: 580;
    color: var(--accent); border: 1.5px solid var(--accent);
    padding: 0.42rem 1.1rem; border-radius: 100px; transition: all 0.2s;
}
.nav-cta:hover { background: var(--accent); color: #fff; }

.nav-mobile-btn {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-mobile-btn span {
    display: block; width: 22px; height: 1.5px;
    background: var(--text-primary); transition: all 0.3s;
}

.mobile-drawer {
    display: none; position: fixed;
    top: var(--nav-h); left: 0; right: 0; bottom: 0;
    background: rgba(247,245,241,0.97);
    backdrop-filter: blur(24px); z-index: 99;
    flex-direction: column; align-items: center;
    justify-content: center; gap: 2.75rem;
}
.mobile-drawer.open { display: flex; }
.mobile-drawer a {
    font-size: 2rem; font-weight: 650;
    letter-spacing: -0.04em; color: var(--text-primary);
}

/* ── Layout ──────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
section { padding: 6rem 0; }

.section-label {
    font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 0.85rem;
    display: flex; align-items: center; gap: 0.75rem;
}
.section-label::after {
    content: ''; display: block; height: 1px;
    width: 28px; background: var(--text-muted);
}

.fade-in {
    opacity: 0; transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── Hero ────────────────────────────────────────── */
#hero {
    padding-top: calc(var(--nav-h) + 5.5rem);
    padding-bottom: 6rem;
    min-height: 100svh; display: flex; align-items: center;
}

.hero-label {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-size: 0.78rem; font-weight: 580; letter-spacing: 0.09em;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 2rem;
}
.hero-label::before {
    content: ''; display: inline-block;
    width: 22px; height: 1.5px; background: var(--text-muted);
}

.hero-title {
    font-size: clamp(3.5rem, 7.5vw, 7rem);
    font-weight: 720; letter-spacing: -0.05em;
    line-height: 1.0; color: var(--text-primary);
    max-width: 900px; margin-bottom: 1.75rem;
}
.hero-title em {
    font-style: italic; font-weight: 300;
    color: var(--text-muted);
}

.hero-sub {
    font-size: 1.1rem; color: var(--text-secondary);
    max-width: 500px; line-height: 1.75; margin-bottom: 2.75rem;
}

.hero-actions { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }

.btn-dark {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--text-primary); color: var(--bg);
    font-family: 'Finlandica Text', sans-serif;
    font-size: 0.9rem; font-weight: 580;
    padding: 0.82rem 1.8rem; border-radius: 100px;
    border: none; cursor: pointer; transition: all 0.22s;
}
.btn-dark:hover { opacity: 0.78; transform: translateY(-1px); }

.btn-ghost {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.9rem; font-weight: 500;
    color: var(--text-secondary);
    padding-bottom: 2px;
    border-bottom: 1.5px solid var(--border-strong);
    transition: all 0.2s;
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-primary); }

.hero-scroll {
    margin-top: 5.5rem;
    display: flex; align-items: center; gap: 1.25rem;
}
.hero-scroll-line { width: 48px; height: 1px; background: var(--border-strong); }
.hero-scroll-text {
    font-size: 0.7rem; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--text-muted);
}

/* ── Servicios ───────────────────────────────────── */
#servicios {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.services-head { max-width: 560px; margin-bottom: 3.75rem; }
.services-head .section-title {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 680; letter-spacing: -0.04em;
    margin-bottom: 0.75rem;
}
.services-head p { font-size: 1rem; }

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 1.5px; background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden;
}

.service-card {
    background: var(--surface); padding: 2.25rem 1.9rem;
    transition: background 0.2s;
}
.service-card:hover { background: var(--bg); }

.svc-icon {
    font-size: 1.6rem; margin-bottom: 1.2rem; display: block;
}
.service-card h3 {
    font-size: 1.0rem; font-weight: 660;
    letter-spacing: -0.025em; margin-bottom: 0.55rem;
    color: var(--text-primary);
}
.service-card p { font-size: 0.875rem; line-height: 1.65; }

/* ── Portfolio ───────────────────────────────────── */
#portfolio { background: var(--bg); }

.portfolio-header { margin-bottom: 3.5rem; }
.portfolio-header .section-title {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 680; letter-spacing: -0.04em;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.25rem;
}

.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.75rem;
    display: flex; flex-direction: column;
    transition: all 0.25s;
}
.app-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.06);
}

.app-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }

.app-icon {
    width: 56px; height: 56px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0; overflow: hidden;
    border: 1px solid var(--border);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-icon.pk { background: #FFF8E1; }

.app-meta h3 {
    font-size: 1.0rem; font-weight: 660;
    letter-spacing: -0.02em; color: var(--text-primary);
}
.app-status { font-size: 0.73rem; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

.app-card > p { font-size: 0.875rem; line-height: 1.65; flex: 1; }

.app-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tag {
    font-size: 0.7rem; font-weight: 580; letter-spacing: 0.01em;
    padding: 0.22rem 0.6rem; border-radius: 100px;
    background: var(--bg); color: var(--text-secondary);
    border: 1px solid var(--border);
}

.app-links {
    display: flex; gap: 0.75rem; margin-top: 1.25rem;
    padding-top: 1.25rem; border-top: 1px solid var(--border);
    align-items: center; flex-wrap: wrap;
}
.app-link {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.8rem; font-weight: 560;
    color: var(--text-secondary); transition: color 0.2s;
}
.app-link:hover { color: var(--accent); }
.app-link svg {
    width: 13px; height: 13px; stroke: currentColor;
    fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.app-link.dim { opacity: 0.32; cursor: default; pointer-events: none; }

.badge-appstore {
    display: inline-flex; align-items: center; gap: 0.45rem;
    background: var(--text-primary); color: var(--bg);
    font-size: 0.72rem; font-weight: 620; letter-spacing: -0.01em;
    padding: 0.32rem 0.85rem; border-radius: 100px;
    transition: all 0.2s;
}
.badge-appstore:hover { opacity: 0.76; }
.badge-appstore svg { width: 12px; height: 12px; fill: currentColor; }
.badge-appstore.dim {
    background: var(--surface-alt); color: var(--text-muted);
    border: 1px solid var(--border); pointer-events: none;
}

/* ── Sobre mí ────────────────────────────────────── */
#sobre-mi {
    background: var(--surface);
    border-top: 1px solid var(--border);
}

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

.about-name {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 680; letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
}
.about-bio p { font-size: 1.0rem; line-height: 1.8; margin-bottom: 1.1rem; }

.skills-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.skill-pill {
    font-size: 0.78rem; font-weight: 560;
    padding: 0.3rem 0.85rem; border-radius: 100px;
    border: 1.5px solid var(--border-strong);
    color: var(--text-primary); letter-spacing: -0.01em;
}

.edu-block { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.edu-label {
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: 1.25rem;
}
.edu-item { display: flex; gap: 0.85rem; margin-bottom: 1.1rem; align-items: flex-start; }
.edu-badge {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--bg); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.edu-item h4 {
    font-size: 0.88rem; font-weight: 640; letter-spacing: -0.01em;
    color: var(--text-primary);
}
.edu-item p { font-size: 0.78rem; color: var(--text-muted); margin-top: 1px; }

/* Timeline */
.timeline-label {
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: 1.5rem;
}
.timeline { display: flex; flex-direction: column; }

.t-item {
    position: relative; padding: 0 0 2.25rem 1.5rem;
    border-left: 1.5px solid var(--border-strong);
}
.t-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.t-item::before {
    content: ''; position: absolute; left: -4.5px; top: 5px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-primary); border: 2px solid var(--bg);
}
.t-item.current::before { background: var(--accent); }

.t-date {
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.25rem;
}
.t-role {
    font-size: 0.95rem; font-weight: 660; letter-spacing: -0.02em;
    color: var(--text-primary); margin-bottom: 0.15rem;
}
.t-company { font-size: 0.82rem; color: var(--text-muted); }

/* ── Contacto ────────────────────────────────────── */
#contacto { background: var(--text-primary); color: #fff; }
#contacto .section-label { color: rgba(255,255,255,0.38); }
#contacto .section-label::after { background: rgba(255,255,255,0.28); }

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

.contact-title {
    font-size: clamp(2.25rem, 4.5vw, 4rem);
    font-weight: 700; letter-spacing: -0.045em;
    line-height: 1.08; color: #fff; max-width: 600px;
}
.contact-title em {
    font-style: italic; font-weight: 300;
    color: rgba(255,255,255,0.42);
}

.btn-white {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: #fff; color: var(--text-primary);
    font-family: 'Finlandica Text', sans-serif;
    font-size: 0.9rem; font-weight: 620;
    padding: 0.82rem 1.8rem; border-radius: 100px;
    border: none; cursor: pointer; transition: all 0.22s;
    margin-top: 2.5rem; white-space: nowrap;
}
.btn-white:hover { opacity: 0.88; transform: translateY(-1px); }

.contact-links { display: flex; flex-direction: column; gap: 0.85rem; }

.c-link {
    display: flex; align-items: center; gap: 0.85rem;
    font-size: 0.875rem; font-weight: 500;
    color: rgba(255,255,255,0.6); transition: color 0.2s;
}
.c-link:hover { color: #fff; }
.c-link-icon {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
}
.c-link-icon svg {
    width: 14px; height: 14px; stroke: currentColor;
    fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Footer ──────────────────────────────────────── */
footer {
    background: var(--text-primary);
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 1.5rem 0;
}
.footer-inner {
    max-width: 1100px; margin: 0 auto; padding: 0 2rem;
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 0.5rem;
}
footer p { font-size: 0.78rem; color: rgba(255,255,255,0.32); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 860px) {
    .about-grid { grid-template-columns: 1fr; gap: 3.5rem; }
    .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 720px) {
    .nav-links, .nav-cta { display: none; }
    .nav-mobile-btn { display: flex; }
    section { padding: 4rem 0; }
    .services-grid { grid-template-columns: 1fr; }
}
