@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap');

/* ========== RESET BÁSICO ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light mode palette */
    --bg: #ffffff;
    --text: #555d60;
    --navy: #001f3f;
    --primary: #555d60;
    --border: rgba(0, 31, 63, 0.1);

    /* Logo */
    --logo-nord: rgb(149, 167, 225);
    --logo-hat: rgb(237, 79, 103);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0d10;
        --text: #e5e7eb;
        --navy: #e5e7eb;
        --primary: #d5d8da;
        --border: rgba(255, 255, 255, 0.15);

        --logo-nord: rgb(149, 167, 225);
        --logo-hat: rgb(237, 79, 103);
    }

    .nh-nav {
        /* ~35% transparency */
        background: color-mix(in srgb, var(--bg) 65%, transparent);
    }
}

/* Corpo */
body {
    font-family: "Quicksand", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;

    background: var(--bg);
    color: var(--navy); /* NAVY */
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}

/* ========== NAVBAR ========== */
.nh-nav {
    width: 100%;
    padding: 16px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    background: var(--bg);
    /* ~35% transparency */
    background: color-mix(in srgb, var(--bg) 65%, transparent);

    backdrop-filter: blur(8px);

    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Ensure injected header container never blocks clicks and stays above hero */
#header-slot {
    position: relative;
    z-index: 1000;
}

/* LOGO */

