:root {
    --apple-bg: #ffffff;
    --apple-text: #1d1d1f;
    --apple-gray: #f5f5f7;
    --apple-gray-2: #e8e8ed;
    --apple-blue: #0071e3;
    --apple-accent: #ff9500;
    --accent-glow: rgba(255, 149, 0, 0.15);
    --accent-glow-strong: rgba(255, 149, 0, 0.3);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #ffffff;
    color: #1d1d1f;
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Loading Spinner */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #ffffff;
    color: #1d1d1f;
    font-family: 'Inter', sans-serif;
    flex-direction: column;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--apple-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

*:focus-visible {
    outline: 2px solid rgba(255, 170, 50, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Glassmorphism Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Apple Nav Styles */
.apple-nav {
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    transition: background-color 0.5s cubic-bezier(0.28, 0.11, 0.32, 1);
}

.apple-nav-link {
    color: #1d1d1f;
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: -0.01em;
    opacity: 0.8;
    transition: opacity 0.3s ease, color 0.3s ease;
    display: flex;
    align-items: center;
}

.apple-nav-link:hover {
    opacity: 1;
    color: var(--apple-accent);
}

.logo-link {
    opacity: 1;
}

/* MudBlazor Overrides */
.mud-typography {
    font-family: var(--font-family) !important;
    color: var(--apple-text) !important;
}

.mud-paper {
    background-color: var(--apple-gray) !important;
    color: var(--apple-text) !important;
    border: 1px solid var(--glass-border);
    box-shadow: none !important;
    border-radius: 12px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* --- Hero Section --- */
.hero-section {
    height: 100vh;
    width: 100%;
    background-color: #ffffff;
    margin-top: -44px;
    padding-top: 44px;
    padding-left: 16px;
    padding-right: 16px;
}

.hero-title-gradient {
    font-weight: 700;
    font-size: clamp(2rem, 8vw, 4rem);
    letter-spacing: -0.02em;
    background: -webkit-linear-gradient(45deg, #e8453c, #ff9500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.hero-subtitle-text {
    font-weight: 500;
    color: #1d1d1f;
    max-width: 800px;
    display: inline-block;
    line-height: 1.2;
    margin-bottom: 40px;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
}

/* --- Where to Begin Section --- */
.where-to-begin-section {
    padding: clamp(40px, 8vw, 100px) 0;
}

.fade-in-up {
    animation: fadeInUp 1s ease-out;
}

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

/* --- Apple Cards --- */
.apple-card {
    background: #111111;
    border-radius: 18px;
    padding: 0;
    height: 420px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 1px solid transparent;
}

.apple-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 0 20px var(--accent-glow);
    border-color: rgba(255, 149, 0, 0.25);
}

.card-image {
    width: 100%;
    height: 60%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.apple-card:hover .card-image {
    transform: scale(1.05);
}

.card-content {
    padding: 24px;
    background-color: #111111;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
}

.card-content .mud-typography.mud-typography-h5 {
    color: #ffffff !important;
}

.card-content .mud-typography.mud-typography-body2 {
    color: #a1a1a6 !important;
}

/* --- Story Pages --- */
.content-wrapper {
    background: #ffffff;
    min-height: 50vh;
    padding-top: 40px;
}

.read-time {
    position: fixed;
    top: 78px;
    right: 24px;
    z-index: 98;
    background: rgba(50, 50, 50, 0.85);
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 10px;
    letter-spacing: 0.3px;
    pointer-events: none;
}

.intro-box {
    padding: 60px 20px;
    text-align: center;
}

.story-text {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #424245;
    margin-bottom: 2rem;
    font-weight: 400;
}

.story-text a,
.inline-link {
    color: var(--apple-accent);
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
}

.story-text a:hover,
.inline-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* --- Reveal on Scroll --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Image Containers --- */
.image-container {
    position: relative;
}

.image-caption {
    position: absolute;
    bottom: 20px;
    left: 16px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 14px;
    border-radius: 99px;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

/* --- Luxury Next Link Block --- */
.luxury-next-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #2a1f0e 0%, #1e2a3a 100%);
    border: 1px solid rgba(255, 179, 64, 0.15);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.luxury-next-tile::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at right center, rgba(255, 179, 64, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.luxury-next-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(40, 30, 10, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 179, 64, 0.35);
}

.luxury-next-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    z-index: 1;
}

.luxury-next-text-group {
    display: flex;
    flex-direction: column;
}

.luxury-next-label {
    color: #ffb340;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
    font-weight: 500;
}

.luxury-next-title {
    color: #ffffff;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.luxury-next-subtitle {
    color: #86868b;
    font-size: 14px;
    font-weight: 400;
    margin-top: 4px;
}

.luxury-next-arrow {
    color: #ffb340;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

.luxury-next-tile:hover .luxury-next-arrow {
    transform: translateX(8px);
    color: #ffffff;
}

/* --- Fiber Animation (Next Link) --- */
.fiber-container {
    flex-grow: 1;
    height: 48px;
    margin: 0 40px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.fiber-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.fiber-base {
    stroke: rgba(255, 179, 64, 0.08);
    stroke-width: 1px;
    fill: none;
}

.fiber-path {
    fill: none;
    stroke-linecap: round;
    animation: fiberFlow linear infinite;
}

.fiber-path-1 {
    stroke: #ff9500;
    stroke-width: 2px;
    stroke-dasharray: 40 60;
    animation-duration: 8s;
    opacity: 0.7;
    filter: drop-shadow(0 0 6px #ff9500);
}

.fiber-path-2 {
    stroke: #ffb340;
    stroke-width: 1.5px;
    stroke-dasharray: 25 75;
    animation-duration: 12s;
    opacity: 0.7;
    filter: drop-shadow(0 0 8px #ffb340);
}

.fiber-path-3 {
    stroke: #e07800;
    stroke-width: 2.5px;
    stroke-dasharray: 60 40;
    animation-duration: 10s;
    opacity: 0.5;
    filter: drop-shadow(0 0 10px #e07800);
}

.fiber-path-4 {
    stroke: #ffe0a0;
    stroke-width: 1px;
    stroke-dasharray: 15 85;
    animation-duration: 14s;
    opacity: 0.8;
    filter: drop-shadow(0 0 4px #ffe0a0);
}

@keyframes fiberFlow {
    from { stroke-dashoffset: 100; }
    to { stroke-dashoffset: 0; }
}

.dust-particle {
    position: absolute;
    background: #ffcc80;
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0;
    animation: floatDust linear infinite;
}

@keyframes floatDust {
    0% { transform: translate(0, 0); opacity: 0; }
    20% { opacity: 0.4; }
    80% { opacity: 0.4; }
    100% { transform: translate(30px, -15px); opacity: 0; }
}

/* --- Shared Utility Styles --- */
.inline-link {
    color: var(--apple-accent);
    text-decoration: none;
}

/* Search Results */
.search-result-item:hover {
    background-color: #f5f5f7;
}

/* Breadcrumb */
.breadcrumb-nav a:hover {
    color: var(--apple-accent);
    text-decoration: none;
}

/* --- Dark Tiles --- */
.dark-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    border-radius: 20px;
    background-color: #111111;
    color: #ffffff;
    text-decoration: none;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 240px;
    overflow: hidden;
    overflow: hidden;
}

.dark-tile:hover {
    transform: translateY(-6px);
    background-color: #1a1a1c;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2), 0 0 16px var(--accent-glow);
    border-color: rgba(255, 149, 0, 0.2);
}

.dark-tile .mud-typography {
    color: inherit !important;
}

.tile-image-wrapper {
    width: 100%;
    height: 140px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.tile-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.dark-tile:hover .tile-image-wrapper img {
    transform: scale(1.05);
}

.dark-tile-content {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: flex-start;
}

.tile-title {
    font-weight: 600 !important;
    margin-bottom: 8px;
    color: #ffffff !important;
}

.tile-desc {
    color: #86868b !important;
    line-height: 1.4;
}

/* --- Footer --- */
.luxury-footer-static {
    position: relative;
    overflow: hidden;
    padding-top: 40px;
    padding-bottom: 60px;
    background: transparent;
    min-height: 160px;
}

.footer-divider {
    border-color: rgba(255, 179, 64, 0.1) !important;
}

/* --- Project Card (About page) --- */
.project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1b1e2e 0%, #2d324d 100%);
    border: 1px solid rgba(138, 180, 248, 0.15);
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at right center, rgba(0, 113, 227, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(27, 30, 46, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.12);
    border-color: rgba(138, 180, 248, 0.3);
}

.project-card-content {
    z-index: 1;
}

.project-card .mud-typography {
    color: inherit !important;
}

/* --- Blazor Error UI --- */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* --- Mobile Responsive --- */
@media (max-width: 600px) {
    .apple-card {
        height: 320px;
    }

    .dark-tile {
        min-height: 180px;
    }

    .intro-box {
        padding: 30px 12px;
    }

    .intro-box .mud-typography-h1 {
        font-size: clamp(1.6rem, 7vw, 2.5rem) !important;
    }

    .intro-box .mud-typography-h4 {
        font-size: clamp(0.95rem, 3.5vw, 1.25rem) !important;
    }

    .story-text {
        font-size: 1.05rem;
    }

    .luxury-next-title {
        font-size: 18px;
    }

    .luxury-next-tile {
        padding: 16px;
    }

    .fiber-container {
        display: none;
    }

    .read-time {
        top: 68px;
        right: 12px;
    }
}
