/* ==========================================================================
   QuantaNueva — shared styles for the portfolio page and project case studies
   ========================================================================== */

:root {
    --bg-deep: #050b18;
    --bg-navy: #0B1F3F;
    --cyan: #13C6D3;
    --neon-cyan: #0ea5e9;
    --light-cyan: rgba(19, 198, 211, 0.1);
    --text-main: #E2E8F0;
    --text-dim: #94A3B8;
    --white: #FFFFFF;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    color: var(--text-main);
    line-height: 1.7;
    background-color: var(--bg-deep);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(19, 198, 211, 0.1), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(14, 165, 233, 0.08), transparent 40%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    background-attachment: fixed;
    min-height: 100vh;
}

/* Navigation -------------------------------------------------------------
   Scoped to .site-nav on purpose: the case-study pages also use <nav> for
   the breadcrumb and the previous/next links, which must not inherit the
   sticky white header treatment.
   ----------------------------------------------------------------------- */
.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container { display: flex; align-items: center; }

.logo-img {
    height: 42px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo-img:hover { transform: scale(1.05); }

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    margin-right: auto;
    margin-left: 3rem;
}

.nav-links a {
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
}

.nav-links a:hover, .nav-links a.active { color: #0f172a; }

.nav-links a.active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--cyan);
}

/* Buttons ---------------------------------------------------------------- */
.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--cyan), var(--neon-cyan));
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.4s ease;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(19, 198, 211, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(19, 198, 211, 0.4);
    filter: brightness(1.1);
}

.btn-outline {
    display: inline-block;
    background: transparent;
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.btn-outline:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    transform: translateY(-2px);
}

/* Page header ------------------------------------------------------------ */
.page-header {
    padding: 9rem 5% 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(19, 198, 211, 0.1) 0%, transparent 70%);
    z-index: -1;
    filter: blur(60px);
}

.eyebrow {
    display: inline-block;
    background: var(--light-cyan);
    color: var(--cyan);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.75rem;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 1px solid rgba(19, 198, 211, 0.2);
}

.page-header h1 {
    font-size: 3.75rem;
    color: var(--white);
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
    font-weight: 800;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-header p {
    font-size: 1.2rem;
    color: var(--text-dim);
    max-width: 780px;
    margin: 0 auto;
}

/* Photo slots ------------------------------------------------------------
   Each slot points at a file in /images. Until that file exists the image
   fails to load, the <img> removes itself and the slot shows the expected
   filename instead. Drop the file in with the right name and the photo
   simply appears — no markup changes needed.
   ----------------------------------------------------------------------- */
.photo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 30%, rgba(19, 198, 211, 0.16), transparent 60%),
        linear-gradient(135deg, rgba(11, 31, 63, 0.9), rgba(5, 11, 24, 0.95));
}

.photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo.is-empty::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.photo-note {
    display: none;
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1.5rem;
    color: var(--text-dim);
    font-size: 0.78rem;
    letter-spacing: 1px;
    line-height: 1.6;
}

.photo.is-empty .photo-note { display: block; }

.photo-note strong {
    display: block;
    color: var(--cyan);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.photo-note code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--text-main);
    font-size: 0.78rem;
    word-break: break-all;
}

/* Portfolio listing ------------------------------------------------------ */
.portfolio-section { padding: 2rem 5% 4rem; }

.portfolio-section:last-of-type { padding-bottom: 8rem; }

