/* Orbem Order CAD Solutions: theme styles.
   Tokens and components follow Homepage-html/ design reference. */

:root {
	--surface-000: #ffffff;
	--surface-100: #f6f8f9;
	--surface-200: #eaeff2;
	--grid-100: #e2eaee;
	--line-200: #dbe3e8;
	--line-400: #8597a2;
	--ink-900: #0e1a21;
	--ink-600: #4a5a64;
	--ink-500: #5a6a74;
	--ink-inverse: #f6f8f9;
	--ink-inverse-muted: #b8c6ce;
	--teal-500: #14bbde;
	--teal-700: #0a7690;
	--teal-100: #e1f6fb;
	--dim-500: #e8590c;
	--dim-700: #c2410c;
	--success-600: #1f8a4c;
	--error-600: #c62a2a;
	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-6: 24px;
	--space-8: 32px;
	--space-12: 48px;
	--space-16: 64px;
	--space-24: 96px;
	--radius-sm: 2px;
	--radius-md: 6px;
	--radius-lg: 10px;
	--radius-pill: 999px;
	--shadow-sm: 0 1px 2px rgba(14, 26, 33, .06);
	--shadow-md: 0 8px 24px rgba(14, 26, 33, .08), 0 1px 2px rgba(14, 26, 33, .06);
	--font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
	--font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
	--gutter: clamp(20px, 4vw, 64px);
	--section-y: clamp(64px, 8vw, 96px);
	--nav-h: 73px;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body { margin: 0; }
.oc-root { font-family: var(--font-sans); color: var(--ink-900); background: var(--surface-100); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--teal-700); }
a:hover { color: var(--ink-900); }
img, svg, canvas { display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.oc-skip { position: absolute; left: var(--space-4); top: -100px; z-index: 100; background: var(--ink-900); color: var(--ink-inverse); padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); }
.oc-skip:focus { top: var(--space-4); }

/* Layout helpers */
.oc-wrap { max-width: 1280px; margin: 0 auto; }
.oc-section { padding: var(--section-y) var(--gutter); }
.oc-section--alt { background: var(--surface-200); border-top: 1px solid var(--line-200); border-bottom: 1px solid var(--line-200); }
.oc-stack-48 { display: flex; flex-direction: column; gap: var(--space-12); }
.oc-stack-16 { display: flex; flex-direction: column; gap: var(--space-4); }
.oc-measure { max-width: 680px; }
.oc-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.oc-row--tight { gap: var(--space-2); }
.oc-section__head--split { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-6); }

/* Blueprint grid ground */
.oc-grid { background-color: var(--surface-100); background-image: linear-gradient(var(--grid-100) 1px, transparent 1px), linear-gradient(90deg, var(--grid-100) 1px, transparent 1px); background-size: var(--space-12) var(--space-12); background-position: -1px -1px; }

/* Eyebrow / mono label */
.oc-eyebrow { font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-700); display: inline-flex; align-items: center; gap: var(--space-2); }
.oc-eyebrow::before { content: ""; width: var(--space-4); height: 1px; background: var(--teal-500); }

/* Buttons */
.oc-btn { font-family: var(--font-sans); font-size: 15px; line-height: 20px; font-weight: 600; display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) 20px; border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .15s; }
.oc-btn:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 2px; }
.oc-btn--primary { background: var(--ink-900); color: var(--ink-inverse); }
.oc-btn--primary:hover { background: #1d2e38; color: var(--ink-inverse); }
.oc-btn--accent { background: var(--teal-500); color: var(--ink-900); }
.oc-btn--accent:hover { background: #3fcbe8; color: var(--ink-900); }
.oc-btn--ghost { background: var(--surface-000); color: var(--ink-900); border-color: var(--line-400); }
.oc-btn--ghost:hover { border-color: var(--ink-900); color: var(--ink-900); }
.oc-btn .oc-arrow { transition: transform .15s; }
.oc-btn:hover .oc-arrow { transform: translateX(3px); }

/* Tags and badges */
.oc-tag { font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .04em; color: var(--ink-600); background: var(--surface-000); border: 1px solid var(--line-200); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); display: inline-block; }
.oc-tag--teal { background: var(--teal-100); border-color: transparent; color: var(--teal-700); }
.oc-badge { font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--ink-600); display: inline-flex; align-items: center; gap: var(--space-2); padding: 6px var(--space-3); border: 1px solid var(--line-200); border-radius: var(--radius-pill); background: var(--surface-000); }
.oc-badge::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--success-600); box-shadow: 0 0 0 0 rgba(31, 138, 76, .5); animation: oc-pulse 2.4s ease-out infinite; }
@keyframes oc-pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 138, 76, .45); } 70%, 100% { box-shadow: 0 0 0 6px rgba(31, 138, 76, 0); } }

