/* ============================================
   Dialith — Shared Styles
   Used by: index.html (landing) + prototype.html (3D)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bg: #000000;
    --panel: #0a0a0a;
    --accent: #3b82f6;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- Hide the browser scrollbar globally (scroll still works) --- */
::-webkit-scrollbar {
    display: none;
}
html {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- Hidden scrollbar utility (carousels / panels) --- */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- Landing: hero background (scrolls naturally with the page) --- */
.hero-bg {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* --- Landing: navbar scrolled state --- */
.site-nav {
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease,
        padding 0.4s ease, border-color 0.4s ease;
    border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.nav-link {
    position: relative;
    color: #9ca3af;
    transition: color 0.3s ease;
}
.nav-link:hover,
.nav-link.active {
    color: #ffffff;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    height: 1px;
    width: 0;
    background: #ffffff;
    transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* --- Landing: minimal scroll-down mouse indicator --- */
.scroll-mouse {
    width: 26px;
    height: 42px;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}
.scroll-mouse:hover {
    border-color: #ffffff;
}
.scroll-mouse .wheel {
    width: 3px;
    height: 7px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.85);
    animation: scroll-wheel 1.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
@keyframes scroll-wheel {
    0%   { opacity: 0; transform: translateY(-4px); }
    35%  { opacity: 1; }
    70%  { opacity: 1; transform: translateY(10px); }
    100% { opacity: 0; transform: translateY(12px); }
}
@media (prefers-reduced-motion: reduce) {
    .scroll-mouse .wheel { animation: none; }
}

@keyframes intermittent-fade {
    0%, 30% { opacity: 0; }
    40%, 60% { opacity: 0.7; }
    70%, 100% { opacity: 0; }
}
.animate-intermittent-fade {
    animation: intermittent-fade 8s ease-in-out infinite;
}

/* --- Landing: The Shift comparison --- */
.shift-heading {
    text-align: left;
    margin-left: clamp(1.5rem, 5vw, 4rem);
    margin-right: clamp(1.5rem, 5vw, 4rem);
}

.shift-experience {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
    gap: clamp(2rem, 7vw, 7rem);
    align-items: center;
    min-height: 30rem;
}

.shift-stage {
    position: relative;
    height: clamp(21rem, 38vw, 31rem);
    perspective: 1200px;
}

.shift-object {
    appearance: none;
    position: absolute;
    bottom: 0;
    width: min(43%, 22rem);
    border: 0;
    background: transparent;
    color: #ffffff;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.35rem;
    transform-style: preserve-3d;
    transition: left 0.85s cubic-bezier(0.16, 1, 0.3, 1),
        right 0.85s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.85s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.45s ease;
}

.shift-image {
    height: clamp(15rem, 30vw, 24rem);
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.shift-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1), filter 0.85s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, filter;
    filter: grayscale(0.2) opacity(0.85);
}

.shift-name {
    font-size: clamp(0.9rem, 1.4vw, 1.15rem);
    font-weight: 300;
    letter-spacing: 0.18em;
    line-height: 1.1;
    text-transform: uppercase;
    color: #f5f5f5;
    white-space: nowrap;
    transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), color 0.45s ease;
}

.shift-monolith {
    left: 0;
    z-index: 2;
}

.shift-dialith {
    left: 50%;
    z-index: 2;
}

/* Active State styles */
.shift-experience[data-shift-state="monolith"] .shift-monolith,
.shift-experience[data-shift-state="dialith"] .shift-dialith {
    left: 0;
    z-index: 3;
    opacity: 1;
    transform: translateZ(4rem) rotateY(0deg) scale(1);
}

.shift-experience[data-shift-state="monolith"] .shift-monolith .shift-image img,
.shift-experience[data-shift-state="dialith"] .shift-dialith .shift-image img {
    filter: grayscale(0) opacity(1) drop-shadow(0 0 25px rgba(255, 255, 255, 0.18));
    transform: scale(1.05);
}

/* Inactive State styles */
.shift-experience[data-shift-state="monolith"] .shift-dialith,
.shift-experience[data-shift-state="dialith"] .shift-monolith {
    left: 45%;
    z-index: 1;
    opacity: 0.28;
    transform: translateZ(-5rem) rotateY(-28deg) scale(0.82);
}

.shift-experience[data-shift-state="monolith"] .shift-dialith .shift-image img,
.shift-experience[data-shift-state="dialith"] .shift-monolith .shift-image img {
    filter: grayscale(1) opacity(0.28);
    transform: scale(0.92);
}

/* Inactive Hover reaction */
.shift-experience[data-shift-state="monolith"] .shift-dialith:hover .shift-image img,
.shift-experience[data-shift-state="dialith"] .shift-monolith:hover .shift-image img {
    filter: grayscale(0.4) opacity(0.65) drop-shadow(0 0 15px rgba(255, 255, 255, 0.08));
    transform: scale(0.98);
}

.shift-experience[data-shift-state="monolith"] .shift-dialith:hover .shift-name,
.shift-experience[data-shift-state="dialith"] .shift-monolith:hover .shift-name {
    opacity: 0.6;
    color: rgba(255, 255, 255, 0.8);
}

.shift-experience[data-shift-state="monolith"] .shift-monolith .shift-name,
.shift-experience[data-shift-state="dialith"] .shift-dialith .shift-name {
    color: #ffffff;
    transform: translateY(-0.15rem);
}

.shift-experience[data-shift-state="monolith"] .shift-dialith .shift-name,
.shift-experience[data-shift-state="dialith"] .shift-monolith .shift-name {
    opacity: 0.18;
}

.shift-copy {
    position: relative;
    min-height: 14rem;
}

.shift-copy-panel {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(1.25rem);
    transition: opacity 0.42s ease 0.18s, transform 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.18s;
}

.shift-copy-panel h3 {
    margin: 0;
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    font-weight: 300;
    letter-spacing: 0.13em;
    line-height: 1.1;
    text-transform: uppercase;
    color: #ffffff;
}

.shift-copy-panel p {
    margin: 1.35rem 0 0;
    max-width: 33rem;
    color: #b8bec8;
    font-size: clamp(0.88rem, 1.1vw, 1.05rem);
    font-weight: 300;
    line-height: 1.78;
}

.shift-experience[data-shift-state="overview"] .shift-copy-panel {
    opacity: 0;
    transform: translateX(1.25rem);
}

.shift-experience[data-shift-state="monolith"] [data-shift-copy="monolith"],
.shift-experience[data-shift-state="dialith"] [data-shift-copy="dialith"] {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

/* --- Landing: How It Works (full-screen step frame) --- */
.step-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center right;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 1s ease, transform 6s ease;
    pointer-events: none;
}
.step-bg.is-active {
    opacity: 1;
    transform: scale(1);
}

.system-heading {
    position: absolute;
    top: 7rem;
    left: clamp(1.5rem, 5vw, 4rem);
    width: min(31rem, calc(100vw - 3rem));
}

.system-heading [data-step-title] {
    transition: opacity 0.3s ease;
}

.system-steps {
    position: absolute;
    left: clamp(1.5rem, 5vw, 4rem);
    bottom: 4.5rem;
    display: flex;
    width: min(52rem, calc(100vw - 3rem));
    gap: 0.8rem;
}

.step-card {
    width: 100%;
    text-align: left;
    padding: 1rem 1.1rem 0.95rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 0;
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: background 0.35s ease, opacity 0.35s ease;
}
.step-card:hover {
    background: rgba(255, 255, 255, 0.12);
    opacity: 0.86;
}
.step-card.is-active {
    background: #ffffff;
}
.step-card .step-num {
    font-family: monospace;
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.25em;
    line-height: 1;
    color: #9ca3af;
    transition: color 0.35s ease;
}
.step-card .step-title {
    font-size: 1.02rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.05;
    color: #ffffff;
    margin-top: 0.65rem;
    text-transform: uppercase;
    transition: color 0.35s ease;
}
.step-card .step-sub {
    font-size: 0.72rem;
    font-weight: 300;
    color: #9ca3af;
    margin-top: 0.45rem;
    line-height: 1.35;
    transition: color 0.35s ease;
}
.step-card .step-accent {
    color: #d4d4d4;
    font-weight: 500;
}
.step-card.is-active .step-num,
.step-card.is-active .step-sub {
    color: #6b7280;
}
.step-card.is-active .step-title { color: #000000; }
.step-card.is-active .step-accent { color: #111111; }

.habitat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: clamp(1.5rem, 4vw, 4.5rem);
    width: 100%;
}

.habitat-planet {
    width: min(28vw, 22rem);
    height: min(28vw, 22rem);
    min-width: 14rem;
    min-height: 14rem;
}

/* --- Landing: reveal-on-scroll (graceful fallback if JS/GSAP fails) --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* --- Landing: gradient accent text --- */
.text-gradient {
    background: linear-gradient(120deg, #ffffff 0%, #d4d4d4 50%, #a3a3a3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --- Prototype: 3D viewer surfaces --- */
#canvas-container,
#css-container {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}
#css-container {
    pointer-events: none; /* let pointer events reach the WebGL canvas */
    white-space: nowrap;
}

.cursor-crosshair {
    cursor: crosshair !important;
}

.part-card.active {
    border-color: rgba(255, 255, 255, 0.72);
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.screen-theme-btn.active {
    border-color: rgba(255, 255, 255, 0.72);
}

.screen-theme-list {
    overscroll-behavior-x: contain;
    align-items: stretch;
}

.screen-theme-btn {
    display: flex;
    flex: 0 0 5.05rem;
    height: 9.65rem;
    flex-direction: column;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.045);
}

.screen-theme-preview {
    aspect-ratio: 9 / 16;
    height: 7.25rem;
    min-height: 7.25rem;
    width: 100%;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    overflow: hidden;
    background: #050505;
}

.screen-theme-label {
    display: grid;
    min-height: 2.2rem;
    place-items: center;
    background: #1a1a1a;
    color: #d1d5db;
    font-size: 0.54rem;
    line-height: 1.15;
    padding: 0.35rem 0.45rem;
    text-align: center;
    overflow-wrap: anywhere;
}

#screen-options-panel {
    height: min(18.5rem, 42vh);
}

.screen-sheet-header > div:first-child {
    margin-left: 18.75rem;
}

.screen-sheet-content {
    align-items: flex-start !important;
    gap: 1rem;
    padding-top: 0;
    overflow: visible !important;
}

.interface-overview-card {
    display: flex;
    width: 18rem;
    min-width: 18rem;
    flex-direction: column;
    gap: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.045);
    align-self: stretch;
    height: 15rem;
    margin-top: -3.25rem;
    min-height: 0;
    padding: 1rem;
    overflow: hidden;
}

.interface-overview-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-top: 0.05rem;
}

.interface-overview-icon {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
}

.interface-overview-card h3 {
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    line-height: 1.2;
}

.interface-side-toggle {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.2rem;
}

.interface-side-btn {
    min-width: 0;
    flex: 1;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #8b8b8b;
    cursor: pointer;
    font-size: 0.56rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1;
    padding: 0.48rem 0.45rem;
    text-transform: uppercase;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.interface-side-btn:hover,
.interface-side-btn.active {
    background: rgba(255, 255, 255, 0.11);
    color: #ffffff;
}

.interface-card-preview {
    position: relative;
    flex: 1 1 0;
    display: grid;
    min-height: 0;
    width: 100%;
    place-items: center;
    overflow: hidden;
    border-radius: 0.48rem;
    background: linear-gradient(180deg, #111827, #050505);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.interface-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.interface-card-preview img.is-hidden {
    opacity: 0;
}

.interface-overview-card[data-preview-theme="default"] .interface-card-preview {
    background: linear-gradient(180deg, #374151, #111827);
}

.interface-overview-card[data-preview-theme="robot"] .interface-card-preview {
    background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.14), transparent 28%), linear-gradient(180deg, #1f2937, #000000);
}

.interface-overview-card[data-preview-theme="dimensions"] .interface-card-preview {
    background: linear-gradient(135deg, #6b7280, #111827);
}

.interface-overview-card[data-preview-theme="mission"] .interface-card-preview {
    background: radial-gradient(circle at 50% 45%, rgba(255,255,255,0.22), transparent 8%), repeating-radial-gradient(circle at 50% 45%, rgba(255,255,255,0.18) 0 1px, transparent 1px 18px), linear-gradient(160deg, #9ca3af, #374151);
}

.interface-overview-card[data-preview-theme="dark"] .interface-card-preview {
    background: linear-gradient(180deg, #111827, #000000);
}

.screen-content-wrap {
    align-items: flex-start !important;
    align-self: stretch;
    padding-top: 0.25rem;
}

#screen-theme-list {
    align-items: flex-start;
    height: 100%;
    padding-top: 0 !important;
    padding-bottom: 0.25rem !important;
}

.screen-scroll-btn {
    position: absolute;
    z-index: 10;
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 0;
    background: transparent;
    color: #8b8b8b;
    cursor: pointer;
    transition: color 0.25s ease;
}

.screen-scroll-btn:hover {
    color: #ffffff;
}

.measurement-label {
    color: #2563eb;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    border: 1px solid #bfdbfe;
    pointer-events: none;
    white-space: nowrap;
}

.prototype-nav-btn {
    display: flex;
    min-width: max-content;
    flex-direction: column;
    align-items: center;
    gap: 0.22rem;
    border: 0;
    background: transparent;
    color: #8b8b8b;
    cursor: pointer;
    padding: 0.15rem 0;
    text-align: center;
    transition: color 0.25s ease, opacity 0.25s ease;
}

.prototype-nav-btn:hover,
.prototype-nav-btn.active {
    color: #ffffff;
}

.prototype-nav-title {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.1;
    text-transform: uppercase;
}

.prototype-nav-icon {
    margin-bottom: 0.1rem;
    font-size: 0.95rem;
    opacity: 0.72;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.prototype-nav-btn:hover .prototype-nav-icon,
.prototype-nav-btn.active .prototype-nav-icon {
    opacity: 1;
    transform: translateY(-1px);
}

.prototype-nav-sub {
    max-width: 7.5rem;
    color: currentColor;
    font-size: 0.58rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.15;
    opacity: 0.58;
}

.prototype-nav-btn.active .prototype-nav-sub {
    opacity: 0.86;
}

@media (max-width: 900px) {
    .prototype-nav-sub {
        display: none;
    }
}

.structure-mode-btn {
    min-width: 6.5rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #8b8b8b;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    line-height: 1;
    padding: 0.75rem 1rem;
    text-transform: uppercase;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.structure-mode-btn:hover,
.structure-mode-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.structure-rotation-btn {
    width: 2.35rem;
    height: 2.35rem;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: transparent;
    color: #d1d5db;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.structure-rotation-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.prototype-bottom-sheet {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: flex;
    height: min(15.5rem, 36vh);
    flex-direction: column;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 10, 10, 0.95);
    box-shadow: 0 -18px 45px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(18px);
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.35s ease;
    will-change: transform;
}

.prototype-bottom-sheet.is-collapsed {
    height: 3.75rem;
}

.sheet-header {
    cursor: default;
    min-height: 3.75rem;
    touch-action: auto;
}

.prototype-bottom-sheet.is-collapsed .sheet-header {
    align-items: center;
    cursor: pointer;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.prototype-bottom-sheet.is-collapsed .sheet-detail,
.prototype-bottom-sheet.is-collapsed .sheet-close,
.prototype-bottom-sheet.is-collapsed .sheet-content {
    display: none;
}

.prototype-bottom-sheet.translate-y-full {
    opacity: 0;
    pointer-events: none;
}

.prototype-bottom-sheet:not(.translate-y-full) {
    opacity: 1;
    pointer-events: auto;
}

#details-carousel-panel {
    height: min(19rem, 44vh);
}

.details-sheet-header > div:first-child {
    margin-left: 18.75rem;
}

.details-sheet-content {
    gap: 1rem;
    padding-top: 0;
    overflow: visible !important;
}

.details-overview-card {
    display: flex;
    width: 18rem;
    min-width: 18rem;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
    align-self: stretch;
    margin-top: -3.65rem;
    min-height: 15.55rem;
    padding: 1.15rem;
    transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.details-overview-card:hover,
.details-overview-card.active {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.08);
}

.details-overview-card:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.75);
    outline-offset: 3px;
}

.details-overview-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-top: 0.05rem;
}

.details-overview-icon {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
}

.details-overview-card h3 {
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    line-height: 1.2;
    text-transform: uppercase;
}

.details-card-model-preview {
    position: relative;
    display: grid;
    flex: 1;
    min-height: 6.2rem;
    place-items: center;
    border-radius: 0.45rem;
}

.mini-dialith-piece {
    position: absolute;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.58);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(175, 175, 175, 0.64));
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
    transition: transform 0.5s ease, opacity 0.35s ease;
}

.mini-dialith-body {
    width: 2.8rem;
    height: 5.15rem;
    border-radius: 0.58rem;
}

.mini-dialith-top {
    width: 2.55rem;
    height: 0.55rem;
    border-radius: 0.38rem 0.38rem 0.14rem 0.14rem;
    transform: translateY(-3.1rem);
}

.mini-dialith-base {
    width: 3rem;
    height: 0.55rem;
    border-radius: 0.12rem 0.12rem 0.42rem 0.42rem;
    transform: translateY(3.08rem);
}

.mini-dialith-left,
.mini-dialith-right {
    width: 0.52rem;
    height: 4.55rem;
    border-radius: 0.32rem;
    background: linear-gradient(145deg, rgba(230, 230, 230, 0.9), rgba(126, 126, 126, 0.6));
}

.mini-dialith-left {
    transform: translateX(-1.68rem);
}

.mini-dialith-right {
    transform: translateX(1.68rem);
}

.details-overview-card[data-preview-state="exploded"] .mini-dialith-top {
    transform: translateY(-3.65rem);
}

.details-overview-card[data-preview-state="exploded"] .mini-dialith-base {
    transform: translateY(3.65rem);
}

.details-overview-card[data-preview-state="exploded"] .mini-dialith-left {
    transform: translateX(-2.55rem);
}

.details-overview-card[data-preview-state="exploded"] .mini-dialith-right {
    transform: translateX(2.55rem);
}

.details-overview-card p {
    margin-top: 0.35rem;
    color: rgba(209, 213, 219, 0.76);
    font-size: 0.76rem;
    line-height: 1.45;
}

.details-overview-card dl {
    display: grid;
    gap: 0.35rem;
}

.details-overview-card dl div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.68rem;
}

