/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    /* Surfaces */
    --bg: #0a0d12;
    --bg-raised: #10141b;
    --bg-raised-2: #161b23;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.18);

    /* Text */
    --text: #eef1f5;
    --text-secondary: #9aa7b5;
    --text-tertiary: #66707d;

    /* Signal accent (amber) — primary CTAs / highlights */
    --accent: #f5b942;
    --accent-strong: #ffc860;
    --accent-soft: rgba(245, 185, 66, 0.13);
    --accent-border: rgba(245, 185, 66, 0.35);

    /* Secondary accent (cyan) — links / info */
    --cyan: #38bdf8;
    --cyan-soft: rgba(56, 189, 248, 0.13);
    --cyan-border: rgba(56, 189, 248, 0.32);

    /* Status accent (green) — "available / online" only */
    --green: #34d399;
    --green-soft: rgba(52, 211, 153, 0.14);
    --green-border: rgba(52, 211, 153, 0.35);

    /* Error */
    --red: #f87171;
    --red-soft: rgba(248, 113, 113, 0.13);

    /* Type */
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: "Space Grotesk", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

    /* Layout */
    --rail-width: 92px;
    --tabbar-height: 64px;
    --max-width: 1180px;
    --section-pad: 6.5rem 2.5rem;

    /* Shape / motion */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 999px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.25s var(--ease);
    --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.35);
}

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

html {
    background: var(--bg);
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 185, 66, 0.3) transparent;
}
html::-webkit-scrollbar {
    width: 6px;
}
html::-webkit-scrollbar-thumb {
    background: rgba(245, 185, 66, 0.3);
    border-radius: 3px;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    /* Reserve space for fixed nav chrome */
    padding-bottom: var(--tabbar-height);
}

::selection {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

a {
    text-decoration: none;
    color: inherit;
}
ul {
    list-style: none;
}
img {
    display: block;
    max-width: 100%;
}
button {
    font-family: inherit;
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   TYPE HELPERS
   ============================================ */
.mono {
    font-family: var(--font-mono);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}
.eyebrow::before {
    content: "//";
    color: var(--text-tertiary);
}

.accent-text {
    color: var(--accent);
}
.cyan-text {
    color: var(--cyan);
}
.green-text {
    color: var(--green);
}

/* ============================================
   LAYOUT SHELL
   ============================================ */
main {
    display: block;
}

section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--section-pad);
}

.section-head {
    margin-bottom: 3rem;
    max-width: 640px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-top: 0.6rem;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-top: 0.85rem;
    max-width: 560px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem 1.7rem;
    border-radius: var(--radius-full);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.btn--primary {
    background: var(--accent);
    color: #1a1206;
}
.btn--primary:hover {
    background: var(--accent-strong);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(245, 185, 66, 0.35);
}

.btn--outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strongest);
}
.btn--outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.btn--full {
    width: 100%;
}

/* ============================================
   CHIPS / BADGES / PANELS
   ============================================ */
.chip {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-raised-2);
    border: 1px solid var(--border);
    padding: 0.32rem 0.65rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
}
.badge--accent {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-border);
}
.badge--cyan {
    background: var(--cyan-soft);
    color: var(--cyan);
    border-color: var(--cyan-border);
}
.badge--green {
    background: var(--green-soft);
    color: var(--green);
    border-color: var(--green-border);
}
.badge--neutral {
    background: var(--bg-raised-2);
    color: var(--text-secondary);
    border-color: var(--border);
}

.panel {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.panel--interactive {
    transition: var(--transition);
}
.panel--interactive:hover {
    border-color: var(--border-strong);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

/* Status pill (hero "available" indicator) */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 1rem 0.45rem 0.8rem;
    border-radius: var(--radius-full);
    background: var(--green-soft);
    border: 1px solid var(--green-border);
    color: var(--green);
    font-size: 0.85rem;
    font-weight: 600;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    flex-shrink: 0;
    animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 6px var(--green);
    }
    50% {
        transform: scale(0.7);
        box-shadow: 0 0 14px var(--green);
    }
}

/* ============================================
   METRIC TILES
   ============================================ */
.metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.metric {
    background: var(--bg-raised);
    padding: 1.15rem 0.75rem;
    text-align: center;
}
.metric__value {
    font-family: var(--font-mono);
    font-size: clamp(1.35rem, 2.6vw, 1.9rem);
    font-weight: 700;
    color: var(--accent);
    display: block;
}
.metric__label {
    display: block;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-top: 0.35rem;
}

/* ============================================
   NAV — desktop icon rail
   ============================================ */
#rail {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--rail-width);
    height: 100vh;
    background: var(--bg-raised);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 0;
    z-index: 200;
}

.rail__brand {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: var(--transition);
}
.rail__brand:hover {
    background: var(--accent);
    color: #1a1206;
}

.rail__nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 2.25rem;
}

.rail__link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    width: 68px;
    padding: 0.55rem 0.25rem;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: var(--transition);
}
.rail__link i {
    font-size: 1rem;
}
.rail__link span {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.rail__link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}
.rail__link.active {
    color: var(--accent);
    background: var(--accent-soft);
}
.rail__link.active::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    border-radius: 2px;
    background: var(--accent);
}

.rail__bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}

.rail__resume {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #1a1206;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: 0 4px 18px rgba(245, 185, 66, 0.3);
}
.rail__resume:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 26px rgba(245, 185, 66, 0.45);
}

/* ============================================
   NAV — mobile bottom tab bar
   ============================================ */
#tabbar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--tabbar-height);
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--bg-raised);
    border-top: 1px solid var(--border);
    z-index: 200;
}
.tabbar__inner {
    height: var(--tabbar-height);
    display: flex;
    align-items: stretch;
}
.tabbar__link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: var(--text-tertiary);
    transition: var(--transition);
}
.tabbar__link i {
    font-size: 1.05rem;
}
.tabbar__link.active {
    color: var(--accent);
}
.tabbar__link--resume i {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #1a1206;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.tabbar__link--resume {
    color: var(--accent);
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--bg-raised-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(14px) scale(0.85);
    pointer-events: none;
    transition: var(--transition);
    z-index: 150;
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}
.back-to-top:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    min-width: 300px;
    max-width: 420px;
    width: max-content;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-raised-2);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    pointer-events: all;
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
    width: 100%;
}
.toast.removing {
    opacity: 0;
    transform: translateY(8px);
}
.toast.success {
    border-left: 3px solid var(--green);
}
.toast.error {
    border-left: 3px solid var(--red);
}
.toast.info {
    border-left: 3px solid var(--cyan);
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}
.toast.success .toast-icon {
    color: var(--green);
}
.toast.error .toast-icon {
    color: var(--red);
}
.toast.info .toast-icon {
    color: var(--cyan);
}

.toast-content {
    flex: 1;
    min-width: 0;
}
.toast-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.toast-message {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.1rem;
    flex-shrink: 0;
    transition: color 0.2s;
}
.toast-close:hover {
    color: var(--text);
}

/* ============================================
   SCROLL REVEAL (progressive enhancement)
   Default state is fully visible; the inline
   head script only adds .has-motion when JS is
   present AND the user hasn't asked for reduced
   motion, so content never depends on JS to show.
   ============================================ */
.has-motion [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity 0.6s var(--ease),
        transform 0.6s var(--ease);
}
.has-motion [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
