/* =========================================================
   CALCATLAS
   Main stylesheet
   ========================================================= */

:root {
    --background: #f7f8f6;
    --surface: #ffffff;
    --surface-soft: #eef4f2;
    --text: #273236;
    --text-soft: #667276;
    --primary: #3f7180;
    --primary-dark: #315d69;
    --secondary: #6f927d;
    --accent: #c39a5a;
    --border: #dde4e1;
    --radius-small: 6px;
    --radius-medium: 10px;
    --radius-large: 16px;
    --shadow-soft: 0 8px 28px rgba(27, 44, 49, 0.06);
    --page-width: 1240px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    font-size: 17px;
    line-height: 1.65;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

button,
input,
select,
textarea {
    font: inherit;
}

.site-container {
    width: min(92%, var(--page-width));
    margin-inline: auto;
}

/* Header */

.site-header {
    position: relative;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-size: 25px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: -0.7px;
}

.site-logo:hover {
    color: var(--text);
}

.site-logo-image {
    width: 31px;
    height: 31px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 29px;
}

.main-nav a {
    color: var(--text-soft);
    font-size: 15px;
    font-weight: 600;
}

.main-nav a:hover {
    color: var(--primary);
}

.menu-button {
    display: none;
    padding: 9px 14px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    cursor: pointer;
}

/* Homepage hero */

.home-hero {
    padding: 92px 0 76px;
    text-align: center;
}

.hero-label {
    margin-bottom: 14px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.hero-title {
    max-width: 820px;
    margin: 0 auto;
    color: var(--text);
    font-size: clamp(42px, 6vw, 72px);
    font-weight: 780;
    line-height: 1.06;
    letter-spacing: -2.5px;
}

.hero-intro {
    max-width: 680px;
    margin: 24px auto 0;
    color: var(--text-soft);
    font-size: 20px;
    line-height: 1.6;
}

/* Search */

.calculator-search {
    max-width: 680px;
    margin: 40px auto 0;
    display: flex;
    padding: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
}

.calculator-search input {
    flex: 1;
    min-width: 0;
    padding: 14px 17px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.calculator-search input::placeholder {
    color: #899490;
}

.calculator-search button {
    padding: 13px 21px;
    border: 0;
    border-radius: 9px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.calculator-search button:hover {
    background: var(--primary-dark);
}

/* Sections */

.section {
    padding: 65px 0;
}

.section-heading {
    max-width: 700px;
    margin-bottom: 30px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.15;
    letter-spacing: -1px;
}

.section-heading p {
    margin: 10px 0 0;
    color: var(--text-soft);
}

/* Tool cards */

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.tool-card {
    display: block;
    min-height: 190px;
    padding: 27px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    color: var(--text);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tool-card:hover {
    transform: translateY(-3px);
    color: var(--text);
    border-color: #cad6d2;
    box-shadow: var(--shadow-soft);
}

.tool-category {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 750;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tool-name {
    margin-bottom: 9px;
    font-size: 21px;
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -0.4px;
}

.tool-description {
    margin: 0;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.55;
}

/* Responsive */

@media (max-width: 900px) {
    .main-nav {
        display: none;
    }

    .menu-button {
        display: block;
    }

    .home-hero {
        padding: 68px 0 58px;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
	.category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.why-layout {
    grid-template-columns: 1fr;
    gap: 45px;
}
	.footer-grid {
    grid-template-columns: 1fr 1fr;
}
}

/* =========================================================
   MOBILE / SMALL TABLET LAYOUT
   ========================================================= */

@media (max-width: 768px) {

    /* Browse by Category */

    .category-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .category-card {
        width: 100%;
        padding: 18px;
        gap: 14px;
    }

    .category-icon {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .category-content h3 {
        font-size: 18px;
        line-height: 1.25;
    }

    .category-content p {
        font-size: 14px;
        line-height: 1.45;
        margin-bottom: 9px;
    }


    /* Why CalcAtlas */

    .why-layout {
        display: block;
    }

    .why-intro {
        margin-bottom: 35px;
    }

    .why-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .why-item {
        padding: 18px 0 0;
    }

    .why-intro h2 {
        font-size: 30px;
        line-height: 1.15;
    }

    .why-intro p {
        font-size: 16px;
    }
}

@media (max-width: 560px) {

    body {
        font-size: 16px;
    }

    .site-container {
        width: 91%;
    }

    .header-inner {
        min-height: 62px;
    }

    .site-logo {
        font-size: 20px;
    }

    .logo-mark {
        width: 27px;
        height: 27px;
        font-size: 19px;
        border-radius: 8px;
    }

    .menu-button {
        padding: 7px 11px;
        font-size: 14px;
    }

    .home-hero {
        padding: 48px 0 40px;
    }

    .hero-label {
        font-size: 12px;
        letter-spacing: 1.2px;
    }

    .hero-title {
        font-size: 38px;
        letter-spacing: -1.2px;
    }

    .hero-intro {
        margin-top: 20px;
        font-size: 17px;
        line-height: 1.55;
    }
	
	.calculator-search {
    margin-top: 30px;
    padding: 5px;
    border-radius: 12px;
}

.calculator-search input {
    padding: 10px 12px;
    font-size: 16px;
}

.calculator-search button {
    width: auto;
    padding: 10px 16px;
    font-size: 15px;
    border-radius: 8px;
}
	.section {
    padding: 42px 0;
}

.category-grid {
    grid-template-columns: 1fr;
    gap: 14px;
}

.category-card {
    padding: 18px;
    gap: 14px;
    align-items: flex-start;
}

.category-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    font-size: 14px;
}

.category-content h3 {
    margin-bottom: 5px;
    font-size: 18px;
    line-height: 1.25;
}

.category-content p {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.45;
}

.category-link {
    font-size: 13px;
}

.category-section .section-heading {
    margin-bottom: 22px;
}

.category-section .section-heading h2 {
    font-size: 30px;
}

.category-section .section-heading p {
    font-size: 15px;
    line-height: 1.5;
}

.why-section {
    padding: 55px 0;
}

.why-layout {
    gap: 35px;
}

.why-intro h2 {
    font-size: 32px;
}

.why-intro p {
    font-size: 16px;
}

.why-grid {
    grid-template-columns: 1fr;
    gap: 25px;
}
	.footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
}
}

/* =========================================================
   CATEGORY SECTION
   ========================================================= */

.category-section {
    background: #ffffff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.category-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;

    padding: 25px;

    background: var(--background);

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    color: var(--text);

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.category-card:hover {
    transform: translateY(-2px);

    color: var(--text);

    border-color: #cad6d2;

    box-shadow: var(--shadow-soft);
}

.category-icon {
    flex: 0 0 45px;

    width: 45px;
    height: 45px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background: var(--surface-soft);
    color: var(--primary);

    font-size: 16px;
    font-weight: 800;
}

.category-content {
    min-width: 0;
}

.category-content h3 {
    margin: 0 0 7px;

    color: var(--text);

    font-size: 19px;
    line-height: 1.3;

    letter-spacing: -0.3px;
}

.category-content p {
    margin: 0 0 14px;

    color: var(--text-soft);

    font-size: 14px;
    line-height: 1.55;
}

.category-link {
    color: var(--primary);

    font-size: 13px;
    font-weight: 700;
}


/* =========================================================
   WHY CALCATLAS
   ========================================================= */

.why-section {
    padding: 85px 0;
}

.why-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 0.9fr)
        minmax(0, 1.1fr);

    gap: 80px;

    align-items: start;
}

.section-label {
    display: inline-block;

    margin-bottom: 14px;

    color: var(--primary);

    font-size: 13px;
    font-weight: 750;

    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.why-intro h2 {
    margin: 0;

    max-width: 520px;

    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.12;

    letter-spacing: -1.4px;
}

.why-intro p {
    max-width: 540px;

    margin: 22px 0 0;

    color: var(--text-soft);

    font-size: 17px;
}

.why-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 35px 30px;
}

.why-item {
    padding-top: 16px;

    border-top: 1px solid var(--border);
}

.why-number {
    display: block;

    margin-bottom: 10px;

    color: var(--primary);

    font-size: 13px;
    font-weight: 750;
}

.why-item h3 {
    margin: 0 0 7px;

    font-size: 18px;
}

.why-item p {
    margin: 0;

    color: var(--text-soft);

    font-size: 14px;
    line-height: 1.55;
}

/* Footer */

.site-footer {
    margin-top: 80px;
    padding: 55px 0 25px;
    background: #273236;
    color: #d9e0de;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
}

.footer-logo {
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 23px;
    font-weight: 750;
}

.site-footer p {
    max-width: 390px;
    color: #aebbb7;
}

.site-footer strong {
    display: block;
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 14px;
}

.site-footer a {
    display: block;
    margin: 7px 0;
    color: #b8c4c0;
    font-size: 14px;
}

.site-footer a:hover {
    color: #ffffff;
}

.footer-bottom {
    margin-top: 45px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #8f9d99;
    font-size: 13px;
}

/* =========================================================
   NARROW SCREEN CATEGORY + WHY LAYOUT
   ========================================================= */

@media (max-width: 1200px) {

    /* Browse by Category */

    .category-grid {
        grid-template-columns: 1fr !important;
    }

    .category-card {
        width: 100%;
    }


    /* Why CalcAtlas */

    .why-layout {
        grid-template-columns: 1fr !important;
    }

    .why-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================
   CALCATLAS - REAL MOBILE OVERRIDES
   ========================================================= */

@media (max-width: 600px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .site-container {
        width: 90%;
        max-width: 100%;
    }


    /* -------------------------
       HEADER
       ------------------------- */

    .site-header {
        width: 100%;
    }

    .header-inner {
        position: relative;
        min-height: 68px;
    }

    .site-logo {
        font-size: 21px;
    }

    .site-logo-image {
    width: 30px;
    height: 30px;
}

    .menu-button {
        display: block;
        padding: 8px 13px;
        font-size: 15px;
    }


    /* Mobile navigation */

    .main-nav {
        display: none;

        position: absolute;
        top: 100%;
        left: 0;
        right: 0;

        flex-direction: column;
        align-items: stretch;
        gap: 0;

        padding: 10px 5% 14px;

        background: #ffffff;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);

        box-shadow: 0 10px 20px rgba(27, 44, 49, 0.08);
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav a {
        display: block;

        padding: 12px 4px;

        border-bottom: 1px solid var(--border);

        font-size: 16px;
    }

    .main-nav a:last-child {
        border-bottom: 0;
    }


    /* -------------------------
       HERO
       ------------------------- */

    .home-hero {
        padding: 55px 0 48px;
    }

    .hero-label {
        font-size: 11px;
        letter-spacing: 1.1px;
    }

    .hero-title {
        font-size: 42px;
        line-height: 1.03;
        letter-spacing: -1.5px;
    }

    .hero-intro {
        max-width: 100%;

        margin-top: 22px;

        font-size: 17px;
        line-height: 1.55;
    }


    /* -------------------------
       SEARCH
       ------------------------- */

    .calculator-search {
        width: 100%;

        margin-top: 30px;
        padding: 5px;

        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;

        border-radius: 12px;
    }

    .calculator-search input {
        width: 100%;
        min-width: 0;

        padding: 11px 10px;

        font-size: 15px;

        overflow: hidden;
        text-overflow: ellipsis;
    }

    .calculator-search button {
        width: auto;

        padding: 10px 14px;

        font-size: 14px;

        white-space: nowrap;
    }


    /* -------------------------
       GENERAL SECTIONS
       ------------------------- */

    .section {
        padding: 45px 0;
    }

    .section-heading {
        margin-bottom: 24px;
    }

    .section-heading h2 {
        font-size: 30px;
        line-height: 1.15;
    }

    .section-heading p {
        font-size: 16px;
        line-height: 1.5;
    }


    /* -------------------------
       POPULAR CALCULATORS
       ------------------------- */

    .card-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tool-card {
        width: 100%;
        min-height: 0;

        padding: 21px;
    }

    .tool-category {
        margin-bottom: 10px;
        font-size: 12px;
    }

    .tool-name {
        margin-bottom: 7px;

        font-size: 20px;
        line-height: 1.25;
    }

    .tool-description {
        font-size: 15px;
        line-height: 1.5;
    }


    /* -------------------------
       CATEGORIES
       ------------------------- */

    .category-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .category-card {
        width: 100%;

        padding: 18px;

        gap: 14px;
    }

    .category-icon {
        flex: 0 0 38px;

        width: 38px;
        height: 38px;
    }

    .category-content h3 {
        font-size: 18px;
    }

    .category-content p {
        font-size: 14px;
        line-height: 1.45;
    }


    /* -------------------------
       WHY CALCATLAS
       ------------------------- */

    .why-layout {
        display: block;
    }

    .why-intro {
        margin-bottom: 34px;
    }

    .why-intro h2 {
        font-size: 30px;
    }

    .why-grid {
        grid-template-columns: 1fr !important;
        gap: 22px;
    }


    /* -------------------------
       FOOTER
       ------------------------- */

    .site-footer {
        width: 100%;

        margin-top: 50px;

        padding: 42px 0 22px;
    }

    .footer-grid {
        display: grid;
        grid-template-columns: 1fr !important;

        gap: 28px;
    }

    .site-footer p {
        max-width: 100%;

        margin-bottom: 0;

        font-size: 15px;
        line-height: 1.55;
    }

    .footer-logo {
        font-size: 22px;
    }

    .site-footer strong {
        margin-bottom: 8px;
    }

    .site-footer a {
        margin: 6px 0;
        font-size: 15px;
    }

    .footer-bottom {
        margin-top: 30px;
        padding-top: 18px;
    }

}
