/* ============================================================================
   Vaucai — «Cuéntame a qué te dedicas» (/funcionalidades/, 2026-10-09).
   The box sits between the subtitle and the search. When the visitor sends
   what they do (written or as a voice note) the page turns into their answer:
   the catalog leaves and what their Vaucai can do for them arrives line by
   line, closing on «Crear mi Vaucai». The button is the home's
   (hero-cta.css); this file only sizes it here. Behaviour: oficio.js.
   ============================================================================ */

@property --oficio-giro {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ----- The box ----- */
.oficio {
    max-width: 720px;
    margin: 0 auto clamp(44px, 7vh, 72px);
    position: relative;
}
.oficio-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.oficio-caja {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    min-height: 68px;
    padding: 10px 10px 10px 24px;
    box-sizing: border-box;
    border-radius: 34px;
    background: linear-gradient(180deg, #15181F 0%, #0F1115 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 1px 0 rgba(0, 0, 0, 0.6),
        0 30px 80px -34px color-mix(in srgb, var(--vaucai-blue) 55%, transparent);
    isolation: isolate;
}
/* Its edge: a hairline that a slow light keeps going round. Brighter while
   the visitor writes. */
.oficio-caja::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background:
        conic-gradient(from var(--oficio-giro),
            transparent 0deg,
            color-mix(in srgb, var(--vaucai-blue) 70%, transparent) 60deg,
            rgba(255, 255, 255, 0.85) 95deg,
            color-mix(in srgb, var(--vaucai-blue) 70%, transparent) 130deg,
            transparent 200deg,
            transparent 360deg),
        linear-gradient(var(--border-light), var(--border-light));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: 0.7;
    animation: oficio-giro 7s linear infinite;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}
@keyframes oficio-giro { to { --oficio-giro: 360deg; } }
/* The light under it. */
.oficio-caja::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    top: 40%;
    bottom: -30%;
    border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--vaucai-blue) 24%, transparent), transparent);
    filter: blur(28px);
    opacity: 0.55;
    z-index: -1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.oficio-caja:focus-within::before { opacity: 1; animation-duration: 4.5s; }
.oficio-caja:focus-within::after { opacity: 0.9; }

.oficio-texto {
    flex: 1 1 auto;
    min-width: 0;
    align-self: center;
    margin: 0;
    padding: 12px 0;
    border: 0;
    outline: none;
    resize: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 18px;
    line-height: 1.45;
    letter-spacing: -0.01em;
    max-height: 160px;
    overflow-y: auto;
    scrollbar-width: none;
}
.oficio-texto::-webkit-scrollbar { display: none; }
.oficio-texto::placeholder { color: var(--text-soft); opacity: 0.75; }

/* ----- The two buttons ----- */
.oficio-botones {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
}
.oficio-btn {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.3s var(--ease-spring), background 0.25s ease, box-shadow 0.3s ease, opacity 0.25s ease, color 0.25s ease;
}
.oficio-btn svg { width: 22px; height: 22px; display: block; }
.oficio-btn:active { transform: scale(0.92); transition-duration: 0.08s; }
.oficio-btn:focus-visible { outline: 2px solid var(--vaucai-blue); outline-offset: 3px; }

.oficio-micro {
    background: rgba(255, 255, 255, 0.06);
    color: var(--fg-soft);
    box-shadow: inset 0 0 0 1px var(--border-light);
}
@media (hover: hover) {
    .oficio-micro:hover { background: rgba(255, 255, 255, 0.11); color: #fff; }
}

.oficio-enviar {
    color: #fff;
    background: linear-gradient(180deg, color-mix(in srgb, var(--vaucai-blue) 72%, #fff) 0%, var(--vaucai-blue) 55%, color-mix(in srgb, var(--vaucai-blue) 82%, #000) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 10px 28px color-mix(in srgb, var(--vaucai-blue) 50%, transparent);
}
@media (hover: hover) {
    .oficio-enviar:not(:disabled):hover {
        transform: translateY(-2px);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.55),
            0 14px 36px color-mix(in srgb, var(--vaucai-blue) 65%, transparent);
    }
}
.oficio-enviar:disabled {
    cursor: default;
    color: var(--text-faint);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px var(--border-light);
}

/* ----- Recording a voice note ----- */
.oficio-onda {
    display: none;
    flex: 1 1 auto;
    min-width: 0;
    align-self: center;
    align-items: center;
    gap: 14px;
    height: 48px;
}
.oficio-onda canvas {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    display: block;
}
.oficio-tiempo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    color: var(--fg-soft);
}
.oficio-tiempo::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff453a;
    box-shadow: 0 0 12px rgba(255, 69, 58, 0.8);
    animation: oficio-latido 1.1s ease-in-out infinite;
}
@keyframes oficio-latido {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}
.oficio-caja.is-grabando .oficio-texto { display: none; }
.oficio-caja.is-grabando .oficio-onda { display: flex; }
.oficio-caja.is-grabando .oficio-micro {
    background: rgba(255, 69, 58, 0.14);
    color: #ff6961;
    box-shadow: inset 0 0 0 1px rgba(255, 69, 58, 0.35);
}

