/* ============================================================
   MaribelServer.ai — Editorial Noir Design System
   ============================================================ */

/* ============================================
   1. TOKENS
   ============================================ */
:root {
    /* Neutrals */
    --ink: #070707;
    --noir: #0d0d0d;
    --carbon: #141414;
    --ash: #1a1a1a;
    --smoke: #2a2a2a;
    --bone: #f5f1ea;
    --cream: #e8e2d5;
    --mute: #8a8580;
    --muted: rgba(245, 241, 234, 0.72);   /* ↑ body legible (antes 0.55) */
    --muted-soft: rgba(245, 241, 234, 0.55);
    --subtle: rgba(245, 241, 234, 0.45);  /* ↑ captions (antes 0.35) */
    --faint: rgba(245, 241, 234, 0.14);
    --hairline: rgba(245, 241, 234, 0.10);

    /* Accent */
    --rouge: #E72277;
    --rouge-deep: #c01862;
    --ember: #F39979;

    /* Type */
    --font-display: 'Fraunces', Georgia, serif;
    --font-sans: 'Instrument Sans', 'Helvetica Neue', system-ui, sans-serif;

    /* Motion */
    --ease-editorial: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-ghost: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Prevenir scroll horizontal global */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* ============================================
   2. BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    background-color: var(--ink);
    height: 100%;
    margin: 0;
}

body {
    font-family: var(--font-sans);
    color: var(--bone);
    font-weight: 400;
    position: relative;
    z-index: 20;
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'ss01', 'ss02', 'cv01', 'cv11';
}

::selection {
    background-color: var(--rouge);
    color: var(--bone);
}

/* Film grain overlay */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    opacity: 0.06;
    mix-blend-mode: overlay;
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */
.font-display { font-family: var(--font-display); }
.font-sans { font-family: var(--font-sans); }

.display-hero {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7.5rem);
    line-height: 0.95;
    letter-spacing: -0.045em;
    font-variation-settings: 'opsz' 144, 'SOFT' 50;
}

.display-xl {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    font-variation-settings: 'opsz' 100;
}

.display-lg {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-variation-settings: 'opsz' 60;
}

.display-italic {
    font-style: italic;
    font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

.eyebrow {
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--rouge);
}

.caption {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--subtle);
}

/* Jerarquía fuerte para encabezados de columnas (footer, etc.) */
.section-heading {
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--bone);
}

.serial {
    font-family: var(--font-display);
    font-feature-settings: 'tnum' on;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   LOGO (nav + footer)
   ============================================ */
.site-logo {
    position: relative;
    z-index: 120;              /* por encima del mobile menu (z-95) */
    display: inline-flex;
    align-items: baseline;
    text-decoration: none;
    pointer-events: auto;
}
.site-logo-word {
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1;
    color: var(--bone);
    letter-spacing: -0.025em;
    font-variation-settings: 'opsz' 144, 'SOFT' 30;
    white-space: nowrap;
}
.site-logo-tld {
    display: inline;
    margin-left: 1px;
    font-family: var(--font-display);
    font-size: 0.72em;
    color: rgba(245, 241, 234, 0.45);
    letter-spacing: -0.01em;
    font-variation-settings: 'opsz' 60;
}
.site-logo:hover .site-logo-tld { color: rgba(245, 241, 234, 0.75); }
.site-logo-lg .site-logo-word { font-size: 1.5rem; }

/* ============================================
   MOBILE MENU
   ============================================ */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 95;
    background-color: var(--ink);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-editorial);
}
.mobile-menu-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
/* Spacer igual a la altura del nav para no solaparse */
.mobile-menu-spacer {
    flex-shrink: 0;
    height: 67px;
    border-bottom: 1px solid rgba(245, 241, 234, 0.06);
}
.mobile-menu-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mobile-link-main {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 10vw, 3.25rem);
    line-height: 1.05;
    color: var(--bone);
    letter-spacing: -0.035em;
    padding: 1.15rem 0;
    border-bottom: 1px solid rgba(245, 241, 234, 0.06);
    font-variation-settings: 'opsz' 96, 'SOFT' 40;
    text-decoration: none;
    transition: color 0.25s ease, transform 0.35s var(--ease-editorial);
}
.mobile-link-main:last-child {
    border-bottom: none;
}
.mobile-link-main:active,
.mobile-link-main:hover {
    color: var(--rouge);
    transform: translateX(4px);
}

