/* =========================================================================
  stuhec.dev — stylesheet
  Marko Štuhec
   ========================================================================= */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html,
body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
    margin: 0;
    padding: 0;
}
ul {
    list-style: none;
}
a {
    color: inherit;
    text-decoration: none;
}
img,
svg,
canvas {
    display: block;
    max-width: 100%;
}
button,
input,
textarea {
    font: inherit;
    color: inherit;
}
button {
    background: none;
    border: none;
    cursor: pointer;
}

/* ---------- Design ---------- */
:root {
    /* Surfaces */
    --bg-void: #090c11;
    --bg-void-2: #0c1017;
    --bg-surface: #0f141c;
    --bg-surface-2: #131a24;
    --glass-fill: rgba(255, 255, 255, 0.035);
    --glass-fill-hi: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-border-hi: rgba(255, 255, 255, 0.16);

    /* Signal colors */
    --cyan: #3fe0d0;
    --cyan-soft: rgba(63, 230, 210, 0.14);
    --cyan-line: rgba(63, 230, 210, 0.35);
    --amber: #ffb454;
    --amber-soft: rgba(255, 180, 84, 0.14);
    --green: #5eeb9c;
    --green-soft: rgba(94, 235, 156, 0.14);
    --red: #ff6b6b;

    /* Text */
    --text-primary: #e9eef4;
    --text-secondary: #94a4b8;
    --text-tertiary: #5b6b80;

    /* Type */
    --font-mono:
        "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
    --font-sans:
        "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;

    /* Scale */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 22px;
    --container: 1180px;

    /* Glow */
    --glow-cyan: 0 0 1px var(--cyan), 0 0 28px rgba(63, 230, 210, 0.22);
    --glow-amber: 0 0 1px var(--amber), 0 0 28px rgba(255, 180, 84, 0.22);

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Base ---------- */
html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(
            circle at 12% -10%,
            rgba(63, 230, 210, 0.08),
            transparent 45%
        ),
        radial-gradient(
            circle at 88% 8%,
            rgba(255, 180, 84, 0.06),
            transparent 40%
        );
    background-attachment: fixed;
}

body.nav-open {
    overflow: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

::selection {
    background: var(--cyan-soft);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-void);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-surface-2);
    border-radius: 8px;
    border: 2px solid var(--bg-void);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--cyan-line);
}

/* Focus visibility (keyboard accessibility) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Skip link */
.skip-link {
    position: fixed;
    top: -60px;
    left: 16px;
    z-index: 999;
    background: var(--bg-surface);
    border: 1px solid var(--cyan-line);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    transition: top 0.2s var(--ease);
}
.skip-link:focus {
    top: 16px;
}

/* ---------- Utility ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.06em;
    color: var(--cyan);
    text-transform: none;
}
.eyebrow::before {
    content: "//";
    color: var(--text-tertiary);
}

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

.led {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-tertiary);
    box-shadow: none;
    flex-shrink: 0;
}
.led--cyan {
    background: var(--cyan);
    box-shadow: 0 0 8px rgba(63, 230, 210, 0.8);
}
.led--amber {
    background: var(--amber);
    box-shadow: 0 0 8px rgba(255, 180, 84, 0.8);
}
.led--green {
    background: var(--green);
    box-shadow: 0 0 8px rgba(94, 235, 156, 0.8);
}
.led--pulse {
    animation: pulse-led 2.2s ease-in-out infinite !important;
}

@keyframes pulse-led {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        transform: scale(0.82);
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--green);
    background: var(--green-soft);
    border: 1px solid rgba(94, 235, 156, 0.3);
    padding: 7px 14px;
    border-radius: 999px;
}

.chip {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    padding: 5px 11px;
    border-radius: 999px;
}

.glass-card {
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition:
        border-color 0.3s var(--ease),
        transform 0.3s var(--ease),
        box-shadow 0.3s var(--ease),
        background 0.3s var(--ease);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    padding: 13px 24px;
    border-radius: var(--radius-sm);
    transition:
        transform 0.25s var(--ease),
        box-shadow 0.25s var(--ease),
        border-color 0.25s var(--ease),
        background 0.25s var(--ease);
}
.btn:hover {
    transform: translateY(-2px);
}
.btn:active {
    transform: translateY(0);
}

.btn--primary {
    background: var(--cyan);
    color: #06110f;
    border: 1px solid var(--cyan);
}
.btn--primary:hover {
    box-shadow: var(--glow-cyan);
}

.btn--ghost {
    background: var(--glass-fill);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}
.btn--ghost:hover {
    border-color: var(--glass-border-hi);
    background: var(--glass-fill-hi);
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 0.7s var(--ease),
        transform 0.7s var(--ease);
}
.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Header / Nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 12, 17, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}

.navbar {
    max-width: var(--container);
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
}
.brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--cyan-soft);
    border: 1px solid var(--cyan-line);
    color: var(--cyan);
    font-size: 12px;
}
.brand-text {
    color: var(--text-primary);
}
.brand:hover .brand-mark {
    box-shadow: var(--glow-cyan);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--text-secondary);
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition:
        color 0.2s var(--ease),
        border-color 0.2s var(--ease),
        background 0.2s var(--ease);
}
.nav-link:hover {
    color: var(--text-primary);
    background: var(--glass-fill);
}
.nav-link.active {
    color: var(--cyan);
    border-color: var(--cyan-line);
    background: var(--cyan-soft);
}
.nav-link .led {
    transition:
        background 0.2s,
        box-shadow 0.2s;
}
.nav-link:hover .led {
    background: var(--amber);
    box-shadow: 0 0 8px rgba(255, 180, 84, 0.7);
}
.nav-link.active .led {
    background: var(--cyan);
    box-shadow: 0 0 8px rgba(63, 230, 210, 0.9);
}

.nav-cta {
    margin-left: 6px;
    border: 1px solid var(--glass-border-hi);
}
.nav-cta:hover {
    border-color: var(--cyan-line);
    color: var(--cyan);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}
.nav-toggle-bar {
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: var(--text-primary);
    transition:
        transform 0.25s var(--ease),
        opacity 0.25s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--glass-border);
    padding: 28px 0 40px;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-tertiary);
}
.footer-status {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.footer-status span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

/* =========================================================================
   Hero / Landing portal (index.html)
   ========================================================================= */