/* Cards with drafting corner marks */
.oc-card { position: relative; background: var(--surface-000); border: 1px solid var(--line-200); border-radius: var(--radius-md); padding: var(--space-6); box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s, border-color .2s; }
.oc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-400); }
.oc-card::before, .oc-card::after { content: ""; position: absolute; width: 10px; height: 10px; border-color: var(--teal-500); border-style: solid; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 1; }
.oc-card::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: var(--radius-md); }
.oc-card::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: var(--radius-md); }
.oc-card:hover::before, .oc-card:hover::after { opacity: 1; }
.oc-card__num { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: var(--ink-500); }
.oc-card__icon { width: 40px; height: 40px; margin: var(--space-4) 0; color: var(--teal-700); }
.oc-card__title { font-family: var(--font-display); font-size: 20px; line-height: 28px; font-weight: 600; margin: 0 0 var(--space-2); }
.oc-card__body { font-size: 14px; line-height: 22px; color: var(--ink-600); margin: 0 0 var(--space-4); }
.oc-card__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.oc-card--service { display: flex; flex-direction: column; }
.oc-card--service .oc-card__tags { margin-top: auto; }

/* Nav */
.oc-nav { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--gutter); background: rgba(246, 248, 249, .85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-200); }
.admin-bar .oc-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .oc-nav { top: 46px; } }
.oc-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-900); }
.oc-logo:hover { color: var(--ink-900); }
.oc-logo__mark { width: 28px; height: 28px; }
.oc-logo__word { font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1; letter-spacing: -.01em; }
.oc-logo__sub { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-500); margin-top: 3px; font-weight: 500; }
.oc-nav__links { display: flex; gap: var(--space-8); }
.oc-nav__links a { font-size: 15px; font-weight: 500; color: var(--ink-600); text-decoration: none; padding: 4px 0; }
.oc-nav__links a:hover, .oc-nav__links a[aria-current] { color: var(--ink-900); }
.oc-nav__links a[aria-current] { box-shadow: inset 0 -2px 0 var(--teal-500); }

/* Type */
.oc-h-xl { font-family: var(--font-display); font-size: clamp(40px, 5.2vw, 64px); line-height: 1.06; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.oc-h-lg { font-family: var(--font-display); font-size: clamp(32px, 4vw, 44px); line-height: 1.14; font-weight: 600; letter-spacing: -.015em; margin: 0; }
.oc-lead { font-size: 18px; line-height: 28px; color: var(--ink-600); margin: 0; }
.oc-hl { color: var(--teal-700); }
.oc-mono { font-family: var(--font-mono); font-size: 13px; line-height: 20px; }

/* Hero */
.oc-hero { padding: clamp(56px, 8vw, 96px) var(--gutter); border-bottom: 1px solid var(--line-200); }
.oc-hero__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.oc-hero__copy { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-6); align-items: flex-start; }
.oc-hero__copy .oc-lead { max-width: 560px; }
.oc-hero__formats { margin-top: var(--space-2); }
.oc-hero__view { flex: 1 1 480px; min-width: 0; }

/* Viewport chrome */
.oc-viewport { position: relative; margin: 0; background: var(--surface-000); border: 1px solid var(--line-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.oc-viewport__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--line-200); font-family: var(--font-mono); font-size: 12px; color: var(--ink-500); }
.oc-viewport__dots { display: flex; gap: 6px; }
.oc-viewport__dots i { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--line-200); }
.oc-viewport__foot { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); padding: var(--space-2) var(--space-4); border-top: 1px solid var(--line-200); font-family: var(--font-mono); font-size: 12px; color: var(--ink-500); }
.oc-viewport__foot b { color: var(--ink-900); font-weight: 500; }

