/* Root & Reset */
:root {
    --bg: #0b0f17;
    --bg-elev: #101625;
    --text: #e8eefc;
    --muted: #a7b0c4;
    --brand: #6ea8fe;
    --brand-2: #8a5cff;
    --accent: #22d3ee;
    --card: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 10px 30px rgba(0,0,0,.35);
    --radius: 14px;
    --container: 1200px;
    --nav-h: 52px;
}

/* Light theme overrides */
:root[data-theme="light"] {
    --bg: #f6f7fb;
    --bg-elev: #ffffff;
    --text: #0b0f17;
    --muted: #3a4358;
    --card: rgba(0, 0, 0, 0.04);
    --border: rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background:
        radial-gradient(1000px 400px at 80% -10%, rgba(138,92,255,.18), transparent 60%),
        radial-gradient(900px 360px at 10% -20%, rgba(34,211,238,.16), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg) 60%, color-mix(in oklab, var(--bg) 90%, black) 100%);
}

.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: auto; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--bg-elev); color: var(--text); padding: .6rem .8rem; border-radius: .5rem; }

/* Anchor offset for sticky header */
#about, #features, #apps, #hero, #founder { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* Navbar (Apple-like) */
.site-header { position: sticky; top: 0; z-index: 100; backdrop-filter: blur(14px) saturate(180%); background: color-mix(in oklab, var(--bg) 70%, transparent); border-bottom: 1px solid var(--border); transition: background .35s ease, border-color .35s ease; }
.site-header.scrolled { background: color-mix(in oklab, var(--bg) 85%, transparent); }
.navbar { display: flex; align-items: center; justify-content: flex-start; gap: 1.4rem; height: var(--nav-h); padding: 0; }
.brand { font-weight: 700; letter-spacing: .2px; color: var(--text); text-decoration: none; font-size: 1.05rem; padding: 0 .4rem; }
.nav-toggle { display: grid; gap: 5px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.06); padding: .55rem; border-radius: .6rem; cursor: pointer; transition: background .25s ease, border-color .25s ease, transform .2s ease; }
.nav-toggle:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); transform: translateY(-1px); }
.nav-toggle .bar { width: 20px; height: 2px; background: var(--text); display: block; border-radius: 2px; }
.nav-menu { list-style: none; display: flex; gap: 1.6rem; margin: 0; padding: 0; align-items: center; }
.nav-menu a { position: relative; color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.98rem; letter-spacing: .01em; padding: .4rem 0; transition: color .25s ease; }
.nav-menu a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transform: scaleX(0); transform-origin: center; transition: transform .25s ease; border-radius: 2px; opacity: .9; }
.nav-menu a:hover { color: #fff; }
.nav-menu a:hover::after { transform: scaleX(1); }

@media (max-width: 800px) {
    .navbar { justify-content: space-between; }
    .nav-menu { position: fixed; top: var(--nav-h); left: 0; right: 0; flex-direction: column; justify-content: flex-start; align-items: center; gap: 0.5rem; background: rgba(8,10,16,.85); backdrop-filter: blur(24px) saturate(180%); border: none; padding: 2rem 1.5rem; padding-top: 3rem; padding-bottom: 3rem; transform: translateY(-6%); opacity: 0; pointer-events: none; transition: opacity .28s ease, transform .28s ease; z-index: 999; will-change: transform, opacity; height: auto; }
    .nav-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
    .nav-menu li { width: 100%; text-align: center; list-style: none; }
    .nav-menu a { font-size: 1rem; padding: .7rem 1rem; display: block; width: 100%; max-width: 300px; margin: 0 auto; }
    .nav-toggle { z-index: 1000; position: relative; }
}

@media (min-width: 801px) {
    .nav-toggle { display: none; }
}

/* Hero */
.hero { display: grid; grid-template-columns: 1fr; align-items: center; gap: 3rem; padding: 6rem 0 4rem; }
.headline { font-size: clamp(2rem, 4vw + .5rem, 3.25rem); line-height: 1.05; margin: 0 0 1rem; letter-spacing: -.02em; }
.headline #typewriter { display: inline-block; position: relative; min-width: 1ch; }
.headline #typewriter::after { content: ""; display: inline-block; width: 2px; height: 1.1em; background: currentColor; margin-left: 4px; transform: translateY(2px); animation: caret-blink 1s steps(1) infinite; }
@keyframes caret-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.subhead { color: var(--muted); font-size: clamp(1rem, 1vw + .6rem, 1.15rem); margin: 0 0 1.75rem; }
.subhead #typewriter-sub { display: inline-block; position: relative; min-width: 1ch; }
.subhead #typewriter-sub::after { content: ""; display: inline-block; width: 2px; height: 1em; background: currentColor; margin-left: 3px; transform: translateY(2px); animation: caret-blink 1s steps(1) infinite; opacity: .8; }
.cta { display: flex; gap: .8rem; align-items: flex-start; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.05rem; border-radius: .8rem; border: 1px solid var(--border); text-decoration: none; color: var(--text); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .3s ease; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 24px rgba(110,168,254,.22); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(110,168,254,.28); }
.btn.ghost { background: var(--card); }
.btn.ghost:hover { background: rgba(255,255,255,.1); }
.btn.cta-highlight { 
    background: linear-gradient(135deg, #22d3ee, #6ea8fe, #8a5cff); 
    background-size: 200% 200%;
    box-shadow: 0 8px 24px rgba(34,211,238,.35), 0 0 20px rgba(110,168,254,.25);
    animation: gradient-shift 3s ease infinite;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}
.btn.cta-highlight::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
    animation: shine 2s ease-in-out infinite;
}
.btn.cta-highlight:hover { 
    transform: translateY(-2px) scale(1.02); 
    box-shadow: 0 12px 32px rgba(34,211,238,.45), 0 0 30px rgba(110,168,254,.35);
}
.btn.cta-synex { 
    background: linear-gradient(135deg, #ff6b6b, #ff8e53, #ff6b9d, #c44569); 
    background-size: 200% 200%;
    box-shadow: 0 8px 24px rgba(255,107,107,.4), 0 0 25px rgba(255,142,83,.3), 0 0 15px rgba(255,107,157,.25);
    animation: gradient-shift 3s ease infinite;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}
.btn.cta-synex::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
    animation: shine 2s ease-in-out infinite;
}
.btn.cta-synex:hover { 
    transform: translateY(-2px) scale(1.02); 
    box-shadow: 0 12px 32px rgba(255,107,107,.5), 0 0 35px rgba(255,142,83,.4), 0 0 20px rgba(255,107,157,.35);
}
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes shine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.hero-art { display: none; }

/* Sections */
.section-head { text-align: center; margin: 4rem 0 2rem; }
.section-head h2 { margin: 0 0 .4rem; font-size: clamp(1.4rem, 1.8vw + .6rem, 2rem); }
.section-head p { margin: 0; color: var(--muted); }

.grid.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding-bottom: 2rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); transition: transform .2s ease, background .3s ease, border-color .3s ease; }
.card:hover { transform: translateY(-4px); background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); }
.card .icon { font-size: 1.4rem; margin-bottom: .4rem; }
.card h3 { margin: .2rem 0 .3rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); }

