/* ==========================================================================
   armandojimenez.dev — home stylesheet
   Direction: pure white, neutral black, color only from artwork.
   Type: Cabinet Grotesk (display) + Switzer (body), self-hosted.
   This file styles index.html only; sibling pages keep their own assets.
   ========================================================================== */

/* ---- fonts ---- */
@font-face {
    font-family: 'Cabinet Grotesk';
    src: url('../fonts/cabinet-grotesk-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Cabinet Grotesk';
    src: url('../fonts/cabinet-grotesk-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Cabinet Grotesk';
    src: url('../fonts/cabinet-grotesk-800.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Switzer';
    src: url('../fonts/switzer-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Switzer';
    src: url('../fonts/switzer-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Switzer';
    src: url('../fonts/switzer-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* ---- tokens ---- */
:root {
    --blanco: #ffffff;
    --negro: #0e0f11;
    --gris: #6e7276;
    --linea: #ececee;
    --display: 'Cabinet Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --body: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.35, 0.4, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    background: var(--blanco);
    color: var(--negro);
    font-family: var(--body);
    font-size: 16.5px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

ul,
ol {
    list-style: none;
}

a {
    color: var(--negro);
    text-decoration: underline;
    text-decoration-color: var(--linea);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s var(--ease-out);
}

a:hover {
    text-decoration-color: var(--negro);
}

:focus-visible {
    outline: 2px solid var(--negro);
    outline-offset: 3px;
    border-radius: 2px;
}

::selection {
    background: var(--negro);
    color: var(--blanco);
}

.wrap {
    max-width: 1020px;
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

/* ---- skip link ---- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--negro);
    color: var(--blanco);
    padding: 0.6em 1em;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0 0 6px 6px;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ---- header ---- */
.site-head {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s var(--ease-out);
}

.site-head.scrolled {
    border-bottom-color: var(--linea);
}

.head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
    padding-block: 0.9rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
}

.brand-mask {
    display: block;
    overflow: hidden;
}

.brand-name {
    display: block;
}

.brand-memoji {
    display: block;
    height: 30px;
    width: auto;
}

/* Scroll handoff: the hero name and memoji rise into the bar once their
   large versions have passed underneath it. Hidden states only exist with JS. */
.js .brand-name {
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.5s var(--ease-spring), opacity 0.25s var(--ease-out);
}

.js .site-head.show-name .brand-name {
    transform: translateY(0);
    opacity: 1;
}

.js .brand-memoji {
    transform: translateY(130%);
    transition: transform 0.55s var(--ease-spring);
}

.js .site-head.show-memoji .brand-memoji {
    transform: translateY(0);
}

.site-nav {
    display: flex;
    gap: clamp(0.9rem, 2.5vw, 1.6rem);
}

.site-nav a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gris);
    text-decoration: none;
    transition: color 0.2s var(--ease-out);
    white-space: nowrap;
}

.site-nav a:hover {
    color: var(--negro);
}

.site-nav .lang-link {
    color: var(--negro);
    border: 1px solid var(--linea);
    border-radius: 999px;
    padding: 0.2em 0.75em;
    transition: border-color 0.2s var(--ease-out);
}

.site-nav .lang-link:hover {
    border-color: var(--negro);
}

/* ---- hero ---- */
.hero {
    padding-top: clamp(4.5rem, 12vh, 8.5rem);
    padding-bottom: clamp(4rem, 10vh, 7rem);
}

.eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gris);
}

.hero h1 {
    font-family: var(--display);
    font-size: clamp(3.4rem, 12vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 0.94;
    margin-top: 1rem;
}

.hero .intro {
    margin-top: 1.8rem;
    font-size: 1.12rem;
    max-width: 34em;
    text-wrap: pretty;
}

.quiet {
    color: var(--gris);
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.6rem;
    margin-top: 1.7rem;
}

.hero-links a {
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--linea);
    padding-bottom: 2px;
    transition: border-color 0.2s var(--ease-out);
}

.hero-links a:hover {
    border-bottom-color: var(--negro);
}

/* hero load-in */
.anim {
    opacity: 0;
    transform: translateY(18px);
    animation: rise 0.7s var(--ease-out) both;
}

.hero .anim:nth-child(1) { animation-delay: 0.05s; }
.hero .anim:nth-child(2) { animation-delay: 0.13s; }
.hero .anim:nth-child(3) { animation-delay: 0.21s; }
.hero .anim:nth-child(4) { animation-delay: 0.29s; }

@keyframes rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- sections ---- */
section {
    margin-bottom: clamp(5rem, 12vh, 8rem);
}

.section-rule {
    border-top: 2px solid var(--negro);
    padding-top: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.section-rule h2 {
    font-family: var(--display);
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.rule-meta {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gris);
    white-space: nowrap;
}

/* ---- memoji peek ---- */
.peek {
    display: flex;
    justify-content: flex-end;
    padding-right: clamp(1rem, 7%, 5rem);
    overflow: hidden;
}

.peek-btn {
    border: 0;
    background: none;
    cursor: pointer;
    display: block;
    padding: 0;
    margin-bottom: -6px;
}

.peek-btn img {
    width: clamp(120px, 16vw, 175px);
    transition: transform 0.9s var(--ease-spring);
    will-change: transform;
}

.js .peek-btn img {
    transform: translateY(85%);
}

.js .peek.in .peek-btn img {
    transform: translateY(0);
}

.peek.duck .peek-btn img {
    transform: translateY(85%);
    transition: transform 0.3s ease-in;
}

/* ---- app grid ---- */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
    gap: clamp(2.2rem, 4vw, 3.2rem) clamp(1.4rem, 3vw, 2.2rem);
    margin-top: 2.6rem;
}

.app-icon {
    display: inline-block;
    border-radius: 22.5%;
    line-height: 0;
}

.app-icon img {
    width: 68px;
    height: 68px;
    border-radius: 22.5%;
    box-shadow:
        0 1px 2px rgba(14, 15, 17, 0.10),
        0 4px 14px rgba(14, 15, 17, 0.08),
        inset 0 0 0 1px rgba(14, 15, 17, 0.06);
    transition: transform 0.28s var(--ease-spring), box-shadow 0.28s var(--ease-out);
}

.app.featured .app-icon img {
    width: 84px;
    height: 84px;
}

.app-icon:hover img,
.app-icon:focus-visible img {
    transform: translateY(-4px) scale(1.03);
    box-shadow:
        0 2px 4px rgba(14, 15, 17, 0.10),
        0 12px 28px rgba(14, 15, 17, 0.14),
        inset 0 0 0 1px rgba(14, 15, 17, 0.06);
}

.app h3 {
    font-family: var(--display);
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 0.95rem;
}

.app-desc {
    font-size: 0.88rem;
    color: var(--gris);
    line-height: 1.55;
    margin-top: 0.3rem;
    max-width: 30em;
    text-wrap: pretty;
}

.app-stats {
    font-size: 0.76rem;
    font-weight: 600;
    margin-top: 0.55rem;
    letter-spacing: 0.01em;
}

.app-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.9rem;
    margin-top: 0.55rem;
}

.app-links a {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--gris);
    text-decoration: none;
    border-bottom: 1px solid var(--linea);
    padding-bottom: 1px;
    transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    white-space: nowrap;
}

.app-links a:hover {
    color: var(--negro);
    border-bottom-color: var(--negro);
}

/* ---- web cards ---- */
.web-card {
    display: flex;
    align-items: center;
    gap: clamp(1.2rem, 3vw, 2rem);
    margin-top: 2.2rem;
}

.web-thumb {
    flex-shrink: 0;
    display: block;
    border: 1px solid var(--linea);
    border-radius: 20px;
    padding: 0.7rem;
    background: var(--blanco);
    line-height: 0;
    transition: transform 0.28s var(--ease-spring), box-shadow 0.28s var(--ease-out);
}

.web-thumb img {
    width: 92px;
    height: 93px;
    object-fit: contain;
    display: block;
}

.web-thumb:hover,
.web-thumb:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(14, 15, 17, 0.12);
}

.web-body h3 {
    font-family: var(--display);
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.web-body .app-desc {
    max-width: 40em;
}

/* ---- prose sections ---- */
.prose {
    margin-top: 1.8rem;
    max-width: 44em;
}

.prose p + p {
    margin-top: 1em;
}

/* ---- jobs / education ---- */
.jobs {
    margin-top: 1.8rem;
}

.job {
    display: grid;
    grid-template-columns: 11rem 1fr;
    gap: 0.4rem 2rem;
    padding-block: 1.4rem;
    border-bottom: 1px solid var(--linea);
}

.job:last-child {
    border-bottom: 0;
}

.job-dates {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gris);
    padding-top: 0.25rem;
}

.job-body h3 {
    font-family: var(--display);
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.job-role {
    font-size: 0.9rem;
    color: var(--gris);
    margin-top: 0.15rem;
    max-width: 48em;
}

.job-body ul {
    margin-top: 0.8rem;
    max-width: 56ch;
}

.job-body li {
    font-size: 0.94rem;
    padding-left: 1.15rem;
    position: relative;
    margin-top: 0.5rem;
    color: var(--negro);
}

.job-body li::before {
    content: '·';
    position: absolute;
    left: 0.2rem;
    color: var(--gris);
}

/* ---- skills ---- */
.skills-list {
    margin-top: 1.4rem;
}

.skill-row {
    display: grid;
    grid-template-columns: 11rem 1fr;
    gap: 0.3rem 2rem;
    padding-block: 0.95rem;
    border-bottom: 1px solid var(--linea);
}

.skill-row:last-child {
    border-bottom: 0;
}

.skill-row dt {
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.98rem;
}

.skill-row dd {
    font-size: 0.94rem;
    color: var(--gris);
}

/* ---- contact ---- */
.contact-block {
    margin-top: 1.8rem;
}

.contact-block .prose {
    margin-top: 0;
}

.contact-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem clamp(2.5rem, 6vw, 5rem);
    align-items: start;
}

@media (max-width: 760px) {
    .contact-cols {
        grid-template-columns: 1fr;
    }
}

.contact-form .field {
    margin-bottom: 1.1rem;
}

.contact-form label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gris);
    margin-bottom: 0.4rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    font-family: var(--body);
    font-size: 0.95rem;
    color: var(--negro);
    background: var(--blanco);
    border: 1px solid var(--linea);
    border-radius: 10px;
    padding: 0.7em 0.85em;
    transition: border-color 0.2s var(--ease-out);
    resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--gris);
    opacity: 0.7;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--negro);
}

