:root{
    --bg: #181c30;
    --text: #f4f3fb;
    --dbg: #262c4a;
    --dbg2: #2f3658;
    --col1: #ff5d8f;
    --col1-soft: #ff8aab;
    --muted: #8d92b8;
    --shadow: 0 8px 24px #00000040;
    --radius: 10px;
    --mono: monospace;
    --sans: sans-serif;

}



*{
    box-sizing: border-box;
    font-family: var(--sans);
    caret-color: var(--col1);
transition: 0.2s;}

html { scroll-behavior: smooth; }

body{
    background-color: var(--bg);
    color: var(--text);
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    gap: 2.4rem;
    padding: 2rem 0 4rem;
}

::selection{ background-color: var(--col1); color: var(--bg); }
body::-webkit-scrollbar{ display: none; }

textarea::-webkit-scrollbar{ background-color: transparent; width: 8px; }
textarea::-webkit-scrollbar-thumb{
    background-color: var(--col1);
    border-radius: var(--radius);
}

body > section, body > header, body > footer{
    width: 85%;
    max-width: 980px;
}

/* ───────────── HEADER ───────────── */
header{
    height: 3.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

header .logo{
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.logo-mark{
    color: var(--col1);
    font-size: 1.7rem;
}

header button.mode{
    background-color: var(--col1);
    color: var(--bg);
    height: 2.6rem;
    aspect-ratio: 1;
    border: none;
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
}
header button.mode:hover{ transform: rotate(20deg); }
header button.mode svg{ width: 20px; height: 20px; }

/* ───────────── TITLE / KINETIC HEADLINE ───────────── */
.title{
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    align-items: center;
    text-align: center;
    padding-top: 1rem;
}

.kinetic-headline{
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem 1rem;
}

.kw{
    font-size: clamp(2rem, 6vw, 4.2rem);
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--text);
    position: relative;
    display: inline-block;
}

.kw:nth-child(2){ color: var(--col1); }

.kw::after{
    content: '';
    position: absolute;
    left: 0; bottom: -0.18em;
    width: 100%; height: 4px;
    background: var(--col1);
    transform: scaleX(0);
    transform-origin: left;
    animation: underlineGrow 0.7s 0.4s cubic-bezier(0.65,0,0.35,1) forwards;
}
.kw:nth-child(1)::after{ background: transparent; }
.kw:nth-child(3)::after{ animation-delay: 0.6s; }

@keyframes underlineGrow{ to{ transform: scaleX(1); } }

.title h3{
    font-family: var(--sans);
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--muted);
    width: 100%;
    text-align: center;
}

/* ───────────── FIELD ───────────── */
.field{
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    color: var(--text);
}

.field-head{
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--mono);
}

