/* =============================================================
   DokPath — Brand design system
   Shared type scale, buttons, sections and cards.
   Loaded after theme.css; uses its --dp-* tokens so light/dark work.
   ============================================================= */

:root {
    --dp-radius: 10px;
    --dp-radius-lg: 14px;
    --dp-band-bg: #0b1220;
    --dp-band-text: #f8fafc;
    --dp-band-muted: #94a3b8;
    --dp-band-border: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] {
    --dp-band-bg: #0f172a;
}

/* ---------------------------------------------------------
   Typography
--------------------------------------------------------- */
body.dp {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
}

.dp .font-display,
.dp h1,
.dp h2,
.dp h3 {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: -0.022em;
    text-transform: none;
}

.dp .font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.dp-h1 {
    font-size: clamp(2.5rem, 5.2vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.035em !important;
}

.dp-h1--long {
    font-size: clamp(2rem, 3.7vw, 3.1rem);
    line-height: 1.1;
}

.dp-h2 {
    font-size: clamp(1.875rem, 3.4vw, 2.625rem);
    line-height: 1.15;
    letter-spacing: -0.028em !important;
}

.dp-h3 {
    font-size: 1.125rem;
    line-height: 1.35;
}

.dp-lead {
    font-size: 1.125rem;
    line-height: 1.65;
    color: var(--dp-text-secondary);
}

.dp-body {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--dp-text-secondary);
}

.dp-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dp-accent-text);
    margin-bottom: 1rem;
}

.dp-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dp-text-muted);
}

/* ---------------------------------------------------------
   Layout
--------------------------------------------------------- */
.dp-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.dp-section {
    padding: 6rem 0;
    border-top: 1px solid var(--dp-border);
    background: var(--dp-bg);
}

.dp-section--alt { background: var(--dp-bg-alt); }

@media (max-width: 767px) {
    .dp-section { padding: 4rem 0; }
    .dp-container { padding: 0 1rem; }
}

.dp-section-head {
    max-width: 44rem;
    margin-bottom: 3.5rem;
}

/* ---------------------------------------------------------
   Buttons
--------------------------------------------------------- */
.dp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 3rem;
    padding: 0 1.375rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    text-transform: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.dp-btn--sm { height: 2.5rem; padding: 0 1rem; font-size: 0.875rem; }

.dp-btn--primary {
    background: var(--dp-accent);
    color: #fff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.dp-btn--primary:hover { background: var(--dp-accent-hover); }

.dp-btn--secondary {
    background: var(--dp-bg-card);
    color: var(--dp-text) !important;
    border: 1px solid var(--dp-border-strong);
}
.dp-btn--secondary:hover { border-color: var(--dp-text-muted); }

.dp-btn:focus-visible {
    outline: 2px solid var(--dp-accent);
    outline-offset: 2px;
}

.dp-link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dp-accent-text);
}
.dp-link-arrow svg { transition: transform 0.15s ease; }
.dp-link-arrow:hover svg { transform: translateX(3px); }

/* ---------------------------------------------------------
   Cards
--------------------------------------------------------- */
.dp-card {
    background: var(--dp-bg-card);
    border: 1px solid var(--dp-border);
    border-radius: var(--dp-radius-lg);
    box-shadow: var(--dp-card-shadow);
}

.dp-icon-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    background: var(--dp-accent-soft);
    border: 1px solid var(--dp-accent-border);
    color: var(--dp-accent-text);
    flex-shrink: 0;
}
.dp-icon-tile svg { width: 1.25rem; height: 1.25rem; }

.dp-check {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--dp-accent-text);
    flex-shrink: 0;
    margin-top: 0.2rem;
}

/* ---------------------------------------------------------
   Product frames (screenshots / app mock panels)
--------------------------------------------------------- */
.dp-frame {
    border-radius: var(--dp-radius-lg);
    border: 1px solid var(--dp-border-strong);
    background: var(--dp-bg-card);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 24px 48px -16px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.dp-frame__bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 2.25rem;
    padding: 0 0.875rem;
    border-bottom: 1px solid var(--dp-border);
    background: var(--dp-bg-alt);
}

.dp-frame__url {
    flex: 1;
    max-width: 16rem;
    margin: 0 auto;
    height: 1.375rem;
    border-radius: 6px;
    background: var(--dp-bg-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    line-height: 1.375rem;
    text-align: center;
    color: var(--dp-text-muted);
}

.dp-frame__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dp-text);
}

/* ---------------------------------------------------------
   Hero stage — desktop app + phone, layered with depth
   Layout is proportional to the stage width so the two
   screenshots stay aligned at every breakpoint.
--------------------------------------------------------- */
.dp-stage {
    --mx: 0;
    --my: 0;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 0.74;
    perspective: 1600px;
    isolation: isolate;
}

