*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Cyberpunk palette tuned to the >_ Vyvoj.net logo (terminal green primary) */
  --bg: #04070a;
  --bg-soft: #07101a;
  --panel: rgba(8, 16, 24, 0.78);
  --panel-strong: rgba(5, 11, 18, 0.94);

  --line: rgba(22, 217, 126, 0.22);
  --line-strong: rgba(22, 217, 126, 0.55);

  --text: #e2f4e9;
  --muted: #7d9c8c;

  /* Primary green — matches the ">_" / ".net" accent in the logo */
  --accent: #16d97e;
  --accent-soft: rgba(22, 217, 126, 0.18);
  /* Cyberpunk 2077 magenta */
  --accent-2: #ff2bd6;
  /* Deus Ex / Blade Runner amber */
  --accent-3: #ffb347;

  --shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  --glow-green: 0 0 20px rgba(22, 217, 126, 0.45);
  --glow-magenta: 0 0 18px rgba(255, 43, 214, 0.4);

  /* Aggressive notched corner cut */
  --corner: polygon(
    0 0.9rem,
    0.9rem 0,
    calc(100% - 1.6rem) 0,
    100% 1.6rem,
    100% calc(100% - 0.9rem),
    calc(100% - 0.9rem) 100%,
    1.6rem 100%,
    0 calc(100% - 1.6rem)
  );

  --mono: "Share Tech Mono", "JetBrains Mono", ui-monospace, monospace;
  --display: "Orbitron", sans-serif;
  --body: "Rajdhani", "Space Grotesk", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(22, 217, 126, 0.18), transparent 32%),
    radial-gradient(circle at 82% 12%, rgba(255, 43, 214, 0.16), transparent 30%),
    radial-gradient(circle at 70% 86%, rgba(255, 179, 71, 0.12), transparent 28%),
    linear-gradient(180deg, #050a10 0%, #02060a 100%);
  color: var(--text);
  font-family: var(--body);
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

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

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* ---------- Atmosphere ---------- */

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(22, 217, 126, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 217, 126, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 40%, black 30%, transparent 80%);
  pointer-events: none;
  z-index: -3;
  opacity: 0.55;
}

.ambient {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.42;
  z-index: -2;
}

.ambient-a {
  top: -10rem;
  right: -6rem;
  background: rgba(22, 217, 126, 0.32);
  animation: drift-a 16s ease-in-out infinite alternate;
}

.ambient-b {
  bottom: -14rem;
  left: -10rem;
  background: rgba(255, 43, 214, 0.22);
  animation: drift-b 18s ease-in-out infinite alternate;
}

.ambient-c {
  top: 40%;
  left: 55%;
  width: 22rem;
  height: 22rem;
  background: rgba(255, 179, 71, 0.16);
  animation: drift-a 22s ease-in-out infinite alternate-reverse;
}

.scanlines {
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04) 0,
    rgba(255, 255, 255, 0.04) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.18;
  pointer-events: none;
  z-index: -1;
  mix-blend-mode: overlay;
  animation: scan-flicker 4s steps(40) infinite;
}

.vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  z-index: -1;
}

/* ---------- HUD overlay ---------- */

.hud {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  z-index: 5;
  text-align: right;
  text-shadow: 0 0 8px rgba(22, 217, 126, 0.55);
  pointer-events: none;
}

.hud-line em {
  font-style: normal;
  color: var(--accent-3);
  animation: pulse 1.4s ease-in-out infinite;
}

/* ---------- Layout containers ---------- */

.site-header,
.site-footer,
.section {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 0 0;
  gap: 1.5rem;
}

/* ---------- Brand / logo ---------- */

.brand {
  display: inline-flex;
  gap: 1rem;
  align-items: center;
}

.brand-logo {
  /* Logo is dark text + green accents on light bg.
     Invert + hue-rotate flips lightness while preserving the green hue. */
  height: 2.4rem;
  width: auto;
  filter: invert(1) hue-rotate(180deg) drop-shadow(0 0 10px rgba(22, 217, 126, 0.35));
  transition: filter 220ms ease, transform 220ms ease;
}

.brand:hover .brand-logo,
.brand:focus-visible .brand-logo {
  filter: invert(1) hue-rotate(180deg) drop-shadow(0 0 16px rgba(22, 217, 126, 0.7));
  transform: translateY(-1px);
}

