/* ==========================================================================
   Word Counter — Main Stylesheet
   ========================================================================== */

/* Tailwind-inspired utility classes (lightweight, no build step) */

*,::before,::after{box-sizing:border-box;margin:0;padding:0}
html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Sans',sans-serif}
body{line-height:inherit}
a{text-decoration:none;color:inherit}
img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}
img,video{max-width:100%;height:auto}

/* Layout */
.min-h-screen{min-height:100vh}
.min-h-\[60vh\]{min-height:60vh}
.max-w-3xl{max-width:48rem}
.max-w-4xl{max-width:56rem}
.max-w-5xl{max-width:64rem}
.max-w-6xl{max-width:72rem}
.max-w-7xl{max-width:80rem}
.max-w-md{max-width:28rem}
.mx-auto{margin-left:auto;margin-right:auto}

/* Spacing */
.px-4{padding-left:1rem;padding-right:1rem}
.py-12{padding-top:3rem;padding-bottom:3rem}
.py-16{padding-top:4rem;padding-bottom:4rem}
.py-20{padding-top:5rem;padding-bottom:5rem}
.-mt-4{margin-top:-1rem}
.-mt-8{margin-top:-2rem}
.mt-5{margin-top:1.25rem}
.mt-6{margin-top:1.5rem}
.mt-8{margin-top:2rem}
.mt-10{margin-top:2.5rem}
.mt-12{margin-top:3rem}
.mb-2{margin-bottom:0.5rem}
.mb-3{margin-bottom:0.75rem}
.mb-4{margin-bottom:1rem}
.mb-6{margin-bottom:1.5rem}
.mb-8{margin-bottom:2rem}
.mb-10{margin-bottom:2.5rem}
.mb-12{margin-bottom:3rem}
.gap-1{gap:0.25rem}
.gap-2{gap:0.5rem}
.gap-3{gap:0.75rem}
.gap-4{gap:1rem}
.gap-6{gap:1.5rem}
.gap-8{gap:2rem}
.gap-10{gap:2.5rem}
.space-y-2 > * + *{margin-top:0.5rem}
.space-y-5 > * + *{margin-top:1.25rem}
.space-y-6 > * + *{margin-top:1.5rem}

