/* physicalai.tools — shared styles
   Two-face brand: dev-tools-coded surface, generic on the outside, deeper inside.
*/

:root {
    --bg-0: #0a0506;
    --bg-1: #110a0d;
    --bg-2: #1a1014;
    --bg-3: #2a1820;
    --border: rgba(255, 255, 255, 0.04);
    --border-strong: rgba(255, 255, 255, 0.10);
    --text-0: #f0e8e8;
    --text-1: #b8a8a8;
    --text-2: #6e5a5c;
    --crimson: #c41e3a;
    --crimson-deep: #8b1428;
    --crimson-glow: #ff2d5a;
    --gold: #d4af37;
    --gold-bright: #ffd966;
    --ivory: #f5e8d4;
    --cyan: #4dd0e1;
    --cyan-deep: #00838f;
    --green: #00d68f;
    --red: #ff5252;
    --yellow: #ffcc00;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg-0);
    color: var(--text-0);
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(196, 30, 58, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 131, 143, 0.06) 0%, transparent 60%);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan); text-decoration: underline; }

h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
p { color: var(--text-1); margin-bottom: 1rem; }

code, .mono { font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace; }
.mono-sm { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; color: var(--text-1); }
.italic { font-style: italic; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Navigation ─────────────────────────────────────── */
nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10, 5, 6, 0.85);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.logo {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, var(--ivory) 0%, var(--crimson-glow) 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo .accent {
    -webkit-text-fill-color: var(--cyan);
    color: var(--cyan);
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--text-1); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text-0); text-decoration: none; }
.nav-cta {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--crimson), var(--crimson-deep));
    border-radius: 6px;
    color: white !important;
    font-weight: 600;
    transition: all 0.2s;
}
.nav-cta:hover {
    background: linear-gradient(135deg, var(--crimson-glow), var(--crimson));
    text-decoration: none;
    transform: translateY(-1px);
}

/* ── Hero ───────────────────────────────────────────── */
.hero { text-align: center; padding: 4rem 0 3rem; }
.hero .pre-title {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    padding: 0.4rem 0.9rem;
    background: rgba(77, 208, 225, 0.08);
    border: 1px solid rgba(77, 208, 225, 0.2);
    border-radius: 999px;
    margin-bottom: 1.5rem;
}
.hero h1 {
    font-size: clamp(2.4rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--ivory) 0%, var(--crimson-glow) 60%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero .tagline {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-1);
    max-width: 640px;
    margin: 0 auto 2.5rem;
}
.hero .cta-group { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

.btn {
    padding: 0.85rem 1.6rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: linear-gradient(135deg, var(--crimson), var(--crimson-deep));
    color: white;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--crimson-glow), var(--crimson));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(196, 30, 58, 0.4);
    color: white;
}
.btn-secondary {
    background: var(--bg-2);
    color: var(--text-0);
    border-color: var(--border-strong);
}
.btn-secondary:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}
.btn-cyan {
    background: linear-gradient(135deg, var(--cyan), var(--cyan-deep));
    color: var(--bg-0);
}
.btn-cyan:hover { transform: translateY(-1px); color: var(--bg-0); }

/* ── Sections ───────────────────────────────────────── */
section { padding: 3rem 0; }
.section-head { margin-bottom: 2.5rem; }
.section-head .eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}
.section-head h2 {
    background: linear-gradient(135deg, var(--ivory) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.section-sub { color: var(--text-1); max-width: 600px; margin: 0; }

/* ── Grid + cards ───────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--crimson), var(--crimson-deep));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}
.card.cyan .card-icon { background: linear-gradient(135deg, var(--cyan), var(--cyan-deep)); color: var(--bg-0); }
.card.gold .card-icon { background: linear-gradient(135deg, var(--gold), var(--gold-bright)); color: var(--bg-0); }
.card h3 { font-weight: 700; }
.card p { font-size: 0.92rem; margin-bottom: 0; }

/* ── Code block ─────────────────────────────────────── */
pre.code {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-0);
    margin: 1.25rem 0;
}
pre.code .comment { color: var(--text-2); }
pre.code .string  { color: var(--green); }
pre.code .keyword { color: var(--cyan); }
pre.code .func    { color: var(--gold); }

/* ── Status indicators ─────────────────────────────── */
.status { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; }
.status.online .dot { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.status.warn .dot { background: var(--yellow); }
.status.err .dot { background: var(--red); }
.status.idle .dot { background: var(--text-2); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── Forms ──────────────────────────────────────────── */
.field { margin-bottom: 1.25rem; }
.field label {
    display: block;
    color: var(--text-1);
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.4rem;
}
.field input,
.field textarea,
.field select {
    width: 100%;
    background: var(--bg-1);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    color: var(--text-0);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--cyan);
}
.field textarea { min-height: 100px; resize: vertical; }
.field .hint { font-size: 0.78rem; color: var(--text-2); margin-top: 0.3rem; }

.error {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: var(--red);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.success {
    background: rgba(0, 214, 143, 0.1);
    border: 1px solid rgba(0, 214, 143, 0.3);
    color: var(--green);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ── Footer ─────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    text-align: center;
    color: var(--text-2);
    font-size: 0.85rem;
    margin-top: 4rem;
}
footer a { color: var(--text-1); }

/* ── Tips ticker ────────────────────────────────────── */
.tip-ticker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text-1);
    max-width: 480px;
    margin: 0 auto 1.5rem;
}
.tip-ticker .dot-anim {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold);
    animation: pulse 1.5s infinite;
    flex-shrink: 0;
}
.tip-ticker strong { color: var(--gold); font-weight: 700; }

/* ── Utility ────────────────────────────────────────── */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.col { flex: 1; min-width: 0; }

@media (max-width: 640px) {
    .nav-links a:not(.nav-cta) { display: none; }
    .hero { padding: 2rem 0 1rem; }
    section { padding: 2rem 0; }
}
