/* ============================================================
   Petr Hanuš — personal site
   Aesthetic: dark "control room" — industrial precision,
   amber instrument accent, schematic details, mono labels.
   ============================================================ */

:root {
    --bg: #0b0e11;
    --bg-raise: #10151b;
    --panel: #12181f;
    --line: #232c35;
    --line-soft: #1a2129;
    --text: #e8e4da;
    --muted: #97a0aa;
    --dim: #7e8994;
    --accent: #ffb454;
    --accent-hot: #ffc87d;
    --signal: #56c8d8;
    --font-display: "Chakra Petch", sans-serif;
    --font-body: "IBM Plex Sans", sans-serif;
    --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #14100a; }

/* ---------- ambient background: PCB traces + code rain ---------- */

.bg-fx {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

#code-rain {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
}

.bg-pcb {
    position: absolute;
    inset: 0;
    opacity: 0.75;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320'%3E%3Cg fill='none' stroke='%233d4f61' stroke-width='1.2'%3E%3Cpath d='M28 28 H140 L172 60 V150'/%3E%3Ccircle cx='28' cy='28' r='4'/%3E%3Ccircle cx='172' cy='150' r='4'/%3E%3Cpath d='M292 52 H232 L208 76 V140 L176 172 H84'/%3E%3Ccircle cx='292' cy='52' r='4'/%3E%3Ccircle cx='84' cy='172' r='4'/%3E%3Cpath d='M52 288 V228 L88 192'/%3E%3Ccircle cx='52' cy='288' r='4'/%3E%3Ccircle cx='88' cy='192' r='4'/%3E%3Cpath d='M268 292 V224 L240 196 H196 L180 212 V248'/%3E%3Ccircle cx='268' cy='292' r='4'/%3E%3Ccircle cx='180' cy='248' r='4'/%3E%3Cpath d='M300 168 H272 L252 148 V108'/%3E%3Ccircle cx='300' cy='168' r='4'/%3E%3Ccircle cx='252' cy='108' r='4'/%3E%3Cpath d='M36 96 V132 L64 160'/%3E%3Ccircle cx='36' cy='96' r='4'/%3E%3C/g%3E%3Cg fill='%233d4f61'%3E%3Ccircle cx='140' cy='28' r='2'/%3E%3Ccircle cx='208' cy='76' r='2'/%3E%3Ccircle cx='64' cy='160' r='2'/%3E%3Ccircle cx='232' cy='52' r='2'/%3E%3Ccircle cx='240' cy='196' r='2'/%3E%3Ccircle cx='120' cy='250' r='2'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 320px 320px;
    mask-image: linear-gradient(180deg, black, rgba(0, 0, 0, 0.35) 32%, rgba(0, 0, 0, 0.35) 68%, black);
    -webkit-mask-image: linear-gradient(180deg, black, rgba(0, 0, 0, 0.35) 32%, rgba(0, 0, 0, 0.35) 68%, black);
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; }

h1:focus { outline: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hot); }

p { margin: 0 0 1em; }

/* ---------- top bar ---------- */

.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.7rem 1.5rem;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
}

.brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.08em;
    color: var(--text);
}

.brand-cursor {
    color: var(--accent);
    animation: blink 1.2s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.topnav {
    display: flex;
    gap: 1.4rem;
    margin-left: auto;
}

.topnav a {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.topnav a:hover { color: var(--accent); }

.lang-toggle {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    background: none;
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--dim);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.lang-toggle:hover { border-color: var(--accent); }
.lang-sep { margin: 0 0.25em; color: var(--line); }
.lang-active { color: var(--accent); font-weight: 600; }

.sys-clock {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: var(--dim);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sys-clock-label { color: var(--signal); margin-right: 0.5em; }

@media (max-width: 720px) {
    .topnav { display: none; }
    .sys-clock { display: none; }
    .lang-toggle { margin-left: auto; }
}

/* ---------- hero ---------- */

.hero {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--line-soft);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 80% at 30% 40%, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 30% 40%, black 20%, transparent 75%);
    animation: grid-drift 22s linear infinite;
}

@keyframes grid-drift { to { background-position: 56px 56px; } }

/* CRT scanline sweeping down the hero */
.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -140px;
    height: 140px;
    background: linear-gradient(180deg, transparent, rgba(232, 228, 218, 0.045), transparent);
    pointer-events: none;
    animation: scan 9s linear infinite;
}

@keyframes scan {
    from { top: -140px; }
    to { top: 100%; }
}

/* portrait as a live camera feed on the operator console */
.hero-photo {
    width: min(280px, 24vw);
    flex: 0 0 auto;
    padding: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 2px;
    pointer-events: none;
}

.hero-photo-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    color: var(--dim);
    padding: 0 2px 8px;
}

.hero-photo-bar .live { display: flex; align-items: center; gap: 0.45em; color: var(--signal); }

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 7px var(--signal);
    animation: pulse 2.4s ease-in-out infinite;
}

.hero-photo::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 16px;
    height: 16px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
}

