/* =========================================================
   RusJJ — Dev / Reverse Engineer / Game Modder site
   Design tokens
   ========================================================= */

@font-face {
    font-family: 'HeaderFont';
    src: url('/fonts/header.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ContentFont';
    src: url('/fonts/content.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* colors */
    --bg: #0f0f1a;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.09);
    --border-hover: rgba(255, 255, 255, 0.18);
    --text: #f2f0e9;
    --text-muted: #9a96a8;
    --accent-gold: #e8b04b;
    --accent-gold-dim: rgba(232, 176, 75, 0.16);
    --accent-blue: #6fd3f7;
    --accent-blue-dim: rgba(111, 211, 247, 0.16);

    /* aliases used by /bugs (bugs.css) */
    --ink: var(--text);
    --ink-dim: var(--text-muted);
    --signal: var(--accent-blue);
    --alert: var(--accent-gold);

    /* type */
    --font-display: 'HeaderFont', 'JetBrains Mono', 'Fira Code', monospace;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    --font-body: 'ContentFont', 'Inter', -apple-system, sans-serif;

    --radius: 14px;
    --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection { background: var(--accent-gold-dim); color: var(--text); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 10px; }

a { color: inherit; text-decoration: none; }

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent-gold);
    color: #14110a;
    padding: 10px 16px;
    z-index: 100;
    font-family: var(--font-mono);
    font-size: 13px;
    border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

canvas#stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* =========================================================
   Header / nav
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 22px 24px 14px;
    backdrop-filter: blur(6px);
}

.brand {
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: 0.5px;
    color: var(--text);
}
.brand .brand-dot { color: var(--accent-gold); }

.site-nav { display: flex; gap: 26px; }

.site-nav a {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    position: relative;
    padding: 4px 0;
    transition: color 0.2s ease;
}
.site-nav a::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    width: 0;
    background: var(--accent-gold);
    transition: width 0.25s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--text); }
.site-nav a:hover::before, .site-nav a:focus-visible::before { width: 100%; }

/* =========================================================
   Hero / terminal
   ========================================================= */

.hero {
    position: relative;
    z-index: 1;
    padding: 9vh 24px 8vh;
    display: flex;
    justify-content: center;
}

.terminal {
    width: 100%;
    max-width: 620px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    opacity: 0;
    animation: riseIn 0.7s ease-out 0.15s forwards;
}

.terminal-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.red { background: #ff5f57; }
.terminal-dot.amber { background: #ffbd2e; }
.terminal-dot.green { background: #28c840; }
.terminal-titlebar-label {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.terminal-body {
    padding: 28px 30px 32px;
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.8;
}
.term-line { color: var(--text-muted); }
.term-prompt { color: var(--accent-gold); margin-right: 8px; }
.term-output { color: var(--text); margin: 2px 0 20px; font-size: 17px; }
.term-output:last-child { margin-bottom: 0; }
.term-output.name { font-size: 26px; font-weight: 600; letter-spacing: 0.3px; }

.type-target { white-space: pre-wrap; }

.cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: var(--accent-blue);
    margin-left: 3px;
    vertical-align: text-bottom;
    animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@keyframes riseIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Section eyebrows
   ========================================================= */

.section-head {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}
.eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-blue);
    letter-spacing: 0.5px;
    margin: 0 0 14px;
}
.eyebrow::before { content: '// '; color: var(--text-muted); }

/* =========================================================
   Bento grid
   ========================================================= */

.bento-grid {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 64px;
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(150px, auto);
    gap: 16px;
}

@media (min-width: 620px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .card-wide, .card-lg { grid-column: span 2; }
}
@media (min-width: 940px) {
    .bento-grid { grid-template-columns: repeat(4, 1fr); }
}

.bento-card {
    grid-column: span 1;
    grid-row: span 1;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    opacity: 0;
    transform: translateY(14px);
    animation: cardIn 0.6s ease-out forwards;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    overflow: hidden;
}
.card-tall { grid-row: span 2; }

.bento-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.05) 50%, transparent 60%);
    transform: translateX(-120%);
    transition: transform 0.6s ease;
    pointer-events: none;
}
.bento-card:hover, .bento-card:focus-visible {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    background: var(--surface-hover);
}
.bento-card:hover::after { transform: translateX(120%); }

@keyframes cardIn { to { opacity: 1; transform: translateY(0); } }

.card-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.6px;
    color: var(--accent-gold);
    background: var(--accent-gold-dim);
    padding: 3px 8px;
    border-radius: 5px;
    margin-bottom: 12px;
}
.card-tag.tag-link { color: var(--accent-blue); background: var(--accent-blue-dim); }

.bento-card h3 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}
.bento-card p {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-muted);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--accent-blue);
}

.skills-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.skill-pill {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 4px 9px;
    border-radius: 20px;
}

/* =========================================================
   Links grid (compact cards)
   ========================================================= */

.links-grid { grid-auto-rows: minmax(96px, auto); }

.link-card { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }

.link-icon {
    flex: none;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-gold);
}
.link-icon svg { width: 18px; height: 18px; }

.link-text { min-width: 0; }
.link-label {
    display: block;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.link-sub {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 24px 60px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-muted); transition: color 0.2s ease; }
.site-footer a:hover { color: var(--accent-gold); }

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .terminal, .bento-card { animation: none; opacity: 1; transform: none; }
    .cursor { animation: none; opacity: 1; }
    .bento-card::after { display: none; }
    .bento-card:hover { transform: none; }
}