.section-head {
    max-width: 1280px;
    margin: 0 auto 2.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.25rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-head h2 {
    font-size: 1.85rem;
    color: var(--white);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.section-head p {
    color: var(--text-dim);
    font-size: 0.95rem;
    max-width: 520px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2.5rem;
    max-width: 1280px;
    margin: 0 auto;
}

.project-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.project-card:hover {
    transform: translateY(-12px);
    border-color: rgba(19, 198, 211, 0.3);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

.project-card .photo {
    aspect-ratio: 4 / 3;
    border-bottom: 1px solid var(--glass-border);
}

.project-card-body {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-tag {
    color: var(--cyan);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}

.project-card-body h3 {
    font-size: 1.4rem;
    color: var(--white);
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.35;
    margin-bottom: 0.4rem;
}

.project-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1.1rem;
}

.project-card-body p {
    color: var(--text-dim);
    font-size: 0.97rem;
    margin-bottom: 1.75rem;
}

.card-link {
    margin-top: auto;
    color: var(--cyan);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.project-card:hover .card-link { gap: 0.9rem; }
.card-link span { transition: all 0.3s ease; }

/* Case study ------------------------------------------------------------- */
.breadcrumb {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2.5rem 5% 0;
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--cyan); }

.case-header {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem 5% 3rem;
}

.case-header h1 {
    font-size: 3rem;
    color: var(--white);
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.case-header .lede {
    font-size: 1.15rem;
    color: var(--text-dim);
    max-width: 720px;
}

.case-hero {
    max-width: 1080px;
    margin: 0 auto 4rem;
    padding: 0 5%;
}

/* Collage hero: one tall photo alongside two stacked ones. Site photography
   is shot on phones and comes in portrait, so a single wide banner would crop
   the building out of frame. */
.hero-collage {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1.25rem;
    aspect-ratio: 4 / 3;
}

.hero-collage .photo {
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    min-height: 0;
    min-width: 0;
}

.hero-collage .photo:first-child {
    grid-row: 1 / span 2;
    border-radius: 24px;
}

.case-hero .photo:only-child {
    aspect-ratio: 16 / 9;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
}

.case-body {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 5%;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 4rem;
    align-items: start;
}

.case-body h2 {
    font-size: 1.5rem;
    color: var(--white);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 2.5rem 0 1rem;
}

.case-body h2:first-child { margin-top: 0; }

.case-body p {
    color: var(--text-dim);
    margin-bottom: 1.25rem;
}

.case-body ul {
    color: var(--text-dim);
    margin: 0 0 1.25rem 1.25rem;
}

.case-body li { margin-bottom: 0.6rem; }

.fact-panel {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    position: sticky;
    top: 6rem;
}

.fact-panel h3 {
    font-size: 0.75rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.fact-panel dl { margin: 0; }

.fact-panel dt {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.fact-panel dd {
    margin: 0.2rem 0 1.25rem;
    color: var(--white);
    font-size: 0.98rem;
    line-height: 1.5;
}

.fact-panel dd:last-child { margin-bottom: 0; }

.quote {
    max-width: 1080px;
    margin: 5rem auto 0;
    padding: 0 5%;
}

.quote blockquote {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--cyan);
    border-radius: 16px;
    padding: 2.5rem;
    font-size: 1.2rem;
    color: var(--text-main);
    line-height: 1.7;
    font-style: italic;
}

.quote cite,
.quote figcaption {
    display: block;
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-style: normal;
    font-weight: 600;
}

.quote figcaption { padding-inline-start: 1rem; }

.gallery {
    max-width: 1080px;
    margin: 5rem auto 0;
    padding: 0 5%;
}

.gallery h2 {
    font-size: 1.5rem;
    color: var(--white);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 1.75rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-grid .photo {
    aspect-ratio: 3 / 4;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.case-nav {
    max-width: 1080px;
    margin: 5rem auto 0;
    padding: 2.5rem 5% 0;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.case-nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.case-nav a:hover { color: var(--cyan); }
.case-nav .label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--cyan);
    margin-bottom: 0.3rem;
}

/* Call to action --------------------------------------------------------- */
.cta {
    margin-top: 7rem;
    padding: 7rem 5%;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--glass-border);
}

.cta h2 {
    font-size: 2.5rem;
    color: var(--white);
    margin-bottom: 1.25rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.cta p {
    color: var(--text-dim);
    max-width: 660px;
    margin: 0 auto 2.5rem;
    font-size: 1.1rem;
}

.cta-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Footer ----------------------------------------------------------------- */
footer {
    background-color: var(--white);
    color: #475569;
    padding: 6rem 5% 4rem;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-logo { height: 40px; margin-bottom: 2.5rem; }

footer p { margin-bottom: 0.8rem; font-size: 0.9rem; }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .btn-primary.header-btn { display: none; }
    .page-header { padding-top: 5rem; }
    .page-header h1 { font-size: 2.75rem; }
    .project-grid { grid-template-columns: 1fr; max-width: 560px; }
    .case-body { grid-template-columns: 1fr; gap: 3rem; }
    .fact-panel { position: static; }
    .case-header h1 { font-size: 2.25rem; }
    .hero-collage {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        aspect-ratio: auto;
    }
    .hero-collage .photo { aspect-ratio: 3 / 4; }
    .hero-collage .photo:first-child { grid-row: auto; }
}

@media (max-width: 600px) {
    .page-header h1 { font-size: 2.1rem; letter-spacing: -1px; }
    .page-header p { font-size: 1.05rem; }
    .project-card { border-radius: 16px; }
    .project-card-body { padding: 1.5rem; }
    .case-header h1 { font-size: 1.9rem; }
    .quote blockquote { padding: 1.75rem; font-size: 1.05rem; }
    .cta h2 { font-size: 1.85rem; }
}

/* Four-photo gallery: one row of four on desktop, two by two below. */
.gallery-grid--four {
    grid-template-columns: repeat(4, 1fr);
}

.office-gallery figure { min-width: 0; }

.office-gallery .photo { aspect-ratio: 1; }

.office-gallery .photo:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.office-gallery figcaption {
    margin-top: 0.65rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}

@media (max-width: 900px) {
    .gallery-grid--four { grid-template-columns: repeat(2, 1fr); }
}

/* Three portrait photos side by side, for projects shot entirely in portrait. */
.hero-trio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.hero-trio .photo {
    aspect-ratio: 3 / 4;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    min-width: 0;
}

/* Two-item gallery: kept to a sensible width rather than stretching. */
.gallery-grid--pair {
    grid-template-columns: repeat(2, minmax(0, 380px));
    justify-content: center;
}

.photo--video { background: #050b18; }

.photo--video video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 700px) {
    .hero-trio { grid-template-columns: 1fr; }
    .gallery-grid--pair { grid-template-columns: 1fr; }
}