.hero-photo::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 16px;
    height: 16px;
    border-bottom: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
}

.hero-photo img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 1px;
    filter: grayscale(0.15) sepia(0.05) saturate(1.05) brightness(0.95) contrast(1.02);
}


@media (max-width: 960px) {
    .hero-photo { display: none; }
}

.hero-inner {
    position: relative;
    max-width: 1060px;
    margin: 0 auto;
    padding: 7rem 1.5rem 9rem;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 3.5rem;
}

.hero-main { flex: 1; min-width: 0; }

.kicker {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    color: var(--signal);
    margin-bottom: 1.6rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 8px var(--signal);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: 0.25; box-shadow: none; } }

.hero h1 {
    font-size: clamp(2.6rem, 6.5vw, 5rem);
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    white-space: nowrap;
}

.hero-role {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: clamp(0.85rem, 2vw, 1.05rem);
    letter-spacing: 0.04em;
    margin: 1.4rem 0 1rem;
}

.hero-tagline {
    max-width: 34rem;
    color: var(--muted);
    font-size: 1.05rem;
}

.hero-stats {
    display: flex;
    gap: 2.5rem;
    margin: 2.4rem 0;
    flex-wrap: wrap;
}

.stat { display: flex; flex-direction: column; gap: 0.15rem; }

.stat-num {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dim);
}

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.5rem;
    border-radius: 2px;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #14100a;
    font-weight: 600;
}

.btn-primary:hover {
    color: #14100a;
    box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 45%, transparent);
    transform: translateY(-1px);
}

.btn-ghost {
    border: 1px solid var(--line);
    color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-wave {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 140px;
    animation: wave-in 1.4s ease 0.3s both;
}

@keyframes wave-in { from { opacity: 0; } }

/* oscilloscope: green phosphor, beam sweeping left-to-right with fading
   persistence. All layers reuse one path (pathLength=1000); the dash heads
   stay aligned because each layer's offset travels the same 1000-unit span. */
.wave-base, .wave-persist, .wave-beam, .wave-spot {
    fill: none;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* long-persistence afterglow of the whole waveform */
.wave-base {
    stroke: #3cf57c;
    stroke-width: 1;
    opacity: 0.18;
    filter: drop-shadow(0 0 3px rgba(60, 245, 124, 0.5));
}

/* fading tail behind the beam */
.wave-persist {
    stroke: #3cf57c;
    stroke-width: 1.2;
    opacity: 0.5;
    filter: drop-shadow(0 0 4px rgba(60, 245, 124, 0.6));
    stroke-dasharray: 380 620;
    animation: sweep-persist 7s linear infinite;
}

/* bright section right behind the beam spot */
.wave-beam {
    stroke: #a2ffc0;
    stroke-width: 1.5;
    opacity: 0.8;
    filter: drop-shadow(0 0 5px rgba(90, 255, 150, 0.7));
    stroke-dasharray: 110 890;
    animation: sweep-beam 7s linear infinite;
}

/* the beam spot itself */
.wave-spot {
    stroke: #eaffef;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 6px #8cffb0);
    stroke-dasharray: 5 995;
    animation: sweep-spot 7s linear infinite;
}

@keyframes sweep-persist { from { stroke-dashoffset: 380; } to { stroke-dashoffset: -620; } }
@keyframes sweep-beam { from { stroke-dashoffset: 110; } to { stroke-dashoffset: -890; } }
@keyframes sweep-spot { from { stroke-dashoffset: 5; } to { stroke-dashoffset: -995; } }

/* page-load reveals */
.reveal { opacity: 0; transform: translateY(14px); animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
.r1 { animation-delay: 0.05s; }
.r2 { animation-delay: 0.15s; }
.r3 { animation-delay: 0.3s; }
.r4 { animation-delay: 0.42s; }
.r5 { animation-delay: 0.54s; }
.r6 { animation-delay: 0.66s; }

@keyframes rise { to { opacity: 1; transform: none; } }

/* scroll-triggered reveals — hidden only once fx.js has taken over,
   so content stays visible without JS (crawlers, no-script) */
body.fx-ready [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
}

body.fx-ready [data-reveal].in-view {
    animation: rise 0.65s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .reveal { animation: none; opacity: 1; transform: none; }
    .led, .brand-cursor, .live-dot { animation: none; }
    .hero-grid, .hero-wave { animation: none; }
    .hero::after { animation: none; display: none; }
    .wave-persist, .wave-beam, .wave-spot { animation: none; display: none; }
    .wave-base { opacity: 0.45; }
    body.fx-ready [data-reveal] { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

/* ---------- sections ---------- */

.section {
    max-width: 1060px;
    margin: 0 auto;
    padding: 5.5rem 1.5rem 1rem;
}

.section-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 2.6rem;
}

.section-num {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.85rem;
}

.section-head h2 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.section-rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line), transparent);
    align-self: center;
}

/* ---------- about ---------- */

.about-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 3rem;
}