.send-btn {
    margin-top: 0.4rem;
    font-family: var(--body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--blanco);
    background: var(--negro);
    border: 1px solid var(--negro);
    border-radius: 999px;
    padding: 0.65em 1.7em;
    cursor: pointer;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.send-btn:hover {
    background: var(--blanco);
    color: var(--negro);
}

.contact-mail {
    margin-top: 1.6rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem 1.4rem;
}

.big-email {
    font-family: var(--display);
    font-size: clamp(1.25rem, 2.6vw, 1.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    border-bottom: 2px solid var(--linea);
    transition: border-color 0.25s var(--ease-out);
    overflow-wrap: anywhere;
}

.big-email:hover {
    border-bottom-color: var(--negro);
}

.copy-btn {
    font-family: var(--body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--negro);
    background: none;
    border: 1px solid var(--negro);
    border-radius: 999px;
    padding: 0.45em 1.15em;
    cursor: pointer;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.copy-btn:hover {
    background: var(--negro);
    color: var(--blanco);
}

.copy-btn.copied {
    background: var(--negro);
    color: var(--blanco);
}

.contact-social {
    margin-top: 1.6rem;
    display: flex;
    gap: 1.6rem;
}

.contact-social a {
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--linea);
    padding-bottom: 2px;
    transition: border-color 0.2s var(--ease-out);
}

.contact-social a:hover {
    border-bottom-color: var(--negro);
}

/* ---- footer ---- */
main > section:last-of-type {
    margin-bottom: clamp(7rem, 16vh, 11rem);
}

.site-foot {
    border-top: 1px solid var(--linea);
    padding-block: 2rem 2.6rem;
}

.foot-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 0.82rem;
    color: var(--gris);
}

/* ---- scroll reveal (hidden state only when JS is available) ---- */
.js .r {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.js .r.in {
    opacity: 1;
    transform: translateY(0);
}

/* ---- responsive ---- */
@media (max-width: 720px) {
    /* The brand gets its own row. Until the name arrives from the hero, that
       row collapses completely so the bar is just the links. */
    .head-row {
        padding-block: 0.8rem;
        gap: 0.2rem 1.2rem;
    }

    .brand {
        flex-basis: 100%;
    }

    .js .brand {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.45s var(--ease-out), opacity 0.3s var(--ease-out);
    }

    .js .site-head.show-name .brand {
        max-height: 2.4rem;
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .job,
    .skill-row {
        grid-template-columns: 1fr;
    }

    .job-dates {
        padding-top: 0;
    }

    .app-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .app.featured {
        grid-column: 1 / -1;
    }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .anim {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .js .r {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .js .peek-btn img,
    .peek-btn img {
        transform: none;
        transition: none;
    }

    .js .brand-name,
    .js .brand-memoji,
    .js .brand {
        transition: none;
    }

    .app-icon img,
    .app-icon:hover img {
        transition: none;
        transform: none;
    }
}