.details-overview-card dt {
    color: rgba(156, 163, 175, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.details-overview-card dd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.details-card-controls {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.45rem;
    margin-top: auto;
}

.details-mode-toggle {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.2rem;
}

.details-mode-btn {
    min-width: 0;
    flex: 1;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #8b8b8b;
    cursor: pointer;
    font-size: 0.54rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1;
    padding: 0.55rem 0.45rem;
    text-transform: uppercase;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.details-mode-btn:hover,
.details-mode-btn.active {
    background: rgba(255, 255, 255, 0.11);
    color: #ffffff;
}

.details-rotation-btn {
    display: grid;
    width: 2.05rem;
    height: 2.05rem;
    min-width: 2.05rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    color: #d1d5db;
    cursor: pointer;
    font-size: 0.68rem;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.details-rotation-btn:hover {
    background: rgba(255, 255, 255, 0.11);
    color: #ffffff;
}

.details-overview-card > .details-rotation-btn {
    width: 2.05rem;
    height: 2.05rem;
    min-width: 2.05rem;
    margin-top: 0;
}

.details-mini-panel {
    position: absolute;
    left: 50%;
    bottom: 1.5rem;
    z-index: 42;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    transform: translate(-50%, 0);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.86);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.65);
    padding: 0.25rem;
    backdrop-filter: blur(18px);
    cursor: pointer;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
}

.details-mini-panel.translate-y-full {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 1.25rem);
}

.details-mini-mode-btn {
    min-width: 6.5rem;
    padding: 0.72rem 0.95rem;
}

.details-mini-rotation-btn {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: transparent;
    color: #d1d5db;
    cursor: pointer;
    font-size: 0.72rem;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.details-mini-rotation-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.content-protected {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.dialith-loader-mark {
    position: relative;
    width: 4.8rem;
    height: 7.1rem;
    margin-bottom: 1.5rem;
    display: grid;
    place-items: center;
    border-radius: 1.05rem;
    overflow: hidden;
}

.dialith-loader-mark::before,
.dialith-loader-mark::after {
    content: "";
    position: absolute;
    border-radius: inherit;
}

.dialith-loader-mark::before {
    inset: 0;
    background:
        conic-gradient(from 0deg,
            rgba(255, 255, 255, 0.08),
            rgba(255, 255, 255, 0.24),
            #ffffff,
            rgba(190, 190, 190, 0.42),
            rgba(255, 255, 255, 0.08),
            rgba(255, 255, 255, 0.0),
            rgba(255, 255, 255, 0.08));
    box-shadow:
        0 0 28px rgba(255, 255, 255, 0.13),
        inset 0 0 18px rgba(255, 255, 255, 0.08);
    animation: dialith-loader-spin 1.45s linear infinite;
}

.dialith-loader-mark::after {
    inset: 3px;
    background: #050505;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 12px 22px rgba(255, 255, 255, 0.02);
}

.dialith-loader-core {
    position: relative;
    z-index: 1;
    width: calc(100% - 1.05rem);
    height: calc(100% - 1.05rem);
    border-radius: 0.78rem;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.08), transparent 34%),
        #050505;
    box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.03);
}

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