/* LOGO TEXT (for "nordHat") */
.nh-logo-text {
    font-family: "Quicksand", sans-serif;
    font-size: 2.46rem; /* ~70% smaller than 8.2rem */
    letter-spacing: -0.08em;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Home hero: oversized NordHat logo */
body.nh-home .nh-hero .nh-logo-text {
    font-size: 7.4rem; /* ~3x header size */
    letter-spacing: -0.085em;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    body.nh-home .nh-hero .nh-logo-text {
        font-size: 4.6rem;
        margin-bottom: 24px;
    }
}

/* Home page in portrait: hide hero logo (header logo will be shown for UX) */
@media (orientation: portrait) {
    body.nh-home .nh-hero .nh-logo-text {
        display: none;
    }
}

.nh-logo-text .nord {
    color: var(--logo-nord); /*logo main blue */
    font-weight: 300; /* Lighter */
}


.nh-logo-text .hat {
    color: var(--logo-hat); /* Soft orange with subtle rosy tint */
    font-weight: 500; /* Stronger for contrast */
}

/* Contact page logo */
.nh-logo-contact {
    font-size: 4.1rem;      /* reduced vs. homepage logo */
    margin-bottom: 28px;    /* extra space before "Contact NordHat" */
}

/* MENU */
.nh-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

/* Checkbox is STATE ONLY — never visible (global safeguard) */
.nh-menu-toggle {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.nh-menu li a {
    color: var(--navy);
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.02em;

    transition: 0.2s ease;
}

.nh-menu li a:hover {
    opacity: 0.6;
}

/* ========== HEADER LOGO VISIBILITY RULES ========== */
/* Default: if the injected header contains a logo element, show it */
.nh-header-logo,
.nh-nav .nh-logo-text {
    display: flex;
    align-items: center;
}

/* Home page: hide header logo because the hero already shows the brand */
body.nh-home .nh-header-logo,
body.nh-home .nh-nav .nh-logo-text {
    display: none;
}

/* Home page in portrait (vertical): show header logo for better UX */
@media (orientation: portrait) {
    body.nh-home .nh-header-logo,
    body.nh-home .nh-nav .nh-logo-text {
        display: flex;
    }
}

/* ========== HERO ========== */
.nh-hero {
    flex: 1;
    display: flex;
    align-items: flex-start;
    padding: 18px 40px 40px;
    background-color: var(--bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@media (prefers-color-scheme: dark) {
    .nh-hero {
        background-color: var(--bg);
    }
}

/* --- Home hero: make the photo feel designed (no HTML changes) --- */
body.nh-home .nh-hero {
    position: relative;
    overflow: hidden;

    /* Zoom-out a bit vs pure cover, and anchor the photo to the right */
    background-position: right center;
    background-repeat: no-repeat;
    background-size: clamp(1200px, 120vw, 1900px) auto;

    /* Left-side readability veil (~40% width) */
    background-image:
        linear-gradient(
            to right,
            color-mix(in srgb, var(--bg) 92%, transparent) 0%,
            color-mix(in srgb, var(--bg) 88%, transparent) 40%,
            transparent 68%
        ),
        url("assets/images/work_from_home.png");
}

@media (prefers-color-scheme: dark) {
    body.nh-home .nh-hero {
        background-image:
            linear-gradient(
                to right,
                color-mix(in srgb, var(--bg) 94%, transparent) 0%,
                color-mix(in srgb, var(--bg) 90%, transparent) 40%,
                transparent 68%
            ),
            url("assets/images/work_from_home_night.png");
    }
}

/* --- About hero: use app_users.png only on about.html --- */
body.nh-about .nh-hero {
    position: relative;
    overflow: hidden;

    /* Anchor photo to the right, keep it realistic (not over-zoomed) */
    background-position: right center;
    background-repeat: no-repeat;
    background-size: clamp(1200px, 120vw, 2000px) auto;

    background-image:
        radial-gradient(
            circle at top left,
            color-mix(in srgb, var(--bg) 96%, transparent) 0%,
            color-mix(in srgb, var(--bg) 90%, transparent) 28%,
            color-mix(in srgb, var(--bg) 65%, transparent) 52%,
            transparent 78%
        ),
        radial-gradient(
            circle at bottom left,
            color-mix(in srgb, var(--bg) 32%, transparent) 0%,
            transparent 62%
        ),
        url("assets/images/app_users.png");
}

@media (prefers-color-scheme: dark) {
    body.nh-about .nh-hero {
        background-image:
            radial-gradient(
                circle at top left,
                color-mix(in srgb, var(--bg) 92%, transparent) 0%,
                color-mix(in srgb, var(--bg) 86%, transparent) 28%,
                color-mix(in srgb, var(--bg) 60%, transparent) 52%,
                transparent 78%
            ),
            radial-gradient(
                circle at bottom left,
                color-mix(in srgb, var(--bg) 24%, transparent) 0%,
                transparent 62%
            ),
            url("assets/images/app_users.png");
    }
}

/* Keep About content above the gradient/photo */
body.nh-about .nh-hero-content {
    position: relative;
    z-index: 1;
}

/* About: narrower left column so text invades less the image */
body.nh-about .nh-hero-content {
    max-width: 760px;
}

/* About: make the lead paragraph (right after the H1) slightly larger */
body.nh-about .nh-hero-content > p {
    font-size: 1.34rem;
    line-height: 1.38;
    max-width: 62ch;
    opacity: 0.88;
}

/* About: typography polish + elegant bullets */
body.nh-about .nh-hero-content h2,
body.nh-about .nh-hero-content h3 {
    font-family: "Public Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.62rem;
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 26px 0 12px;
    position: relative;
}

body.nh-about .nh-hero-content h2::after,
body.nh-about .nh-hero-content h3::after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    margin-top: 10px;
    border-radius: 999px;
    background: linear-gradient(
        to right,
        color-mix(in srgb, var(--logo-hat) 70%, transparent),
        color-mix(in srgb, var(--logo-nord) 70%, transparent)
    );
    opacity: 0.55;
}

/* Make non-lead paragraphs read cleaner (keeps hero lead untouched) */
body.nh-about .nh-hero-content p {
    font-size: 1.08rem;
    line-height: 1.55;
    color: var(--text);
    opacity: 0.9;
    max-width: 70ch;
}

/* Divider lines (when you use <hr>) */
body.nh-about .nh-hero-content hr {
    border: none;
    height: 1px;
    width: min(72ch, 100%);
    background: color-mix(in srgb, var(--navy) 18%, transparent);
    margin: 22px 0 26px;
    opacity: 0.55;
}

/* Elegant bullet list */
body.nh-about .nh-hero-content ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 70ch;
}

body.nh-about .nh-hero-content li {
    position: relative;
    padding-left: 18px;
    font-size: 1.05rem;
    line-height: 1.45;
    color: var(--text);
    opacity: 0.92;
}

body.nh-about .nh-hero-content li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--logo-hat) 58%, var(--logo-nord));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bg) 75%, transparent);
    opacity: 0.9;
}

