/* ==========================================================================
   Codedstar — public site design system
   ========================================================================== */
:root {
    --bg:        #0a0e1a;
    --bg-soft:   #111729;
    --surface:   #161d33;
    --surface-2: #1d2640;
    --border:    rgba(255,255,255,.08);
    --text:      #e8ecf5;
    --muted:     #9aa6c0;
    --brand:     #6c5ce7;
    --brand-2:   #00d4ff;
    --accent:    #ff7a59;
    --ok:        #2ecc71;
    --warn:      #ffb020;
    --grad:      linear-gradient(135deg, #6c5ce7 0%, #00d4ff 100%);
    --grad-soft: linear-gradient(135deg, rgba(108,92,231,.18), rgba(0,212,255,.10));
    --radius:    18px;
    --radius-sm: 12px;
    --shadow:    0 20px 50px -20px rgba(0,0,0,.6);
    --ring:      0 0 0 1px var(--border);
    --container: 1180px;
    --font:      'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---- Layout helpers ---- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.center { text-align: center; }
.grad-text {
    background: var(--grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.eyebrow {
    display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .14em;
    text-transform: uppercase; color: var(--brand-2); margin-bottom: 14px;
}
.section-head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; }
.section-head p { color: var(--muted); margin-top: 14px; font-size: 1.05rem; }

h1,h2,h3,h4 { font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
    padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: .95rem;
    cursor: pointer; border: 0; transition: transform .15s ease, box-shadow .2s ease, background .2s; white-space: nowrap;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px rgba(108,92,231,.7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(108,92,231,.85); }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--text); box-shadow: var(--ring); }
.btn-ghost:hover { background: rgba(255,255,255,.12); transform: translateY(-2px); }
.btn-lg { padding: 16px 34px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---- Header / nav ---- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(14px);
    background: rgba(10,14,26,.72);
    border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; }
.brand .dot { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 6px 18px -6px var(--brand); }
.brand .dot svg { width: 18px; height: 18px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
    padding: 9px 14px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: .95rem;
    transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); background: rgba(255,255,255,.06); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: 8px; }
.nav-toggle svg { width: 26px; height: 26px; }

/* ---- Hero ---- */
.hero { position: relative; padding: 120px 0 100px; overflow: hidden; }
.hero::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(60% 50% at 75% 0%, rgba(0,212,255,.16), transparent 70%),
        radial-gradient(50% 50% at 15% 20%, rgba(108,92,231,.22), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); letter-spacing: -.03em; }