/* 3D stages */
.oc-stage, .oc-shot { position: relative; cursor: grab; touch-action: pan-y; outline: none; -webkit-user-select: none; user-select: none; }
.oc-stage:active, .oc-shot:active { cursor: grabbing; }
.oc-stage:focus-visible, .oc-shot:focus-visible { box-shadow: inset 0 0 0 2px var(--teal-500); }
.oc-stage--hero { aspect-ratio: 500 / 380; background-color: var(--surface-000); background-image: linear-gradient(var(--surface-100) 1px, transparent 1px), linear-gradient(90deg, var(--surface-100) 1px, transparent 1px); background-size: 24px 24px; }
.oc-shot { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); border: 1px solid var(--line-200); overflow: hidden; background-size: 24px 24px; }
.oc-shot__file { position: absolute; left: 10px; top: 8px; font-size: 11px; color: var(--ink-500); z-index: 1; pointer-events: none; }
.oc-shot__expand { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--surface-000); border: 1px solid var(--line-200); color: var(--ink-600); opacity: 0; transform: translateY(-2px); transition: opacity .2s, transform .2s; pointer-events: none; }
.oc-shot:hover .oc-shot__expand, .oc-shot:focus-visible .oc-shot__expand { opacity: 1; transform: none; }
.oc-stage__status { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); pointer-events: none; }
.oc-stage__status::before { content: ""; position: absolute; width: 44px; height: 44px; border: 1.5px dashed var(--line-400); border-radius: var(--radius-pill); animation: oc-spin 3s linear infinite; translate: 0 -30px; }
[data-loaded] .oc-stage__status { display: none; }
[data-failed] .oc-stage__status::before { display: none; }
@keyframes oc-spin { to { transform: rotate(360deg); } }
.oc-stage__hint { position: absolute; left: 50%; bottom: 10px; translate: -50% 0; font-size: 10px; letter-spacing: .1em; color: var(--ink-500); background: rgba(255, 255, 255, .85); padding: 2px 8px; border-radius: var(--radius-sm); pointer-events: none; transition: opacity .3s; white-space: nowrap; }
.oc-stage:hover .oc-stage__hint { opacity: 0; }

/* Per preview 2D canvas, filled from the shared WebGL renderer by viewer.js */
.oc-stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.oc-shot__file, .oc-shot__expand, .oc-stage__hint { z-index: 1; }

/* Work gallery */
.oc-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-6); }
.oc-gallery > li { display: block; }
.oc-gallery > li[hidden] { display: none; }
.oc-card--work { display: flex; flex-direction: column; gap: var(--space-4); height: 100%; padding: var(--space-4); }
.oc-card__content { display: flex; flex-direction: column; gap: var(--space-2); padding: 0 var(--space-2) var(--space-2); flex: 1; }
.oc-card__content .oc-card__title, .oc-card__content .oc-card__body { margin: 0; }
.oc-card__content .oc-card__tags { margin-top: auto; padding-top: var(--space-1); }
.oc-card__spec { margin: 0; font-size: 12px; color: var(--dim-700); letter-spacing: .02em; }
.oc-card--work:hover .oc-shot { border-color: var(--teal-500); }

/* Filter pills */
.oc-pill { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 10px 16px; min-height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line-200); background: var(--surface-000); color: var(--ink-600); cursor: pointer; }
.oc-pill:hover { border-color: var(--line-400); color: var(--ink-900); }
.oc-pill[aria-pressed="true"] { background: var(--teal-100); border-color: var(--teal-500); color: var(--teal-700); }
.oc-pill:focus-visible, .oc-field:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 2px; }

/* Services */
.oc-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-6); }


/* Dark band */
.oc-band { background: var(--ink-900); color: var(--ink-inverse); }
.oc-band .oc-lead { color: var(--ink-inverse-muted); }
.oc-band .oc-eyebrow { color: var(--teal-500); }
.oc-band .oc-h-lg { color: var(--ink-inverse); }