.field-label{
    font-size: 0.78rem;
    color: var(--col1);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.field-hint{
    font-size: 0.7rem;
    color: var(--muted);
}

.field textarea{
    height: 28vh;
    background-color: var(--dbg);
    width: 100%;
    color: var(--text);
    position: relative;
    resize: none;
    padding: 1.1rem;
    font-size: 0.92rem;
    font-family: var(--mono);
    font-weight: 500;
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    line-height: 1.6;
}
.field textarea:focus{
    border-color: var(--col1);
    outline: none;
    box-shadow: 0 0 0 4px #ff5d8f1f;
}

::placeholder{ color: var(--muted); opacity: 0.85; }

.field .number{
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
}

button{
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
}

.number button, .number input{
    appearance: none;
    border-radius: 8px;
    text-align: center;
    color: var(--text);
    height: 100%;
    box-shadow: var(--shadow);
}

.number button{ height: 2.9rem; aspect-ratio: 1; }

.number input{
    background-color: var(--dbg);
    width: 7rem;
    padding: 0.7rem 0;
    font-family: var(--mono);
    border: 1.5px solid transparent;
}
.number input:focus{ border-color: var(--col1); outline: none; }

.start, .trim{ background-color: var(--col1); color: var(--bg); }
.start:hover, .trim:hover{ background-color: var(--col1-soft); }
.start svg, .trim svg{ stroke: var(--bg); }

.number .clear{ background-color: var(--dbg); }
.number .clear:hover{ background-color: var(--dbg2); }

input::-webkit-inner-spin-button{ appearance: none; }

.face{
    position: relative;
    background-color: var(--dbg);
    display: flex;
    height: 2.9rem;
    width: fit-content;
    border-radius: 8px;
    aspect-ratio: 1;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
    border: 1.5px solid transparent;
}

svg{ color: var(--text); }

.number .face p{
    opacity: 1;
    font-size: 1.3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.number .active{ border-color: var(--col1); }
.number .active svg{ color: var(--col1); }

.number > div{ display: flex; gap: 0.7rem; }

/* ───────────── STATS ───────────── */
.stats{
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
}

.stats .data{
    width: calc(100% / 3);
    background-color: var(--dbg);
    border: 1.5px solid #ffffff10;
    font-size: 1.2rem;
    padding: 1.4rem 1.4rem;
    border-radius: var(--radius);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.stats .data:hover{ border-color: #ff5d8f50; }

.data-tag{
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.1em;
}

.stats .data > div:nth-child(2){
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stats .data > div p:first-child{
    font-family: var(--mono);
}

.stats .data > div p:last-child{
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.stats .num{
    font-size: 2.6rem;
    color: var(--col1);
    font-weight: 700;
}

.data-Emu{
    position: absolute;
    bottom: 0.1rem ;
    right: 0.6rem;
    font-size: 4.5rem;
    color: var(--text);
    opacity: 0.05;
    line-height: 1;
    pointer-events: none;
}
.data-Emu svg{
    width: 4rem;
    height: 4rem;
}

/* ───────────── DENSITY ───────────── */
.density{
    display: flex;
    flex-direction: column;
    justify-content: start;
    gap: 1.1rem;
}

.density header{
    height: fit-content;
    width: fit-content;
    padding: 0.45rem 0.9rem;
    color: var(--col1);
    background-color: var(--dbg);
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

.density .letter_dens{
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    width: 100%;
    min-height: 10rem;
    justify-content: center;
    align-items: center;
    background-color: var(--dbg);
    border-radius: var(--radius);
    padding: 1.6rem;
}

.empty-state{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.empty-Emu{
    font-size: 3.2rem;
    color: var(--muted);
    opacity: 0.4;
}

.empty-state p{
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}

.letter_dens .letter{
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: barIn 0.4s ease-out backwards;
}

@keyframes barIn{
    from{ opacity: 0; transform: translateX(-8px); }
    to{ opacity: 1; transform: translateX(0); }
}

.letter .let{
    font-family: var(--mono);
    font-weight: 700;
    width: 1.4rem;
    flex-shrink: 0;
    color: var(--text);
    font-size: 0.9rem;
}

.letter .bar{
    background-color: var(--bg);
    display: flex;
    justify-content: start;
    border-radius: 50px;
    height: 18px;
    flex: 1;
    overflow: hidden;
}

.letter .bar span{
    background: linear-gradient(90deg, var(--col1), var(--col1-soft));
    height: 100%;
    border-radius: 50px;
    transition: width 0.6s cubic-bezier(0.16,1,0.3,1);
}

.perc{
    width: 5.5rem;
    text-wrap: nowrap;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--mono);
    color: var(--muted);
    flex-shrink: 0;
    text-align: right;
}

/* ───────────── FOOTER ───────────── */
.page-footer{
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #ffffff10;
}
.page-footer p{
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

/* ───────────── RESPONSIVE ───────────── */
@media (max-width:1016px){
    .kw{ font-size: clamp(1.8rem, 7vw, 3rem); }
}

@media (max-width:736px){
    html{ font-size: 15px; }
    body > section, body > header, body > footer{ width: 90%; }
    header{ height: 2.8rem; }
    .stats{ flex-direction: column; }
    .stats .data{ width: 100%; flex-direction: row; align-items: center; padding: 1.1rem 1.2rem; }
    .stats .data > div:nth-child(2){ flex: 1; }
    .data-tag{ writing-mode: vertical-rl; }
    .data-Emu{ font-size: 3rem; bottom: -0.2rem; right: 0.4rem; }
}

@media (max-width:524px){
    .kinetic-headline{ gap: 0.4rem 0.6rem; }
}

@media (max-width:437px){
    .number input{ width: 5rem; padding: 0.55rem 0; }
    .kw{ font-size: clamp(1.4rem, 8vw, 2.2rem); }
}

@media (prefers-reduced-motion: reduce){
    *{ animation: none !important; transition: none !important; }
}