* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #222;
}

/* Navigation */

nav {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 16px 5%;
    background: #222;
}

nav h2 {
    color: white;
    margin: 0 auto 0 0;
}

nav a {
    color: white;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}


/* Main Sections */

main,
.tools,
.blog,
.projects,
.about,
.contact {
    width: 90%;
    max-width: 1100px;
    margin: 40px auto;
}


/* Hero */

.hero {
    text-align: center;
    padding: 70px 20px;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.hero a,
.tool-card > a,
.project-card > a {
    display: inline-block;
    text-decoration: none;
    background: #222;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
}


/* Cards */

.tool-container,
.blog-container,
.project-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.tool-card,
.blog-card,
.project-card {
    flex: 1 1 280px;
    background: white;
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.tool-card h2,
.tool-card h3,
.blog-card h3,
.project-card h3 {
    margin-top: 0;
}

.tool-card a {
    color: #222;
}

.tool-card > a {
    color: white;
}


/* About / Blog / Projects / Contact */

.about,
.blog,
.projects,
.contact,
.tools {
    padding: 20px 0;
}

.about h1,
.blog h1,
.projects h1,
.contact h1,
.tools h1 {
    margin-bottom: 25px;
}


/* Contact Form */

.contact form {
    max-width: 600px;
    background: white;
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.contact label {
    display: block;
    margin-top: 15px;
    margin-bottom: 6px;
}

.contact input,
.contact textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}

.contact textarea {
    min-height: 140px;
    resize: vertical;
}

.contact button {
    margin-top: 18px;
    padding: 12px 20px;
    background: #222;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}


/* Calculator */

.calculator-page {
    text-align: center;
    max-width: 500px;
    margin: 40px auto;
}

.calculator-page h1 {
    margin-bottom: 8px;
}

.calculator-page > p {
    color: #666;
    margin-bottom: 25px;
}

.calculator {
    width: 100%;
    max-width: 360px;
    margin: auto;
    padding: 20px;
    background: #222;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

#calcScreen {
    width: 100%;
    height: 70px;
    margin-bottom: 15px;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: white;
    color: #222;
    text-align: right;
    font-size: 30px;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calc-button {
    height: 60px;
    border: none;
    border-radius: 10px;
    background: #f4f4f4;
    color: #222;
    font-size: 20px;
    cursor: pointer;
}

.calc-button:hover {
    background: #ddd;
}

.calc-button.zero {
    grid-column: span 2;
}

.calc-button.equal {
    grid-column: span 1;
}


/* URL Opener */

.url-opener-page {
    max-width: 800px;
    margin: 40px auto;
}

#urlBox {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
    resize: vertical;
}

.url-actions {
    margin-top: 15px;
}

#openBtn {
    padding: 12px 20px;
    background: #222;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#urlMsg {
    margin-left: 10px;
}


/* Footer */

footer {
    margin-top: 50px;
    padding: 25px;
    text-align: center;
    background: #222;
    color: white;
}

footer a {
    color: white;
    margin: 0 8px;
}


/* Mobile */

@media (max-width: 700px) {

    nav {
        flex-wrap: wrap;
        gap: 12px;
    }

    nav h2 {
        width: 100%;
    }

    .hero h1 {
        font-size: 32px;
    }

    .calculator {
        max-width: 100%;
    }

    .calc-button {
        height: 55px;
    }

}