/* Definición de fuente Gelion local */
@font-face {
    font-family: 'Gelion';
    src: url('typography/gelion/gelion-thin.woff') format('woff');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gelion';
    src: url('typography/gelion/gelion-light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gelion';
    src: url('typography/gelion/gelion-regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gelion';
    src: url('typography/gelion/gelion-medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gelion';
    src: url('typography/gelion/gelion-semibold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gelion';
    src: url('typography/gelion/gelion-bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --text-color: #3e2723;
    --bg-color: #faf8f3;
    --separator-color: rgba(62, 39, 35, 0.08);
    --text-size: 18pt;
    --line-height: 40pt;
    --separator-height: 1px;
}

/* Dark mode automático según sistema */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #faf8f3;
        --bg-color: #000000;
        --separator-color: rgba(250, 248, 243, 0.08);
    }
}

body {
    font-family: 'Gelion', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 
                 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 
                 sans-serif !important;
    font-weight: 300;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.letter-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20vh 0 5vh 0;
}

.letter-content {
    width: 100%;
    position: relative;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent calc(var(--line-height) - var(--separator-height)),
        var(--separator-color) calc(var(--line-height) - var(--separator-height)),
        var(--separator-color) var(--line-height)
    );
    background-size: 100% var(--line-height);
    background-position: 0 0;
    background-repeat: repeat;
    min-height: 40vh;
    overflow: visible;
}

.line-wrapper {
    position: relative;
    min-height: var(--line-height);
    overflow: visible;
}

.text-line {
    font-family: 'Gelion', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 
                 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 
                 sans-serif !important;
    font-size: var(--text-size);
    line-height: var(--line-height);
    min-height: var(--line-height);
    display: block;
    position: relative;
    padding: 0 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Cursor parpadeante */
.text-line.typing::after {
    content: '|';
    animation: blink 1.2s ease-in-out infinite;
    margin-left: 2px;
    opacity: 0.8;
    font-weight: 300;
}

@keyframes blink {
    0%, 40% { opacity: 0.8; }
    50%, 90% { opacity: 0.3; }
    100% { opacity: 0.8; }
}

/* Efecto fade suave en el texto */
.text-line {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    animation: fadeInText 0.4s ease-out forwards;
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Separadores ahora son parte del fondo, este CSS mantiene compatibilidad */
.separator {
    display: none;
}

/* Estilos para iconos */
.icon-wrapper {
    display: inline;
    margin-left: 4px;
    margin-right: 2px;
    vertical-align: middle;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.icon-wrapper svg {
    display: inline-block;
    vertical-align: middle;
}

.expand-text {
    display: inline;
    line-height: 1;
    vertical-align: baseline;
    font-size: inherit;
    opacity: 0;
    animation: fadeInExpand 0.5s ease-out forwards;
}

@keyframes fadeInExpand {
    from {
        opacity: 0;
        transform: translateX(-3px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.icon-wrapper:hover {
    transform: scale(1.02);
    opacity: 0.7;
    transition: all 0.2s ease-in-out;
}

@media (max-width: 768px) {
    .letter-container {
        padding: 20vh 32pt 5vh 32pt;
    }
    
    .text-line {
        padding: 0 5px;
    }
}

.icon-wrapper {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-color);
    display: inline;
    margin-left: 2px;
    margin-right: 0px;
    vertical-align: baseline;
    line-height: 1;
}

/* Efecto de texto tachado */
.strikethrough {
    text-decoration: line-through;
    opacity: 0.6;
}

/* Texto que se está borrando */
.deleting {
    opacity: 0.4;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --text-size: 16pt;
        --line-height: 38pt;
    }
    
    .letter-container {
        max-width: 100%;
    }
    
    .text-line {
        padding: 0 5px;
    }
}

@media (max-width: 480px) {
    :root {
        --text-size: 14pt;
        --line-height: 36pt;
    }
    
    body {
        padding: 15px;
    }
}

/* Prevenir flash inicial */
.text-line:empty::before {
    content: '\00a0';
}

/* Suavizar la aparición */
.letter-content {
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

