/* DGTL.TECH Styles */
/* Optimized for SEO and Performance */

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

:root {
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-card: #ffffff;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --border-color: rgba(0,0,0,0.06);
    --nav-bg: rgba(255, 255, 255, 0.6);
    --btn-secondary-bg: #e8e8ed;
    --btn-secondary-hover: #d2d2d7;
    --logo-image: url('hex-bw.png');
}

[data-theme="dark"] {
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --bg-primary: #000000;
    --bg-secondary: #1d1d1f;
    --bg-card: #1d1d1f;
    --accent: #2997ff;
    --accent-hover: #0077ed;
    --border-color: rgba(255,255,255,0.1);
    --nav-bg: rgba(0, 0, 0, 0.6);
    --btn-secondary-bg: #333336;
    --btn-secondary-hover: #48484a;
    --logo-image: url('hex-wb.png');
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --text-primary: #f5f5f7;
        --text-secondary: #86868b;
        --bg-primary: #000000;
        --bg-secondary: #1d1d1f;
        --bg-card: #1d1d1f;
        --accent: #2997ff;
        --accent-hover: #0077ed;
        --border-color: rgba(255,255,255,0.1);
        --nav-bg: rgba(0, 0, 0, 0.6);
        --btn-secondary-bg: #333336;
        --btn-secondary-hover: #48484a;
        --logo-image: url('hex-wb.png');
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    top: 0;
}

/* Navigation */
nav[role="navigation"] {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: saturate(200%) blur(30px);
    -webkit-backdrop-filter: saturate(200%) blur(30px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px;
    height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-primary);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.nav-link:hover,
.nav-link:focus {
    opacity: 1;
}

.nav-cta {
    font-size: 12px;
    font-weight: 400;
    color: var(--accent);
    transition: opacity 0.3s;
}

.nav-cta:hover,
.nav-cta:focus {
    opacity: 0.7;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.3s, background 0.3s;
    border-radius: 50%;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.theme-toggle:focus {
    outline: none;
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun {
        display: block;
    }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon {
        display: none;
    }
}

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 480px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    z-index: 10000;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    transform: translateY(calc(100% + 48px));
    transition: transform 0.4s ease;
}

.cookie-consent.visible {
    transform: translateY(0);
}

.cookie-consent-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.cookie-consent-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.cookie-consent-text a {
    color: var(--accent);
    text-decoration: none;
}

.cookie-consent-text a:hover {
    text-decoration: underline;
}

.cookie-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.cookie-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.cookie-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
}

.cookie-option input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.cookie-option-content {
    flex: 1;
}

.cookie-option-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-option-required {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

.cookie-option-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 4px;
}

.cookie-consent-buttons {
    display: flex;
    gap: 12px;
}

.cookie-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.cookie-btn-accept {
    background: var(--accent);
    color: #fff;
}

.cookie-btn-accept:hover {
    background: var(--accent-hover);
}

.cookie-btn-settings {
    background: var(--btn-secondary-bg);
    color: var(--text-primary);
}

.cookie-btn-settings:hover {
    background: var(--btn-secondary-hover);
}

.cookie-btn-reject {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.cookie-btn-reject:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.cookie-btn-save {
    background: var(--accent);
    color: #fff;
}

.cookie-btn-save:hover {
    background: var(--accent-hover);
}

.cookie-consent-initial .cookie-options {
    display: none;
}

.cookie-consent-initial .cookie-btn-save,
.cookie-consent-initial .cookie-btn-reject {
    display: none;
}

.cookie-consent-expanded .cookie-btn-settings,
.cookie-consent-expanded .cookie-btn-accept {
    display: none;
}

@media (max-width: 540px) {
    .cookie-consent {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 20px;
    }

    .cookie-consent-buttons {
        flex-direction: column;
    }
}

/* Hero */
.hero {
    padding: 160px 24px 120px;
    text-align: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.03;
    animation: heroPulse 8s ease-in-out infinite;
}

@keyframes heroPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.03; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.06; }
}

.hero-logo {
    width: 180px;
    height: auto;
    margin-bottom: 40px;
    animation: logoSpinInitial 1.5s cubic-bezier(0.15, 0.8, 0.3, 1) forwards;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.hero-logo.spin {
    animation: logoSpinClick 1.5s cubic-bezier(0.15, 0.8, 0.3, 1);
}

.hero-logo.flyaway {
    animation: logoFlyAway 1.5s cubic-bezier(0.2, 0, 0.8, 1) forwards;
}

.dead-logo {
    position: absolute;
    width: 126px;
    height: auto;
    opacity: 0;
    z-index: 0;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.dead-logo.show {
    animation: deadLogoAppear 1.5s ease-out 1.5s forwards;
}

@keyframes logoSpinInitial {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(2160deg); }
}

@keyframes logoSpinClick {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(2160deg); }
}

@keyframes logoFlyAway {
    0% { transform: rotate(0deg) scale(1); opacity: 1; }
    100% { transform: rotate(4320deg) scale(0) translateY(-500px); opacity: 0; }
}

@keyframes deadLogoAppear {
    0% {
        opacity: 0;
        top: -200px;
    }
    1% {
        opacity: 0;
        top: 200px;
    }
    100% {
        opacity: 1;
        top: 200px;
    }
}

