/* ─────────────────────────────────────────────────────────────
   Sabicode — sabiedu.com
   Flat, minimal, engineered. Light default + dark toggle.
   No gradients, no glow, no glassmorphism, no emoji. One accent.
   Self-contained: every class here is real CSS (no Tailwind).
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@500;600;700&family=Inter:wght@400;450;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── Tokens: light (default) ─────────────────────────────────── */
:root {
    --bg: #ffffff;
    --bg-subtle: #fafafa;
    --surface: #ffffff;
    --border: #ececec;
    --border-strong: #dadada;

    --ink: #0a0a0a;
    --muted: #6b7280;
    --faint: #9ca3af;

    --accent: #2348ff;
    --accent-ink: #ffffff;
    --accent-soft: rgba(35, 72, 255, 0.07);
    --accent-line: rgba(35, 72, 255, 0.22);

    --ok-bg: #ecfdf3;
    --ok-fg: #027a48;
    --err-bg: #fef3f2;
    --err-fg: #b42318;

    --radius: 12px;
    --radius-sm: 9px;
    --maxw: 1120px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --display: 'Inter Tight', var(--font);
    --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ── Tokens: dark (toggle) ───────────────────────────────────── */
:root[data-theme="dark"] {
    --bg: #0a0a0b;
    --bg-subtle: #0f0f12;
    --surface: #121215;
    --border: #232327;
    --border-strong: #2e2e34;

    --ink: #f4f4f5;
    --muted: #a1a1aa;
    --faint: #71717a;

    --accent: #6f8bff;
    --accent-ink: #0a0a0b;
    --accent-soft: rgba(111, 139, 255, 0.10);
    --accent-line: rgba(111, 139, 255, 0.28);

    --ok-bg: rgba(5, 150, 105, 0.14);
    --ok-fg: #4ade80;
    --err-bg: rgba(220, 38, 38, 0.14);
    --err-fg: #f87171;
}

/* ── Reset / base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Eyebrow (mono label) ────────────────────────────────────── */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font);
    font-size: 14.5px;
    font-weight: 550;
    line-height: 1;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
                color 0.18s var(--ease), transform 0.06s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--ink); }

.btn-sm { padding: 9px 14px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* ── Nav ─────────────────────────────────────────────────────── */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.2) blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
}
.brand-mark svg { width: 22px; height: 22px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a.navlink {
    font-size: 14px;
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 8px;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav-links a.navlink:hover { color: var(--ink); background: var(--bg-subtle); }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--border-strong); }
.theme-toggle svg { width: 17px; height: 17px; }
/* show moon in light mode (click → dark), sun in dark mode (click → light) */
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: inline-flex; }

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
    padding: 92px 0 72px;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
/* faint engineered grid backdrop — flat, no glow */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 70%);
    mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}
.hero > * { position: relative; }

.hero-title {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(40px, 6.4vw, 70px);
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin: 22px 0 0;
    max-width: 16ch;
}
.hero-title .accent { color: var(--accent); }
.hero-sub {
    margin: 22px 0 0;
    max-width: 56ch;
    font-size: 18px;
    color: var(--muted);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 40px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
}
.tag {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    padding: 6px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
}

/* ── Section scaffolding ─────────────────────────────────────── */
.section { padding: 84px 0; border-bottom: 1px solid var(--border); }
.section.subtle { background: var(--bg-subtle); }

.section-head { max-width: 62ch; margin-bottom: 44px; }
.section-num {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 0.06em;
}
.section-title {
    font-family: var(--display);
    font-weight: 650;
    font-size: clamp(26px, 3.6vw, 38px);
    line-height: 1.12;
    letter-spacing: -0.025em;
    margin: 12px 0 0;
}
.section-desc { margin: 14px 0 0; color: var(--muted); font-size: 17px; }

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

