/* ============================
   NORTHBUILT CARPENTRY — Styles
   ============================ */

:root {
    --bg: #0d1a34;
    --surface: #142549;
    --surface-2: #1b2f5c;
    --text: #f5f7fb;
    --muted: #9caccb;
    --accent: #c8202b;        /* maple red */
    --accent-strong: #e0343f;
    --accent-dim: rgba(200, 32, 43, 0.16);
    --border: rgba(245, 247, 251, 0.10);
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-w: 1040px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section__eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    margin-bottom: 0.85rem;
}

/* ===== NAV ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.55rem 0;
    background: rgba(13, 26, 52, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav__inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.01em;
    line-height: 1;
}
.nav__logo img {
    height: 42px;
    width: auto;
    display: block;
}
@media (max-width: 640px) {
    .nav__logo img { height: 36px; }
}

.nav__links {
    display: flex;
    list-style: none;
    gap: 1.75rem;
}

.nav__links a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.nav__links a:hover { color: var(--text); }

.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav__toggle span {
    width: 22px;
    height: 1.5px;
    background: var(--text);
    transition: 0.2s;
}

.hero {
    min-height: 88vh;
    display: flex;
    align-items: flex-end;
    padding: 6rem 0 5rem;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1200px 500px at 15% 10%, rgba(200, 32, 43, 0.10), transparent 70%),
        linear-gradient(180deg, var(--surface-2) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}

/* Cross-fading hero photo cycler (JS populates .hero__bg with <img> tags) */
.hero__bg {
    position: absolute; inset: 0;
    z-index: 0;
    overflow: hidden;
}
.hero__bg-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transform: scale(1.06);
    transition: opacity 1.1s ease-in-out, transform 8s ease-out;
    filter: brightness(0.62) contrast(1.05) saturate(0.95);
    will-change: opacity, transform;
}
.hero__bg-img.is-active {
    opacity: 1;
    transform: scale(1.0);
}
.hero__scrim {
    position: absolute; inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(10,20,44,0.90) 0%, rgba(10,20,44,0.65) 45%, rgba(10,20,44,0.32) 75%, rgba(10,20,44,0.58) 100%),
        linear-gradient(180deg, rgba(10,20,44,0.35) 0%, transparent 30%, transparent 60%, rgba(10,20,44,0.80) 100%),
        radial-gradient(1400px 800px at 78% 30%, rgba(200,32,43,0.16), transparent 65%);
}
.hero__content {
    position: relative;
    z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
    .hero__bg-img { transition: none; transform: none; }
}

.hero__content {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.hero__eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 9vw, 6rem);
    font-weight: 600;
    line-height: 0.98;
    color: var(--text);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero__subtitle {
    font-size: 1.15rem;
    color: var(--muted);
    margin-bottom: 2.5rem;
    max-width: 560px;
    font-weight: 300;
    line-height: 1.6;
}

.hero__ctas {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.85rem 1.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    letter-spacing: 0.02em;
    font-family: var(--font-body);
}

.btn--primary {
    background: var(--accent);
    color: #ffffff;
}

.btn--primary:hover {
    background: var(--accent-strong);
    transform: translateY(-1px);
}

.btn--outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn--outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== SECTIONS ===== */
.section {
    padding: 6rem 0;
}

.section h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 600;
    line-height: 1.15;
    margin-bottom: 1.75rem;
    color: var(--text);
    letter-spacing: -0.015em;
}

/* ===== ABOUT ===== */
.about {
    border-top: 1px solid var(--border);
}

.about__grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 3.5rem;
    align-items: start;
}

.about__image {
    position: relative;
    background: var(--surface);
    border-radius: 6px;
    aspect-ratio: 3/4;
    border: 1px solid var(--border);
    overflow: hidden;
}

.about__image::before {
    /* subtle branded fallback shown until the first photo loads */
    content: '';
    position: absolute; inset: 0;
    background:
        linear-gradient(135deg, rgba(200, 32, 43, 0.10), transparent 60%),
        linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}
.about__image.is-ready::before { display: none; }

.about__image img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 900ms ease-in-out;
}
.about__image img.is-active { opacity: 1; }

.about__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.about__text p {
    color: var(--muted);
    margin-bottom: 1.25rem;
    font-size: 1rem;
    line-height: 1.8;
}

.about__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.stat__num {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat__label {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ===== SERVICES ===== */
.services {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}

.service {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.75rem;
    transition: border-color 0.2s, transform 0.2s;
}

.service:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.service__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: var(--accent-dim);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.service h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.service p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ===== PROJECTS ===== */
.projects__intro {
    color: var(--muted);
    margin-bottom: 0.75rem;
    max-width: 620px;
}

.projects__ig {
    margin: 0 0 2rem;
    font-size: 0.9rem;
}

.projects__ig a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    text-decoration: none;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: color 0.2s, border-color 0.2s;
}

.projects__ig a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.projects__ig strong { color: var(--text); font-weight: 600; }

.icon-ig { flex: 0 0 auto; }

/* Showcase carousel (auto-cycles project photos, hides missing files gracefully) */
.showcase {
    position: relative;
    margin-top: 1rem;
    background: #0e0906;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    max-height: 720px;
}

.showcase__placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: rgba(242, 234, 217, 0.35);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.2rem;
    letter-spacing: 0.06em;
    background:
        linear-gradient(135deg, rgba(214, 151, 82, 0.12), rgba(214, 151, 82, 0.02)),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 10px, transparent 10px 20px),
        var(--surface-2);
}
.showcase__placeholder::after {
    content: attr(data-placeholder);
}
.showcase.is-ready .showcase__placeholder { display: none; }

