/* ===========================
   Base + tokens
   =========================== */

:root {
    --bg: #FFFFFF;
    --bg-alt: #F5F5F5;
    --border-subtle: #E5E5E5;
    --border-muted: #CCCCCC;
    --text-main: #333333;
    --text-muted: #888888;
    --max-width: 1040px;
    --radius-soft: 10px;
    --radius-pill: 999px;
    --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.06);
    --transition-fast: 180ms ease-out;
    --gap-xl: 3rem;
    --gap-lg: 2rem;
    --gap-md: 1.5rem;
    --gap-sm: 1rem;
    --gap-xs: 0.5rem;
}

.group-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.group-card-link:hover,
.group-card-link:focus-visible {
    text-decoration: none;
}

/* Global reset-ish */

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

html, body {
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
}

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

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

main {
    min-height: 60vh;
}

/* Accessibility */

.skip-link {
    position: absolute;
    left: -999px;
    padding: 0.5rem 1rem;
    background: var(--text-main);
    color: #fff;
    z-index: 1000;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

/* ===========================
   Layout shells
   =========================== */

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

.section {
    padding: 4rem 0;
}

.section-muted {
    background-color: var(--bg-alt);
}

.section-hero {
    padding-top: 6rem;
    padding-bottom: 4.5rem;
}

.section-hero-compact {
    padding-top: 5rem;
    padding-bottom: 2rem;
}

/* ===========================
   Header / Navigation
   =========================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 0.75rem;
}

/* Logo */

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.logo-mark {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid var(--text-main);
}

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

/* Navigation */

.site-nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.site-nav a {
    position: relative;
    padding-block: 0.25rem;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 1px;
    background: var(--text-main);
    transition: width var(--transition-fast);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
    width: 100%;
}

/* Mobile nav toggle */

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.nav-toggle-line {
    display: block;
    width: 18px;
    height: 1px;
    background: var(--text-main);
    margin-block: 4px;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* ===========================
   Hero
   =========================== */

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
    gap: var(--gap-xl);
    align-items: center;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.section h1,
.section-hero h1 {
    font-size: clamp(2.2rem, 3vw, 2.8rem);
    margin: 0 0 0.75rem;
    letter-spacing: 0.04em;
}

.hero-subtitle {
    max-width: 34rem;
    color: var(--text-muted);
    margin: 0 0 1.75rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-meta {
    display: grid;
    gap: 0.75rem;
}

.hero-card {
    border-radius: var(--radius-soft);
    border: 1px solid var(--border-subtle);
    padding: 1rem 1.25rem;
    background: #fff;
}

.hero-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    margin: 0 0 0.25rem;
}

.hero-value {
    margin: 0;
    font-size: 0.95rem;
}

/* ===========================
   Typography: headings, sections
   =========================== */

.section h2 {
    font-size: 1.4rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 0.75rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.section-heading {
    margin-bottom: var(--gap-lg);
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: var(--gap-xl);
    align-items: flex-start;
}

/* ===========================
   Buttons
   =========================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    padding: 0.6rem 1.4rem;
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
}

.btn.primary {
    background: var(--text-main);
    color: #fff;
    border-color: var(--text-main);
}

.btn.primary:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.btn.ghost {
    border-color: var(--border-muted);
    background: rgba(0, 0, 0, 0);
}

.btn.ghost:hover {
    background: #fff;
}

.btn.subtle {
    border-color: var(--border-subtle);
    background: #fff;
}

.btn.subtle:hover {
    box-shadow: var(--shadow-soft);
}

/* ===========================
   Project grid
   =========================== */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--gap-lg);
}

.project-card {
    border-radius: var(--radius-soft);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition:
        box-shadow var(--transition-fast),
        transform var(--transition-fast),
        border-color var(--transition-fast);
}

.project-card:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
    border-color: var(--border-muted);
}