/* ── Cards ───────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 16px;
}
.card-icon svg { width: 20px; height: 20px; }

.card h3 {
    font-family: var(--display);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

.card-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 8px;
}
.card-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--muted);
}
.card-list li::before {
    content: "";
    width: 14px;
    height: 1px;
    background: var(--accent);
    flex: none;
}

/* ── Product cards (portfolio) ───────────────────────────────── */
.product {
    display: flex;
    flex-direction: column;
    min-height: 188px;
}
.product .product-arrow {
    margin-top: auto;
    padding-top: 18px;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.18s var(--ease), color 0.18s var(--ease);
}
.product:hover .product-arrow { gap: 11px; color: var(--accent); }
.product .meta {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
}

/* ── Approach steps ──────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step {
    border-top: 2px solid var(--ink);
    padding-top: 18px;
}
.step-num {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 0.06em;
}
.step h3 {
    font-family: var(--display);
    font-weight: 600;
    font-size: 19px;
    margin: 12px 0 8px;
    letter-spacing: -0.01em;
}
.step p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ── Team ────────────────────────────────────────────────────── */
.team-card { display: flex; flex-direction: column; }
.avatar {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-weight: 500;
    font-size: 15px;
    color: var(--ink);
    margin-bottom: 16px;
}
.team-card .role { color: var(--muted); font-size: 14px; margin-top: 2px; }
.team-card .badge {
    align-self: flex-start;
    margin-top: 14px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 9px;
}

/* ── Contact ─────────────────────────────────────────────────── */
.contact-wrap {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 48px;
    align-items: start;
}
.contact-aside .section-title { margin-top: 12px; }
.contact-mail {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    margin-top: 26px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color 0.18s var(--ease);
}
.contact-mail:hover { border-color: var(--border-strong); }
.contact-mail .ic {
    display: inline-flex;
    color: var(--accent);
}
.contact-mail small { display: block; color: var(--faint); font-size: 12px; }
.contact-mail strong { font-weight: 550; font-size: 15px; }

.form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 7px;
}
.input, .textarea {
    font-family: var(--font);
    font-size: 14.5px;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    width: 100%;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 130px; resize: vertical; }

.form-note {
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}
.form-note.ok { background: var(--ok-bg); color: var(--ok-fg); }
.form-note.err { background: var(--err-bg); color: var(--err-fg); }

/* ── Footer ──────────────────────────────────────────────────── */
.footer { padding: 34px 0; }
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.footer-inner span { color: var(--faint); font-size: 13.5px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a {
    color: var(--muted);
    font-size: 13.5px;
    transition: color 0.15s var(--ease);
}
.footer-links a:hover { color: var(--ink); }

/* ── Scroll reveal (subtle) ──────────────────────────────────── */
/* Hidden only when JS is live (html.js set by THEME_INIT_JS) — SSR/no-JS
   users always see the content. */
.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.06s; }
.reveal.d2 { transition-delay: 0.12s; }
.reveal.d3 { transition-delay: 0.18s; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 960px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .contact-wrap { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 720px) {
    .nav-links .navlink { display: none; }
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .row { grid-template-columns: 1fr; }
    .hero { padding: 64px 0 52px; }
    .section { padding: 60px 0; }
}

/* ── Blog article prose (markdown → HTML) ───────────────────────── */
.prose { color: var(--text-secondary, #374151); line-height: 1.75; font-size: 17px; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text-primary, #111827); font-weight: 800; margin: 1.6em 0 .6em; line-height: 1.25; }
.prose h2 { font-size: 1.55em; } .prose h3 { font-size: 1.22em; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { margin: 0 0 1.1em 1.4em; }
.prose li { margin-bottom: .4em; }
.prose strong { color: var(--text-primary, #111827); }
.prose a { color: var(--accent, #6366F1); text-decoration: underline; }
.prose blockquote { border-left: 3px solid var(--accent, #6366F1); padding-left: 1em; margin: 1.2em 0; color: var(--text-secondary, #6b7280); }
.prose code { background: var(--bg-subtle, #f3f4f6); padding: .15em .4em; border-radius: 5px; font-size: .88em; font-family: var(--mono, monospace); }
.prose pre { background: var(--bg-subtle, #f3f4f6); padding: 1em 1.2em; border-radius: 10px; overflow-x: auto; margin: 1.2em 0; }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; border-radius: 10px; }
.prose hr { border: none; border-top: 1px solid var(--border, #e5e7eb); margin: 2em 0; }