@media (max-width: 768px) {
    body.nh-about .nh-hero-content > p {
        font-size: 1.2rem;
    }

    body.nh-about .nh-hero-content h2,
    body.nh-about .nh-hero-content h3 {
        font-size: 1.45rem;
    }
}

@media (prefers-color-scheme: dark) {
    body.nh-about .nh-hero-content hr {
        background: color-mix(in srgb, var(--navy) 22%, transparent);
    }

    body.nh-about .nh-hero-content li::before {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--bg) 60%, transparent);
    }
}

/* Keep content above the gradient */
body.nh-home .nh-hero-content {
    position: relative;
    z-index: 1;
}

/* Make the headline feel designed (subtle underline accent) */
body.nh-home .nh-hero-content h1 {
    letter-spacing: -0.02em;
    line-height: 0.98;

    background-image:
        linear-gradient(
            to right,
            color-mix(in srgb, var(--logo-hat) 70%, transparent),
            color-mix(in srgb, var(--logo-nord) 70%, transparent)
        );
    background-repeat: no-repeat;
    background-size: 0% 3px;
    background-position: 0 100%;
    padding-bottom: 6px;
}

@media (prefers-reduced-motion: no-preference) {
    body.nh-home .nh-hero-content h1 {
        animation: nh-hero-underline 900ms ease-out 120ms forwards;
    }

    @keyframes nh-hero-underline {
        to { background-size: 62% 3px; }
    }
}

/* Buttons: add depth + clearer hover */
body.nh-home .nh-hero-actions .nh-btn {
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.10),
        0 6px 14px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    body.nh-home .nh-hero-actions .nh-btn {
        box-shadow:
            0 22px 46px rgba(0, 0, 0, 0.45),
            0 8px 18px rgba(0, 0, 0, 0.32);
    }
}

body.nh-home .nh-hero-actions .nh-btn:hover {
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    body.nh-home .nh-hero-actions .nh-btn:hover {
        transform: none;
    }
}

/* Slightly stronger micro-line for personality */
body.nh-home .nh-hero-micro {
    opacity: 0.78;
}

.nh-hero-content {
    max-width: 980px; /* wider frame for headings and paragraphs */
}

.nh-hero-logo {
    height: 80px;
    width: auto;
    margin-bottom: 20px;
}

.nh-hero-content h1 {
    font-family: "Public Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(1.77rem, 2.89vw, 2.89rem);
    line-height: 0.98;
    margin-bottom: 20px;
    color: var(--text);
}

.nh-hero-content p {
    font-size: 1.2rem;
    opacity: 0.85;
    margin-bottom: 28px;
    color: var(--text);
}

/* Home hero micro line (used on index.html) */
.nh-hero-micro {
    font-size: 0.95rem;
    color: var(--text);
    opacity: 0.72;
    letter-spacing: 0.02em;
    margin-top: -14px;
    margin-bottom: 26px;
}

@media (max-width: 768px) {
    .nh-hero-micro {
        margin-top: -10px;
        margin-bottom: 22px;
    }
}

/* ========== PROJECTS PAGE (MilkyGrid) ========== */
.nh-project-intro {
    margin-top: 8px;
    margin-bottom: 18px;
}

.nh-project-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
}

.nh-project-head-media {
    flex: 0 0 auto;
}

.nh-project-title {
    font-family: "Public Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(2.4rem, 4.2vw, 3.6rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin: 10px 0 10px;
    color: var(--text);
}

.nh-project-lead {
    font-size: 1.22rem;
    line-height: 1.35;
    color: var(--text);
    opacity: 0.88;
    margin-bottom: 0;
    max-width: 74ch;
}

/* Two-column layout: copy + screenshots */
.nh-project-grid {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 42px;
    margin-top: 18px;
}

.nh-project-copy {
    flex: 1 1 420px;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nh-project-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nh-project-kicker {
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--navy);
}

