/* =========================================================
   Innovelous CAD Portfolio — consolidated stylesheet
   Sections: tokens · base · header · hero · projects ·
   expertise · contact · footer · dialogs/owner (preserved) ·
   motion · responsive
   ========================================================= */
:root {
  --bg: #08080a;
  --bg-soft: #0c0c10;
  --panel: #0e0e13;
  --text: #f4f2f6;
  --muted: #a19ca7;
  --dim: #6c6772;
  --line: rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.18);
  --purple: #a970ff;
  --purple-deep: #7a45d6;
  --purple-line: rgba(169,112,255,.5);
  --max: 1240px;
  --gutter: 24px;
  --header-h: 74px;
  --header-top: 16px;
  --nav-max: 1080px;
  --ease: cubic-bezier(.22,.72,.22,1);
  --t-hover: 240ms;
  --t-enter: 620ms;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--header-top) + 12px); background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body::selection { background: rgba(169,112,255,.32); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid rgba(169,112,255,.85); outline-offset: 3px; }

.skip-link {
  position: fixed; z-index: 200; left: 16px; top: 12px; padding: 10px 14px;
  background: #fff; color: #111; font-size: 13px; border-radius: 6px;
  transform: translateY(-160%); transition: transform var(--t-hover) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.section { width: min(calc(100% - var(--gutter) * 2), var(--max)); margin: 0 auto; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border: 1px solid transparent; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: .01em; cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease,
              color var(--t-hover) ease, transform var(--t-hover) var(--ease), box-shadow var(--t-hover) ease;
}
.button-primary { color: #fff; background: var(--purple-deep); border-color: var(--purple-deep); }
.button-secondary { color: #e9e5ee; background: transparent; border-color: rgba(255,255,255,.22); }
.button .arrow { display: inline-block; transition: transform var(--t-hover) var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .button:hover { transform: translateY(-2px); }
  .button-primary:hover { background: #8a52e8; border-color: #8a52e8; box-shadow: 0 8px 24px rgba(122,69,214,.28); }
  .button-secondary:hover { color: #fff; border-color: var(--purple-line); background: rgba(169,112,255,.07); }
  .button:hover .arrow { transform: translate(2px,-2px); }
}
.button:focus-visible { transform: translateY(-1px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: var(--header-top) 0 auto; z-index: 60;
  pointer-events: none;
}
.nav-shell {
  pointer-events: auto;
  width: min(calc(100% - var(--gutter) * 2), var(--nav-max)); min-height: var(--header-h); margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px; position: relative;
  padding: 12px 16px;
  background: rgba(12,12,17,.84); border: 1px solid rgba(255,255,255,.08); border-radius: 20px;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
}
.brand { display: inline-flex; align-items: center; min-width: 0; border-radius: 12px; }
.brand-mark { display: block; width: 44px; height: 44px; border-radius: 11px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-copy { display: grid; gap: 2px; min-width: 0; }
.brand-name { font-size: 15px; font-weight: 620; letter-spacing: -.02em; color: #faf8fc; }
.brand-role { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: rgba(240,235,245,.58); }
.nav-drawer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; min-width: 0; }
.nav-center { display: flex; justify-self: center; align-items: center; gap: 28px; min-width: 0; }
.nav-center > a {
  position: relative; padding-block: 8px; color: rgba(246,243,248,.78); font-size: 13px;
  transition: color var(--t-hover) ease;
}
.nav-center > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: var(--purple); transform: scaleX(0); transform-origin: left center;
  transition: transform var(--t-hover) var(--ease);
}
.nav-center > a:hover, .nav-center > a:focus-visible, .nav-center > a.is-current { color: #fff; }
.nav-center > a:hover::after, .nav-center > a:focus-visible::after, .nav-center > a.is-current::after { transform: scaleX(1); }
.nav-actions { justify-self: end; }
.main-site-simple {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: rgba(246,243,248,.88);
  background: rgba(255,255,255,.02); font-size: 12px; white-space: nowrap;
  transition: color var(--t-hover) ease, border-color var(--t-hover) ease, background-color var(--t-hover) ease, transform var(--t-hover) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .main-site-simple:hover { color: #fff; border-color: rgba(169,112,255,.4); background: rgba(169,112,255,.08); transform: translateY(-1px); }
}
.menu-toggle {
  display: none; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px; background: transparent; color: #eee; cursor: pointer;
  align-items: center; justify-content: center; justify-self: end;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  display: block; width: 18px; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform var(--t-hover) var(--ease), background-color var(--t-hover) ease;
}
.menu-toggle span { position: relative; }
.menu-toggle span::before, .menu-toggle span::after { content: ""; position: absolute; left: 0; }
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }
.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: clip;
  width: 100%; max-width: none; margin: 0;
  min-height: clamp(610px, calc(100svh - 108px), 690px);
  padding: calc(var(--header-top) + var(--header-h) + 38px) max(var(--gutter), calc((100vw - var(--max)) / 2)) 28px;
  display: grid; grid-template-columns: minmax(300px, 45fr) minmax(0, 55fr);
  align-items: center; gap: clamp(32px, 4vw, 74px);
  background: linear-gradient(103deg, #09090b 0%, #0d0d12 48%, #130f19 100%);
}
.hero-background, .hero-shade { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.hero-background {
  background:
    radial-gradient(ellipse at 79% 45%, rgba(142,82,219,.14) 0%, rgba(112,62,178,.06) 32%, transparent 66%),
    radial-gradient(ellipse at 16% 20%, rgba(68,48,112,.09) 0%, transparent 58%),
    linear-gradient(115deg, rgba(5,5,8,.96) 0%, rgba(12,9,16,.94) 48%, rgba(24,13,34,.90) 100%);
}
.hero-shade { background: linear-gradient(90deg, rgba(0,0,0,.16), transparent 42%, rgba(95,49,151,.035)); }
.hero-copy { max-width: 560px; padding-top: 12px; }
@media (min-width: 1081px) { .hero-line { white-space: nowrap; } }
.hero-title {
  margin: 0; font-size: clamp(44px, 4.55vw, 68px); line-height: .98;
  letter-spacing: -.048em; font-weight: 460; color: #f6f3f8;
}
.hero-line { display: block; padding-bottom: .075em; }
.hero-line > span { display: block; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 34px; }

.viewer-wrap { position: relative; z-index: 1; min-width: 0; width: 100%; display: flex; justify-content: center; }
.viewer-wrap::before { content: ""; position: absolute; inset: 14% 10% 19% 18%; background: radial-gradient(circle at 52% 46%, rgba(148,99,232,.12), rgba(148,99,232,.03) 38%, transparent 70%); filter: blur(22px); pointer-events: none; z-index: -1; }
.viewer-wrap::after { content: ""; position: absolute; left: 25%; right: 13%; bottom: 42px; height: 26px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(0,0,0,.33) 0%, rgba(0,0,0,.18) 48%, transparent 78%); filter: blur(12px); pointer-events: none; z-index: -1; }
.viewer-frame {
  width: 100%; max-width: 780px; height: min(66vh, 560px); min-height: 430px;
  display: flex; flex-direction: column; gap: 8px; background: transparent; border: 0; overflow: visible;
}
/* The viewer stays untouched: no blur, no CSS scaling, no filters. */
.viewer-frame model-viewer {
  flex: 1 1 auto; width: 100%; min-height: 0; background: transparent; --poster-color: transparent;
  filter: none; transform: none;
}
.viewer-toolbar { display: flex; justify-content: center; min-height: 44px; }
.viewer-controls {
  display: inline-flex; gap: 2px; padding: 3px; border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px; background: rgba(8,8,11,.52);
}
.icon-button {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0;
  border-radius: 50%; color: rgba(246,243,248,.74); background: transparent; cursor: pointer;
  transition: color var(--t-hover) ease, background-color var(--t-hover) ease;
}
.icon-button:hover, .icon-button:focus-visible { color: #fff; background: rgba(255,255,255,.08); }
.icon-button svg { width: 17px; height: 17px; fill: currentColor; }
.model-loading, .model-error {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  color: var(--muted); text-align: center;
}
.loading-mark { width: 56px; height: 56px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.loading-mark img { width: 100%; height: 100%; object-fit: cover; }
.progress-track { width: min(220px, 45vw); height: 2px; overflow: hidden; background: rgba(255,255,255,.1); border-radius: 2px; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--purple); }
.model-loading p, .model-error span { margin: 0; font-size: 11px; letter-spacing: .06em; }
.model-error strong { color: #fff; font-size: 14px; }

/* ---------- Sections ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-head h2, .contact-section h2 {
  margin: 0; white-space: nowrap; font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -.04em; font-weight: 520;
}
.projects-section { padding-top: 96px; padding-bottom: 72px; }
.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 0; }
.filter-button {
  min-height: 36px; padding: 0 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px;
  color: #a9a4ae; background: transparent; font-size: 12px; cursor: pointer;
  transition: color var(--t-hover) ease, border-color var(--t-hover) ease, background-color var(--t-hover) ease;
}
.filter-button:hover, .filter-button:focus-visible { color: #fff; border-color: rgba(255,255,255,.28); }
.filter-button.is-active { color: #fff; border-color: var(--purple-line); background: rgba(169,112,255,.09); }

/* ---------- Project grid ---------- */
.portfolio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 28px; }
.project-card { position: relative; display: block; cursor: pointer; border-radius: 14px; outline: none; }
.project-image {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 12px;
  background: #0d0d11; border: 1px solid rgba(255,255,255,.08);
  transition: border-color var(--t-hover) ease, box-shadow var(--t-hover) ease;
}
.project-image img {
  width: 100%; height: 100%; object-fit: contain; background: #0d0d11; /* never crops drawings */
  transition: transform 280ms var(--ease);
}
.project-image-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--dim); font-size: 11px; letter-spacing: .14em; }
.project-action {
  position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(10,10,14,.82); border: 1px solid rgba(255,255,255,.18);
  transition: border-color var(--t-hover) ease, background-color var(--t-hover) ease;
}
.project-card-content { padding: 16px 2px 0; }
.project-category {
  margin: 0 0 6px; color: var(--purple); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.project-card h3 { margin: 0; font-size: clamp(19px, 1.8vw, 24px); font-weight: 520; letter-spacing: -.02em; line-height: 1.2; }
@media (hover: hover) and (pointer: fine) {
  .project-card:hover .project-image { border-color: var(--purple-line); box-shadow: 0 0 0 1px rgba(169,112,255,.10); }
  .project-card:hover .project-image img { transform: scale(1.03); }
  .project-card:hover .project-action { background: var(--purple-deep); border-color: var(--purple-deep); }
}
.project-card:focus-visible .project-image { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(169,112,255,.25); }
.project-card:focus-visible .project-action { background: var(--purple-deep); border-color: var(--purple-deep); }

.empty-state { display: flex; align-items: center; gap: 22px; padding: 34px; border: 1px dashed rgba(255,255,255,.14); border-radius: 12px; color: #77727c; }
.empty-state strong { display: block; color: #bdb9c1; font-size: 14px; font-weight: 540; }
.empty-state p { margin: 5px 0 0; max-width: 380px; font-size: 12px; }
.empty-schematic { flex: none; width: 64px; height: 64px; border: 1px solid rgba(169,112,255,.25); border-radius: 10px; }

/* ---------- Expertise ---------- */
.expertise-section { padding-top: 64px; padding-bottom: 80px; border-top: 1px solid rgba(255,255,255,.07); }
.software-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.software-card {
  position: relative; display: grid; gap: 14px; min-height: 150px; padding: 20px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.015);
  transition: border-color var(--t-hover) ease, transform var(--t-hover) var(--ease);
}
.software-card:hover { border-color: rgba(169,112,255,.3); transform: translateY(-3px); }
.software-index { position: absolute; right: 18px; top: 16px; color: #4f4b55; font-size: 11px; }
.software-code { color: var(--purple); font-size: 12px; font-weight: 600; letter-spacing: .14em; }
.software-copy h3 { margin: 0; font-size: 16px; font-weight: 540; }
.software-copy p { margin: 5px 0 0; color: #8b8691; font-size: 12px; }
.software-count { align-self: end; color: #6a666f; font-size: 10px; letter-spacing: .12em; }
.software-empty { grid-column: 1 / -1; padding: 24px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; color: #77727c; font-size: 13px; }

/* ---------- Contact ---------- */
.contact-section {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  padding: 56px 0 72px; border-top: 1px solid rgba(255,255,255,.07);
}
.contact-section p { margin: 12px 0 0; max-width: 460px; color: #9a95a0; font-size: 14px; line-height: 1.6; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid rgba(255,255,255,.07); background: #060608; }
.footer-inner {
  width: min(calc(100% - var(--gutter) * 2), var(--max)); margin: 0 auto; padding: 36px 0 28px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px 40px; align-items: start;
}
.footer-brand { display: grid; gap: 14px; max-width: 340px; }
.footer-logo { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.footer-logo img { width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); }
.footer-brand p { margin: 0; color: #8e8994; font-size: 13px; line-height: 1.6; }
.footer-col h4 { margin: 0 0 12px; color: #6f6a74; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.footer-col ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.footer-col a { display: inline-block; padding: 4px 0; color: #b4afba; font-size: 13px; transition: color var(--t-hover) ease; }
.footer-col a:hover, .footer-col a:focus-visible { color: #fff; }
.footer-bottom {
  width: min(calc(100% - var(--gutter) * 2), var(--max)); margin: 0 auto; padding: 18px 0 26px;
  border-top: 1px solid rgba(255,255,255,.06); color: #5f5b64; font-size: 12px;
}

/* Project details */
dialog { color: var(--text); border: 0; padding: 0; background: transparent; }
dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(12px); }
.project-dialog { width: min(1120px, calc(100vw - 32px)); max-width: none; }
.project-dialog-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1.45fr) minmax(300px,.55fr);
  min-height: 620px;
  max-height: min(86vh,820px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 4px;
  background: #0b0b0e;
  box-shadow: 0 40px 100px rgba(0,0,0,.55);
}
.dialog-close {
  position: absolute;
  z-index: 20;
  right: 14px;
  top: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 2px;
  color: #d9d5dd;
  background: rgba(9,9,12,.78);
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}
.project-dialog-media { min-width: 0; display: grid; grid-template-rows: minmax(0,1fr) auto; background: #07070a; overflow: hidden; }
.detail-stage { min-height: 0; display: grid; place-items: center; overflow: hidden; }
.detail-stage img { width: 100%; height: 100%; object-fit: contain; }
.detail-model { width: 100%; height: 100%; min-height: 520px; background: radial-gradient(circle, rgba(121,73,207,.11), transparent 54%); }
.detail-media-bar { min-height: 68px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(255,255,255,.08); background: #0b0b0e; }
.detail-thumbs { display: flex; gap: 7px; overflow-x: auto; }
.detail-thumb { width: 54px; height: 46px; padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.12); background: #111; cursor: pointer; opacity: .58; }
.detail-thumb.is-active { opacity: 1; border-color: rgba(156,114,255,.55); }
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-model-toggle { flex: 0 0 auto; padding: 9px 11px; border: 1px solid rgba(255,255,255,.13); border-radius: 2px; background: transparent; color: #c7c2cb; font-size: 9px; cursor: pointer; }
.detail-model-toggle:hover, .detail-model-toggle:focus-visible { color: #fff; border-color: rgba(255,255,255,.28); }
.dialog-content { padding: 70px 34px 34px; overflow-y: auto; }
.project-meta-line { display: flex; gap: 16px; color: #7f7a85; font-size: 8px; letter-spacing: .16em; text-transform: uppercase; }
.dialog-content h3 { margin: 18px 0 16px; font-size: clamp(28px,3vw,42px); line-height: 1.04; letter-spacing: -.035em; font-weight: 520; }
.dialog-content > p { margin: 0; color: #aaa5ae; font-size: 13px; line-height: 1.75; }
.detail-software { margin-top: 34px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); }
.detail-label { color: #6f6a74; font-size: 8px; letter-spacing: .16em; }
.software-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.software-tags span { padding: 7px 9px; border: 1px solid rgba(255,255,255,.09); border-radius: 2px; color: #aaa5af; font-size: 9px; }

/* Owner area */
.owner-dialog { width: min(1040px, calc(100vw - 28px)); max-width: none; }
.owner-shell { position: relative; max-height: 90vh; overflow-y: auto; padding: 28px; border: 1px solid rgba(255,255,255,.14); border-radius: 4px; background: #0d0d11; box-shadow: 0 40px 100px rgba(0,0,0,.58); }
.owner-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-right: 52px; margin-bottom: 22px; }
.owner-head h2 { margin: 6px 0 0; font-size: 30px; letter-spacing: -.03em; font-weight: 520; }
.owner-login { max-width: 460px; display: grid; gap: 12px; }
.owner-login label, .admin-form label { display: grid; gap: 7px; color: #918c96; font-size: 10px; }
.owner-login input, .admin-form input, .admin-form textarea, .admin-form select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 2px;
  outline: 0;
  color: #eeeaf0;
  background: #111116;
}
.owner-login input:focus, .admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { border-color: rgba(156,114,255,.62); }
.admin-form label small { color: #615d66; font-size: 9px; line-height: 1.45; }
.backend-notice { margin: 0 0 18px; padding: 12px 14px; border: 1px solid rgba(156,114,255,.2); background: rgba(156,114,255,.05); color: #aaa5af; font-size: 11px; }
.backend-notice code { color: #d6c9ff; }
.owner-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.owner-tabs { display: flex; gap: 6px; }
.owner-tab, .admin-action, .text-button {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 2px;
  background: transparent;
  color: #a7a2ac;
  cursor: pointer;
  padding: 8px 10px;
  font-size: 10px;
}
.owner-tab.is-active { border-color: rgba(156,114,255,.4); color: #fff; background: rgba(156,114,255,.07); }
.text-button { border-color: transparent; padding-left: 0; padding-right: 0; }
.admin-form { padding: 18px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.012); }
.admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.admin-grid .span-2 { grid-column: span 2; }
.toggle-row { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 9px !important; }
.toggle-row input { width: auto; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.form-message { min-height: 18px; margin: 0; color: #89848e; font-size: 10px; }
.form-message.error { color: #e59b9b; }
.form-message.success { color: #a6d9b1; }
.admin-list { display: grid; gap: 7px; margin-top: 14px; }
.admin-item { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; min-height: 72px; padding: 8px; border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.01); }
.admin-item-thumb { width: 58px; height: 52px; object-fit: cover; background: #16161b; }
.admin-item-noimage { display: grid; place-items: center; color: #6d6872; font-size: 9px; }
.admin-item-main { display: grid; gap: 3px; min-width: 0; }
.admin-item-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 540; }
.admin-item-main span { color: #716c76; font-size: 9px; }
.admin-item-actions { display: flex; gap: 5px; }
.admin-action { padding: 7px 8px; }
.admin-action:hover { color: #fff; border-color: rgba(255,255,255,.22); }
.admin-action.danger:hover { color: #ffc2c2; border-color: rgba(255,110,110,.28); }
.admin-action:disabled { opacity: .3; cursor: default; }

/* ---------- Motion ---------- */
/* Content is visible by default; animation only applies once JS adds .motion-enabled / .hero-ready. */
.hero-ready .hero-line > span { animation: riseIn var(--t-enter) var(--ease) both; }
.hero-ready .hero-line:nth-child(2) > span { animation-delay: 90ms; }
.hero-ready .hero-actions { animation: riseIn 580ms var(--ease) 200ms both; }
.hero-ready .hero-model { animation: fadeIn 650ms ease-out 140ms both; } /* opacity only: model stays crisp */
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.motion-enabled .reveal {
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--t-enter) ease var(--reveal-delay,0ms), transform var(--t-enter) var(--ease) var(--reveal-delay,0ms);
}
.motion-enabled .reveal.is-visible { opacity: 1; transform: none; }

.noscript { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100; padding: 12px; background: #fff; color: #111; }

/* ---------- Dialog refinements ---------- */
.project-dialog-shell { border-radius: 16px; border-color: rgba(255,255,255,.13); background: #0a0a0e; }
.detail-media-bar { background: #0a0a0e; }
.dialog-close { border-radius: 50%; }
.detail-thumb { border-radius: 6px; }
.detail-thumb.is-active { border-color: var(--purple-line); }
.detail-stage img { object-fit: contain; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(260px, 40fr) minmax(0, 60fr); gap: 24px; }
  .viewer-frame { min-height: 480px; }
  .software-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .project-dialog-shell { grid-template-columns: 1fr; max-height: 92vh; overflow-y: auto; }
  .detail-model { min-height: 360px; }
  .dialog-content { padding: 24px 22px 28px; overflow: visible; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-grid .span-2 { grid-column: auto; }
  .admin-item { grid-template-columns: 58px 1fr; }
  .admin-item-actions { grid-column: 1 / -1; flex-wrap: wrap; }
}
@media (max-width: 860px) {
  :root { --gutter: 18px; --header-top: 12px; }
  .nav-shell { grid-template-columns: 1fr auto; padding: 10px 12px; min-height: 64px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-name { font-size: 14px; }
  .brand-role { font-size: 9px; }
  .menu-toggle { display: inline-flex; }
  .nav-drawer {
    position: absolute; left: 0; right: 0; top: calc(100% + 10px);
    grid-template-columns: 1fr; gap: 14px; padding: 12px;
    background: rgba(10,10,14,.96); border: 1px solid rgba(255,255,255,.08); border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,.32);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity var(--t-hover) ease, transform var(--t-hover) var(--ease), visibility 0s linear var(--t-hover);
  }
  .nav-drawer.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav-center { flex-direction: column; align-items: stretch; gap: 0; justify-self: stretch; }
  .nav-center > a { padding: 14px 2px; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.06); }
  .nav-center > a::after { display: none; }
  .nav-actions { justify-self: start; }
  .main-site-simple { padding: 10px 16px; font-size: 13px; }

  .hero { grid-template-columns: 1fr; min-height: auto; gap: 12px; padding-top: calc(var(--header-top) + var(--header-h) + 26px); padding-bottom: 22px; }
  .hero-copy { max-width: 640px; padding-top: 0; }
  .hero-title { font-size: clamp(42px, 11vw, 64px); line-height: .98; }
  .hero-actions { margin-top: 24px; }
  .viewer-wrap::before { inset: 10% 6% 18% 8%; }
  .viewer-wrap::after { left: 14%; right: 12%; bottom: 30px; }
  .viewer-frame { height: min(52vh, 520px); min-height: 360px; max-width: 640px; margin: 0 auto; }

  .projects-section { padding-top: 64px; padding-bottom: 48px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .filters { justify-content: flex-start; }
  .section-head h2, .contact-section h2 { white-space: normal; }
  .portfolio-grid { grid-template-columns: 1fr; gap: 36px; }
  .software-grid { grid-template-columns: 1fr 1fr; }
  .contact-section { flex-direction: column; align-items: flex-start; padding: 44px 0 56px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .brand-copy { display: none; }
  .hero-actions .button { flex: 1 1 100%; }
  .viewer-frame { min-height: 320px; height: 46vh; }
  .software-grid { grid-template-columns: 1fr; }
  .contact-actions .button { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .button:hover, .project-card:hover .project-image img, .software-card:hover { transform: none !important; }
}

/* ===== Instant animated hero model + animated gradient + project motion ===== */
#heroCanvas { flex: 1 1 auto; width: 100%; min-height: 0; display: block; cursor: grab; touch-action: pan-y; opacity: 0; animation: canvasIn .5s ease .05s forwards; }
#heroCanvas:active { cursor: grabbing; }
@keyframes canvasIn { to { opacity: 1; } }

body { background: transparent; }
.hero { background: transparent; }
body {
  background:
    radial-gradient(1100px 760px at 82% 8%, rgba(116,63,190,.17), transparent 62%),
    radial-gradient(900px 620px at 12% 35%, rgba(73,51,132,.09), transparent 68%),
    linear-gradient(135deg, #07070a 0%, #0b0910 44%, #120b19 72%, #08080b 100%);
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(52% 52% at 76% 36%, rgba(155,91,230,.12), transparent 72%),
    radial-gradient(42% 48% at 28% 82%, rgba(80,55,143,.08), transparent 76%);
  animation: ambientGradient 18s ease-in-out infinite alternate;
}
body::after { content: none; }
@keyframes ambientGradient {
  from { opacity: .75; transform: translate3d(-1%,0,0) scale(1); }
  to { opacity: 1; transform: translate3d(1.5%,-1%,0) scale(1.035); }
}

/* project cards: polished entrance + premium hover motion */
.project-card {
  opacity: 1;
  transform: none;
  animation: projectCardIn 640ms var(--ease) backwards;
  animation-delay: var(--card-delay, 0ms);
  transition: transform 260ms var(--ease), filter 260ms ease;
}
@keyframes projectCardIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.project-image {
  transition: border-color 240ms ease, box-shadow 240ms ease, transform 260ms var(--ease);
}
.project-image img {
  transform: scale(1);
  transition: transform 520ms var(--ease), filter 300ms ease;
}
.project-image::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(174,114,255,.10) 50%, transparent 70%);
  transform: translateX(-38%);
  transition: opacity 260ms ease, transform 650ms var(--ease);
}
.project-card-content { transition: transform 260ms var(--ease); }
.project-card h3 { transition: color 220ms ease; }
@media (hover: hover) and (pointer: fine) {
  .project-card:hover { transform: translateY(-7px); filter: drop-shadow(0 18px 28px rgba(0,0,0,.18)); }
  .project-card:hover .project-image { border-color: rgba(169,112,255,.52); box-shadow: 0 12px 34px rgba(86,45,139,.16); transform: translateY(-1px); }
  .project-card:hover .project-image img { transform: scale(1.035); }
  .project-card:hover .project-image::after { opacity: 1; transform: translateX(38%); }
  .project-card:hover .project-card-content { transform: translateY(-2px); }
  .project-card:hover h3 { color: #f7f3ff; }
}
.project-card:focus-visible { transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none !important; }
  .project-card { opacity: 1 !important; transform: none !important; animation: none !important; }
  .project-image img, .project-card, .project-image, .project-card-content { transition-duration: 1ms !important; }
}

/* =========================================================
   Innovelous AutoCAD logo treatment
   ========================================================= */
.brand { gap:0; }
.brand-logo {
  display:block;
  width:210px;
  height:auto;
  max-width:100%;
  border:0;
  border-radius:0;
}
.footer-logo { display:inline-flex; align-items:center; }
.footer-logo img {
  width:190px;
  height:auto;
  max-width:100%;
  border:0;
  border-radius:0;
}

@media (max-width:860px) {
  .brand-logo { width:185px; }
}
@media (max-width:480px) {
  .brand-logo { width:160px; }
  .footer-logo img { width:170px; }
}