.about-text p { color: var(--muted); }
.about-text p:first-child { color: var(--text); font-size: 1.08rem; }

.about-facts {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 1.4rem 1.5rem;
    background: var(--panel);
    position: relative;
    align-self: start;
}

.about-facts::before {
    content: "";
    position: absolute;
    top: -1px; left: -1px;
    width: 14px; height: 14px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
}

.about-facts::after {
    content: "";
    position: absolute;
    bottom: -1px; right: -1px;
    width: 14px; height: 14px;
    border-bottom: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
}

.about-facts div { padding: 0.55rem 0; border-bottom: 1px dashed var(--line-soft); }
.about-facts div:last-child { border-bottom: none; }

.about-facts dt {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dim);
}

.about-facts dd { margin: 0.1rem 0 0; font-size: 0.92rem; }

@media (max-width: 820px) {
    .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---------- skills ---------- */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1px;
    background: var(--line-soft);
    border: 1px solid var(--line-soft);
}

.skill-card {
    background: var(--bg-raise);
    padding: 1.5rem 1.5rem 1.2rem;
    transition: background 0.2s;
}

.skill-card:hover { background: var(--panel); }

.skill-card h3 {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.tags li {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.03em;
    padding: 0.22rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--text);
    background: color-mix(in srgb, var(--panel) 60%, transparent);
}

.tags-dim li { color: var(--muted); border-color: var(--line-soft); }

/* ---------- timeline ---------- */

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 3px;
    width: 1px;
    background: linear-gradient(var(--accent), var(--line) 30%, var(--line));
}

.tl-item {
    position: relative;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.6rem;
    padding: 0 0 2.6rem 2rem;
}

.tl-node {
    position: absolute;
    left: 0;
    top: 8px;
    width: 7px;
    height: 7px;
    background: var(--bg);
    border: 1.5px solid var(--accent);
    transform: rotate(45deg);
}

.tl-years {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--accent);
}

.tl-company {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    margin-top: 0.2rem;
}

.tl-body h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--signal);
    font-family: var(--font-mono);
    margin-bottom: 0.5rem;
}

.tl-body p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.8rem; }

@media (max-width: 720px) {
    .tl-item { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ---------- projects ---------- */

.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
}

.project-card {
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--bg-raise);
    padding: 1.6rem 1.6rem 1.3rem;
    position: relative;
    transition: border-color 0.2s, transform 0.2s;
}

.project-card:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    transform: translateY(-2px);
}

.project-card header {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    margin-bottom: 0.8rem;
}

.project-index {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--dim);
    border: 1px solid var(--line);
    padding: 0.1rem 0.4rem;
    border-radius: 2px;
}

.project-card h3 { font-size: 1.15rem; }
.project-card h3 a { color: var(--text); }
.project-card h3 a:hover { color: var(--accent); }
.project-card > p { color: var(--muted); font-size: 0.95rem; margin-bottom: 1rem; }

@media (max-width: 720px) {
    .projects-grid { grid-template-columns: 1fr; }
}

.offgrid {
    margin-top: 2.4rem;
    border-left: 2px solid var(--signal);
    background: linear-gradient(90deg, color-mix(in srgb, var(--signal) 7%, transparent), transparent 70%);
    padding: 1.2rem 1.6rem;
}

.offgrid h3 {
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--signal);
    margin-bottom: 0.5rem;
}

.offgrid p { color: var(--muted); margin: 0; max-width: 46rem; }

/* ---------- contact ---------- */

.section-contact { padding-bottom: 6rem; text-align: center; }

.contact-mail {
    display: inline-block;
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 4.5vw, 2.6rem);
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.2rem;
    margin-bottom: 2.2rem;
    transition: color 0.2s;
}

.contact-mail:hover { color: var(--accent); }

.contact-links { display: flex; gap: 1rem; justify-content: center; }

/* ---------- footer ---------- */

.footer {
    border-top: 1px solid var(--line-soft);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 1060px;
    margin: 0 auto;
    padding: 1.6rem 1.5rem 2.2rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--dim);
}

/* ---------- boot shell: static snapshot shown before Blazor starts ---------- */

.boot-shell {
    max-width: 720px;
    margin: 0 auto;
    padding: 5rem 1.5rem 4rem;
    color: var(--muted);
}

.boot-note {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: var(--dim);
}

.boot-shell h1 {
    font-size: 2.6rem;
    color: var(--text);
    text-transform: uppercase;
}

.boot-role { font-family: var(--font-mono); color: var(--accent); margin-top: 0.5rem; }

.boot-shell h2 {
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 1.8rem 0 0.6rem;
}

.boot-shell ul { margin: 0; padding-left: 1.2rem; }
.boot-shell li { margin-bottom: 0.25rem; }

/* ---------- Blazor error UI ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #2a1414;
    color: #ffd9d9;
    border-top: 1px solid #713131;
    padding: 0.8rem 1.4rem;
    font-size: 0.9rem;
}

#blazor-error-ui .reload { color: var(--accent); margin-left: 0.75rem; }

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.8rem;
}