/* soft brand glow + fine dot grid behind the product */
.dp-stage__bg {
    position: absolute;
    inset: -8% -6% -10% -6%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60% 55% at 62% 42%, var(--dp-accent-soft) 0%, transparent 70%),
        radial-gradient(circle, var(--dp-border-strong) 1px, transparent 1.5px) 0 0 / 22px 22px;
    -webkit-mask-image: radial-gradient(70% 70% at 55% 48%, #000 30%, transparent 78%);
            mask-image: radial-gradient(70% 70% at 55% 48%, #000 30%, transparent 78%);
    opacity: 0.9;
}

.dp-scene {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: rotateY(calc(var(--mx) * -5deg)) rotateX(calc(var(--my) * 3.5deg));
    will-change: transform;
}

/* every layer: entrance animation on the wrapper, parallax on .dp-par */
.dp-layer {
    position: absolute;
    animation: dpRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--delay, 0ms);
}
.dp-par {
    transform: translate3d(calc(var(--mx) * var(--depth, 0) * 1px), calc(var(--my) * var(--depth, 0) * 1px), 0);
}

.dp-layer--frame { left: 0; top: 7%; width: 90%; --depth: 8; --delay: 80ms; }
.dp-layer--phone { right: 0; bottom: 0; width: 27%; --depth: 22; --delay: 380ms; animation-name: dpRisePhone; }
.dp-layer--chip-a { right: 12%; top: 0; --depth: 34; --delay: 900ms; animation-name: dpPop; }
.dp-layer--chip-b { left: 2%; bottom: 9%; --depth: 30; --delay: 1100ms; animation-name: dpPop; }

.dp-layer--frame .dp-frame { position: relative; }
/* one-time light sweep across the app window */
.dp-layer--frame .dp-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
    transform: translateX(-120%);
    animation: dpSheen 1.6s ease-out 1.1s 1 both;
    pointer-events: none;
}