.nh-project-text {
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--text);
    opacity: 0.9;
}

.nh-project-cta {
    margin-top: 10px;
}

.nh-project-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    text-decoration: none;
    border-radius: 999px;
    padding: 12px 22px;

    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    background: var(--primary);
    color: var(--bg);
    border: 2px solid var(--primary);

    transition: 0.2s ease;
}

.nh-project-link:hover {
    opacity: 0.9;
}

/* Media / screenshots */

.nh-project-media-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: center;
}

.nh-project-shot {
    margin: 0;
    flex: 0 0 184px;   /* +15% */
    width: 184px;
    max-width: 184px;
    min-width: 184px;
}

.nh-project-shot-frame {
    width: 100%;
    max-width: 184px;
    border-radius: 24px; /* ~30% reduction from 34px */
    overflow: hidden; /* this clips the image and removes the “entorno” */
    background: transparent;

    /* shadow on the frame, so the clipping is clean */
    box-shadow:
        0 22px 52px rgba(0, 0, 0, 0.18),
        0 6px 16px rgba(0, 0, 0, 0.10);

    aspect-ratio: 9 / 19.5; /* iPhone-like portrait */
}

.nh-project-shot-img {
    display: block;          /* removes inline-image baseline gaps */
    width: 100%;
    height: 100%;
    object-fit: cover;       /* crops away baked-in margins */
    transform: scale(1.04);  /* tiny zoom to fully eliminate borders */
    transform-origin: center;

    border: none;
    background: transparent;
    border-radius: 0;        /* radius is handled by the frame */
    box-shadow: none;        /* shadow is handled by the frame */
}

@media (prefers-color-scheme: dark) {
    .nh-project-shot-frame {
        box-shadow:
            0 26px 64px rgba(0, 0, 0, 0.55),
            0 8px 20px rgba(0, 0, 0, 0.35);
    }
}

.nh-project-shot-cap {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text);
    opacity: 0.75;
}

/* ========== PROJECTS (Funções-style single product section) ========== */
.nh-projects-product {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) auto;
    column-gap: 56px;
    align-items: start;
}

.nh-projects-product-head {
    grid-column: 1;
    margin-bottom: 18px;
}

.nh-projects-product-title {
    font-family: "Quicksand", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(2.2rem, 3.6vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
    color: var(--text);
}

.nh-projects-product-lead {
    font-size: 1.18rem;
    line-height: 1.42;
    color: var(--text);
    opacity: 0.88;
    margin: 0;
    max-width: 82ch;
}

.nh-feature-row {
    display: contents;
}

.nh-feature-copy {
    grid-column: 1;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nh-feature-kicker {
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--navy);
    opacity: 0.85;
}

.nh-feature-title {
    font-family: "Public Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0;
}

.nh-feature-lead {
    font-size: 1.08rem;
    line-height: 1.45;
    color: var(--text);
    opacity: 0.88;
    margin: 0;
}

.nh-feature-bullets {
    margin: 6px 0 0;
    padding-left: 18px;
    color: var(--text);
    opacity: 0.9;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nh-feature-bullets li {
    line-height: 1.35;
}

.nh-feature-cta {
    margin-top: 10px;
}

.nh-feature-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    text-decoration: none;
    border-radius: 999px;
    padding: 12px 22px;

    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    background: var(--primary);
    color: var(--bg);
    border: 2px solid var(--primary);

    transition: 0.2s ease;
}

.nh-feature-link:hover {
    opacity: 0.9;
}

.nh-feature-media {
    grid-column: 2;
    align-self: start;
}

.nh-feature-media-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: center;
}

.nh-feature-shot {
    margin: 0;
    width: 184px;
}

/* ========== BOTÕES ========== */
.nh-hero-actions {
    display: flex;
    gap: 16px;
}

.nh-btn {
    border-radius: 999px;
    padding: 12px 26px;
    font-size: 0.95rem;
    border: 2px solid var(--primary);
    text-decoration: none;
    cursor: pointer;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    transition: 0.2s ease;
}

/* Botão principal */
.nh-btn-primary {
    background: var(--primary);
    color: var(--bg);
}