.brand-meta {
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-tag {
  font-size: 0.62rem;
  color: var(--muted);
}

.brand-id {
  font-size: 0.74rem;
  color: var(--accent);
}

.cursor {
  display: inline-block;
  margin-left: 0.1em;
  color: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}

/* ---------- Typography utilities ---------- */

.eyebrow,
.section-code,
.feature-meta,
.feature-cta {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.prompt {
  color: var(--accent);
  font-family: var(--mono);
  text-shadow: 0 0 8px rgba(22, 217, 126, 0.6);
  margin-right: 0.4em;
}

/* ---------- Nav ---------- */

.site-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.78rem;
  color: var(--muted);
  position: relative;
  padding: 0.3rem 0;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.site-nav a .nav-bracket {
  color: var(--accent);
  opacity: 0.7;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(22, 217, 126, 0.6);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transition: width 180ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  width: 100%;
}

/* ---------- Sections ---------- */

.section {
  padding: 4rem 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 1.4rem;
  padding-top: 3.5rem;
}

/* ---------- Panels ---------- */

.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(22, 217, 126, 0.08), transparent 32%),
    var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--corner);
  padding: 1.75rem 1.6rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.panel:hover {
  border-color: var(--line-strong);
}

/* Decorative corner brackets */
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 1.4rem;
  height: 1.4rem;
  pointer-events: none;
  border: 1px solid transparent;
}

.panel::before {
  top: 0.7rem;
  left: 0.7rem;
  border-top-color: var(--line-strong);
  border-left-color: var(--line-strong);
}

.panel::after {
  right: 0.7rem;
  bottom: 0.7rem;
  border-right-color: rgba(255, 43, 214, 0.55);
  border-bottom-color: rgba(255, 43, 214, 0.55);
}

.eyebrow,
.section-code {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  color: var(--accent);
}

.hero h1,
.section h2 {
  margin: 0;
  font-family: var(--display);
  line-height: 0.95;
  font-weight: 800;
}

/* ---------- Glitch H1 ---------- */

.hero h1 {
  position: relative;
  font-size: clamp(3.2rem, 8vw, 6.4rem);
  max-width: 14ch;
  text-wrap: balance;
  letter-spacing: 0.02em;
  color: var(--text);
  text-shadow: 0 0 22px rgba(22, 217, 126, 0.25);
}

.hero h1::before,
.hero h1::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero h1::before {
  color: var(--accent-2);
  clip-path: polygon(0 0, 100% 0, 100% 42%, 0 42%);
  animation: glitch-a 5.4s infinite steps(1);
}

.hero h1::after {
  color: var(--accent);
  clip-path: polygon(0 58%, 100% 58%, 100% 100%, 0 100%);
  animation: glitch-b 4.6s infinite steps(1);
}

.section h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.02em;
}

.lead {
  max-width: 42rem;
  font-size: 1.18rem;
  line-height: 1.65;
  color: #d6efe0;
  margin: 1.35rem 0 0;
}

.site-footer p,
.feature-text {
  color: var(--muted);
  line-height: 1.7;
}

.accent {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(22, 217, 126, 0.5);
}

.accent-alt {
  color: var(--accent-3);
  text-shadow: 0 0 10px rgba(255, 179, 71, 0.4);
}

/* ---------- Buttons ---------- */

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.9rem 1.4rem;
  clip-path: var(--corner);
  border: 1px solid var(--line-strong);
  font-family: var(--display);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  position: relative;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  overflow: hidden;
}

.button-glyph {
  font-family: var(--mono);
  color: var(--accent);
  text-shadow: 0 0 8px rgba(22, 217, 126, 0.7);
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(22, 217, 126, 0.18) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 480ms ease;
  pointer-events: none;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--glow-green);
}

.button:hover::after,
.button:focus-visible::after {
  transform: translateX(100%);
}

.button-primary {
  background: linear-gradient(135deg, rgba(22, 217, 126, 0.22), rgba(255, 43, 214, 0.16));
  color: var(--text);
}

.button-secondary {
  background: rgba(7, 17, 29, 0.7);
  color: var(--text);
}

.button-secondary .button-glyph {
  color: var(--accent-2);
  text-shadow: 0 0 8px rgba(255, 43, 214, 0.7);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  box-shadow: var(--glow-magenta);
  border-color: rgba(255, 43, 214, 0.6);
}

/* ---------- Hero visual / portrait ---------- */

.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  justify-content: center;
  background:
    linear-gradient(145deg, rgba(255, 43, 214, 0.08), transparent 35%),
    var(--panel-strong);
}