.hero p.lead { color: var(--muted); font-size: 1.18rem; margin: 22px 0 32px; max-width: 540px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-badges { display: flex; gap: 26px; margin-top: 42px; flex-wrap: wrap; }
.hero-badges .stat strong { display: block; font-size: 1.8rem; }
.hero-badges .stat span { color: var(--muted); font-size: .9rem; }

.hero-visual {
    position: relative; border-radius: 24px; padding: 26px;
    background: var(--grad-soft); box-shadow: var(--shadow); border: 1px solid var(--border);
}
.code-window { background: #0c1120; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.code-bar { display: flex; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.code-bar i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.code-bar i:nth-child(1){background:#ff5f57;} .code-bar i:nth-child(2){background:#febc2e;} .code-bar i:nth-child(3){background:#28c840;}
.code-body { padding: 20px; font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: .82rem; line-height: 1.9; color: #cdd6f4; }
.code-body .k { color: #c792ea; } .code-body .s { color: #c3e88d; } .code-body .f { color: #82aaff; } .code-body .c { color: #5c6785; }
.float-card {
    position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px 16px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; font-size: .85rem;
}
.float-card .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; }
.float-card.one { bottom: -22px; left: -22px; animation: float 5s ease-in-out infinite; }
.float-card.two { top: -22px; right: -18px; animation: float 5s ease-in-out infinite 1.5s; }
@keyframes float { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-12px);} }

/* ---- Marquee / trust ---- */
.trust { border-block: 1px solid var(--border); padding: 28px 0; }
.trust .row { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; opacity: .7; }
.trust span { font-weight: 700; letter-spacing: .04em; color: var(--muted); }

/* ---- Cards grid ---- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 30px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-6px); border-color: rgba(108,92,231,.5); box-shadow: var(--shadow); }
.card .ic {
    width: 54px; height: 54px; border-radius: 14px; background: var(--grad-soft);
    display: grid; place-items: center; margin-bottom: 18px; color: var(--brand-2);
}
.card .ic svg { width: 26px; height: 26px; }
.card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: .96rem; }

/* ---- Projects ---- */
.filters { display: flex; gap: 10px; justify-content: center; margin-bottom: 40px; flex-wrap: wrap; }
.filters button {
    padding: 9px 20px; border-radius: 999px; border: 1px solid var(--border); background: transparent;
    color: var(--muted); cursor: pointer; font-weight: 600; font-size: .9rem; transition: all .15s;
}
.filters button.active, .filters button:hover { background: var(--grad); color: #fff; border-color: transparent; }
.project {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.project:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.project .thumb { aspect-ratio: 16/10; position: relative; overflow: hidden; background: var(--grad-soft); }
.project .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project .body { padding: 22px; }
.project .meta { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.tag { font-size: .72rem; font-weight: 700; padding: 4px 11px; border-radius: 999px; letter-spacing: .03em; text-transform: uppercase; }
.tag.cat { background: rgba(0,212,255,.14); color: var(--brand-2); }
.tag.completed { background: rgba(46,204,113,.16); color: var(--ok); }
.tag.in_progress { background: rgba(255,176,32,.16); color: var(--warn); }
.project h3 { font-size: 1.18rem; margin-bottom: 8px; }
.project p { color: var(--muted); font-size: .92rem; }
.project .tech { margin-top: 14px; font-size: .8rem; color: var(--brand-2); font-weight: 500; }
.project .links { margin-top: 16px; }
.project .links a { color: var(--brand-2); font-weight: 600; font-size: .9rem; }

/* ---- Pricing ---- */
.currency-bar { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 44px; }
.currency-bar label { color: var(--muted); font-size: .92rem; }
.currency-bar select {
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    padding: 10px 16px; border-radius: 10px; font-size: .95rem; cursor: pointer; font-family: inherit;
}
.plans { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; align-items: start; }
.plan {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 34px 30px; position: relative; transition: transform .2s, box-shadow .2s;
}
.plan.featured { border-color: var(--brand); box-shadow: 0 24px 60px -24px rgba(108,92,231,.6); transform: scale(1.03); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.plan .ribbon { position: absolute; top: 18px; right: 18px; background: var(--grad); color: #fff; font-size: .7rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; letter-spacing: .05em; text-transform: uppercase; }
.plan h3 { font-size: 1.3rem; }
.plan .summary { color: var(--muted); font-size: .9rem; margin: 8px 0 22px; min-height: 40px; }
.plan .price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; }
.plan .price .per { font-size: .95rem; color: var(--muted); font-weight: 500; }
.plan .approx { font-size: .8rem; color: var(--muted); margin-top: 4px; min-height: 18px; }
.plan ul { margin: 24px 0 28px; display: grid; gap: 12px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.plan li svg { width: 18px; height: 18px; flex: none; margin-top: 3px; }
.plan li.no { color: var(--muted); opacity: .65; }
.plan li.yes svg { color: var(--ok); } .plan li.no svg { color: var(--muted); }

/* feature comparison table */
.compare { margin-top: 72px; overflow-x: auto; }
.compare table { width: 100%; border-collapse: collapse; min-width: 640px; }
.compare th, .compare td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--border); }
.compare thead th { font-size: 1rem; }
.compare tbody td { text-align: center; color: var(--muted); }
.compare tbody td:first-child { text-align: left; color: var(--text); font-weight: 500; }
.compare svg { width: 18px; height: 18px; }

/* ---- Blog ---- */
.post-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s;
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.post-card .thumb { aspect-ratio: 16/9; background: var(--grad-soft); display: grid; place-items: center; }
.post-card .thumb svg { width: 48px; height: 48px; color: var(--brand-2); opacity: .8; }
.post-card .body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.post-card .src { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-2); margin-bottom: 10px; }
.post-card h3 { font-size: 1.12rem; margin-bottom: 10px; }
.post-card p { color: var(--muted); font-size: .92rem; flex: 1; }
.post-card .more { margin-top: 16px; color: var(--brand-2); font-weight: 600; font-size: .9rem; }
.post-card .date { font-size: .8rem; color: var(--muted); margin-top: 8px; }

.subhead { font-size: 1.4rem; margin: 8px 0 28px; }

/* article */
.article { max-width: 760px; margin: 0 auto; }
.article h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 16px; }
.article .meta { color: var(--muted); margin-bottom: 32px; }
.article p { margin-bottom: 22px; color: #d4dcef; font-size: 1.08rem; }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; }
.contact-info h2 { font-size: 2rem; margin-bottom: 16px; }
.contact-info p { color: var(--muted); margin-bottom: 24px; }
.contact-info .line { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.contact-info .line .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--grad-soft); display: grid; place-items: center; color: var(--brand-2); }
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 8px; color: var(--muted); }
.field input, .field textarea {
    width: 100%; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px;
    padding: 13px 16px; color: var(--text); font-family: inherit; font-size: .96rem; transition: border-color .15s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 140px; }
.hp { position: absolute; left: -9999px; opacity: 0; }

/* ---- Alerts ---- */
.alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 22px; font-size: .94rem; }
.alert.success { background: rgba(46,204,113,.14); color: #8ef0b6; border: 1px solid rgba(46,204,113,.3); }
.alert.error { background: rgba(255,90,90,.14); color: #ffb3b3; border: 1px solid rgba(255,90,90,.3); }

/* ---- CTA band ---- */
.cta-band { background: var(--grad-soft); border: 1px solid var(--border); border-radius: 28px; padding: 60px; text-align: center; }
.cta-band h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.cta-band p { color: var(--muted); margin: 14px auto 30px; max-width: 520px; }

/* ---- Testimonials ---- */
.quote { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; }
.quote p { font-size: 1.02rem; margin-bottom: 20px; }
.quote .who { display: flex; align-items: center; gap: 12px; }
.quote .who .av { width: 44px; height: 44px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 700; }
.quote .who strong { display: block; } .quote .who span { color: var(--muted); font-size: .85rem; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); padding: 64px 0 32px; background: var(--bg-soft); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-grid h4 { font-size: .95rem; margin-bottom: 18px; }
.footer-grid a { color: var(--muted); display: block; padding: 6px 0; font-size: .92rem; transition: color .15s; }
.footer-grid a:hover { color: var(--text); }
.footer-grid p { color: var(--muted); font-size: .92rem; margin-top: 14px; max-width: 280px; }
.socials { display: flex; gap: 12px; margin-top: 18px; }
.socials a { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.06); display: grid; place-items: center; color: var(--muted); }
.socials a:hover { background: var(--grad); color: #fff; }
.socials svg { width: 18px; height: 18px; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 26px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; }

/* ---- Reveal animation ---- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---- Page header ---- */
.page-hero { padding: 80px 0 40px; text-align: center; position: relative; }
.page-hero::before { content:''; position:absolute; inset:0; z-index:-1; background: radial-gradient(50% 80% at 50% 0%, rgba(108,92,231,.18), transparent 70%); }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.page-hero p { color: var(--muted); max-width: 560px; margin: 16px auto 0; font-size: 1.08rem; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
    .hero-grid, .contact-grid { grid-template-columns: 1fr; }
    .hero-visual { display: none; }
    .grid-3, .grid-4, .plans { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .plan.featured { transform: none; }
    .contact-grid { gap: 32px; }
}
@media (max-width: 720px) {
    .section { padding: 64px 0; }
    .section-sm { padding: 44px 0; }
    .hero { padding: 72px 0 56px; }
    .page-hero { padding: 56px 0 28px; }
    .section-head { margin-bottom: 36px; }
    .nav-links, .nav-cta .btn-ghost { display: none; }
    .nav-toggle { display: block; }
    .nav-links.open {
        display: flex; flex-direction: column; position: absolute; top: 74px; left: 0; right: 0;
        background: var(--bg-soft); padding: 16px 24px 24px; border-bottom: 1px solid var(--border); gap: 4px;
        z-index: 99;
    }
    .nav-links.open a { padding: 12px 14px; }
    .grid-3, .grid-4, .grid-2, .plans { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-grid { gap: 28px; }
    .cta-band { padding: 40px 24px; }
    .card { padding: 22px; }
    .plan { padding: 26px 22px; }
    .form { padding: 26px 20px; }
    .compare { margin-top: 40px; }
}
@media (max-width: 480px) {
    .section { padding: 48px 0; }
    .section-sm { padding: 32px 0; }
    .hero { padding: 52px 0 40px; }
    .page-hero { padding: 44px 0 22px; }
    .page-hero p { font-size: .96rem; }
    .section-head { margin-bottom: 28px; }
    .section-head p { font-size: .96rem; }
    .hero p.lead { font-size: 1.04rem; margin: 18px 0 26px; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .hero-badges { gap: 14px 24px; margin-top: 28px; }
    .hero-badges .stat strong { font-size: 1.5rem; }
    .card { padding: 18px; }
    .plan { padding: 22px 18px; }
    .cta-band { padding: 28px 16px; }
    .form { padding: 20px 16px; }
    .contact-grid { gap: 24px; }
    .footer-grid { gap: 20px; }
    .footer-bottom { flex-direction: column; gap: 8px; }
    .subhead { font-size: 1.2rem; }
    .btn-lg { padding: 14px 24px; font-size: .95rem; }
    .nav { height: 64px; }
    .trust .row { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}

/* ---- Page loader ---- */
#pl {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity .45s ease, visibility .45s ease;
}
#pl::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(55% 55% at 50% 40%, rgba(108,92,231,.18), transparent 70%),
        radial-gradient(35% 35% at 70% 70%, rgba(0,212,255,.10), transparent 70%);
}
#pl.pl-done { opacity: 0; visibility: hidden; pointer-events: none; }
.pl-inner { position: relative; z-index: 1; text-align: center; user-select: none; }
.pl-brand {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; margin-bottom: 40px;
    font-weight: 800; font-size: 1.45rem; color: var(--text); letter-spacing: -.02em;
}
.pl-dot {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--grad); display: grid; place-items: center;
    box-shadow: 0 8px 28px -8px rgba(108,92,231,.7);
}
.pl-dot svg { width: 20px; height: 20px; }
.pl-track {
    width: 260px; height: 2px; background: rgba(255,255,255,.08);
    border-radius: 2px; overflow: hidden; margin: 0 auto;
}
.pl-bar {
    height: 100%; width: 0;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    border-radius: 2px;
    transition: width .18s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0 8px rgba(0,212,255,.5);
}
.pl-status {
    margin-top: 20px;
    font-family: 'SF Mono', ui-monospace, 'Cascadia Code', Menlo, monospace;
    font-size: .75rem; letter-spacing: .05em; color: var(--muted);
    height: 1.2em;
}
.pl-prompt { color: var(--brand-2); }
.pl-cursor {
    display: inline-block; width: 7px; height: .85em;
    background: var(--brand-2); margin-left: 3px; vertical-align: middle;
    animation: plBlink .75s step-end infinite;
}
@keyframes plBlink { 0%,100%{opacity:1} 50%{opacity:0} }
@media (prefers-reduced-motion: reduce) {
    #pl { transition: none; }
    .pl-cursor { animation: none; opacity: 0; }
}

/* ---- Contact form inline validation ---- */
.cf-error { border-color: #ff4757 !important; }
.cf-error-msg { color: #ff4757; font-size: .82rem; margin-top: 5px; }
.cf-label-error { color: #ff4757 !important; }

/* ---- AdSense units ---- */
.ad-unit { width: 100%; padding: 32px 0; text-align: center; }
.ad-unit ins { min-width: 300px; }

/* ---- Feed pagination ---- */
.feed-nav { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 48px; }
.feed-nav-info { color: var(--muted); font-size: .9rem; }
