/* =========================================================================
   Traveller — custom stylesheet
   Layers on top of Tailwind (CDN). Production-ready polish: brand tokens,
   components (btn / card / field / badge / alert / toast), animations,
   aurora hero, glass morphism, reveal-on-scroll, skeleton loaders,
   dark-mode variables, custom scrollbar.
   ========================================================================= */

:root {
    --brand-50:  #eef2ff;
    --brand-100: #e0e7ff;
    --brand-200: #c7d2fe;
    --brand-300: #a5b4fc;
    --brand-400: #818cf8;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-800: #3730a3;
    --brand-900: #312e81;

    --accent-400: #fb923c;
    --accent-500: #f97316;
    --accent-600: #ea580c;

    --surface:      #ffffff;
    --surface-alt:  #f8fafc;
    --surface-2:    #f1f5f9;
    --border:       #e2e8f0;
    --text:         #0f172a;
    --text-muted:   #64748b;

    --success: #10b981;
    --warn:    #f59e0b;
    --danger:  #ef4444;

    --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
    --shadow-md: 0 4px 14px rgba(15,23,42,.08);
    --shadow-lg: 0 20px 40px -12px rgba(15,23,42,.18);

    --radius:     14px;
    --radius-lg:  20px;

    --nav-h: 64px;
}

[data-theme="dark"] {
    --surface:     #0b1120;
    --surface-alt: #0f172a;
    --surface-2:   #1e293b;
    --border:      #1f2a3d;
    --text:        #e2e8f0;
    --text-muted:  #94a3b8;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 4px 14px rgba(0,0,0,.5);
    --shadow-lg: 0 20px 40px -12px rgba(0,0,0,.6);
}

/* Base -------------------------------------------------------------------- */
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    letter-spacing: -0.011em;
    font-feature-settings: "cv02","cv03","cv04","cv11";
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.font-display { font-family: 'Playfair Display', Georgia, serif; letter-spacing: -0.02em; }

/* Gradient headline ------------------------------------------------------- */
.text-gradient {
    background: linear-gradient(135deg, var(--brand-600) 0%, #a855f7 50%, var(--accent-500) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Aurora hero background -------------------------------------------------- */
.bg-aurora {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(60% 80% at 10% 10%, rgba(99,102,241,.28) 0%, transparent 60%),
        radial-gradient(50% 70% at 92% 10%, rgba(244,114,182,.22) 0%, transparent 60%),
        radial-gradient(60% 80% at 50% 110%, rgba(251,146,60,.22) 0%, transparent 60%),
        linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
}
.bg-aurora::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(15,23,42,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,.045) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 42%, transparent 78%);
            mask-image: radial-gradient(ellipse at center, #000 42%, transparent 78%);
    pointer-events: none;
    z-index: -1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .55;
    pointer-events: none;
    animation: float 12s ease-in-out infinite;
    z-index: -1;
}
.blob--a { width: 360px; height: 360px; background: #a5b4fc; top: -120px; left: -120px; }
.blob--b { width: 320px; height: 320px; background: #fda4af; top: 20%; right: -80px;  animation-delay: -3s; }
.blob--c { width: 280px; height: 280px; background: #fdba74; bottom: -80px; left: 40%; animation-delay: -6s; }

@keyframes float {
    0%,100% { transform: translate(0,0); }
    50%     { transform: translate(22px,-28px); }
}

/* Reveal on scroll -------------------------------------------------------- */
.reveal      { opacity: 0; transform: translateY(22px); transition: opacity .75s ease, transform .75s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .16s; }
.reveal.delay-3 { transition-delay: .24s; }
.reveal.delay-4 { transition-delay: .32s; }

/* Glass + cards ----------------------------------------------------------- */
.glass {
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(226,232,240,.7);
}
[data-theme="dark"] .glass { background: rgba(11,17,32,.72); border-color: rgba(31,42,61,.7); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-hover {
    transition: transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s ease, border-color .25s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-300);
}

.card-gradient {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid transparent;
}
.card-gradient::before {
    content: "";
    position: absolute; inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--brand-400), var(--accent-500));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

/* Buttons ----------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .65rem 1.1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: .875rem;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease,
                color .2s ease, border-color .2s ease, filter .2s ease;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.btn[aria-busy="true"]::before {
    content: "";
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid currentColor; border-top-color: transparent;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-primary {
    background: linear-gradient(135deg, var(--brand-600), #7c3aed);
    color: #fff;
    box-shadow: 0 6px 18px -6px rgba(79,70,229,.55);
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 12px 28px -10px rgba(79,70,229,.65); }

.btn-accent {
    background: linear-gradient(135deg, var(--accent-500), #ec4899);
    color: #fff;
    box-shadow: 0 6px 18px -6px rgba(236,72,153,.5);
}
.btn-accent:hover { filter: brightness(1.07); }

.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-alt); }

.btn-outline {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.btn-outline:hover { border-color: var(--brand-400); color: var(--brand-700); }

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #e11d48);
    color: #fff;
    box-shadow: 0 6px 18px -6px rgba(239,68,68,.55);
}
.btn-danger:hover { filter: brightness(1.07); }

.btn-sm { padding: .42rem .8rem; font-size: .75rem; border-radius: 10px; }
.btn-lg { padding: .95rem 1.6rem; font-size: 1rem; border-radius: 14px; }

/* Form controls ----------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field-label { font-size: .78rem; font-weight: 500; color: var(--text-muted); }
.field-help  { font-size: .72rem; color: var(--text-muted); }

.input, .select, .textarea {
    width: 100%;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .68rem .9rem;
    font-size: .9rem;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .2s ease;
}
.input:hover, .select:hover, .textarea:hover { border-color: #cbd5e1; }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px rgba(99,102,241,.18);
}
.textarea { min-height: 92px; resize: vertical; }

.check { accent-color: var(--brand-600); width: 18px; height: 18px; }

/* Badges ------------------------------------------------------------------ */
.badge {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .2rem .55rem;
    font-size: .7rem; font-weight: 600;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--text-muted);
}
.badge-dot::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }
.badge-success { background:#dcfce7; color:#166534; }
.badge-warn    { background:#fef3c7; color:#92400e; }
.badge-danger  { background:#fee2e2; color:#991b1b; }
.badge-brand   { background: var(--brand-100); color: var(--brand-800); }

/* Nav --------------------------------------------------------------------- */
[data-navbar] { transition: background-color .25s ease, box-shadow .25s ease, backdrop-filter .25s ease; }
[data-navbar].is-scrolled {
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow: 0 1px 0 rgba(15,23,42,.06), 0 6px 24px -12px rgba(15,23,42,.1);
}
[data-theme="dark"] [data-navbar].is-scrolled { background: rgba(11,17,32,.8); }

.nav-link {
    position: relative;
    color: var(--text-muted);
    font-size: .88rem;
    font-weight: 500;
    padding: .35rem 0;
    transition: color .2s ease;
    text-decoration: none;
}
.nav-link:hover   { color: var(--text); }
.nav-link.active  { color: var(--brand-700); }
.nav-link.active::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: -10px;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-500), var(--accent-500));
    border-radius: 2px;
}

.brand-mark {
    display: inline-grid; place-items: center;
    width: 32px; height: 32px;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--accent-500) 100%);
    box-shadow: 0 6px 18px -6px rgba(79,70,229,.5);
}