.mobile-menu-footer {
    flex-shrink: 0;
    padding: 1.5rem 2rem 2.5rem;
    border-top: 1px solid rgba(245, 241, 234, 0.06);
}
.mobile-menu-secondary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1.5rem;
    margin-bottom: 1.75rem;
}
.mobile-link-sec {
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(245, 241, 234, 0.55);
    padding: 0.25rem 0;
    text-decoration: none;
    transition: color 0.2s ease;
}
.mobile-link-sec:hover,
.mobile-link-sec:active {
    color: var(--bone);
}

/* ============================================
   BODY PROSE
   ============================================ */
.prose-editorial {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--muted);
    max-width: 38ch;
    font-weight: 400;
}

/* Prose del blog — HTML libre dentro del body de entrada */
.prose-blog h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 3vw, 2rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--bone);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-variation-settings: 'opsz' 96;
}
.prose-blog h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.25rem, 2.2vw, 1.4rem);
    line-height: 1.25;
    color: var(--bone);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-variation-settings: 'opsz' 72;
}
.prose-blog p {
    font-family: var(--font-sans);
    color: rgba(245, 241, 234, 0.82);
}
.prose-blog a {
    color: var(--bone);
    border-bottom: 1px solid rgba(231, 34, 119, 0.4);
    transition: border-color 0.25s, color 0.25s;
}
.prose-blog a:hover {
    color: var(--rouge);
    border-bottom-color: var(--rouge);
}
.prose-blog strong {
    color: var(--bone);
    font-weight: 600;
}
.prose-blog em {
    color: rgba(245, 241, 234, 0.88);
    font-style: italic;
}
.prose-blog ul,
.prose-blog ol {
    padding-left: 1.25rem;
    color: rgba(245, 241, 234, 0.82);
}
.prose-blog ul { list-style: none; }
.prose-blog ul li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}
.prose-blog ul li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--rouge);
}
.prose-blog ol { list-style: decimal; }
.prose-blog ol li { margin-bottom: 0.5rem; padding-left: 0.25rem; }
.prose-blog blockquote {
    border-left: 2px solid var(--rouge);
    padding-left: 1.25rem;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1.5;
    color: rgba(245, 241, 234, 0.9);
    margin: 2rem 0;
    font-variation-settings: 'opsz' 60, 'SOFT' 40;
}
.prose-blog figure {
    margin: 2rem 0;
}
.prose-blog figure img {
    width: 100%;
    height: auto;
    display: block;
}
.prose-blog figure figcaption {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--subtle);
    margin-top: 0.5rem;
    text-align: center;
    letter-spacing: 0.04em;
}
.prose-blog code {
    font-family: 'JetBrains Mono', 'Menlo', monospace;
    font-size: 0.9em;
    background: rgba(245, 241, 234, 0.06);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

/* ============================================
   4. BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.95rem 1.75rem;
    border-radius: 9999px;
    transition: all 0.35s var(--ease-editorial);
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--bone);
    color: var(--ink);
    border: 1px solid var(--bone);
}

.btn-primary:hover {
    background: transparent;
    color: var(--bone);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--rouge);
    color: var(--bone);
    border: 1px solid var(--rouge);
}

.btn-accent:hover {
    background: var(--rouge-deep);
    border-color: var(--rouge-deep);
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(231, 34, 119, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--bone);
    border: 1px solid var(--faint);
}

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

.btn-link {
    background: transparent;
    color: var(--muted);
    border: none;
    padding: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

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

.btn-lg {
    padding: 1.1rem 2.25rem;
    font-size: 0.875rem;
}

/* ============================================
   5. LAYOUT
   ============================================ */
.container-editorial {
    max-width: 1280px;
    margin: 0 auto;
    padding-left: clamp(1.25rem, 4vw, 2.5rem);
    padding-right: clamp(1.25rem, 4vw, 2.5rem);
}

.rule {
    height: 1px;
    background: var(--hairline);
    width: 100%;
}

.rule-vertical {
    width: 1px;
    background: var(--hairline);
    height: 100%;
}

/* ============================================
   6. CARDS & SURFACES
   ============================================ */
.surface {
    background: var(--noir);
    border: 1px solid var(--hairline);
}

.surface-raised {
    background: var(--carbon);
    border: 1px solid var(--hairline);
}

/* Style / portrait cards */
.portrait-card {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.6s var(--ease-editorial);
    background: var(--carbon);
}

/* Variante apaisada 16:9 para los heros del blog.
   Mayor especificidad (.portrait-card.is-landscape) para anular el 4/5 por defecto
   sin afectar a los thumbnails de estilos, que siguen siendo 4:5. */
.portrait-card.is-landscape {
    aspect-ratio: 16 / 9;
}

.portrait-card img {
    transition: transform 0.9s var(--ease-editorial), filter 0.5s var(--ease-editorial);
    filter: saturate(0.85) contrast(1.02);
}

.portrait-card:hover img {
    transform: scale(1.04);
    filter: saturate(1.05) contrast(1.05);
}

.portrait-card .portrait-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(7, 7, 7, 0.95) 0%, rgba(7, 7, 7, 0.3) 45%, transparent 70%);
    pointer-events: none;
}

