/**
 * Shared base CSS — used by all Saksh·ai web pages.
 * Single source of truth for design tokens, reset, typography, and common components.
 *
 * Pages import this via: <link rel="stylesheet" href="/shared/base.css">
 * The public.html worker build inlines it automatically.
 */

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* === DESIGN TOKENS === */
:root {
    /* Brand colors */
    --gold: #A0842E;
    --gold-bright: #B8982E;
    --gold-muted: #8A7430;
    --navy: #14142B;
    --navy-light: #E8E8E4;
    --void: #F5F5F0;
    --cream: #1A1A2E;

    /* Text */
    --text-heading: #1A1A2E;
    --text-body: #3A3A4A;
    --text-label: #6B6B7B;

    /* Backgrounds */
    --bg-deep: #F5F5F0;
    --bg-card: #FFFFFF;
    --bg-section-alt: #FAFAF8;

    /* Borders */
    --border: #E0E0DC;
    --border-hover: #D0D0CC;
    --border-active: #A0842E;

    /* Semantic */
    --red: #C83828;
    --red-bg: rgba(200, 60, 40, 0.08);
    --green: #3D9E50;
    --green-bg: rgba(61, 158, 80, 0.1);

    /* Typography stacks */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', Menlo, monospace;
}

/* === BODY BASE === */
body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-body);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* Noise texture overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.008;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
    z-index: 10000;
}

/* === TYPOGRAPHY === */
h1, h2, h3 { color: var(--text-heading); }

/* === BUTTONS === */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 11px 24px;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    letter-spacing: 0.02em;
}
.btn-primary {
    background: var(--gold);
    color: #FFFFFF;
    font-weight: 500;
    border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold-bright); }
.btn-secondary {
    background: transparent;
    color: var(--gold-muted);
    border-color: rgba(160, 132, 46, 0.25);
}
.btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(160, 132, 46, 0.04);
}

/* === BRAND === */
.brand-ai { color: var(--gold); }
.brand-text {
    font-family: 'Rockwell', 'Rockwell Nova', 'Roboto Slab', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-heading);
    text-decoration: none;
    letter-spacing: 0.02em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    position: relative; top: 2px;
}
.brand-text .brand-ai { color: var(--gold); }

/* Brand morph animation (Ski ↔ Saksh·ai) */
.brand-wrap { display: inline-block; position: relative; }
.brand-wrap::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 130%; height: 160%;
    background: radial-gradient(ellipse, rgba(160, 132, 46, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
    animation: brand-pulse 4s ease-in-out infinite alternate;
}
@keyframes brand-pulse {
    0% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}
.brand-text .brand-morph {
    display: inline-block; overflow: hidden;
    vertical-align: bottom; transition: max-width 0.6s ease;
}
.brand-text .brand-morph-expand { max-width: 0; }
.brand-text .brand-morph-collapse { max-width: 50px; }
.brand-text.expanded .brand-morph-expand { max-width: 200px; }
.brand-text.expanded .brand-morph-collapse { max-width: 0; }

/* === LANDING PAGE NAV (fixed, frosted glass) === */
.top-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9500;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px;
    background: rgba(245, 245, 240, 0.85);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(200, 200, 196, 0.5);
}
.top-nav-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; line-height: 1; }
.top-nav-brand svg { color: var(--gold); flex-shrink: 0; display: block; }
.top-nav-brand-text {
    font-family: 'Rockwell', 'Rockwell Nova', 'Roboto Slab', Georgia, serif;
    font-size: 1.15rem; font-weight: 700; color: var(--text-heading);
    line-height: 1; display: inline-flex; align-items: center;
    position: relative; top: 2px;
}
.top-nav-brand-text .brand-ai { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
    font-family: var(--font-body); font-size: 0.78rem; color: var(--text-label);
    text-decoration: none; transition: color 0.2s; letter-spacing: 0.03em;
}
.nav-links a:hover { color: var(--gold); }
.nav-cta {
    background: var(--gold); color: #FFFFFF;
    padding: 7px 16px; border-radius: 5px; font-weight: 500;
}
.nav-cta:hover { background: var(--gold-bright); color: #FFFFFF; }

/* === APP HEADER (flex, non-fixed — demo/cert) === */
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
    background: rgba(245, 245, 240, 0.85);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.header-left { display: flex; align-items: center; gap: 8px; text-decoration: none; line-height: 1; }
.header-left svg { color: var(--gold); flex-shrink: 0; display: block; }
.page-badge {
    font-size: 0.58rem; font-weight: 500; padding: 2px 7px; border-radius: 4px;
    background: rgba(160, 132, 46, 0.1); color: var(--gold);
    border: 1px solid rgba(160, 132, 46, 0.25); letter-spacing: 0.06em;
    text-transform: uppercase; line-height: 1; vertical-align: middle;
}

/* === HERO === */
.hero {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center; min-height: 80vh;
    padding: 100px 24px 60px;
    position: relative;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(circle, rgba(160, 132, 46, 0.12) 1.2px, transparent 1.2px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 60% 40% at 50% 22%, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 50%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 60% 40% at 50% 22%, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 50%, transparent 75%);
    pointer-events: none;
}
.tagline {
    font-family: var(--font-display);
    font-size: 1.8rem; font-weight: 400;
    color: var(--gold-muted); letter-spacing: 0.04em; margin-bottom: 20px;
}
.hero-desc {
    font-size: 0.95rem; color: var(--text-body);
    max-width: 560px; line-height: 1.9; margin-bottom: 28px;
}
.separator { width: 48px; height: 1px; background: var(--gold-muted); opacity: 0.3; margin-bottom: 28px; }
.hero-ctas { display: flex; gap: 14px; margin-bottom: 36px; }

/* === LANDING SECTIONS === */
.section { padding: 72px 24px; }
.section.alt { background: var(--bg-section-alt); }
.section-heading {
    font-family: var(--font-display); font-weight: 400;
    font-size: 2.2rem; letter-spacing: 0.01em; margin-bottom: 12px;
    color: var(--text-heading);
}
.section-heading span { color: var(--gold); font-weight: 500; }
.section-intro {
    font-size: 0.92rem; color: var(--text-body);
    max-width: 600px; line-height: 1.8; margin-bottom: 36px;
}

/* Landing cards (grid-based) */
.card-grid { display: grid; gap: 14px; }
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; padding: 20px; transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-hover); }

/* === FOOTER === */
footer {
    border-top: 1px solid var(--border);
    padding: 36px 24px;
    text-align: center;
    width: 100%;
}
.footer-brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.footer-brand svg { color: var(--gold-muted); display: block; }
.footer-brand-text { font-family: var(--font-body); font-size: 1.1rem; font-weight: 500; color: var(--text-body); }
.footer-brand-text .brand-ai { color: var(--gold); }
.footer-links { display: flex; justify-content: center; gap: 28px; margin-bottom: 18px; }
.footer-links a { font-size: 0.72rem; color: var(--text-label); text-decoration: none; transition: color 0.2s; letter-spacing: 0.04em; opacity: 0.6; }
.footer-links a:hover { color: var(--gold); opacity: 1; }
.footer-ety { font-size: 0.68rem; color: var(--text-label); font-style: italic; margin-bottom: 6px; opacity: 0.5; }
.footer-copy { font-size: 0.6rem; color: var(--text-label); opacity: 0.35; }

/* === LOGO SVG (inline, used via class) === */
.logo-svg { color: var(--gold); flex-shrink: 0; display: block; }

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .brand-text .brand-morph-expand { max-width: 200px !important; }
    .brand-text .brand-morph-collapse { max-width: 0 !important; }
}