/* Alerts ------------------------------------------------------------------ */
.alert {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: .85rem 1rem;
    border-radius: 12px;
    font-size: .875rem;
    border: 1px solid var(--border);
    background: var(--surface);
    animation: slide-in .4s ease;
}
@keyframes slide-in { from { opacity:0; transform: translateY(-6px); } to { opacity:1; transform: translateY(0); } }
.alert svg { flex: none; margin-top: 1px; }
.alert-success { background:#ecfdf5; border-color:#a7f3d0; color:#065f46; }
.alert-warn    { background:#fffbeb; border-color:#fde68a; color:#92400e; }
.alert-danger  { background:#fef2f2; border-color:#fecaca; color:#991b1b; }

/* Toasts ------------------------------------------------------------------ */
#toast-root {
    position: fixed; top: 1rem; right: 1rem;
    display: flex; flex-direction: column; gap: .5rem;
    z-index: 100;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 240px; max-width: 360px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand-500);
    border-radius: 12px;
    padding: .8rem 1rem;
    box-shadow: var(--shadow-lg);
    animation: toast-in .28s ease-out;
    font-size: .88rem;
}
.toast-success { border-left-color: var(--success); }
.toast-warn    { border-left-color: var(--warn); }
.toast-danger  { border-left-color: var(--danger); }
.toast.toast-hide { animation: toast-out .28s ease forwards; }
@keyframes toast-in  { from { transform: translateX(18px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-out { to   { transform: translateX(18px); opacity: 0; } }

/* Skeleton loader --------------------------------------------------------- */
.skeleton {
    background: linear-gradient(90deg, var(--surface-alt) 0%, var(--surface-2) 40%, var(--surface-alt) 80%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Line-clamp -------------------------------------------------------------- */
.clamp-2, .clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}
.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

/* Rich-content pages (Privacy / About) ------------------------------------ */
.prose-page {
    max-width: 72ch;
    color: var(--text);
    line-height: 1.75;
}
.prose-page h1 { font-size: 2rem; font-weight: 700; margin: 0 0 1rem; font-family: 'Playfair Display', serif; }
.prose-page h2 { font-size: 1.4rem; font-weight: 700; margin: 2rem 0 .8rem; }
.prose-page h3 { font-size: 1.1rem; font-weight: 600; margin: 1.4rem 0 .6rem; }
.prose-page p  { margin: 0 0 1rem; color: var(--text); }
.prose-page a  { color: var(--brand-600); text-decoration: underline; text-underline-offset: 3px; }
.prose-page ul, .prose-page ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.prose-page li { margin: .3rem 0; }
.prose-page code { background: var(--surface-2); padding: .1rem .4rem; border-radius: 6px; font-size: .9em; }
.prose-page blockquote { border-left: 3px solid var(--brand-300); padding: .4rem 1rem; color: var(--text-muted); margin: 1.2rem 0; }

/* Utility helpers --------------------------------------------------------- */
.ring-brand { box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.kbd {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: .75rem;
    background: var(--surface-2);
    padding: .1rem .4rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Scrollbar --------------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    border: 2px solid var(--surface-alt);
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }

/* Smooth theme transitions ------------------------------------------------ */
body, .card, .glass, .alert, .input, .select, .textarea, [data-navbar] {
    transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

/* Print ------------------------------------------------------------------- */
@media print {
    [data-navbar], footer, #toast-root, .no-print { display: none !important; }
    body { background: #fff !important; }
    .card, .glass { box-shadow: none !important; border: 1px solid #ddd; }
}

/* Reduced motion ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .blob { animation: none; }
}