@media (max-width: 1024px) {
    .site-nav {
        gap: 1rem;
    }

    .step-card {
        padding: 1rem;
    }

    .prototype-top-nav {
        gap: 1.25rem !important;
    }

    .prototype-bottom-sheet {
        height: min(15rem, 34vh);
    }
}

@media (max-width: 768px) {
    .site-nav {
        padding: 1rem 1.25rem;
    }

    .site-nav > a:first-child {
        font-size: 1rem;
        letter-spacing: 0.22em;
    }

    .site-nav .prototype-cta {
        width: 2.8rem;
        height: 2.8rem;
        justify-content: center;
        gap: 0;
        padding: 0;
        font-size: 0;
        letter-spacing: 0;
        white-space: nowrap;
    }

    .site-nav .prototype-cta span {
        display: none;
    }

    .site-nav .prototype-cta i {
        font-size: 0.82rem;
    }

    #hero {
        min-height: 100svh;
        height: 100svh;
    }

    #hero h1 {
        font-size: clamp(2.35rem, 10vw, 4.25rem);
        letter-spacing: 0.065em;
        padding-left: 0.065em;
    }

    #hero p,
    #cta p {
        font-size: 0.95rem;
        line-height: 1.7;
        letter-spacing: 0.08em;
    }

    #concept,
    #evolution,
    #habitats,
    #cta {
        padding-top: 5.5rem;
        padding-bottom: 5.5rem;
    }

    #concept h2,
    #system h2,
    #evolution h2,
    #habitats h2,
    #cta h2 {
        font-size: clamp(1.85rem, 8vw, 2.5rem);
        letter-spacing: 0.12em;
        line-height: 1.18;
    }

    #concept h3 {
        font-size: 1.65rem;
        letter-spacing: 0.12em;
    }

    #concept p {
        font-size: 1rem;
    }

    .shift-heading {
        margin-bottom: 4.25rem;
    }

    .shift-experience {
        grid-template-columns: 1fr;
        gap: 2.75rem;
        min-height: auto;
    }

    .shift-stage {
        height: clamp(19rem, 78vw, 28rem);
    }

    .shift-object {
        width: min(44%, 13rem);
    }

    .shift-monolith {
        left: 0;
    }

    .shift-dialith {
        left: 50%;
    }

    .shift-experience[data-shift-state="monolith"] .shift-monolith,
    .shift-experience[data-shift-state="dialith"] .shift-dialith {
        left: 0;
    }

    .shift-experience[data-shift-state="monolith"] .shift-dialith,
    .shift-experience[data-shift-state="dialith"] .shift-monolith {
        left: 45%;
    }

    .shift-image {
        height: clamp(13.5rem, 58vw, 21rem);
    }

    .shift-name {
        font-size: clamp(0.8rem, 3.2vw, 1rem);
        letter-spacing: 0.12em;
        white-space: normal;
    }

    .shift-copy {
        min-height: 12.5rem;
    }

    .shift-copy-panel h3 {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
    }

    .shift-copy-panel p {
        font-size: clamp(0.85rem, 3.5vw, 0.95rem);
        max-width: 100%;
    }

    #system {
        height: auto;
        min-height: 100svh;
    }

    #system > .relative {
        min-height: 100svh;
        padding-top: 6.5rem;
        padding-bottom: 4.5rem;
        gap: 3rem;
    }

    .step-bg {
        object-position: center;
    }

    .system-heading {
        top: 6.2rem;
        left: 1.25rem;
        width: min(24rem, calc(100vw - 2.5rem));
    }

    .system-steps {
        left: 1rem;
        bottom: 2rem;
        width: min(100%, calc(100vw - 2rem));
        flex-direction: column;
        gap: 0.65rem;
    }

    .step-card .step-title {
        font-size: 1.05rem;
    }

    #evolution .relative.h-\[400px\] {
        height: 19rem;
    }

    .habitat-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .habitat-planet {
        width: min(68vw, 16rem);
        height: min(68vw, 16rem);
        min-width: 12rem;
        min-height: 12rem;
    }

    #cta .w-\[500px\] {
        width: 18rem;
        height: 18rem;
    }

    .prototype-header {
        padding: 1rem 1rem 0;
    }

    .prototype-brand {
        left: 1rem !important;
        top: 1rem !important;
    }

    .prototype-brand h1 {
        font-size: 0.95rem;
        letter-spacing: 0.22em;
    }

    .prototype-brand p {
        display: none;
    }

    .prototype-info-button {
        right: 1rem !important;
        top: 1rem !important;
    }

    .prototype-top-nav {
        position: absolute;
        top: 3.35rem;
        left: 0.75rem;
        right: 0.75rem;
        width: auto !important;
        max-width: none !important;
        justify-content: space-between;
        gap: 0.35rem !important;
        padding: 0.55rem 0.6rem !important;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 999px;
        background: rgba(10, 10, 10, 0.72);
        backdrop-filter: blur(14px);
    }

    .prototype-nav-btn {
        flex: 1;
        min-width: 0;
        gap: 0.16rem;
    }

    .prototype-nav-icon {
        font-size: 0.85rem;
    }

    .prototype-nav-title {
        font-size: 0.56rem;
        letter-spacing: 0.04em;
    }

    .prototype-nav-sub {
        display: none;
    }

    #prototype-info-bubble {
        top: 3.25rem;
        right: 1rem;
        width: min(20rem, calc(100vw - 2rem));
    }

    #part-tooltip,
    #details-info-panel {
        top: 7.4rem;
        left: 1rem;
        width: min(17rem, calc(100vw - 2rem));
    }

    #details-info-panel h2 {
        font-size: 1rem;
        letter-spacing: 0.12em;
    }

    #details-info-panel p {
        margin-top: 0.55rem;
        font-size: 0.68rem;
        line-height: 1.55;
    }

    .structure-mode-btn {
        min-width: 5.6rem;
        padding: 0.68rem 0.75rem;
        font-size: 0.58rem;
    }

    .structure-rotation-btn {
        width: 2.2rem;
        height: 2.2rem;
        font-size: 0.65rem;
    }

    #structure-mode-panel {
        bottom: 1.15rem;
    }

    .prototype-bottom-sheet {
        height: min(17rem, 42vh);
    }

    #details-carousel-panel {
        height: min(18rem, 44vh);
    }

    #screen-options-panel {
        height: min(17.5rem, 43vh);
    }

    .details-sheet-header > div:first-child,
    .screen-sheet-header > div:first-child {
        margin-left: 11.4rem;
    }

    .prototype-bottom-sheet.is-collapsed {
        height: 3.55rem;
    }

    .sheet-header {
        min-height: 3.55rem;
        padding: 1rem 1.1rem 0.65rem !important;
    }

    .sheet-header h2 {
        font-size: 1rem;
    }

    .sheet-detail {
        font-size: 0.72rem;
        line-height: 1.45;
    }

    .sheet-content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-bottom: 1rem !important;
    }

    #parts-carousel {
        gap: 0.65rem;
        padding-left: 2.15rem !important;
        padding-right: 2.15rem !important;
    }

    .part-card {
        width: 7rem !important;
        padding: 0.65rem !important;
    }

    .details-sheet-content {
        gap: 0.65rem;
    }

    .screen-sheet-content {
        gap: 0.65rem;
    }

    .details-overview-card {
        width: 11rem;
        min-width: 11rem;
        gap: 0.45rem;
        margin-top: -2.75rem;
        min-height: 13rem;
        padding: 0.75rem;
    }

    .interface-overview-card {
        width: 11rem;
        min-width: 11rem;
        gap: 0.45rem;
        height: 12.55rem;
        margin-top: -2.45rem;
        min-height: 0;
        padding: 0.75rem;
    }

    .interface-overview-icon {
        font-size: 0.78rem;
    }

    .interface-overview-card h3 {
        font-size: 0.68rem;
    }

    .interface-side-btn {
        font-size: 0.48rem;
        padding: 0.45rem 0.25rem;
    }

    .details-overview-icon {
        font-size: 0.78rem;
    }

    .details-overview-card h3 {
        font-size: 0.68rem;
    }

    .details-overview-card p {
        font-size: 0.62rem;
        line-height: 1.35;
    }

    .details-card-model-preview {
        min-height: 4.65rem;
        transform: scale(0.78);
    }

    .details-overview-card dl {
        gap: 0.2rem;
    }

    .details-overview-card dl div {
        font-size: 0.58rem;
    }

    .details-card-controls {
        gap: 0.35rem;
    }

    .details-mode-btn {
        font-size: 0.46rem;
        padding: 0.45rem 0.25rem;
    }

    .details-rotation-btn {
        width: 1.85rem;
        height: 1.85rem;
        min-width: 1.85rem;
        font-size: 0.6rem;
    }

    .details-overview-card > .details-rotation-btn {
        width: 1.85rem;
        height: 1.85rem;
        min-width: 1.85rem;
    }

    .details-mini-panel {
        bottom: 1.05rem;
    }

    .details-mini-mode-btn {
        min-width: 5.5rem;
        padding: 0.64rem 0.72rem;
        font-size: 0.52rem;
    }

    .details-mini-rotation-btn {
        width: 2.15rem;
        height: 2.15rem;
        font-size: 0.64rem;
    }

    .screen-theme-btn {
        flex-basis: 4.45rem;
        height: 8.6rem;
    }

    .screen-theme-preview {
        height: 6.4rem;
        min-height: 6.4rem;
    }

    .screen-theme-label {
        min-height: 2rem;
        font-size: 0.5rem;
        padding: 0.25rem;
    }

    .screen-theme-preview,
    .screen-theme-btn .h-24 {
        height: 6.4rem;
    }
}

