html, body { font-family:'Inter', 'Helvetica Neue', Arial, sans-serif; margin:0; }

html { transition: background-color 0.3s ease, color 0.3s ease; }

body { 
    background:var(--c-bg); 
    color:var(--c-text); 
    transition: background-color 0.3s ease, color 0.3s ease;
    font-variation-settings: "wght" 500; 
}

/* Inline theme variables to guarantee availability */
:root, :root[data-theme="default"] { 
    --c-bg:#08091f; 
    --c-text:#e9efff; 
    --c-glow:#36c7de; 
    --c-accent:#9b47d8; 
    --c-gradient:linear-gradient(135deg,#36c7de 0%, #9b47d8 100%); 
    --c-glass:rgba(255,255,255,0.10); 
    --c-header-bg:rgba(8,9,31,0.72);
    --c-border:rgba(255,255,255,0.14);
    --c-card-border:rgba(255,255,255,0.14);
    --c-input-bg:rgba(255,255,255,0.09);
    --c-input-border:rgba(255,255,255,0.22);
    --c-focus-shadow:rgba(54,199,222,0.22);
    --c-orb:radial-gradient(circle at 45% 50%, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 35%), radial-gradient(circle at 50% 50%, rgba(54,199,222,0.35) 0%, rgba(155,71,216,0.32) 70%);
    --c-page-bg:radial-gradient(circle at 30% 30%, #2c3b8f 0%, #141a38 55%, #2a235d 90%);
    --radius:20px; 
    --c-input-text:#e9efff; 
}
:root[data-theme="light"] {
    --c-bg:#f8f9ff;
    --c-text:#1a1a2e;
    --c-glow:#0ea5e9;
    --c-accent:#7e22ce;
    --c-gradient:linear-gradient(135deg,#0ea5e9 0%, #7e22ce 100%);
    --c-glass:rgba(255,255,255,0.7);
    --c-header-bg:rgba(255,255,255,0.85);
    --c-border:rgba(0,0,0,0.1);
    --c-card-border:rgba(0,0,0,0.08);
    --c-input-bg:rgba(255,255,255,0.9);
    --c-input-border:rgba(0,0,0,0.2);
    --c-focus-shadow:rgba(6,182,212,0.3);
    --c-orb:radial-gradient(circle at 45% 50%, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 35%), radial-gradient(circle at 50% 50%, rgba(6,182,212,0.3) 0%, rgba(168,85,247,0.25) 70%);
    --c-page-bg:linear-gradient(135deg, #e0f2fe 0%, #f3e8ff 100%);
    --radius:20px;
    --c-input-text:#1a1a2e;
}
:root[data-theme="dark"] {
    --c-bg:#0f0f1e; 
    --c-text:#e2e8f0; 
    --c-glow:#22d3ee; 
    --c-accent:#c084fc; 
    --c-gradient:linear-gradient(135deg,#22d3ee 0%, #c084fc 100%); 
    --c-glass:rgba(255,255,255,0.05); 
    --c-header-bg:rgba(15,15,30,0.85);
    --c-border:rgba(255,255,255,0.08);
    --c-card-border:rgba(255,255,255,0.1);
    --c-input-bg:rgba(255,255,255,0.05);
    --c-input-border:rgba(255,255,255,0.2);
    --c-focus-shadow:rgba(34,211,238,0.3);
    --c-orb:radial-gradient(circle at 45% 50%, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 35%), radial-gradient(circle at 50% 50%, rgba(34,211,238,0.4) 0%, rgba(192,132,252,0.35) 70%);
    --c-page-bg:radial-gradient(circle at 30% 30%, #1e293b 0%, #0f172a 55%, #1e1b4b 90%);
    --radius:20px; 
    --c-input-text:#f1f5f9; 
}

/* Theme variables moved to separate files: theme-default.css, theme-light.css, theme-dark.css */

a, .btn-link { color: var(--c-glow); text-decoration:none; transition: color 0.3s ease; }
a:hover { color:var(--c-accent); }
/* Header navigation */
.site-header { position:sticky; top:0; z-index:60; background:var(--c-header-bg); backdrop-filter:blur(10px); border-bottom:1px solid var(--c-border); transition: background-color 0.3s ease, border-color 0.3s ease; }
.site-header .inner { max-width:1300px; margin:0 auto; display:flex; align-items:center; justify-content:space-between; padding:.7rem 1.3rem; box-sizing:border-box; width:100%; }
.brand-text { user-select:none; }
.header-right { display:flex; align-items:center; gap:1rem; }
/* Distinct header logo sizing */
.logo-mini { width:38px; height:38px; object-fit:contain; filter:drop-shadow(0 0 5px rgba(255,255,255,0.35)); }
@media (max-width:760px){ .logo-mini{ width:32px; height:32px; } }
.main-nav { display:flex; gap:1.2rem; }
.main-nav a { color:var(--c-text); padding:.55rem 1rem; border-radius:30px; font-weight:500; transition:.25s; opacity:0.9; outline:none; }
.main-nav a:focus-visible { box-shadow:0 0 0 2px var(--c-glow); }
.main-nav a.active { background:var(--c-gradient); color:#fff; opacity:1; }
.main-nav a:hover { background:var(--c-glass); color:var(--c-text); opacity:1; }
.theme-dropdown { position:relative; }
.theme-trigger { background:var(--c-glass); color:var(--c-text); border:1px solid var(--c-border); padding:.55rem .9rem; border-radius:30px; font-weight:500; cursor:pointer; display:flex; align-items:center; gap:.35rem; backdrop-filter:blur(6px); }
.theme-trigger:hover { background:var(--c-gradient); color:#fff; }
.theme-trigger:focus-visible { outline:none; box-shadow:0 0 0 2px var(--c-glow); }
.theme-list { position:absolute; right:0; top:110%; list-style:none; margin:0; padding:.4rem; background:var(--c-header-bg); border:1px solid var(--c-border); backdrop-filter:blur(10px); border-radius:16px; min-width:140px; display:flex; flex-direction:column; gap:.25rem; box-shadow:0 8px 24px -6px rgba(0,0,0,0.4); }
.theme-list[hidden] { display:none; }
.theme-list button { background:transparent; border:none; color:var(--c-text); text-align:left; padding:.55rem .75rem; border-radius:12px; cursor:pointer; font-size:.85rem; }
.theme-list button:hover { background:var(--c-glass); }
.theme-list button:focus-visible { outline:none; box-shadow:0 0 0 2px var(--c-glow); }
.theme-list button.active { background:var(--c-gradient); color:#fff; }

/* Mobile menu (kebab) */
.mobile-menu-trigger { display:none; background:var(--c-glass); border:1px solid var(--c-border); color:var(--c-text); width:42px; height:42px; border-radius:12px; font-size:1.1rem; cursor:pointer; align-items:center; justify-content:center; }
.mobile-menu-trigger:hover { background:var(--c-gradient); color:#fff; }
.mobile-menu-trigger:focus-visible { outline:none; box-shadow:0 0 0 2px var(--c-glow); }
@media (max-width:760px){ .main-nav, .theme-dropdown { display:none; } .mobile-menu-trigger { display:flex; } .header-right { gap:.6rem; } }
@media (min-width:761px){ .mobile-menu-panel { display:none !important; } }
.mobile-menu-panel { position:fixed; inset:0; background:rgba(0,0,0,0.6); backdrop-filter:blur(8px); z-index:200; display:flex; align-items:flex-start; justify-content:flex-end; padding:4.5rem 1rem 1rem; }
.mobile-menu-content { background:var(--c-header-bg); border:1px solid var(--c-border); border-radius:20px; width:260px; max-width:90vw; padding:1rem 1rem 1.2rem; display:flex; flex-direction:column; gap:1rem; box-shadow:0 12px 40px -10px rgba(0,0,0,0.6); }
.mobile-menu-content nav { display:flex; flex-direction:column; gap:.8rem; }
/* REVISED: make anchors block flex items with gap spacing and consistent height */
.mobile-menu-content nav a { display:block; width:100%; padding:.70rem .95rem; border-radius:14px; background:var(--c-glass); color:var(--c-text); font-weight:500; line-height:1.25; box-sizing:border-box; }
.mobile-menu-content nav a.active { background:var(--c-gradient); color:#fff; }
.mobile-menu-content nav a:hover { background:var(--c-gradient); color:#fff; }
.mobile-theme-list button { width:100%; background:var(--c-glass); border:1px solid var(--c-border); color:var(--c-text); padding:.55rem .75rem; border-radius:14px; cursor:pointer; font-size:.85rem; }
.mobile-theme-list button:hover { background:var(--c-gradient); color:#fff; }
.mobile-theme-list button.active { background:var(--c-gradient); color:#fff; }
.close-mobile { position:absolute; top:1rem; right:1rem; background:var(--c-glass); border:1px solid var(--c-border); color:var(--c-text); padding:.45rem .75rem; border-radius:10px; cursor:pointer; }
.close-mobile:hover { background:var(--c-gradient); color:#fff; }

/* Buttons */
.btn { cursor:pointer; border:none; border-radius:40px; padding:.75rem 1.4rem; font-weight:600; letter-spacing:.4px; transition:.35s; position:relative; overflow:hidden; }
.primary-btn { background:var(--c-gradient); color:#fff; box-shadow:0 8px 25px -8px rgba(66,232,255,0.4),0 8px 25px -8px rgba(202,8,255,0.4); }
.primary-btn:hover { filter:brightness(1.1); transform:translateY(-2px); }
.glass-btn { background:var(--c-glass); color:var(--c-text); backdrop-filter:blur(8px); border:1px solid var(--c-border); }
.glass-btn:hover { background:var(--c-gradient); color:#fff; }
.btn.large { font-size:1.15rem; padding:1rem 2.2rem; }
.hero { position:relative; min-height:70vh; display:flex; align-items:center; justify-content:center; text-align:center; padding:4rem 1.5rem 2rem; overflow:hidden; }
.hero-inner { max-width:890px; z-index:2; }
/* High resolution hero logo styling */
.hero-logo-img { width:220px; max-width:55vw; image-rendering:auto; filter:drop-shadow(0 0 14px rgba(67,232,255,0.35)) drop-shadow(0 0 18px rgba(202,8,255,0.35)); animation:float 7s ease-in-out infinite; }
@media (max-width:640px){ .hero-logo-img{ width:160px; } }
.gradient-text { background:var(--c-gradient); -webkit-background-clip:text; color:transparent; user-select:none; -webkit-user-select:none; -moz-user-select:none; outline:none !important; }
.hero h1, .hero h1:focus, .hero h1:focus-visible, .gradient-text:focus, .gradient-text:focus-visible { outline:none !important; border:none !important; box-shadow:none !important; }
.hero h1 { font-size:clamp(2.8rem,7vw,5rem); margin:.4rem 0 .3rem; font-weight:700; 
    font-variation-settings: "wght" 700; 
}
.hero .tagline { font-size:clamp(1.1rem,2.6vw,2rem); font-weight:500; opacity:.9; margin:.4rem 0 1.2rem; }
.lead { font-size:1.15rem; line-height:1.55rem; opacity:.9; }
.cta-group { margin:2rem 0 0; display:flex; gap:1rem; justify-content:center; flex-wrap:wrap; }
.orb { position:absolute; width:760px; height:760px; background:var(--c-orb); mix-blend-mode:screen; filter:blur(25px) brightness(1.3); opacity:.35; animation:pulse 10s linear infinite; }
.section { padding:4rem 1.5rem; max-width:1200px; margin:0 auto; }
.section-title { font-size:2rem; margin:0 0 2rem; font-weight:600; position:relative; }
.section-title:after { content:""; position:absolute; left:0; bottom:-10px; width:80px; height:4px; background:var(--c-gradient); border-radius:2px; }
.grid-3 { display:grid; gap:2rem; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.card { background:var(--c-glass); padding:1.4rem 1.3rem 1.2rem; border-radius:var(--radius); border:1px solid var(--c-card-border); box-shadow:0 0 0 1px rgba(255,255,255,0.06),0 8px 28px -8px rgba(0,0,0,0.55); transition:transform 0.4s ease, box-shadow 0.4s ease, background-color 0.3s ease, border-color 0.3s ease; color:var(--c-text); }
.card:hover { transform:translateY(-4px); box-shadow:0 8px 32px -6px rgba(66,232,255,0.4),0 8px 32px -6px rgba(202,8,255,0.4); }
/* Icon + title layout in cards */
.card h4 { display:flex; align-items:center; gap:.55rem; margin:0 0 .4rem; }
.card h4 .icon { width:22px; height:22px; color:var(--c-glow); opacity:.9; flex:0 0 22px; }

.timeline { display:grid; gap:1.5rem; }
.t-item { display:flex; gap:1.2rem; background:var(--c-glass); padding:1rem 1.3rem; border-radius:16px; border:1px solid var(--c-card-border); position:relative; overflow:hidden; transition:background-color 0.3s ease, border-color 0.3s ease; color:var(--c-text); }
.t-index { font-size:1.9rem; font-weight:700; opacity:.25; line-height:1; }
.final-cta { text-align:center; margin-bottom:1.5rem; }
.final-cta h3 { font-size:2.2rem; margin:0 0 1rem; }
.glass { background:var(--c-glass); border:1px solid var(--c-card-border); border-radius:var(--radius); backdrop-filter:blur(10px); box-shadow:0 8px 30px -10px rgba(0,0,0,0.5); color:var(--c-text); }
.glass-lite { background:var(--c-glass); border:1px solid var(--c-border); border-radius:16px; padding:1.5rem; color:var(--c-text); }
/* Contact */
.contact-grid { display:grid; gap:1.5rem; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); margin:2rem 0; }
.contact-card { background:var(--c-glass); padding:1.2rem 1.1rem 1rem; border-radius:16px; border:1px solid var(--c-border); color:var(--c-text); }
.pill-list { list-style:none; padding:0; margin:.5rem 0 0; display:flex; flex-wrap:wrap; gap:.5rem; }
.pill-list li { background:linear-gradient(90deg,rgba(77,233,255,0.25),rgba(202,8,255,0.25)); padding:.4rem .8rem; border-radius:40px; font-size:.75rem; letter-spacing:.5px; }
.mail-link { font-weight:600; }
.form-grid { display:grid; column-gap:1.25rem; row-gap:1rem; grid-template-columns:repeat(2,minmax(0,1fr)); }
@media (max-width:640px){ .form-grid { grid-template-columns:1fr; } }
/* ensure inputs don't overflow */
.fancy-form .form-control { max-width:100%; box-sizing:border-box; }
.sent { margin-top:1rem; background:var(--c-gradient); -webkit-background-clip:text; color:transparent; font-weight:600; }
input, textarea { background:var(--c-input-bg); border:1px solid var(--c-input-border); padding:.7rem .9rem; width:100%; color:var(--c-text); border-radius:12px; font-size:.95rem; transition:background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; }
input:focus, textarea:focus { outline:none; border-color:var(--c-glow); box-shadow:0 0 0 3px var(--c-focus-shadow); }
/* Contact form enhancements */
.contact-section .fancy-form { margin-top:5rem; padding:2rem 1.6rem 1.8rem; position:relative; overflow:hidden; }
.fancy-form:before { content:""; position:absolute; inset:0; background:linear-gradient(135deg,rgba(67,232,255,0.08),rgba(202,8,255,0.08)); pointer-events:none; }
.fancy-form .form-title { font-size:1.4rem; margin:0 0 1.2rem; font-weight:600; background:var(--c-gradient); -webkit-background-clip:text; color:transparent; }
.fancy-form .field { display:flex; flex-direction:column; gap:.4rem; position:relative; }
.fancy-form label { font-size:.8rem; letter-spacing:.5px; text-transform:uppercase; opacity:.7; font-weight:600; }
.fancy-form .form-control { background:var(--c-input-bg); border:1px solid var(--c-input-border); padding:.75rem .85rem; border-radius:14px; font-size:.9rem; resize:vertical; color:var(--c-input-text); }
.fancy-form .form-control::placeholder { color:color-mix(in srgb, var(--c-input-text) 60%, transparent); }
.fancy-form .form-control:focus { outline:none; border-color:var(--c-glow); box-shadow:0 0 0 3px var(--c-focus-shadow); }
.fancy-form .char-counter { position:absolute; right:.6rem; bottom:.6rem; font-size:.7rem; opacity:.6; }
.fancy-form .text-danger, .validation-message { color:#ff6b6b; font-size:.75rem; font-weight:500; }
.fancy-form .sent { margin-top:1rem; background:var(--c-gradient); -webkit-background-clip:text; color:transparent; font-weight:600; }
.fancy-form button[type=submit] { margin-top:1.2rem; }
/* Higher contrast labels & counter in dark theme */
:root[data-theme="dark"] .fancy-form label { opacity:.85; color:var(--c-input-text); }
:root[data-theme="dark"] .fancy-form .char-counter { opacity:.75; color:var(--c-input-text); }
/* Animations */
@keyframes float { 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(-14px);} }
@keyframes pulse { 0%{ transform:scale(1);} 50%{ transform:scale(1.05);} 100%{ transform:scale(1);} }
@media (max-width:640px){ .hero{ padding:3.2rem 1.2rem 2.8rem; margin-bottom:2.6rem; } /* ensure first section after hero has spacing if custom classes override margins */ .hero + .section{ margin-top:0; } }
#blazor-error-ui { color-scheme:light only; background:lightyellow; bottom:0; box-shadow:0 -1px 2px rgba(0,0,0,0.2); box-sizing:border-box; display:none; left:0; padding:.6rem 1.25rem .7rem 1.25rem; position:fixed; width:100%; z-index:1000; }
#blazor-error-ui .dismiss { cursor:pointer; position:absolute; right:.75rem; top:.5rem; }
.blazor-error-boundary { background:#b32121; padding:1rem 1rem 1rem 3.7rem; color:white; }
.blazor-error-boundary::after { content:"An error occurred." }
.fancy-form .field.full { grid-column: 1 / span 2; }
.fancy-form .actions { grid-column: 1 / span 2; display:flex; justify-content:flex-end; }
.fancy-form .actions .btn.align-right { min-width:220px; }
@media (max-width:640px){
  .fancy-form .field.full { grid-column: auto; }
  .fancy-form .actions { grid-column: auto; justify-content:stretch; }
  .fancy-form .actions .btn.align-right { width:100%; }
}

/* Remove previous duplicates and set consistent grid rules */
.fancy-form .form-grid { display:grid; column-gap:1.25rem; row-gap:1rem; grid-template-columns:repeat(2,minmax(0,1fr)); }
.fancy-form .field.full { grid-column: 1 / span 2; }
.fancy-form .actions { grid-column: 1 / span 2; display:flex; justify-content:flex-end; }
.fancy-form .actions .btn.align-right { min-width:180px; border-radius:15px; padding:.65rem 1.2rem; }
@media (max-width:640px){
  .fancy-form .form-grid { grid-template-columns:1fr; }
  .fancy-form .field.full { grid-column:auto; }
  .fancy-form .actions { grid-column:auto; justify-content:stretch; }
  .fancy-form .actions .btn.align-right { width:100%; }
}

.section.contact.contact-section { margin-top:1.5rem; }
.section.glass { margin-bottom: 2rem; }
.section.glass + .section.glass { margin-top: 2rem; }