/* ================================================================
   MAKE3D Web — Style
   Dark industrial precision aesthetic (matches Sure Precision)
   ================================================================ */

:root {
    --bg:           #0a0a0c;
    --bg-raised:    #111114;
    --bg-card:      #16161a;
    --bg-input:     #1a1a1f;
    --border:       #2a2a30;
    --border-light: #3a3a42;
    --text:         #e8e8ec;
    --text-dim:     #8888a0;
    --text-muted:   #555568;
    --accent:       #00d4aa;
    --accent-dim:   #00a882;
    --accent-glow:  rgba(0, 212, 170, 0.15);
    --danger:       #ff4466;
    --warning:      #ffaa22;
    --success:      #00d4aa;
    --mono:         'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --sans:         'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius:       6px;
    --radius-lg:    10px;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}
a:hover { opacity: 0.8; }

code, pre {
    font-family: var(--mono);
}

.hidden { display: none !important; }


/* ── Nav ───────────────────────────────────────────────────── */

.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
}
.nav-brand:hover { opacity: 1; }

.nav-monogram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: var(--bg);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    border-radius: 4px;
}

.nav-title {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.nav-subtitle {
    display: block;
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    opacity: 1;
}


/* ── Buttons ───────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-dim);
    border-color: var(--accent-dim);
    opacity: 1;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border-color: var(--border);
}
.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text-dim);
    opacity: 1;
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* ── Tags ──────────────────────────────────────────────────── */

.tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    background: rgba(255,255,255,0.04);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.tag-primary {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(0, 212, 170, 0.3);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
}


/* ── Hero ──────────────────────────────────────────────────── */

.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4rem 1.5rem;
}

.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,212,170,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,212,170,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 80%);
}

.hero-content {
    position: relative;
    max-width: 720px;
    text-align: center;
}

.hero-badge {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.hero-title {
    font-family: var(--sans);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-accent {
    background: linear-gradient(135deg, var(--accent), #00f0c0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.05rem;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto 2.5rem;
}

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


/* ── Sections ──────────────────────────────────────────────── */

.section {
    padding: 5rem 1.5rem;
}

.section-dark {
    background: var(--bg-raised);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-cta {
    padding: 4rem 1.5rem;
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.section-label {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 3rem;
    letter-spacing: -0.01em;
}


/* ── Steps ─────────────────────────────────────────────────── */

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

.step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: border-color 0.3s;
}

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

.step-num {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.step h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.step p {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.6;
}

.step-example {
    margin-top: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}

.step-example code {
    font-size: 0.75rem;
    color: var(--accent);
    line-height: 1.5;
    word-break: break-word;
}


/* ── Cards ─────────────────────────────────────────────────── */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all 0.3s;
}

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

.card-icon {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
}


/* ── Footer ────────────────────────────────────────────────── */

.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer p {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}


/* ================================================================
   GENERATE PAGE
   ================================================================ */

.generate-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.gen-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.gen-sub {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}


/* Prompt box */

.prompt-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.3s;
    margin-bottom: 1.5rem;
}

.prompt-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.prompt-box textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.9rem;
    padding: 1.25rem;
    resize: vertical;
    min-height: 100px;
    outline: none;
    line-height: 1.6;
}

.prompt-box textarea::placeholder {
    color: var(--text-muted);
}

.prompt-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
}

.char-count {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}


/* Options */

.gen-options {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.opt-group {
    flex: 1;
    min-width: 200px;
}

.opt-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.opt-row {
    display: flex;
    gap: 0.4rem;
}

.opt-btn {
    font-family: var(--mono);
    font-size: 0.72rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-card);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.opt-btn:hover {
    border-color: var(--border-light);
    color: var(--text);
}

.opt-btn.active {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(0, 212, 170, 0.3);
}


/* Example chips */

.examples {
    margin-bottom: 2rem;
}

.examples-label {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.example-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip {
    font-family: var(--mono);
    font-size: 0.7rem;
    padding: 0.35rem 0.7rem;
    background: var(--bg-card);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

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


/* Generate button */

.btn-generate {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: 1rem;
}

/* Viewer embed */

.viewer-embed {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #0c1117;
}

.viewer-embed iframe {
    width: 100%;
    height: 420px;
    display: block;
    border: none;
}


/* ── Progress Panel ────────────────────────────────────────── */

.gen-progress-inner {
    margin-top: 1rem;
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-prompt {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--accent);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    word-break: break-word;
}

.progress-log {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.log-entry {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    padding: 0.4rem 0.75rem;
    background: var(--bg-card);
    border-left: 2px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) 0;
    animation: fadeIn 0.3s ease;
}

.log-entry.done {
    border-left-color: var(--accent);
    color: var(--accent);
}

.log-entry.error {
    border-left-color: var(--danger);
    color: var(--danger);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}


/* ── Results Panel ─────────────────────────────────────────── */

.gen-results-inner {
    margin-top: 1rem;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

/* Spec summary */

.spec-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

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

.spec-item-label {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.spec-item-value {
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}


/* Manufacturing badge */

.mfg-badge {
    margin-bottom: 1.25rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mfg-ready {
    background: rgba(0, 212, 170, 0.08);
    border: 1px solid rgba(0, 212, 170, 0.25);
    color: var(--success);
}

.mfg-caution {
    background: rgba(255, 170, 34, 0.08);
    border: 1px solid rgba(255, 170, 34, 0.25);
    color: var(--warning);
}

.mfg-not-ready {
    background: rgba(255, 68, 102, 0.08);
    border: 1px solid rgba(255, 68, 102, 0.25);
    color: var(--danger);
}


/* File list */

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    transition: border-color 0.2s;
}

.file-row:hover {
    border-color: var(--border-light);
}

.file-row-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-ext {
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    background: rgba(255,255,255,0.04);
    color: var(--text-dim);
    border: 1px solid var(--border);
    min-width: 44px;
    text-align: center;
}

.file-ext-step {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(0, 212, 170, 0.3);
}

.file-name {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--text);
}

.file-size {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.file-dl {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--accent);
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.file-dl:hover {
    background: var(--accent-glow);
    opacity: 1;
}


/* Metrics */

.metrics-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
}

.metrics-panel h3 {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.metric-label {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.metric-value {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
}


/* ================================================================
   GALLERY PAGE
   ================================================================ */

.gallery-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.gallery-header {
    margin-bottom: 2rem;
}

.gallery-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.gallery-header p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

.gallery-empty p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

.gallery-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.3s;
}

.gallery-card:hover {
    border-color: var(--border-light);
}

.gallery-card-top {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.gallery-card-type {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.gallery-card-body {
    padding: 1rem 1.25rem;
}

.gallery-card-prompt {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.gallery-card-time {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.gallery-card-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.gallery-file-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 3px;
    transition: all 0.2s;
}

.gallery-file-link:hover {
    border-color: var(--accent);
    opacity: 1;
}

.gallery-file-ext {
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent);
}

.gallery-file-size {
    font-family: var(--mono);
    font-size: 0.55rem;
    color: var(--text-muted);
}


/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 640px) {
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.72rem; }
    .hero { min-height: 60vh; padding: 3rem 1rem; }
    .steps { grid-template-columns: 1fr; }
    .cards { grid-template-columns: 1fr; }
    .gen-options { flex-direction: column; gap: 1rem; }
    .gallery-grid { grid-template-columns: 1fr; }
    .spec-summary { grid-template-columns: 1fr 1fr; }
    .footer-inner { flex-direction: column; text-align: center; }
}