.portrait-card .portrait-label {
    position: absolute;
    left: 1.25rem;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 2;
}

.portrait-card.is-signature {
    outline: 1px solid var(--rouge);
    outline-offset: -1px;
}

/* ============================================
   7. STYLE CARDS (en generador - horizontal)
   ============================================ */
.style-card {
    transition: all 0.3s var(--ease-editorial);
    border: 1px solid var(--hairline);
    cursor: pointer;
    background: var(--noir);
}

.style-card:hover {
    border-color: var(--muted);
    background: var(--carbon);
}

.style-card.selected {
    border-color: var(--rouge);
    background: var(--carbon);
}

.check-icon { display: none; }
.style-card.selected .check-icon { display: block; }

/* ============================================
   8. BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--font-sans);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 2px;
}

.badge-signature {
    background: var(--rouge);
    color: var(--bone);
}

.badge-outline {
    border: 1px solid var(--rouge);
    color: var(--rouge);
}

.badge-muted {
    border: 1px solid var(--hairline);
    color: var(--muted);
}

/* ============================================
   9. DIVIDERS & SECTION MARKERS
   ============================================ */
.section-marker {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
}

.section-marker::before {
    content: "";
    height: 1px;
    width: 2rem;
    background: var(--rouge);
}

.numeral {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--rouge);
    letter-spacing: 0.1em;
}

/* ============================================
   10. ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s var(--ease-editorial), transform 0.9s var(--ease-editorial);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Fallback móvil: si por cualquier razón el IntersectionObserver no dispara
   (layout muy alto, threshold insuficiente, scroll raro), los .reveal
   se muestran garantizadamente. El contenido no debe depender de JS. */
@media (max-width: 767px) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

.fade-text {
    animation: fadeInOut 0.5s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0.5; transform: translateY(2px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Marquee for style showcase */
@keyframes drift {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.drift {
    animation: drift 60s linear infinite;
}

/* ============================================
   11. SCROLLBAR
   ============================================ */
.custom-scrollbar::-webkit-scrollbar { width: 3px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--faint);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--subtle); }

/* ============================================
   12. MOBILE MENU
   ============================================ */
#mobile-menu {
    background-color: var(--ink);           /* fondo sólido 100% */
    background-image:
        radial-gradient(ellipse at top right, rgba(231, 34, 119, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse at bottom left, rgba(243, 153, 121, 0.04) 0%, transparent 55%);
}

.mobile-link {
    background-color: transparent;
}

.mobile-login {
    background-color: transparent;
    padding-top: 20px;
    padding-bottom: 20px;
}

/* ============================================
   13. FORMS
   ============================================ */
.field-label {
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.875rem;
    display: block;
}

.input-upload {
    transition: all 0.3s var(--ease-editorial);
    background: transparent;
    border: 1px dashed var(--faint);
}

.input-upload:hover {
    border-color: var(--muted);
    background: var(--noir);
}

/* ============================================
   14. FOCUS STATES (Accessibility)
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--rouge);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ============================================
   15. PROSE (legal pages)
   ============================================ */
.prose-legal {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.75;
    color: var(--muted);
}

.prose-legal h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--bone);
    font-weight: 400;
    letter-spacing: -0.035em;
    margin-bottom: 2rem;
    line-height: 1.05;
}

.prose-legal h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--bone);
    font-weight: 500;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.015em;
}

.prose-legal p {
    margin-bottom: 1rem;
}

.prose-legal strong {
    color: var(--bone);
    font-weight: 500;
}

.prose-legal a {
    color: var(--rouge);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

/* ============================================
   16. REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
    .drift { animation: none; }
}