.dp-phone {
    display: block;
    padding: 5px;
    border-radius: 1.6rem;
    background: linear-gradient(160deg, #334155 0%, #0b1220 60%);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.5),
        0 30px 60px -18px rgba(15, 23, 42, 0.55),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.dp-phone img { display: block; width: 100%; border-radius: 1.25rem; }

.dp-float { animation: dpBob 6s ease-in-out infinite; }
.dp-float--slow { animation-duration: 8s; animation-delay: -2s; }
.dp-float--alt { animation-duration: 7s; animation-delay: -4s; }

.dp-chip {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem 0.5rem 0.5rem;
    border-radius: 12px;
    background: var(--dp-bg-card);
    border: 1px solid var(--dp-border);
    box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.25), 0 2px 4px rgba(15, 23, 42, 0.06);
    white-space: nowrap;
}
.dp-chip .dp-icon-tile { width: 2rem; height: 2rem; }
.dp-chip .dp-icon-tile svg { width: 1rem; height: 1rem; }
.dp-chip__k { font-size: 0.6875rem; line-height: 1.2; color: var(--dp-text-muted); }
.dp-chip__v { font-size: 0.8125rem; line-height: 1.3; font-weight: 600; color: var(--dp-text); }
.dp-chip__dot {
    width: 0.5rem; height: 0.5rem; border-radius: 999px; background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    animation: dpPing 2s ease-out infinite;
}

@keyframes dpRise {
    from { opacity: 0; transform: translateY(28px) scale(0.965); filter: blur(6px); }
    to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes dpRisePhone {
    from { opacity: 0; transform: translateY(70px) rotate(2deg); filter: blur(6px); }
    to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes dpPop {
    0%   { opacity: 0; transform: translateY(10px) scale(0.85); }
    60%  { opacity: 1; transform: translateY(-3px) scale(1.03); }
    100% { opacity: 1; transform: none; }
}
@keyframes dpBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}
@keyframes dpSheen {
    to { transform: translateX(120%); }
}
@keyframes dpPing {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    80%, 100% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

@media (max-width: 639px) {
    .dp-stage { aspect-ratio: 1 / 0.86; }
    .dp-layer--chip-b { display: none; }
    .dp-layer--chip-a { right: 4%; top: -7%; }
    .dp-layer--phone { width: 30%; }
    .dp-layer--frame { width: 92%; }
    .dp-scene { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .dp-layer, .dp-float, .dp-chip__dot, .dp-layer--frame .dp-frame::after { animation: none !important; }
    .dp-layer { opacity: 1; filter: none; transform: none; }
    .dp-scene, .dp-par { transform: none !important; }
}

/* ---------------------------------------------------------
   Header / nav
--------------------------------------------------------- */
.dp-nav-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--dp-text-secondary);
    transition: color 0.15s ease;
}
.dp-nav-link:hover,
.dp-nav-link[aria-current="page"] { color: var(--dp-text); }

/* ---------------------------------------------------------
   Dark band (final CTA)
--------------------------------------------------------- */
.dp-band {
    background: var(--dp-band-bg);
    color: var(--dp-band-text);
}
.dp-band h2 { color: var(--dp-band-text) !important; }
.dp-band .dp-band-muted { color: var(--dp-band-muted); }
.dp-band .dp-btn--secondary {
    background: transparent;
    color: var(--dp-band-text) !important;
    border-color: var(--dp-band-border);
}
.dp-band .dp-btn--secondary:hover { border-color: rgba(255, 255, 255, 0.35); }

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.dp-footer-heading {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dp-text);
    margin-bottom: 1rem;
}
.dp-footer-link {
    display: block;
    font-size: 0.875rem;
    padding: 0.3rem 0;
}

/* ---------------------------------------------------------
   Legacy pages — normalise older markup to the brand system
   (headings, micro-labels, cards) without touching content.
--------------------------------------------------------- */
.dp h1, .dp h2, .dp h3, .dp h4 { text-transform: none; }
.dp h4 { font-weight: 600; letter-spacing: -0.01em; }
.dp h1.font-black, .dp h2.font-black, .dp h3.font-black,
.dp h1.font-bold, .dp h2.font-bold, .dp h3.font-bold { font-weight: 600; }

.dp .text-\[9px\]  { font-size: 0.6875rem; }
.dp .text-\[10px\] { font-size: 0.75rem; }
.dp .text-\[11px\] { font-size: 0.8125rem; }

.dp .text-slate-800 { color: var(--dp-text) !important; }
.dp .container { max-width: 1200px; }
.dp .grid > * { min-width: 0; }
.dp p, .dp li, .dp a { overflow-wrap: anywhere; }

.dp .tech-card {
    background: var(--dp-bg-card) !important;
    border: 1px solid var(--dp-border) !important;
    border-radius: var(--dp-radius-lg) !important;
    box-shadow: var(--dp-card-shadow) !important;
}
.dp .tech-card:hover { border-color: var(--dp-accent-border) !important; box-shadow: var(--dp-card-shadow-hover) !important; }
.dp .tech-card::before { display: none !important; }

/* Light mode: older pages were authored for a dark canvas (white / pale text).
   Remap those utilities so copy stays readable on the light theme. */
html[data-theme="light"] .dp .text-white:not([class*="bg-"]):not(a):not(button):not(svg) { color: var(--dp-text) !important; }
html[data-theme="light"] .dp [class*="bg-blue-"] .text-white,
html[data-theme="light"] .dp [class*="bg-slate-9"] .text-white:not([class*="bg-"]),
html[data-theme="light"] .dp .dp-btn--primary,
html[data-theme="light"] .dp .dp-band .text-white { color: #fff !important; }
html[data-theme="light"] .dp .dp-band h2,
html[data-theme="light"] .dp .dp-band h3 { color: var(--dp-band-text) !important; }
html[data-theme="light"] .dp .text-slate-100,
html[data-theme="light"] .dp .text-slate-200,
html[data-theme="light"] .dp .text-slate-300,
html[data-theme="light"] .dp .text-gray-100,
html[data-theme="light"] .dp .text-gray-200,
html[data-theme="light"] .dp .text-gray-300 { color: var(--dp-text-secondary) !important; }
html[data-theme="light"] .dp section.text-white,
html[data-theme="light"] .dp .text-white[class*="bg-[#"] { color: var(--dp-text) !important; }
html[data-theme="light"] .dp .text-blue-300,
html[data-theme="light"] .dp .text-blue-400,
html[data-theme="light"] .dp .text-indigo-300,
html[data-theme="light"] .dp .text-indigo-400 { color: var(--dp-accent-text) !important; }
html[data-theme="light"] .dp .text-emerald-300,
html[data-theme="light"] .dp .text-emerald-400 { color: #047857 !important; }
html[data-theme="light"] .dp .text-amber-400,
html[data-theme="light"] .dp .text-amber-500 { color: #b45309 !important; }
html[data-theme="light"] .dp .bg-slate-900\/50,
html[data-theme="light"] .dp .bg-slate-900\/30,
html[data-theme="light"] .dp .bg-slate-800\/50,
html[data-theme="light"] .dp .bg-slate-800\/40 { background-color: var(--dp-bg-alt) !important; }
html[data-theme="light"] .dp .border-slate-700,
html[data-theme="light"] .dp .border-slate-800\/50 { border-color: var(--dp-border) !important; }
html[data-theme="light"] .dp .bg-blue-600\/20 { background-color: var(--dp-accent-soft) !important; }

/* Blog articles: inline styles use a dark palette; recolour for the light theme
   and use the brand typeface instead of the old display font. */
.dp .article-body h2 { font-family: 'Inter', system-ui, sans-serif !important; font-weight: 600 !important; letter-spacing: -0.022em !important; }
html[data-theme="light"] .dp .article-body { color: var(--dp-text-secondary); }
html[data-theme="light"] .dp .article-body h2 { color: var(--dp-text); border-bottom-color: var(--dp-border); }
html[data-theme="light"] .dp .article-body h3,
html[data-theme="light"] .dp .article-body h4,
html[data-theme="light"] .dp .article-body strong,
html[data-theme="light"] .dp .principle-title,
html[data-theme="light"] .dp .step-list li strong { color: var(--dp-text); }
html[data-theme="light"] .dp .principle-desc,
html[data-theme="light"] .dp .step-list li span { color: var(--dp-text-secondary); }
html[data-theme="light"] .dp .principle-number,
html[data-theme="light"] .dp .stat-number,
html[data-theme="light"] .dp .dokpath-callout-title,
html[data-theme="light"] .dp .toc-link:hover { color: var(--dp-accent-text); }
html[data-theme="light"] .dp .toc-link,
html[data-theme="light"] .dp .stat-label,
html[data-theme="light"] .dp .article-disclaimer { color: var(--dp-text-muted); }
html[data-theme="light"] .dp .article-disclaimer { background: var(--dp-bg-alt); border-color: var(--dp-border); }

html[data-theme="light"] .dp [style*="#94a3b8"],
html[data-theme="light"] .dp [style*="#cbd5e1"] { color: var(--dp-text-secondary) !important; }
html[data-theme="light"] .dp [style*="#64748b"] { color: var(--dp-text-muted) !important; }
html[data-theme="light"] .dp [style*="#e2e8f0"],
html[data-theme="light"] .dp [style*="#f1f5f9"] { color: var(--dp-text) !important; }
html[data-theme="light"] .dp .audit-card,
html[data-theme="light"] .dp .chain-diagram,
html[data-theme="light"] .dp .step-list li { background: var(--dp-bg-card); border-color: var(--dp-border); box-shadow: var(--dp-card-shadow); }
html[data-theme="light"] .dp .audit-question { color: var(--dp-text); }
html[data-theme="light"] .dp .audit-text,
html[data-theme="light"] .dp .chain-label { color: var(--dp-text-secondary); }
html[data-theme="light"] .dp .audit-verdict.pass { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
html[data-theme="light"] .dp .audit-verdict.fail { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
html[data-theme="light"] .dp .warning-label { color: #b91c1c; }
html[data-theme="light"] .dp .dokpath-callout { background: var(--dp-accent-soft); border-color: var(--dp-accent-border); }
html[data-theme="light"] .dp [style*="#a5b4fc"],
html[data-theme="light"] .dp [style*="#818cf8"],
html[data-theme="light"] .dp [style*="#c7d2fe"],
html[data-theme="light"] .dp [style*="#6366f1"] { color: var(--dp-accent-text) !important; }
html[data-theme="light"] .dp [style*="#f87171"] { color: #b91c1c !important; }
html[data-theme="light"] .dp [style*="#34d399"] { color: #047857 !important; }
html[data-theme="light"] .dp [style*="#fbbf24"] { color: #b45309 !important; }
html[data-theme="light"] .dp .score-table th { color: var(--dp-text-muted); border-bottom-color: var(--dp-border); }
html[data-theme="light"] .dp .score-table td { color: var(--dp-text-secondary); border-bottom-color: var(--dp-border); }
html[data-theme="light"] .dp .audit-question strong,
html[data-theme="light"] .dp .audit-card strong { color: var(--dp-text); }
html[data-theme="light"] .dp .warning-box { background: #fef2f2; border-color: #fecaca; }
html[data-theme="light"] .dp .warning-box p { color: var(--dp-text-secondary) !important; }
html[data-theme="light"] .dp a[class*="bg-blue-6"],
html[data-theme="light"] .dp a[class*="bg-indigo-6"] { color: #fff !important; }

.dp img.rounded-3xl {
    border-radius: var(--dp-radius-lg);
    box-shadow: var(--dp-card-shadow);
    border: 1px solid var(--dp-border);
}
.dp .shadow-2xl.rounded-3xl { border-radius: var(--dp-radius-lg); box-shadow: var(--dp-card-shadow); }
.dp .sector-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dp-accent-text) !important;
    background: var(--dp-accent-soft) !important;
    border: 1px solid var(--dp-accent-border) !important;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
}

/* ---------------------------------------------------------
   Motion
--------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible,
.reveal.active {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
