/* =========================================================
   Carlos Andres Cortes — personal portfolio stylesheet
   Identity: editorial / print — warm paper, ink, forest green.
   Plain CSS, no framework. No grid/glow motifs, no monospace UI.
   ========================================================= */

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

:root {
    --paper: #f7f2e9;
    --paper-card: #fffdf9;
    --paper-line: #e2d9c4;
    --ink: #1c1a17;
    --ink-soft: #5a5449;
    --forest: #2f4a3a;
    --forest-bright: #45694f;
    --forest-soft: rgba(47, 74, 58, 0.08);
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --container: 1080px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.65;
    overflow-x: hidden;
}

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

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

.serif { font-family: var(--font-display); }

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--forest);
    margin-bottom: 1.1rem;
}

.eyebrow::before,
.eyebrow::after {
    content: '';
    flex: 0 0 28px;
    height: 1px;
    background: var(--forest);
    opacity: 0.5;
}

.section-head {
    max-width: 640px;
    margin: 0 auto 3rem;
    text-align: center;
}

.section-head .eyebrow { justify-content: center; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(2rem, 4.4vw, 2.9rem); font-weight: 600; letter-spacing: -0.01em; }
.section-head p { margin-top: 0.9rem; color: var(--ink-soft); font-size: 1.05rem; }

/* ===== NAV ===== */
.site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    background: rgba(247, 242, 233, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--paper-line);
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--ink);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

.nav-links { display: flex; align-items: center; gap: 1.9rem; list-style: none; }

.nav-links a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover { color: var(--forest); }

.nav-resume {
    color: var(--ink) !important;
    font-weight: 600;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 2px;
}

.nav-resume:hover { color: var(--forest) !important; border-color: var(--forest); }

.lang-toggle { display: flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; }

.lang-btn {
    display: inline-block;
    background: none;
    border: none;
    color: var(--ink-soft);
    font-weight: 600;
    padding: 0.2rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.lang-btn.active { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }

/* ===== HERO ===== */
#hero {
    padding: 9.5rem 1.5rem 5rem;
    background: var(--paper);
}

.hero-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 3.5rem;
    align-items: center;
}

.hero-photo-wrap {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    justify-self: center;
}

.hero-photo-wrap img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.15); }

.hero-copy h1 {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.05;
    margin-bottom: 0.5rem;
}

.hero-copy h2 {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--forest);
    padding-top: 0.75rem;
    border-top: 1px solid var(--ink);
    display: inline-block;
    margin-bottom: 1.5rem;
}

.hero-tagline {
    font-size: 1.02rem;
    color: var(--ink-soft);
    max-width: 520px;
    margin-bottom: 2rem;
}

.hero-ctas { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }

.hero-social { display: flex; gap: 1.1rem; }

.hero-social a {
    color: var(--ink-soft);
    transition: var(--transition);
}

.hero-social a:hover { color: var(--forest); }
.hero-social svg { width: 19px; height: 19px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary { background: var(--forest); color: var(--paper-card); }
.btn-primary:hover { background: var(--forest-bright); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { border-color: var(--forest); color: var(--forest); }

.btn-link {
    color: var(--ink);
    font-weight: 600;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 2px;
}

.btn-link:hover { color: var(--forest); border-color: var(--forest); }

/* ===== SECTIONS ===== */
section { padding: clamp(4rem, 8vw, 6.5rem) 1.5rem; }
.bg-paper { background: var(--paper); }
.bg-card { background: var(--paper-card); }
.bg-forest { background: var(--forest); color: rgba(255, 255, 255, 0.92); }

/* ===== STATS ROW ===== */
.stats-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    max-width: var(--container);
    margin: 0 auto;
}

.stats-row .stat {
    flex: 1 1 160px;
    text-align: center;
    padding: 0 1.5rem;
    border-left: 1px solid var(--paper-line);
}

.stats-row .stat:first-child { border-left: none; }

.stats-row strong {
    display: block;
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--forest);
}

.stats-row span {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ===== ABOUT ===== */
.about-wrap { max-width: 720px; margin: 0 auto; }
.about-wrap p { color: var(--ink-soft); margin-bottom: 1.1rem; font-size: 1.05rem; }
.about-wrap p:first-of-type::first-letter {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--forest);
    float: left;
    line-height: 0.8;
    margin: 0.1rem 0.5rem 0 0;
}

/* ===== SKILLS ===== */
.skills-groups { max-width: 780px; margin: 0 auto; }