.oficio-aviso {
    margin: 14px 0 0;
    min-height: 1.4em;
    text-align: center;
    font-size: 14.5px;
    color: var(--text-soft);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.oficio-aviso.is-visible { opacity: 1; }

/* On the phone the sentence gets the whole width and the two buttons go
   under it, on the right: «Cuéntame a qué te dedicas» never breaks. */
@media (max-width: 600px) {
    .oficio-caja {
        flex-wrap: wrap;
        gap: 4px 8px;
        padding: 14px 10px 10px 20px;
        border-radius: 28px;
    }
    /* 16px keeps iOS from zooming into the field. */
    .oficio-texto { flex-basis: 100%; padding: 6px 6px 2px 0; font-size: 17px; }
    .oficio-onda { flex: 1 1 auto; }
    .oficio-botones { margin-left: auto; }
    .oficio-btn { width: 44px; height: 44px; }
    .oficio-btn svg { width: 20px; height: 20px; }
}

/* ----- The page turns into the answer ----- */
.integraciones-page > .oficio-resultado { display: none; }
.integraciones-page.is-oficio > :not(.oficio-resultado) { display: none; }
.integraciones-page.is-oficio > .oficio-resultado { display: block; }

.oficio-resultado {
    max-width: 780px;
    margin: 0 auto;
    padding-top: clamp(8px, 3vh, 32px);
}
.or-titulo {
    margin: 0 0 clamp(32px, 6vh, 56px);
    font-family: 'Inter', 'Inter Fallback', 'Inter Fallback Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(2.3rem, 6vw, 4.4rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
    color: var(--text);
    text-wrap: balance;
}
.or-titulo em {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', 'Instrument Serif Fallback Noto', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.06em;
    letter-spacing: -0.01em;
    color: var(--vaucai-blue);
}

.or-lineas {
    list-style: none;
    margin: 0;
    padding: 0;
}
.or-lineas li {
    position: relative;
    padding: 18px 0 18px 30px;
    border-top: 1px solid var(--border-soft);
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.45;
    letter-spacing: -0.012em;
    color: var(--fg-soft);
}
.or-lineas li:last-child { border-bottom: 1px solid var(--border-soft); }
.or-lineas li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: calc(18px + 0.725em - 4px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vaucai-blue);
    box-shadow: 0 0 14px color-mix(in srgb, var(--vaucai-blue) 85%, transparent);
}
.or-lineas li b { color: #fff; font-weight: 650; }

/* What arrives, arrives: from below, out of focus, into place. */
.or-llega {
    animation: or-llega 0.75s var(--ease-cinematic) both;
}
@keyframes or-llega {
    from { opacity: 0; transform: translateY(14px); filter: blur(8px); }
    to   { opacity: 1; transform: none; filter: none; }
}

/* While the first line is on its way. */
.or-espera li {
    border-top: 1px solid var(--border-soft);
    padding: 22px 0 22px 30px;
}
.or-espera li span {
    display: block;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.04) 100%);
    background-size: 200% 100%;
    animation: or-brillo 1.6s ease-in-out infinite;
}
.or-espera { list-style: none; margin: 0; padding: 0; }
.or-espera li:nth-child(1) span { width: 62%; }
.or-espera li:nth-child(2) span { width: 78%; animation-delay: 0.12s; }
.or-espera li:nth-child(3) span { width: 54%; animation-delay: 0.24s; }
@keyframes or-brillo {
    from { background-position: 100% 0; }
    to   { background-position: -100% 0; }
}
.or-titulo.is-esperando {
    width: min(70%, 520px);
    height: 0.9em;
    border-radius: 18px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 100%);
    background-size: 200% 100%;
    animation: or-brillo 1.6s ease-in-out infinite;
}

/* ----- «Y puedo aprender lo que me enseñes.» ----- */
.or-skill {
    position: relative;
    margin: clamp(40px, 7vh, 64px) 0 0;
    padding: clamp(26px, 4vw, 38px);
    border-radius: 28px;
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--vaucai-blue) 16%, transparent) 0%, transparent 55%),
        linear-gradient(180deg, #13161C 0%, #0E1014 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 30px 80px -40px color-mix(in srgb, var(--vaucai-blue) 50%, transparent);
    isolation: isolate;
}
.or-skill::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(140deg, color-mix(in srgb, var(--vaucai-blue) 70%, transparent) 0%, var(--border-light) 35%, var(--border-soft) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
}
.or-skill-titulo {
    margin: 0 0 14px;
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: #fff;
}
.or-skill-titulo em {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', 'Instrument Serif Fallback Noto', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.08em;
    color: var(--vaucai-blue);
}
.or-skill-texto {
    margin: 0;
    font-size: clamp(17px, 1.9vw, 20px);
    line-height: 1.55;
    color: var(--fg-soft);
}

/* ----- The close ----- */
.or-cierre {
    margin: clamp(56px, 10vh, 96px) 0 0;
    text-align: center;
}
.or-canales {
    margin: 0 auto;
    max-width: 600px;
    font-size: clamp(17px, 1.9vw, 20px);
    line-height: 1.55;
    color: var(--text-soft);
    text-wrap: balance;
}
.or-canales img {
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.2em;
    margin-right: 0.28em;
}
.or-canales strong { color: var(--fg-soft); font-weight: 600; }
.or-gratis {
    margin: 18px 0 clamp(36px, 6vh, 52px);
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 750;
    letter-spacing: -0.025em;
    color: #fff;
}
.or-cierre .cr-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 72px;
    padding: 0;
    border-radius: 999px;
    background: none;
    color: #fff;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    isolation: isolate;
}
@media (max-width: 768px) {
    .or-cierre .cr-cta { width: 320px; height: 62px; }
}

.or-salidas {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin: clamp(40px, 7vh, 60px) 0 0;
}
.or-salida {
    appearance: none;
    -webkit-appearance: none;
    padding: 6px 2px;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-soft);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 5px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
@media (hover: hover) {
    .or-salida:hover { color: #fff; text-decoration-color: currentColor; }
}
.or-salida:focus-visible { outline: 2px solid var(--vaucai-blue); outline-offset: 3px; border-radius: 4px; }

/* The close arrives as one piece, after the last line. */
.or-final { opacity: 0; }
.or-final.or-llega { opacity: 1; }
