@font-face {
    font-family: 'NType 82';
    src: url('fonts/NType82-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    unicode-range: U+0000-024F, U+2000-20CF;
}

@font-face {
    font-family: 'NType 82 Headlines';
    src: url('fonts/NType82-Headline.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    unicode-range: U+0000-024F, U+2000-20CF;
}

:root {
    --bg-main: #f6f6f6;
    --widget-bg: #ffffff; /* Solid white to stand out against the light gray background */
    --text-primary: #0f0f0f;
    --text-secondary: #4f4f4f;
    --accent: #d92d20;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.12);

    --font-mono: var(--font-sans);
    --font-sans: 'NType 82', 'Tektur', 'Inter', sans-serif;
    --font-headline: 'NType 82 Headlines', 'Tektur', 'Inter', sans-serif;

    --font-ru-headline: 'Tektur', 'Inter', sans-serif;

    --radius-sm: 8px;
    --radius-md: 20px;
    --radius-lg: 32px;

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    --grid-dot-color: #ffffff;
    --grid-dot-size: 1.1px;
    --grid-padding-x: 39px;
    --grid-offset-y: 32px;
    --grid-size: calc((100vw - 2 * var(--grid-padding-x)) / 12);
    --grid-overlay-opacity: 0.6; /* Adjusted for subtle inversion */
}

@media (max-width: 767px) {
    :root {
        --grid-size: calc((100vw - 2 * var(--grid-padding-x)) / 4);
    }
}



/* Dark Mode Variables */
body.dark-mode {
    --bg-main: #000000;
    --widget-bg: rgba(255, 255, 255, 0.1); /* Increased opacity to stand out against black */
    --text-primary: #f5f5f5;
    --text-secondary: #c1c1c1;
    --glass-bg: rgba(0, 0, 0, 0.7);
    --glass-border: rgba(255, 255, 255, 0.14);

    --grid-dot-color: #ffffff;
    --grid-overlay-opacity: 0.6; /* Adjusted for subtle inversion */
}

.theme-invert {
    transition: none;
}

.creative-icon-dark {
    opacity: 0;
}

body.dark-mode .creative-icon-dark {
    opacity: 1;
}

body.dark-mode .creative-icon-light {
    opacity: 0;
}

body.dark-mode .theme-invert {
    filter: invert(1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Typography Classes */
.type-logo h1 {
    font-family: var(--font-headline);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.type-product-name {
    font-family: var(--font-headline);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.type-callout {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Header & Nav */
.header {
    position: fixed;
    top: 24px;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.nav-island {
    pointer-events: auto;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 8px 16px;
    display: grid;
    grid-template-columns: 48px auto 48px;
    align-items: center;
    gap: 24px;
    min-width: 300px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.logo {
    text-decoration: none;
    color: var(--text-primary);
    text-align: center;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: var(--transition);
}

@media (hover: hover) {
    .icon-btn:hover {
        background: rgba(128, 128, 128, 0.1);
    }
}

.header-actions {
    display: flex;
    justify-content: flex-end;
}

/* Page Layout */
.page-content {
    padding: 120px 24px 60px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Hero Section */
.hero-section {
    padding: 40px 0 20px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-specs {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dot-matrix-icon {
    width: 12px;
    height: 12px;
    background-image: radial-gradient(circle, currentColor 40%, transparent 40%);
    background-size: 4px 4px;
    display: inline-block;
}

.plus-icon {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Widget Grid System */
.widget-section {
    width: 100%;
}

.widget-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    gap: 16px;
}

/* Widgets */
.widget {
    background-color: var(--widget-bg);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    border: 1px solid var(--glass-border);
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0) scale(1);
    -webkit-user-drag: none;
    display: grid;
}

.widget img,
.widget svg {
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-user-drag: none;
    user-select: none;
}

.widget-wrapper {
    display: flex;
    flex-direction: column;
}

.widget-wrapper > .widget {
    flex: 1;
    width: 100%;
}

@media (hover: hover) {
    .widget-wrapper:hover > .widget {
        transform: translateZ(0) scale(0.98);
    }
}

.widget-wrapper:active > .widget {
    transform: translateZ(0) scale(0.96);
}

.widget-inner {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 24px;
    position: relative;
    z-index: 1;
    min-height: 150px;
}

.widget-inner.flex-row {
    flex-direction: column;
}

.widget-inner.flex-row .widget-info {
    padding-right: 104px;
}

.widget-inner.flex-row .url-icon {
    position: absolute;
    top: 24px;
    right: 24px;
}

.widget-inner.flex-row>img {
    position: absolute;
    bottom: 24px;
    right: 24px;
}

.widget-large {
    grid-column: span 2;
    grid-row: span 2;
}

.widget-medium {
    grid-column: span 1;
    grid-row: span 1;
}

.widget-wide {
    grid-column: span 2;
    grid-row: span 1;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: auto;
    flex-shrink: 0;
}

.status-pill {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 4px 10px;
    background: rgba(128, 128, 128, 0.1);
    border-radius: 50px;
    text-transform: uppercase;
}

.url-icon {
    width: 24px;
    height: 24px;
    opacity: 0.5;
    transition: var(--transition);
}

@media (hover: hover) {
    .widget-wrapper:hover .url-icon {
        opacity: 1;
    }
}

.widget-wrapper:active .url-icon {
    opacity: 1;
}

.widget-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    flex-shrink: 0;
}

.widget-title {
    font-family: var(--font-headline);
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.widget-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.placeholder-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.placeholder-icon.large {
    width: 80px;
    height: 80px;
    margin-bottom: 0;
}

.widget-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding-right: 16px;
}

/* Empty State Styling */
.empty-state {
    border: 1px dashed rgba(128, 128, 128, 0.3);
    background-color: transparent;
}

body.dark-mode .empty-state {
    border-color: rgba(255, 255, 255, 0.2);
}

@media (hover: hover) {
    .empty-state:hover {
        border-color: var(--text-primary);
    }
}

.empty-state:active {
    border-color: var(--text-primary);
}

/* Footer */
.footer-wrapper {
    position: relative;
    z-index: 20;
    background-color: var(--bg-main);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 50vh 0 50vh var(--bg-main);
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.footer {
    padding: 40px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-copy {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
    .widget-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .widget-large,
    .widget-wide {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .widget-grid {
        grid-template-columns: 1fr;
    }

    .widget-large,
    .widget-wide,
    .widget-medium {
        grid-column: span 1;
    }

    .widget-inner.flex-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .widget-inner.flex-row .widget-info {
        display: contents;
    }

    .widget-inner.flex-row .url-icon {
        position: static;
    }

    .widget-inner.flex-row .widget-header {
        order: 1;
        width: 100%;
    }

    .widget-inner.flex-row>img {
        position: static;
        order: 2;
        width: 64px !important;
        height: 64px !important;
        align-self: flex-start;
    }

    .widget-inner.flex-row .widget-title {
        order: 3;
    }

    .widget-inner.flex-row .widget-desc {
        order: 4;
    }

    .footer {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

/* Menu Dropdown */
.menu-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    pointer-events: none;
}

.menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.menu-dropdown a,
.menu-dropdown button {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-primary);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 16px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

@media (hover: hover) {
    .menu-dropdown a:hover,
    .menu-dropdown button:hover {
        background: rgba(128, 128, 128, 0.1);
    }
}

.menu-dropdown a:active,
.menu-dropdown button:active {
    background: rgba(128, 128, 128, 0.15);
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 8px 0;
}

.lang-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--text-primary);
    color: var(--bg-main);
}

.grid-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: difference;
    background-color: transparent;
    background-image: radial-gradient(circle, var(--grid-dot-color) var(--grid-dot-size), transparent calc(var(--grid-dot-size) + 0.5px));
    background-size: var(--grid-size) var(--grid-size);
    background-position: center calc(var(--grid-offset-y) - var(--grid-size) / 2);
    background-attachment: fixed;
    opacity: var(--grid-overlay-opacity);
}

/* Lenis Recommended CSS */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-smooth iframe {
    pointer-events: none;
}

/* Scroll Reveal Animation */
.hide-initial {
    opacity: 0 !important;
}

@keyframes widgetReveal {
    0% { opacity: 0; transform: translateY(50px) translateZ(0) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) translateZ(0) scale(1); }
}

.widget.reveal-anim {
    animation: widgetReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
/* Refactored Inline Styles */
.header-wrapper {
    position: relative;
    pointer-events: auto;
}

.creative-icon-wrapper {
    position: relative;
    width: 24px;
    height: 24px;
}

.creative-icon {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.4s ease;
}

.widget .widget-bg-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: auto;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

.app-icon-lg {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 8px;
}

.app-icon-md {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin-bottom: 8px;
    background-color: transparent;
    flex-shrink: 0;
    object-fit: contain;
}

.app-icon-wide {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background-color: transparent;
    flex-shrink: 0;
    object-fit: contain;
}

.bg-black {
    background-color: #000;
}