.skills-group {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--paper-line);
}

.skills-group:last-child { border-bottom: 1px solid var(--paper-line); }

.skills-group h3 {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--forest);
}

.skill-list { color: var(--ink-soft); font-size: 0.98rem; line-height: 1.9; }

/* ===== CERTIFICATIONS ===== */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    max-width: 900px;
    margin: 0 auto;
    background: var(--paper-line);
    border: 1px solid var(--paper-line);
}

.cert-card {
    background: var(--paper-card);
    padding: 2rem 1rem;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
}

.cert-card:hover { background: var(--forest-soft); }
.cert-card img { width: 64px; height: 64px; object-fit: contain; margin: 0 auto 1rem; filter: grayscale(0.25); }
.cert-card span { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.cert-card span em { font-style: italic; font-weight: 500; color: var(--ink-soft); }

.cert-more {
    list-style: none;
    max-width: 700px;
    margin: 2.5rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--paper-line);
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 2;
    text-align: center;
}

.cert-more strong { color: var(--ink); font-weight: 600; }

/* ===== EXPERIENCE / CLIENTS ===== */
.clients-wrap { max-width: 900px; margin: 0 auto; text-align: center; }

.clients-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2.2rem 2.8rem;
    margin-top: 2rem;
}

.clients-logos img {
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    filter: grayscale(1);
    opacity: 0.55;
    transition: var(--transition);
}

.clients-logos img:hover {
    filter: grayscale(0);
    opacity: 1;
}

.clients-logos img.invert {
    filter: invert(1) grayscale(1);
}

.clients-logos img.invert:hover {
    filter: invert(1);
    opacity: 1;
}

.clients-more {
    font-family: var(--font-display);
    font-size: 0.95rem;
    line-height: 2;
    color: var(--ink-soft);
    margin-top: 2.2rem;
    opacity: 0.75;
}

.clients-more span::after { content: '  ·  '; color: var(--paper-line); }
.clients-more span:last-child::after { content: ''; }

/* ===== RECOMMENDATIONS ===== */
.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.rec-quote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1.55;
    margin-bottom: 1.3rem;
}

.rec-quote::before { content: '\201C'; }
.rec-quote::after { content: '\201D'; }

.rec-author { font-weight: 700; font-size: 0.9rem; }
.rec-role { font-size: 0.8rem; color: rgba(255, 255, 255, 0.6); margin-top: 0.15rem; }

/* ===== EDUCATION ===== */
.timeline { max-width: 680px; margin: 0 auto; }

.timeline-item {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--paper-line);
}

.timeline-item:last-child { border-bottom: 1px solid var(--paper-line); }
.timeline-date { font-family: var(--font-display); font-size: 1.05rem; color: var(--forest); }
.timeline-item h3 { font-size: 1.05rem; margin-bottom: 0.25rem; font-weight: 700; }
.timeline-item p { color: var(--ink-soft); font-size: 0.92rem; }

/* ===== CONTACT ===== */
#contact { text-align: center; }
.contact-email { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--forest); }
.contact-links { display: flex; gap: 1.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.75rem; }

/* ===== FOOTER ===== */
.site-footer { background: var(--paper); border-top: 1px solid var(--paper-line); color: var(--ink-soft); padding: 2.5rem 1.5rem 1.75rem; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 1.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.footer-links a { color: var(--ink); text-decoration: none; font-size: 0.88rem; }
.footer-links a:hover { color: var(--forest); }
.footer-bottom { font-size: 0.8rem; }
.footer-credit a { color: var(--ink-soft); text-decoration: none; transition: var(--transition); }
.footer-credit a:hover { color: var(--forest); }

/* ===== SCROLL REVEAL ===== */
[data-animate] { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
[data-animate].in-view { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero-photo-wrap { max-width: 220px; }
    .hero-ctas, .hero-social { justify-content: center; }
    .hero-copy h2 { border-top: none; padding-top: 0; }
}

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

    .nav-links {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--paper);
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
        gap: 1.1rem;
        display: none;
        border-bottom: 1px solid var(--paper-line);
    }

    .nav-links.open { display: flex; }
    .timeline-item, .skills-group { grid-template-columns: 1fr; gap: 0.4rem; }
    .stats-row .stat { border-left: none; border-top: 1px solid var(--paper-line); padding: 1.25rem 1rem 0; }
    .stats-row .stat:first-child { border-top: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