.project-media {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-media.placeholder {
    background: linear-gradient(
        135deg,
        #f8f8f8,
        #f2f2f2
    );
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.project-media-label {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
}

.project-body {
    padding: 1.25rem 1.25rem 1.35rem;
    display: grid;
    gap: 0.45rem;
}

.project-title {
    font-size: 1rem;
    margin: 0;
}

.project-meta {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}

.project-description {
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Highlight 3D card subtly */
.project-card-3d .project-media.placeholder {
    background: linear-gradient(
        135deg,
        #f5f5f5,
        #e5e5e5
    );
}

/* ===========================
   3D page layout
   =========================== */

.three-d-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr);
    gap: var(--gap-xl);
    align-items: flex-start;
}

.three-d-viewer-frame {
    border-radius: var(--radius-soft);
    border: 1px solid var(--border-subtle);
    background: #fff;
    min-height: 320px;
    padding: 1rem;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.viewer-placeholder {
    margin: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.three-d-info-panel {
    display: grid;
    gap: var(--gap-md);
}

.meta-list {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.meta-list dt {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}

.meta-list dd {
    margin: 0.1rem 0 0;
}

/* ===========================
   Contact
   =========================== */

.contact-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.contact-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.contact-list span {
    width: 80px;
    color: var(--text-muted);
}

.contact-chat-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: var(--gap-lg);
    align-items: start;
}

.contact-chat-sidebar {
    display: grid;
    gap: 1rem;
}

.contact-card,
.contact-chat-panel {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.contact-card {
    padding: 1.1rem 1.15rem;
}

.contact-card-label,
.upload-summary-label,
.chat-bubble-label {
    margin: 0 0 0.65rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
}

.contact-points {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.45rem;
    color: var(--text-main);
}

.contact-chat-panel {
    padding: 1.25rem;
    display: grid;
    gap: 1rem;
}

.chat-thread {
    display: grid;
    gap: 0.75rem;
}

.chat-bubble {
    max-width: 38rem;
    padding: 0.95rem 1rem;
    border-radius: 18px 18px 18px 6px;
    background: #fff;
    border: 1px solid var(--border-subtle);
}

.chat-bubble p {
    margin: 0;
}

.chat-bubble-muted {
    background: #fafafa;
}

.contact-chat-form {
    display: grid;
    gap: 1rem;
}

.contact-chat-grid {
    display: grid;
    gap: 1rem;
}

.contact-chat-grid.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.upload-row {
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.9fr);
    align-items: start;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field span {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    background: #fff;
    color: var(--text-main);
    font: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.field textarea {
    resize: vertical;
    min-height: 150px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--text-main);
    box-shadow: 0 0 0 4px rgba(51, 51, 51, 0.08);
}

.field-note {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.upload-summary {
    min-height: 100%;
    border: 1px dashed var(--border-muted);
    border-radius: 14px;
    padding: 1rem;
    background: #fcfcfc;
}

.file-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background: var(--bg-alt);
    border: 1px solid var(--border-subtle);
    font-size: 0.82rem;
}

.file-chip strong {
    font-weight: 600;
}

.empty-file-state {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.contact-chat-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.contact-chat-meta {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    max-width: 38rem;
}

.contact-chat-status {
    min-height: 1.5rem;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.contact-chat-status.is-pending {
    color: var(--text-main);
    background: #fafafa;
}

.contact-chat-status.is-success {
    color: #115c2c;
    background: #eef8f0;
    border-color: #cfe7d5;
}

.contact-chat-status.is-error {
    color: #8f2b2b;
    background: #fff1f1;
    border-color: #efcaca;
}

/* ===========================
   Filter Bar & Search
   =========================== */

.filter-bar {
    margin-top: var(--gap-lg);
    padding-top: var(--gap-lg);
    border-top: 1px solid var(--border-subtle);
}

.filter-controls {
    display: flex;
    gap: var(--gap-sm);
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-soft);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg);
    color: var(--text-main);
    transition: border-color var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--text-main);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.btn-filter-reset {
    padding: 0.75rem 1.25rem;
    background: var(--bg-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-soft);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-main);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-filter-reset:hover {
    background: var(--text-main);
    color: var(--bg);
}

/* ===========================
   Project Tags & Actions
   =========================== */

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: var(--bg-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--text-main);
    color: var(--bg);
    border-color: var(--text-main);
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.project-actions .btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

/* ===========================
   Footer
   =========================== */

.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding-block: 1.5rem;
    background: #fff;
}

.footer-inner {
    display: flex;
    justify-content: center;
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 900px) {
    .hero-inner,
    .two-column,
    .three-d-layout {
        grid-template-columns: 1fr;
        gap: var(--gap-lg);
    }

    .contact-chat-layout,
    .contact-chat-grid.two-up,
    .upload-row {
        grid-template-columns: 1fr;
    }

    .section-hero {
        padding-top: 5rem;
    }
}

@media (max-width: 720px) {
    /* mobile nav */
    .site-nav {
        position: absolute;
        inset-inline: 0;
        top: 100%;
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid var(--border-subtle);
        transform-origin: top center;
        transform: scaleY(0.7);
        opacity: 0;
        pointer-events: none;
        transition: transform var(--transition-fast), opacity var(--transition-fast);
    }

    .site-nav ul {
        flex-direction: column;
        padding: 0.75rem 1.5rem 1.25rem;
        gap: 0.75rem;
    }

    .site-header.nav-open .site-nav {
        opacity: 1;
        pointer-events: auto;
        transform: scaleY(1);
    }

    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .shell {
        padding-inline: 1rem;
    }
}

/* ===========================
   Section heading accent
   =========================== */

.section-heading h2 {
    position: relative;
    padding-bottom: 0.7rem;
    margin-bottom: 0.5rem;
}

.section-heading h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 2.5rem;
    height: 2px;
    background: var(--text-main);
    border-radius: 1px;
}

/* ===========================
   Tile overlay cards (gallery / model tiles)
   =========================== */

.group-tile {
    border: none;
    background: transparent;
    overflow: hidden;
    border-radius: var(--radius-soft);
}

.group-tile .group-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tile-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #1c1c2e;
    border-radius: var(--radius-soft);
    flex: 1;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.group-tile:hover .tile-media {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    transform: translateY(-3px);
}

.tile-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease-out;
}

.group-tile:hover .tile-media img {
    transform: scale(1.05);
}

.tile-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.18) 50%,
        transparent 80%
    );
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    pointer-events: none;
}

.tile-title {
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
}

.tile-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}

.tile-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8e8e8, #d4d4d4);
}

.model-placeholder {
    background: linear-gradient(135deg, #1c1c2e, #2d2d44);
}

.placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.2;
    color: #fff;
}

/* ===========================
   Project grid – two‑tier (content + models)
   =========================== */

#content-grid,
#models-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Gallery image card in project-detail page */
.gallery-img-card .project-body {
    display: none;
}