.visual-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.dot-row {
  display: inline-flex;
  gap: 0.35rem;
}

.dot-row i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

.dot-row i:nth-child(2) {
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
  animation-delay: 0.2s;
}

.dot-row i:nth-child(3) {
  background: var(--accent-3);
  box-shadow: 0 0 8px var(--accent-3);
  animation-delay: 0.4s;
}

.portrait-frame {
  position: relative;
  width: min(100%, 24rem);
  margin-inline: auto;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.portrait-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(22, 217, 126, 0.3);
  background:
    radial-gradient(circle, transparent 54%, rgba(22, 217, 126, 0.12) 55%, transparent 60%),
    conic-gradient(
      from 90deg,
      rgba(22, 217, 126, 0.45),
      transparent 28%,
      rgba(255, 43, 214, 0.4),
      transparent 64%,
      rgba(255, 179, 71, 0.4)
    );
  animation: ring-spin 18s linear infinite;
  filter: drop-shadow(0 0 18px rgba(22, 217, 126, 0.25));
}

.portrait-targets .t {
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--accent);
  box-shadow: 0 0 10px rgba(22, 217, 126, 0.5);
}

.portrait-targets .t-tl { top: 6%;    left: 6%;  border-right: 0; border-bottom: 0; }
.portrait-targets .t-tr { top: 6%;    right: 6%; border-left: 0;  border-bottom: 0; }
.portrait-targets .t-bl { bottom: 6%; left: 6%;  border-right: 0; border-top: 0; }
.portrait-targets .t-br { bottom: 6%; right: 6%; border-left: 0;  border-top: 0; }

.portrait {
  position: relative;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(22, 217, 126, 0.55);
  box-shadow: 0 0 40px rgba(22, 217, 126, 0.28);
  overflow: hidden;
  top: -23px;
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.13);
  transform-origin: 50% 30%;
  filter: contrast(1.05) saturate(1.05);
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

/* ---------- Inline repo link in lead ---------- */

.repo-link {
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: 0.04em;
  border-bottom: 1px dashed rgba(22, 217, 126, 0.5);
  padding-bottom: 1px;
  text-shadow: 0 0 10px rgba(22, 217, 126, 0.45);
  transition: color 180ms ease, border-color 180ms ease, text-shadow 180ms ease;
}

.repo-link:hover,
.repo-link:focus-visible {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
  text-shadow: var(--glow-magenta);
}

/* ---------- Featured work ---------- */

.section-heading {
  margin-bottom: 1.4rem;
}

.feature-card {
  display: grid;
  gap: 1rem;
  color: var(--text);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.feature-card:hover,
.feature-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow), var(--glow-green);
}

.feature-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.7rem;
  color: var(--accent);
}

.feature-meta span:last-child {
  color: var(--accent-3);
}

.feature-text {
  margin: 0;
  font-size: 1.1rem;
  max-width: 56ch;
}

.feature-cta {
  font-size: 0.78rem;
  color: var(--accent);
  align-self: start;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.feature-card:hover .feature-cta,
.feature-card:focus-visible .feature-cta {
  color: var(--accent-2);
  text-shadow: var(--glow-magenta);
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px dashed rgba(22, 217, 126, 0.18);
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms ease, transform 500ms ease, border-color 180ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Animations ---------- */

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-3rem, 4rem, 0) scale(1.08); }
}

@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4rem, -3rem, 0) scale(1.06); }
}

@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

@keyframes scan-flicker {
  0%, 96%, 100% { opacity: 0.18; }
  97%           { opacity: 0.05; }
  98%           { opacity: 0.28; }
}

@keyframes glitch-a {
  0%, 95%, 100% { transform: translate(0, 0); opacity: 0; }
  96%           { transform: translate(2px, -1px); opacity: 0.7; }
  98%           { transform: translate(-1px, 1px); opacity: 0.5; }
}

@keyframes glitch-b {
  0%, 94%, 100% { transform: translate(0, 0); opacity: 0; }
  95%           { transform: translate(-2px, 1px); opacity: 0.6; }
  97%           { transform: translate(1px, -1px); opacity: 0.7; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .hud { display: none; }

  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .section { padding: 3rem 0; }
  .hero    { padding-top: 2rem; }

  .hero h1 { font-size: clamp(2.6rem, 14vw, 4.4rem); }

  .button { width: 100%; }

  .hero-actions { flex-direction: column; }

  .brand-logo { height: 2rem; }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