/* Quote */
.oc-quote { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; }
.oc-quote__intro { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.oc-quote__panel { flex: 1.4 1 480px; min-width: 0; background: var(--surface-000); color: var(--ink-900); border-radius: var(--radius-lg); padding: clamp(24px, 3vw, 40px); box-shadow: var(--shadow-md); }
.oc-contact { margin: var(--space-4) 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 14px 24px; font-size: 15px; align-items: baseline; }
.oc-contact dt { font-size: 12px; letter-spacing: .08em; color: var(--ink-inverse-muted); }
.oc-contact dd { margin: 0; color: var(--ink-inverse); }
.oc-contact a { color: var(--teal-500); }
.oc-contact a:hover { color: var(--ink-inverse); }

.oc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.oc-label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink-900); }
.oc-label--full, .oc-form__foot { grid-column: 1 / -1; }
.oc-label__opt { font-weight: 400; color: var(--ink-500); }
.oc-field { width: 100%; font: 15px/22px var(--font-sans); color: var(--ink-900); background: var(--surface-000); border: 1px solid var(--line-400); border-radius: var(--radius-sm); padding: 11px 12px; }
.oc-field:focus { border-color: var(--teal-700); }
.oc-field--file { padding: 9px 12px; border-style: dashed; }
textarea.oc-field { resize: vertical; }
.oc-form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); font-size: 14px; line-height: 22px; color: var(--ink-500); }
.oc-form [aria-busy="true"] { opacity: .7; pointer-events: none; }
.oc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.oc-alert { margin: 0 0 20px; padding: var(--space-3) var(--space-4); border-left: 3px solid var(--error-600); background: #fbeaea; color: #7d1a1a; font-size: 14px; line-height: 22px; border-radius: var(--radius-sm); }
.oc-sent { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6) 0; }
.oc-sent__label { font-size: 12px; letter-spacing: .08em; color: var(--success-600); }
.oc-sent h3 { margin: 0; font-family: var(--font-display); font-size: 28px; line-height: 34px; }
.oc-sent p { margin: 0; font-size: 16px; line-height: 26px; color: var(--ink-600); }

/* Footer */
.oc-footer { border-top: 1px solid #233540; padding: var(--space-8) var(--gutter); }
.oc-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-4); font-size: 14px; color: var(--ink-inverse-muted); }
.oc-footer__brand { display: flex; align-items: center; gap: 10px; color: var(--ink-inverse); font-family: var(--font-display); font-weight: 600; }
.oc-footer__sub { font-size: 11px; letter-spacing: .14em; color: var(--ink-inverse-muted); font-weight: 500; }
.oc-footer a { color: var(--teal-500); }
.oc-footer a:hover { color: var(--ink-inverse); }

.oc-404 { min-height: 60vh; }

/* Inspector dialog */
.oc-dialog { width: min(1100px, calc(100vw - 32px)); max-width: none; height: min(760px, calc(100vh - 32px)); max-height: none; padding: 0; border: 1px solid var(--line-200); border-radius: var(--radius-lg); background: var(--surface-000); color: var(--ink-900); box-shadow: 0 24px 64px rgba(14, 26, 33, .3); overflow: hidden; }
.oc-dialog::backdrop { background: rgba(14, 26, 33, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.oc-dialog[open] { animation: oc-pop .22s ease-out; }
@keyframes oc-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.oc-dialog__panel { display: flex; flex-direction: column; height: 100%; }
.oc-dialog__close { display: grid; place-items: center; width: 28px; height: 28px; margin: -4px -8px -4px 0; border: 0; background: none; color: var(--ink-600); border-radius: var(--radius-sm); cursor: pointer; }
.oc-dialog__close:hover { background: var(--surface-200); color: var(--ink-900); }
.oc-dialog__close:focus-visible { outline: 2px solid var(--teal-500); }
.oc-dialog__stage { position: relative; flex: 1; min-height: 0; background-size: 24px 24px; cursor: grab; touch-action: none; }
.oc-dialog__stage:active { cursor: grabbing; }
.oc-dialog__stage canvas { width: 100%; height: 100%; }
.oc-dialog__hint { position: absolute; left: 16px; bottom: 12px; font-size: 10px; letter-spacing: .1em; color: var(--ink-500); pointer-events: none; }
.oc-dialog__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--line-200); }
.oc-dialog__meta .oc-card__title { margin: 0; }
.oc-dialog__specs { border: 0; padding: 0; }
.oc-dialog__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
html.oc-lock { overflow: hidden; }

/* Responsive */
@media (max-width: 760px) {
	.oc-nav__links { display: none; }
	.oc-stage__hint { display: none; }
}
@media (max-width: 520px) {
	.oc-gallery { grid-template-columns: 1fr; }
	.oc-nav .oc-btn { padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.oc-card, .oc-btn .oc-arrow, .oc-shot__expand { transition: none; }
	.oc-badge::before, .oc-stage__status::before, .oc-dialog[open] { animation: none; }
}