/* Page content hidden until hero loads */
.page-content {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.page-content.loaded {
    opacity: 1;
}

.hero h1 {
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.07;
    margin-bottom: 12px;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out;
}

.hero-tagline {
    font-size: 21px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section */
.section {
    padding: 80px 24px;
}

.section-dark {
    background: var(--bg-secondary);
}

.section-container {
    max-width: 980px;
    margin: 0 auto;
}

.section-title {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 21px;
    font-weight: 400;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 64px;
}

.section-description {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 700px;
    margin: -40px auto 64px;
    line-height: 1.7;
}

/* Cards Grid */
.cards-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 56px;
    align-items: stretch;
}

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

.card {
    background: var(--bg-primary);
    border-radius: 18px;
    padding: 32px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.section-dark .card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.section:not(.section-dark) .card {
    background: var(--bg-secondary);
}

.card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.card-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.card-title-sm {
    font-size: 21px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.card-price {
    font-size: 21px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.card-price span {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
}

.card-features {
    list-style: none;
    margin-bottom: 24px;
    text-align: left;
    flex-grow: 1;
}

.card-features li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.card-features li:last-child {
    border-bottom: none;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 400;
    border-radius: 980px;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--text-secondary);
    border: none;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--btn-secondary-hover);
    color: var(--text-primary);
}

/* FAQ */
.faq-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    max-width: 700px;
    margin: 0 auto;
}

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

.faq-column {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.faq-item {
    display: flex;
    justify-content: flex-start;
    gap: 24px;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 140px;
    flex-shrink: 0;
}

.faq-value {
    font-size: 14px;
    color: var(--text-secondary);
}

.faq-value a {
    color: var(--accent);
}

.faq-value a:hover {
    text-decoration: underline;
}

/* Apps Showcase */
.app-showcase {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 700px) {
    .app-showcase {
        grid-template-columns: 1fr;
    }
}

.app-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 32px 40px;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    max-width: 420px;
    width: 100%;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.app-card-rage,
.app-card-chainflake,
.app-card-rpki,
.app-card-rbl {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.app-card-rage:hover,
.app-card-chainflake:hover,
.app-card-rpki:hover,
.app-card-rbl:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: none;
}

.app-card-glow {
    display: none;
}

.app-card-rage .app-link,
.app-card-chainflake .app-link,
.app-card-rpki .app-link,
.app-card-rbl .app-link {
    color: #fff;
}

.app-icon-rpki,
.app-icon-rbl {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
}

.app-card-placeholder {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: default;
}

.app-card-placeholder:hover {
    transform: none;
    box-shadow: none;
}

.app-icon-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
}

.app-icon-placeholder svg {
    width: 40px;
    height: 40px;
}

.app-link-disabled {
    color: rgba(255, 255, 255, 0.4) !important;
}

.app-card-glow {
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(232, 90, 40, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    flex-shrink: 0;
}

.app-info {
    position: relative;
    z-index: 1;
}

.app-name {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.app-tagline {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 12px;
}

.app-link {
    font-size: 14px;
    font-weight: 500;
    color: #E85A28;
}

@media (max-width: 500px) {
    .app-card {
        flex-direction: column;
        text-align: center;
        padding: 32px 24px;
    }

    .app-card-glow {
        top: -30%;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Partners */
.partners {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
    margin-top: 48px;
    padding-top: 32px;
}

.partners a {
    opacity: 0.5;
    transition: opacity 0.3s;
}

.partners a:hover {
    opacity: 0.7;
}

.partners img {
    height: 32px;
    filter: grayscale(100%);
}

/* Contact */
.contact-section {
    padding: 100px 24px;
    text-align: center;
    background: var(--bg-secondary);
}

.contact-section h2 {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.contact-section p {
    font-size: 21px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.social-links {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.social-links a {
    font-size: 14px;
    color: var(--accent);
    transition: opacity 0.3s;
}

.social-links a:hover {
    opacity: 0.7;
}

/* Footer */
footer {
    padding: 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    font-size: 12px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-legal {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 734px) {
    .hero h1 {
        font-size: 40px;
    }

    .hero-tagline {
        font-size: 17px;
    }

    .section-title {
        font-size: 32px;
    }

    .section-subtitle {
        font-size: 17px;
    }

    .nav-links {
        gap: 16px;
    }

    .partners {
        flex-wrap: wrap;
        gap: 32px;
    }

    .contact-section h2 {
        font-size: 32px;
    }
}

/* Print */
@media print {
    nav, .cookie-consent, .theme-toggle {
        display: none !important;
    }

    .hero {
        padding-top: 20px;
    }
}

/* Legal Pages (ToS, Privacy, Cookies) */
.legal-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 100px 24px 80px;
}

.legal-content h1 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.legal-content .last-updated {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.legal-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
}

.legal-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
}

.legal-content p {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.legal-content ul,
.legal-content ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

.legal-content li {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 8px;
}

.legal-content a {
    color: var(--accent);
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-content blockquote {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.legal-content blockquote p {
    margin-bottom: 0;
}

.toc {
    max-width: 720px;
    margin: 100px auto 0;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.toc-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.toc ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.toc li {
    margin-bottom: 6px;
    font-size: 14px;
}

.contact-box {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 24px 0;
}

.contact-box p {
    margin-bottom: 8px;
}

.contact-box p:last-child {
    margin-bottom: 0;
}

.highlight-box {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.highlight-box p {
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.highlight-box p:last-child {
    margin-bottom: 0;
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.cookie-table th,
.cookie-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.cookie-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
}

.cookie-table td {
    vertical-align: top;
}

.cookie-table tr:last-child td {
    border-bottom: none;
}

.cookie-table td:first-child {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .legal-content h1 {
        font-size: 28px;
    }

    .cookie-table {
        display: block;
        overflow-x: auto;
    }
}