/* Grid */
.grid{display:grid}
.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}
.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(min-width:1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* Flex */
.flex{display:flex}
.inline-flex{display:inline-flex}
.flex-wrap{flex-wrap:wrap}
.items-center{align-items:center}
.justify-between{justify-content:space-between}
.justify-center{justify-content:center}
.flex-shrink-0{flex-shrink:0}

/* Typography */
.text-center{text-align:center}
.text-2xl{font-size:1.5rem;line-height:2rem}
.text-3xl{font-size:1.875rem;line-height:2.25rem}
.text-4xl{font-size:2.25rem;line-height:2.5rem}
.text-5xl{font-size:3rem;line-height:1}
.text-lg{font-size:1.125rem;line-height:1.75rem}
.text-xl{font-size:1.25rem;line-height:1.75rem}
.text-sm{font-size:0.875rem;line-height:1.25rem}
.text-xs{font-size:0.75rem;line-height:1rem}
.text-base{font-size:1rem;line-height:1.5rem}
.font-bold{font-weight:700}
.font-extrabold{font-weight:800}
.font-semibold{font-weight:600}
.font-medium{font-weight:500}
.leading-relaxed{line-height:1.625}
.leading-tight{line-height:1.25}
.tracking-tight{letter-spacing:-0.025em}

/* Colors */
.text-white{color:#fff}
.text-white\/90{color:rgba(255,255,255,0.9)}
.text-slate-300{color:#cbd5e1}
.text-slate-400{color:#94a3b8}
.text-slate-500{color:#64748b}
.text-slate-600{color:#475569}
.text-slate-700{color:#334155}
.text-slate-800{color:#1e293b}
.text-slate-900{color:#0f172a}
.text-indigo-400{color:#818cf8}
.text-indigo-600{color:#4f46e5}
.text-green-600{color:#16a34a}
.text-amber-600{color:#d97706}
.text-purple-600{color:#9333ea}
.bg-white{background-color:#fff}
.bg-white\/80{background-color:rgba(255,255,255,0.8)}
.bg-slate-50{background-color:#f8fafc}
.bg-slate-900{background-color:#0f172a}
.bg-indigo-50{background-color:#eef2ff}
.bg-indigo-50\/50{background-color:rgba(238,242,255,0.5)}
.bg-indigo-600{background-color:#4f46e5}
.bg-green-50{background-color:#f0fdf4}
.bg-amber-50{background-color:#fffbeb}
.bg-purple-50{background-color:#faf5ff}

/* Background Gradients */
.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}
.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}
.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}
.from-slate-50{--tw-gradient-from:#f8fafc;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to,transparent)}
.from-indigo-600{--tw-gradient-from:#4f46e5}
.via-purple-600{--tw-gradient-stops:var(--tw-gradient-from),#9333ea,var(--tw-gradient-to,transparent)}
.to-white{--tw-gradient-to:#fff}
.to-pink-500{--tw-gradient-to:#ec4899}

/* Borders & Shadows */
.border{border-width:1px}
.border-2{border-width:2px}
.border-b{border-bottom-width:1px}
.border-t{border-top-width:1px}
.border-slate-200{border-color:#e2e8f0}
.border-slate-200\/60{border-color:rgba(226,232,240,0.6)}
.border-slate-200\/80{border-color:rgba(226,232,240,0.8)}
.border-slate-100{border-color:#f1f5f9}
.border-slate-300{border-color:#cbd5e1}
.border-slate-700\/50{border-color:rgba(51,65,85,0.5)}
.rounded-2xl{border-radius:1rem}
.rounded-3xl{border-radius:1.5rem}
.rounded-xl{border-radius:0.75rem}
.rounded-lg{border-radius:0.5rem}
.shadow-sm{box-shadow:0 1px 2px rgba(0,0,0,0.05)}
.shadow-md{box-shadow:0 4px 6px -1px rgba(0,0,0,0.1),0 2px 4px -2px rgba(0,0,0,0.1)}
.shadow-lg{box-shadow:0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -4px rgba(0,0,0,0.1)}
.shadow-xl{box-shadow:0 20px 25px -5px rgba(0,0,0,0.1),0 8px 10px -6px rgba(0,0,0,0.1)}

/* Hover States */
.hover\:bg-indigo-50:hover{background-color:#eef2ff}
.hover\:bg-indigo-700:hover{background-color:#4338ca}
.hover\:bg-slate-100:hover{background-color:#f1f5f9}
.hover\:text-indigo-700:hover{color:#4338ca}
.hover\:text-white:hover{color:#fff}
.hover\:underline:hover{text-decoration:underline}
.hover\:shadow-lg:hover{box-shadow:0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -4px rgba(0,0,0,0.1)}
.hover\:shadow-xl:hover{box-shadow:0 20px 25px -5px rgba(0,0,0,0.1),0 8px 10px -6px rgba(0,0,0,0.1)}
.hover\:shadow-2xl:hover{box-shadow:0 25px 50px -12px rgba(0,0,0,0.25)}
.hover\:shadow-md:hover{box-shadow:0 4px 6px -1px rgba(0,0,0,0.1),0 2px 4px -2px rgba(0,0,0,0.1)}
.hover\:border-indigo-200:hover{border-color:#c7d2fe}

/* Transitions */
.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(0.4,0,0.2,1);transition-duration:150ms}
.transition-all{transition-property:all;transition-timing-function:cubic-bezier(0.4,0,0.2,1);transition-duration:150ms}
.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(0.4,0,0.2,1)}
.duration-150{transition-duration:150ms}
.duration-300{transition-duration:300ms}

/* Transform */
.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}
.hover\:-translate-y-0\.5:hover{--tw-translate-y:-0.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}

/* Focus */
.focus\:border-indigo-400:focus{border-color:#818cf8}
.outline-none{outline:2px solid transparent;outline-offset:2px}
.ring-4{box-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color)}
.focus\:ring-4:focus{box-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color)}
.focus\:ring-indigo-100:focus{--tw-ring-color:#e0e7ff}

/* Position */
.relative{position:relative}
.absolute{position:absolute}
.fixed{position:fixed}
.sticky{position:sticky;top:0}
.inset-0{top:0;right:0;bottom:0;left:0}
.inset-x-0{left:0;right:0}
.bottom-0{bottom:0}
.right-0{right:0}
.bottom-6{bottom:1.5rem}
.right-6{right:1.5rem}
.z-10{z-index:10}
.z-50{z-index:50}
.overflow-hidden{overflow:hidden}
.overflow-y-auto{overflow-y:auto}
.overflow-x-auto{overflow-x:auto}

/* Display */
.hidden{display:none}
.block{display:block}
.inline{display:inline}
.w-full{width:100%}
.h-16{height:4rem}
.h-64{height:16rem}
.h-72{height:18rem}
.resize-y{resize:vertical}
.cursor-pointer{cursor:pointer}

/* Opacity */
.opacity-0{opacity:0}
.opacity-50{opacity:0.5}

/* Backdrop */
.backdrop-blur-md{backdrop-filter:blur(12px)}
.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}
.from-white{--tw-gradient-from:#fff}
.to-transparent{--tw-gradient-to:transparent}
.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}
.font-sans{font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Sans',sans-serif}
.uppercase{text-transform:uppercase}
.tracking-wider{letter-spacing:0.05em}
.ml-auto{margin-left:auto}
.ml-1{margin-left:0.25rem}
.ml-2{margin-left:0.5rem}
.mt-1{margin-top:0.25rem}
.mt-2{margin-top:0.5rem}
.mt-3{margin-top:0.75rem}
.p-3{padding:0.75rem}
.p-4{padding:1rem}
.p-5{padding:1.25rem}
.p-6{padding:1.5rem}
.py-1\.5{padding-top:0.375rem;padding-bottom:0.375rem}
.py-2{padding-top:0.5rem;padding-bottom:0.5rem}
.py-3{padding-top:0.75rem;padding-bottom:0.75rem}
.py-3\.5{padding-top:0.875rem;padding-bottom:0.875rem}
.py-4{padding-top:1rem;padding-bottom:1rem}
.px-4{padding-left:1rem;padding-right:1rem}
.px-5{padding-left:1.25rem;padding-right:1.25rem}
.px-8{padding-left:2rem;padding-right:2rem}
.py-2\.5{padding-top:0.625rem;padding-bottom:0.625rem}
.pb-2{padding-bottom:0.5rem}
.pb-4{padding-bottom:1rem}
.pt-3{padding-top:0.75rem}
.pt-6{padding-top:1.5rem}
.px-2{padding-left:0.5rem;padding-right:0.5rem}
.px-3{padding-left:0.75rem;padding-right:0.75rem}
.pl-4{padding-left:1rem}
.py-1{padding-top:0.25rem;padding-bottom:0.25rem}

/* Specific widths/heights */
.w-4{width:1rem}
.w-5{width:1.25rem}
.w-6{width:1.5rem}
.w-7{width:1.75rem}
.w-48{width:12rem}
.h-4{height:1rem}
.h-5{height:1.25rem}
.h-6{height:1.5rem}
.h-7{height:1.75rem}
.max-h-80{max-height:20rem}
.text-right{text-align:right}
.list-disc{list-style-type:disc}
.list-inside{list-style-position:inside}

/* ==========================================================================
   Custom Components
   ========================================================================== */

/* Skip to content */
.skip-link{position:absolute;top:-100px;left:1rem;background:#4f46e5;color:#fff;padding:0.5rem 1rem;border-radius:0.5rem;z-index:100;font-weight:600;transition:top 0.2s}
.skip-link:focus{top:0.5rem}

/* Navigation Links */
.nav-link{padding:0.5rem 0.75rem;border-radius:0.5rem;font-size:0.875rem;font-weight:500;color:#475569;transition:all 150ms;white-space:nowrap;text-decoration:none}
.nav-link:hover{background-color:#eef2ff;color:#4f46e5}
.nav-link.active{background-color:#eef2ff;color:#4f46e5;font-weight:600}

.mobile-nav-link{display:block;padding:0.75rem 1rem;border-radius:0.5rem;font-size:0.9375rem;font-weight:500;color:#334155;transition:all 150ms;text-decoration:none}
.mobile-nav-link:hover{background-color:#f1f5f9;color:#4f46e5}

/* Language Switcher */
.lang-switch-btn{display:flex;align-items:center;gap:0.375rem;padding:0.5rem 0.75rem;border-radius:0.75rem;font-size:0.875rem;font-weight:500;color:#475569;background:#f8fafc;border:1px solid #e2e8f0;cursor:pointer;transition:all 150ms}
.lang-switch-btn:hover{background:#eef2ff;border-color:#c7d2fe;color:#4f46e5}

/* Tool Buttons */
.tool-btn{display:inline-flex;align-items:center;gap:0.375rem;padding:0.5rem 1rem;border-radius:0.75rem;border:1px solid #e2e8f0;background:#fff;color:#64748b;font-size:0.8125rem;font-weight:500;cursor:pointer;transition:all 150ms}
.tool-btn:hover{background:#f8fafc;border-color:#cbd5e1;color:#334155}

/* Stat Cards */
.stat-card{background:#f8fafc;border:1px solid #f1f5f9;border-radius:1rem;padding:0.875rem 1rem;text-align:center;transition:all 150ms}
.stat-card:hover{background:#eef2ff;border-color:#e0e7ff}
.stat-value{display:block;font-size:1.5rem;font-weight:800;color:#4f46e5;line-height:1.2}
.stat-label{display:block;font-size:0.6875rem;font-weight:600;color:#94a3b8;text-transform:uppercase;letter-spacing:0.05em;margin-top:0.25rem}

/* Prose-like content */
.prose{max-width:65ch;color:#334155}
.prose p{margin-bottom:1.25rem;line-height:1.75}
.prose strong{color:#1e293b;font-weight:600}
.prose h2{font-size:1.5rem;font-weight:700;color:#0f172a;margin-top:2.5rem;margin-bottom:1rem;line-height:1.375}
.prose ul{margin-bottom:1.25rem;padding-left:1.25rem}
.prose ul li{margin-bottom:0.375rem}
.prose a{color:#4f46e5;text-decoration:underline}
.prose a:hover{color:#4338ca}

/* Alpine x-cloak */
[x-cloak]{display:none!important}

/* Animations */
@keyframes fade-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.animate-fade-in{animation:fade-in 0.3s ease-out}

/* Responsive */
@media(min-width:640px){
    .sm\:inline{display:inline}
    .sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}
    .sm\:hidden{display:none}
}
@media(min-width:768px){
    .md\:flex{display:flex}
    .md\:hidden{display:none}
    .md\:col-span-2{grid-column:span 2/span 2}
    .md\:px-8{padding-left:2rem;padding-right:2rem}
    .md\:py-16{padding-top:4rem;padding-bottom:4rem}
    .md\:py-20{padding-top:5rem;padding-bottom:5rem}
    .md\:py-28{padding-top:7rem;padding-bottom:7rem}
    .md\:h-80{height:20rem}
    .md\:text-3xl{font-size:1.875rem;line-height:2.25rem}
    .md\:text-4xl{font-size:2.25rem;line-height:2.5rem}
    .md\:text-5xl{font-size:3rem;line-height:1}
    .md\:text-xl{font-size:1.25rem;line-height:1.75rem}
}
@media(min-width:1024px){
    .lg\:px-8{padding-left:2rem;padding-right:2rem}
    .lg\:text-6xl{font-size:3.75rem;line-height:1}
}

/* List styling */
.list-disc{list-style-type:disc}
.space-y-2 > li{margin-bottom:0.5rem}

/* Table */
table{border-collapse:collapse}
th{text-align:left}
td,th{padding:0.375rem 0.25rem}

/* Select */
select{appearance:none;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right 0.5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}