@media (max-width: 420px) {
    .site-nav {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .site-nav > a:first-child {
        font-size: 0.9rem;
        letter-spacing: 0.18em;
    }

    .site-nav .prototype-cta {
        width: 2.7rem;
        height: 2.7rem;
        justify-content: center;
        padding: 0;
        font-size: 0.62rem;
    }

    .site-nav .prototype-cta span {
        display: none;
    }

    .site-nav .prototype-cta i {
        font-size: 0.8rem;
    }

    #hero h1 {
        font-size: clamp(2.2rem, 11.8vw, 3rem);
        letter-spacing: 0.075em;
        padding-left: 0.075em;
    }

    #concept .h-80 {
        height: 15rem;
    }

    .prototype-top-nav {
        left: 0.5rem;
        right: 0.5rem;
        padding-left: 0.45rem !important;
        padding-right: 0.45rem !important;
    }

    .prototype-nav-title {
        font-size: 0.5rem;
    }

    .prototype-nav-icon {
        font-size: 0.78rem;
    }

    .structure-mode-btn {
        min-width: 5rem;
        padding: 0.62rem 0.62rem;
    }

    .structure-rotation-btn {
        width: 2.05rem;
        height: 2.05rem;
    }

    .prototype-bottom-sheet {
        height: min(16.5rem, 44vh);
    }

    #details-carousel-panel {
        height: min(17rem, 46vh);
    }

    #screen-options-panel {
        height: min(16.5rem, 46vh);
    }

    .details-sheet-header > div:first-child,
    .screen-sheet-header > div:first-child {
        margin-left: 0;
    }

    .details-overview-card {
        width: 9.5rem;
        min-width: 9.5rem;
        margin-top: -2.05rem;
        min-height: 11.85rem;
    }

    .interface-overview-card {
        width: 9.5rem;
        min-width: 9.5rem;
        height: 11.5rem;
        margin-top: -1.75rem;
        min-height: 0;
    }

    .details-overview-card p {
        display: none;
    }

    .details-card-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .details-rotation-btn {
        width: 2rem;
        min-width: 2rem;
    }

    .details-mini-mode-btn {
        min-width: 4.8rem;
        padding: 0.58rem 0.58rem;
    }

    .details-mini-rotation-btn {
        width: 2rem;
        height: 2rem;
    }

    .screen-theme-btn {
        flex-basis: 4rem;
        height: 8rem;
    }

    .screen-theme-preview,
    .screen-theme-btn .h-24 {
        height: 5.95rem;
        min-height: 5.95rem;
    }

    .screen-theme-label {
        min-height: 1.85rem;
        font-size: 0.46rem;
        padding: 0.25rem;
    }

    #screen-theme-list {
        padding-left: 2.25rem !important;
        padding-right: 2.25rem !important;
    }
}