.hero {
    position: relative;
    min-height: calc(100vh - 68px);
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--glass-border);
}

.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.9;
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0px 0 64px;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--green);
    min-height: 20px;
    margin-bottom: 22px;
}
.hero-eyebrow .prompt {
    color: var(--text-tertiary);
}
.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--cyan);
    margin-left: 4px;
    vertical-align: -3px;
    animation: blink 1s steps(1) infinite;
}
@keyframes blink {
    50% {
        opacity: 0;
    }
}

.hero-title {
    font-size: clamp(38px, 7vw, 78px);
    line-height: 1.03;
    font-weight: 700;
    letter-spacing: -0.02em;
    max-width: 16ch;
}
.hero-title .accent {
    -webkit-text-stroke: 0;
}

.hero-subtitle {
    margin-top: 22px;
    max-width: 620px;
    font-size: clamp(16px, 2vw, 19px);
    color: var(--text-secondary);
}

/* Port panel */
.port-panel {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 780px;
}

.port-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    cursor: pointer;
}
.port-card:hover,
.port-card:focus-visible {
    border-color: var(--cyan-line);
    transform: translateY(-4px);
    box-shadow: var(--glow-cyan);
    background: var(--glass-fill-hi);
}
.port-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.port-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    color: var(--cyan);
}
.port-index {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-tertiary);
}
.port-label {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
}
.port-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.port-go {
    margin-top: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.port-card:hover .port-go {
    color: var(--cyan);
}
.port-go svg {
    width: 12px;
    height: 12px;
    transition: transform 0.25s var(--ease);
}
.port-card:hover .port-go svg {
    transform: translateX(3px);
}

.hero-statusbar {
    margin-top: 56px;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-tertiary);
}
.hero-statusbar span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

@media (max-width: 760px) {
    .port-panel {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
   404 page — retro terminal
   ========================================================================= */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(63, 230, 210, 0.06),
            transparent 60%
        ),
        repeating-linear-gradient(
            rgba(255, 255, 255, 0.02) 0px,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 3px
        );
}
.terminal-window {
    width: 100%;
    max-width: 640px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border-hi);
    background: rgba(10, 14, 20, 0.85);
    backdrop-filter: blur(10px);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.5),
        var(--glow-cyan);
    overflow: hidden;
}
.terminal-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-surface-2);
    border-bottom: 1px solid var(--glass-border);
}
.terminal-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}
.terminal-dot--red {
    background: #ff6259;
}
.terminal-dot--amber {
    background: var(--amber);
}
.terminal-dot--green {
    background: var(--green);
}
.terminal-titlebar-label {
    margin-left: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-tertiary);
}
.terminal-body {
    padding: 26px 22px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.9;
}
.terminal-line {
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}
.terminal-line .prompt {
    color: var(--green);
}
.terminal-line .path {
    color: var(--cyan);
}
.terminal-error {
    margin-top: 18px;
    color: var(--red);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.02em;
}
.terminal-sub {
    margin-top: 8px;
    color: var(--text-secondary);
}
.terminal-actions {
    margin-top: 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* =========================================================================
   Responsive nav
   ========================================================================= */
@media (max-width: 860px) {
    .nav-toggle {
        display: flex;
    }
    .nav-menu {
        position: fixed;
        inset: 68px 0 0 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 18px;
        background: rgba(9, 12, 17, 0.98);
        backdrop-filter: blur(18px);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition:
            opacity 0.25s var(--ease),
            transform 0.25s var(--ease);
    }
    .nav-menu.is-open {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    .nav-link {
        padding: 15px 16px;
        font-size: 15px;
    }
    .nav-cta {
        margin-left: 0;
        margin-top: 8px;
        text-align: center;
        justify-content: center;
    }
}