/* Apps (Projects) */
.apps { padding: 1rem 0 2rem; }
.apps-grid { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 1rem; 
    align-items: flex-start;
}
.app-card { 
    background: var(--card); 
    border: 1px solid var(--border); 
    border-radius: var(--radius); 
    overflow: hidden; 
    box-shadow: var(--shadow); 
    display: grid; 
    grid-template-rows: auto 1fr; 
    transition: transform .2s ease, background .3s ease, border-color .3s ease;
    flex: 1 1 calc(33.333% - 0.67rem);
}
.app-card:hover { transform: translateY(-4px); background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); }
.app-card .thumb { aspect-ratio: 16 / 9; background: rgba(0,0,0,.12); display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.app-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.app-card .app-body { padding: 1rem; display: grid; gap: .6rem; }
.app-card h3 { margin: 0; font-size: 1.05rem; }
.app-card p { margin: 0; color: var(--muted); }
.app-actions { margin-top: .4rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.app-note { align-self: center; color: var(--muted); font-weight: 600; }
.app-description { color: var(--muted); line-height: 1.6; }
.app-description p { margin: 0 0 12px 0; }
.app-description ul { margin: 8px 0; padding-left: 20px; }
.app-description li { margin: 4px 0; }

@media (max-width: 1100px) {
    .app-card { flex-basis: calc(50% - 0.5rem); }
}
@media (max-width: 700px) {
    .app-card { flex-basis: 100%; }
}

/* Contact */
.contact { padding: 1rem 0 4rem; }
.contact-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.contact-form label { display: grid; gap: .5rem; }
.contact-form .full { grid-column: 1 / -1; }
.contact-form input, .contact-form textarea { width: 100%; background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--border); border-radius: .6rem; padding: .8rem; outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(110,168,254,.2); }
.contact-form button { grid-column: 1 / -1; justify-self: center; }
.form-status { grid-column: 1 / -1; margin-top: .2rem; font-size: .95rem; color: var(--muted); min-height: 1.2em; }

/* Social */
.social { text-align: center; margin-top: 2rem; margin-bottom: 3rem; }
.social h3 { margin: 1.6rem 0 .8rem; font-size: 1.15rem; color: var(--text); }
.social-list { list-style: none; margin: 0 0 2rem 0; padding: 0; display: flex; gap: 1.2rem; justify-content: center; align-items: center; }
.social-list a { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: .7rem; background: color-mix(in oklab, var(--bg) 70%, transparent); border: 1px solid var(--border); color: var(--text); backdrop-filter: blur(10px) saturate(160%); transition: transform .2s ease, background .25s ease, border-color .25s ease, opacity .2s ease, color .25s ease, backdrop-filter .25s ease; }
.social-list a:hover { transform: translateY(-2px); background: color-mix(in oklab, var(--bg) 82%, transparent); border-color: rgba(255,255,255,.2); }
.social-list svg { display: block; }

/* Smooth theme transition */
:root.theming * {
    transition: background-color .5s ease, color .5s ease, border-color .5s ease, fill .5s ease, stroke .5s ease, box-shadow .5s ease;
}
@media (prefers-reduced-motion: reduce) {
    :root.theming * { transition: none !important; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: color-mix(in oklab, var(--bg) 80%, transparent); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 0; font-size: .95rem; color: var(--muted); }
.to-top { color: var(--text); text-decoration: none; background: var(--card); border: 1px solid var(--border); padding: .4rem .6rem; border-radius: .5rem; }
.to-top:hover { background: rgba(255,255,255,.08); }

/* Theme toggle */
.theme-toggle { display: flex; gap: .4rem; align-items: center; padding: .35rem .5rem; border-radius: .8rem; background: color-mix(in oklab, var(--bg) 70%, transparent); border: 1px solid var(--border); backdrop-filter: blur(10px) saturate(160%); box-shadow: var(--shadow); }
.theme-toggle button { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: .6rem; background: var(--card); border: 1px solid var(--border); color: var(--text); cursor: pointer; transition: transform .15s ease, background .25s ease, border-color .25s ease, color .25s ease; }
.theme-toggle button[aria-pressed="true"] { outline: 2px solid color-mix(in oklab, var(--brand) 60%, white); outline-offset: 2px; }
.theme-toggle button:hover { transform: translateY(-1px); background: rgba(255,255,255,.1); }

/* Reveal on scroll */
[data-animate] { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.in-view { opacity: 1 !important; transform: translateY(0) !important; }

/* Responsive */
@media (max-width: 1100px) {
    .hero { gap: 2rem; }
}
@media (max-width: 900px) {
    .grid.features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
    .hero { grid-template-columns: 1fr; padding-top: 4rem; }
    .hero-art { order: -1; height: clamp(220px, 45vw, 340px); }
}
@media (max-width: 560px) {
    .grid.features { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; gap: .6rem; }
    .cta { flex-direction: column; }
    .cta .btn { width: 100%; justify-content: center; }
    .cta-register-wrapper { width: 100%; flex-direction: column; align-items: stretch; }
    .why-register-btn-wrapper { width: 100%; }
    .why-register-card { max-width: 100%; }
}

/* Why Register Card */
.cta-register-wrapper { position: relative; display: inline-flex; flex-direction: row; align-items: flex-start; gap: 0.8rem; }
.cta-register-wrapper > .btn { margin: 0; }
.why-register-btn-wrapper { position: relative; display: inline-block; }
.why-register-card { 
    background: var(--card); 
    border: 1px solid var(--border); 
    border-radius: var(--radius); 
    overflow: hidden; 
    box-shadow: var(--shadow); 
    transition: transform .2s ease, background .3s ease, border-color .3s ease;
    margin-top: 0.8rem;
    width: 100%;
    max-width: 500px;
    animation: slideDown 0.3s ease;
    z-index: 1000;
}
.why-register-card:hover { transform: translateY(-4px); background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); }
.why-register-card-body { padding: 1.2rem; }
.why-register-card-body p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 1.05rem; }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
    .btn.cta-highlight { animation: none; background: linear-gradient(135deg, #22d3ee, #8a5cff); }
    .btn.cta-highlight::before { animation: none; }
    .btn.cta-synex { animation: none; background: linear-gradient(135deg, #ff6b6b, #c44569); }
    .btn.cta-synex::before { animation: none; }
}


