/* ---------------- RESET ---------------- */
html, body { max-width: 100%; overflow-x: hidden; }
* { box-sizing: border-box; font-family: Inter, system-ui, sans-serif; }
img { max-width: 100%; height: auto; }

/* ---------------- VARIABLES ---------------- */
:root {
	--bg:#ffffff; --surface:#f5f6fa; --card:#ffffff; --border:#e6e7eb; --text:#0b0b0d; --muted:#6b7280; --accent:#000000; --pill:#eef0f4;
}
body { margin: 0; background: var(--bg); color: var(--text); }

/* ---------------- HEADER ---------------- */
header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1200px; margin: auto; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; }
.brand { height: 42px; width: auto; object-fit: contain; }
.header-actions { display: flex; gap: 12px; align-items: center; }
.social { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--text); text-decoration: none; }
.btn { padding: 10px 14px; border-radius: 12px; text-decoration: none; font-weight: 700; background: var(--accent); color: white; display: inline-flex; align-items: center; gap: 8px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }

/* Translate widget container (positioned under header) */
.translate-container { position: absolute; top: 64px; right: 12px; z-index: 60; background: var(--card); border: 1px solid var(--border); padding: 10px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); min-width: 200px; }

@media (max-width: 600px) { .translate-container { right: 8px; left: 8px; top: 56px; } }

/* ---------------- HERO ---------------- */
.hero { max-width: 1100px; margin: 90px auto 70px; padding: 0 24px; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 900; letter-spacing: -.05em; word-wrap: break-word; overflow-wrap: break-word;}
.hero span { background: linear-gradient(90deg,#000,#555); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { margin-top: 18px; font-size: 1.1rem; color: var(--muted); }

/* ---------------- FILTERS ---------------- */
.filters { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 40px; }
.filter { padding: 10px 16px; border-radius: 999px; background: var(--pill); border: 1px solid var(--border); font-size: .9rem; }

/* ---------------- LIBRARY ---------------- */
.library { max-width: 1280px; margin: auto; padding: 0 24px 200px; position: relative; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 14px; transition: .25s ease; }
.card:hover { transform: translateY(-6px); box-shadow: 0 25px 60px rgba(0,0,0,.08); }
.icon-wrap { display: flex; justify-content: center; }
.icon { width: 96px; height: 96px; border-radius: 22px; object-fit: cover; }
.title { font-weight: 800; font-size: 1.1rem; text-align: center; }
.dev { text-align: center; font-size: .9rem; color: var(--muted); }
.desc { font-size: .95rem; color: #374151; text-align: center; }
.tag { align-self: center; font-size: .75rem; padding: 6px 10px; background: var(--pill); border-radius: 999px; }
.actions { display: flex; gap: 12px; margin-top: auto; }
.actions { display: flex; gap: 12px; margin-top: auto; justify-content: center; align-items: center; }
.open { padding: 12px 20px; border-radius: 14px; font-weight: 700; background: var(--accent); color: white; text-decoration: none; text-align: center; min-width: 140px; }
.delete { padding: 12px 16px; background: #e74c3c; color: white; border: none; border-radius: 14px; font-weight: 700; cursor: pointer; }
.fab { position: absolute; top: 12px; right: 12px; z-index: 40; padding: 10px 14px; border-radius: 12px; background: var(--accent); color: white; text-decoration: none; font-weight: 800; display: inline-flex; gap: 8px; align-items: center; }

.typewriter {
font-size: 3rem;
display: inline-block;
min-height: 1.2em;
border-right: 3px solid black;
padding-right: 4px;
animation: blink 0.7s step-end infinite;
font-weight: 900;
}

/* Blinking cursor */
@keyframes blink {
	50% { border-color: transparent; }
}

@media (max-width: 768px) {
	.typewriter { font-size: 2rem; }
}

	/* ---------------- SUBMIT ---------------- */
.submit { background: var(--surface); padding: 100px 24px; }
.submit h2 { text-align: center; margin-bottom: 26px; }
form { max-width: 520px; margin: auto; display: grid; gap: 14px; }
input, textarea, button { padding: 14px; border-radius: 14px; border: 1px solid var(--border); font-size: 1rem; }
textarea { resize: none; height: 90px; }
button { background: var(--accent); color: white; font-weight: 800; cursor: pointer; }

footer { border-top: 1px solid var(--border); padding: 50px 24px; text-align: center; font-size: .85rem; color: var(--muted); }

@media (max-width: 600px) { .header-inner { flex-direction: column; gap: 10px; } .brand { height: 48px; } .hero { margin: 60px auto 50px; } .hero p { font-size: 1rem; } .fab { right: 18px; top: 8px; padding: 10px; } }

/* Modal styles */
.modal { display: none; position: fixed; inset: 0; z-index: 100; }
.modal[aria-hidden="false"] { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.modal-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--card); border-radius: 16px; padding: 22px; width: 96%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,0.12); }
.modal-close { position: absolute; right: 12px; top: 8px; background: transparent; border: none; font-size: 22px; cursor: pointer; }
.modal-panel form input, .modal-panel form textarea, .modal-panel form button { width: 100%; }
.modal-panel form textarea { height: 90px; }

/* small helper */
.hidden { display: none !important; }