.nh-btn-primary:hover {
    background: var(--primary);
}

/* Botão transparente */
.nh-btn-ghost {
    background: transparent;
    color: var(--primary);
}

.nh-btn-ghost:hover {
    background: rgba(0, 31, 63, 0.1);
}

/* ========== FOOTER ========== */
.nh-footer {
    width: 100%;
    padding: 16px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--navy);
    opacity: 0.7;

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

/* ========== RESPONSIVIDADE ========== */
@media (max-width: 768px) {
    .nh-nav {
        padding: 12px 20px;
    }

    .nh-menu {
        gap: 18px;
        font-size: 0.9rem;
    }

    .nh-hero {
        padding: 40px 20px;
    }

    .nh-hero-content {
        max-width: 100%;
    }

    .nh-project-grid {
        flex-direction: column;
        gap: 26px;
    }

    .nh-project-copy {
        max-width: 100%;
    }

    .nh-project-media-row {
        gap: 14px;
    }

    .nh-project-shot-frame {
        max-width: 200px;
    }

    .nh-feature-row {
        flex-direction: column;
        gap: 26px;
    }

    .nh-feature-copy {
        max-width: 100%;
    }

    .nh-feature-media-row {
        gap: 14px;
    }

    .nh-feature-shot {
        width: 200px;
    }

    .nh-projects-product {
        display: flex;
        flex-direction: column;
        gap: 26px;
    }
}

@media (max-width: 520px) and (orientation: portrait) {
    .nh-nav {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-auto-rows: auto;
        align-items: center;
        gap: 12px;
    }

    /* Checkbox is STATE ONLY — never visible */
    .nh-menu-toggle {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
        pointer-events: none;
    }

    /* Hamburger icon (3 bars from HTML) */
    .nh-menu-icon {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 6px;

        width: 44px;
        height: 44px;

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

        color: var(--navy);
        background: color-mix(in srgb, var(--bg) 92%, transparent);
        cursor: pointer;
        user-select: none;

        /* keep it from stretching full width */
        align-self: flex-end;
        position: relative;
        z-index: 1100;
        pointer-events: auto;
    }

    /* Place brand on the left, hamburger on the right, menu full-width below */
    .nh-nav .nh-logo-text,
    .nh-header-logo {
        grid-column: 1;
        justify-self: start;
    }

    .nh-menu-icon {
        grid-column: 2;
        justify-self: end;
        margin-left: auto;
    }

    .nh-menu {
        grid-column: 1 / -1;
    }

    .nh-menu-icon .nh-bar {
        width: 22px;
        height: 2px;
        background-color: currentColor;
        border-radius: 2px;
    }

    /* Hide menu by default in portrait */
    .nh-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 12px;
        padding-top: 8px;
        position: relative;
        z-index: 1050;
        pointer-events: auto;
    }

    .nh-menu li a {
        font-size: 1rem;
        padding: 6px 0;
    }

    /* Open state: checkbox toggles the menu (works with label in between) */
    .nh-menu-toggle:checked ~ .nh-menu {
        display: flex;
    }

    .nh-project-media-row {
        flex-direction: column;
    }

    .nh-project-shot-frame {
        max-width: 240px;
    }

    .nh-feature-media-row {
        flex-direction: column;
    }

    .nh-feature-shot {
        width: 240px;
    }
}

/* ========== PROJECTS CAROUSEL (safety sizing) ========== */
/* Ensures carousel screenshots never render oversized even if page CSS fails to load */
.nh-carousel-track .nh-shot-frame,
.nh-carousel-track .nh-project-shot-frame {
    width: 160px;
    max-width: 160px;
}

.nh-carousel-track .nh-shot-img,
.nh-carousel-track .nh-project-shot-img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
}

@media (max-width: 640px) {
    .nh-carousel-track .nh-shot-frame,
    .nh-carousel-track .nh-project-shot-frame {
        width: 200px;
        max-width: 200px;
    }
}

@media (orientation: landscape) {
    .nh-menu-icon {
        display: none !important;
    }

    .nh-menu {
        display: flex !important;
    }
}