/* One slide = a blurred backdrop layer + a contained foreground layer.
   This lets portrait phone photos sit intact inside a landscape frame
   without being cropped, with the blurred image filling the letterbox. */
.showcase__slide {
    position: absolute; inset: 0;
    opacity: 0;
    transition: opacity 900ms ease-in-out;
}
.showcase__slide.is-active { opacity: 1; }

.showcase__img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
}
.showcase__img--bg {
    object-fit: cover;
    object-position: center;
    filter: blur(28px) brightness(0.55) saturate(1.1);
    transform: scale(1.15);
}
.showcase__img--fg {
    object-fit: contain;
    object-position: center;
    z-index: 1;
}

.showcase__caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    padding: 1.5rem 1.5rem 1.25rem;
    display: flex; flex-direction: column; gap: 0.15rem;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(10,20,44,0.85) 60%, rgba(10,20,44,0.95) 100%);
    pointer-events: none;
}
.showcase.is-empty .showcase__caption { display: none; }
.showcase__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}
.showcase__meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.showcase__dots {
    position: absolute;
    right: 1rem; bottom: 1rem;
    z-index: 3;
    display: flex; gap: 0.35rem;
}
.showcase__dots span {
    width: 6px; height: 6px; border-radius: 999px;
    background: rgba(242, 234, 217, 0.35);
    transition: background 0.25s, transform 0.25s;
}
.showcase__dots span.is-active {
    background: var(--accent);
    transform: scale(1.35);
}
.showcase.is-empty .showcase__dots { display: none; }

@media (max-width: 640px) {
    .showcase { aspect-ratio: 4 / 5; }
}

.projects__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.project {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project__img {
    width: 100%;
    aspect-ratio: 4/3;
    background:
        linear-gradient(135deg, rgba(214, 151, 82, 0.12), rgba(214, 151, 82, 0.02)),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 10px, transparent 10px 20px),
        var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    position: relative;
}

.project__img::after {
    content: attr(data-placeholder);
    color: rgba(242, 234, 217, 0.35);
    font-family: var(--font-display);
    font-style: italic;
}

img.project__img::after { content: none; }

.project figcaption {
    padding: 1rem 1.15rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.project figcaption strong {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.project figcaption span {
    color: var(--muted);
    font-size: 0.82rem;
}

/* ===== PROCESS ===== */
.process {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.process__list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.process__list li {
    display: flex;
    gap: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    align-items: flex-start;
}

.process__num {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    min-width: 2.5rem;
}

.process__list h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.process__list p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ===== CONTACT ===== */
.contact {
    border-top: 1px solid var(--border);
}

.contact__sub {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
    max-width: 560px;
}

.contact__phone,
.footer__phone {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
}

.contact__phone:hover,
.footer__phone:hover { color: var(--accent-strong); }

.contact__quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.25rem;
}

.contact__text-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.contact__note {
    grid-column: 1 / -1;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.5rem;
    line-height: 1.5;
}

.contact__form {
    max-width: 720px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form__group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form__group--full { grid-column: 1 / -1; }

.form__group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form__group input,
.form__group select,
.form__group textarea {
    padding: 0.85rem 0.95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form__group textarea { resize: vertical; min-height: 120px; }

.form__group input:focus,
.form__group select:focus,
.form__group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form__group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a89880' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.contact__form .btn { grid-column: 1 / -1; justify-self: start; }

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0 2rem;
    background: var(--surface);
}

.footer__inner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.footer__mark {
    width: 96px;
    height: auto;
    display: block;
    margin-bottom: 0.75rem;
    border-radius: 6px;
}

.footer__logo {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.footer__tag {
    font-size: 0.8rem;
    color: var(--muted);
}

.footer__social {
    margin-top: 0.85rem;
}

.footer__social a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer__social a:hover { color: var(--accent); }

.footer__links {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer__links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer__links a:hover { color: var(--accent); }

.footer__copy {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: right;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .services__grid { grid-template-columns: repeat(2, 1fr); }
    .projects__grid { grid-template-columns: repeat(2, 1fr); }
    .process__list { grid-template-columns: 1fr; }
    .about__grid { grid-template-columns: 260px 1fr; gap: 2.25rem; }
}

@media (max-width: 640px) {
    .nav__links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(13, 26, 52, 0.98);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.25rem;
        border-bottom: 1px solid var(--border);
    }
    .nav__links.active { display: flex; }
    .nav__toggle { display: flex; }

    .section { padding: 4rem 0; }
    .hero { min-height: 78vh; padding: 5rem 0 3.5rem; }

    .about__grid { grid-template-columns: 1fr; gap: 2rem; }
    .about__image { max-width: 280px; }
    .about__stats { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
    .stat__num { font-size: 1.4rem; }
    .stat__label { font-size: 0.7rem; }

    .services__grid { grid-template-columns: 1fr; }
    .projects__grid { grid-template-columns: 1fr; }
    .contact__form { grid-template-columns: 1fr; }

    .footer__inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.25rem;
    }
    .footer__copy { text-align: center; }
    .footer__links { justify-content: center; }

    .hero__ctas .btn { width: 100%; text-align: center; }
}
