/* ==========================================================
   Boris Lysák – portfólio
   Farby, písmo a medzery sú v premenných hneď nižšie.
   ========================================================== */

/* ---------- Písmo Instrument Sans (licencia OFL), uložené priamo na stránke,
   aby sa pri načítaní neposielala IP adresa návštevníka Googlu ---------- */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/instrument-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/instrument-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f7f8fa;          /* pozadie stránky */
  --surface: #ffffff;     /* karty */
  --text: #0f172a;        /* hlavný text */
  --muted: #475569;       /* vedľajší text */
  --line: #e5e7eb;        /* tenké okraje */
  --accent: #1d4ed8;      /* modrá – tlačidlá, odkazy */
  --accent-dark: #1e40af; /* modrá pri prejdení myšou */
  --accent-soft: #eff4ff; /* svetlomodré pozadie ikon a štítkov */
  --green: #16a34a;       /* bodka pri "hľadám stáž" */
  --navy: #0f172a;        /* tmavý blok v kontakte */

  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 4px 16px rgb(15 23 42 / 0.04);
  --shadow-hover: 0 2px 4px rgb(15 23 42 / 0.06), 0 12px 32px rgb(15 23 42 / 0.08);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Základ ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* aby nadpis sekcie nebol pod hornou lištou */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: #dbe4ff;
}

ul {
  list-style: none;
  padding: 0;
}

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

.container {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 48rem) {
  .container {
    padding-inline: 2rem;
  }
}

/* Odkaz "Preskočiť na obsah" – viditeľný len pri ovládaní klávesnicou */
.skip {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  transform: translateY(-200%);
}
.skip:focus {
  transform: none;
}

/* ---------- Horná lišta ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(247 248 250 / 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

/* Kde to prehliadač vie, okraj lišty sa ukáže až po posunutí stránky */
@supports (animation-timeline: scroll()) {
  .topbar {
    animation: topbar-line linear both;
    animation-timeline: scroll();
    animation-range: 0 80px;
  }
}
@keyframes topbar-line {
  from {
    border-bottom-color: transparent;
  }
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4rem;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9375rem;
}

.menu a {
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms, background-color 150ms;
}
.menu a:hover {
  color: var(--text);
  background: rgb(15 23 42 / 0.05);
}

.menu .menu-cta {
  color: #fff;
  background: var(--accent);
  margin-left: 0.25rem;
}
.menu .menu-cta:hover {
  color: #fff;
  background: var(--accent-dark);
}

/* Na telefóne ostane v menu len Kontakt, aby sa lišta zmestila */
@media (max-width: 40rem) {
  .menu a:not(.menu-cta) {
    display: none;
  }
}

/* ---------- Úvod ---------- */
.hero {
  position: relative;
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding-block: 3.5rem 3rem;
}

/* Slabá modrá žiara za úvodom */
.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -4rem 0 auto;
  height: 32rem;
  background:
    radial-gradient(40% 60% at 75% 40%, rgb(29 78 216 / 0.07), transparent 70%),
    radial-gradient(35% 50% at 20% 30%, rgb(56 189 248 / 0.06), transparent 70%);
  pointer-events: none;
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: 1.4fr 1fr;
    gap: 4rem;
    padding-block: 6rem 4.5rem;
  }
}

/* Malý riadok nad nadpisom so zelenou bodkou */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding: 0.3rem 0.85rem 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.7);
  font-size: 0.875rem;
  color: var(--muted);
}
.eyebrow::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgb(22 163 74 / 0.4);
}

.hero h1 {
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* Zvýraznené slová v nadpise – len modrá farba */
.highlight {
  font-style: normal;
  color: var(--accent);
}

.lead {
  margin-top: 1.25rem;
  max-width: 36rem;
  font-size: 1.1875rem;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 200ms var(--ease), background-color 150ms, border-color 150ms, box-shadow 200ms;
}
.button:hover {
  transform: translateY(-2px);
  border-color: #94a3b8;
  box-shadow: var(--shadow);
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.button-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

/* Fotka s jemným modrým rámom za ňou */
.hero-photo {
  position: relative;
  justify-self: center;
  width: min(75%, 22rem);
}
@media (min-width: 56rem) {
  .hero-photo {
    width: min(100%, 22rem);
  }
}
.hero-photo::before {
  content: '';
  position: absolute;
  inset: 1.25rem -1.25rem -1.25rem 1.25rem;
  border-radius: 20px;
  background: var(--accent-soft);
  border: 1px solid #dbe4ff;
  transition: transform 500ms var(--ease), background-color 300ms, border-color 300ms;
}
.hero-photo img {
  position: relative;
  width: 100%;
  height: auto; /* inak by atribút height v HTML prebil pomer strán */
  aspect-ratio: 1 / 1;
  transition: transform 500ms var(--ease), box-shadow 500ms var(--ease);
  object-fit: cover;
  border-radius: 20px;
  box-shadow: var(--shadow-hover);
}

/* Po prejdení myšou sa fotka trochu zdvihne a rám za ňou posunie */
.hero-photo:hover img {
  transform: translate(-4px, -4px);
  box-shadow: 0 8px 16px rgb(15 23 42 / 0.06), 0 24px 48px rgb(29 78 216 / 0.12);
}
.hero-photo:hover::before {
  transform: translate(4px, 4px);
}

/* ---------- Pás s faktami ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stats div {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
}
.stats div:nth-child(-n + 2) {
  border-top: 0;
}
.stats div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

@media (min-width: 48rem) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .stats div {
    border-top: 0;
    border-right: 1px solid var(--line);
  }
  .stats div:last-child {
    border-right: 0;
  }
}

.stats dt {
  font-size: 0.8125rem;
  color: var(--muted);
}
.stats dd {
  margin: 0.15rem 0 0;
  font-weight: 600;
}

/* ---------- Sekcie ---------- */
.section {
  padding-block: 4.5rem 0;
}
@media (min-width: 56rem) {
  .section {
    padding-block: 6.5rem 0;
  }
}

.section-head {
  max-width: 40rem;
  margin-bottom: 2rem;
}
.section-head h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  font-weight: 700;
}
.section-head h2::before {
  content: '';
  display: block;
  width: 2rem;
  height: 3px;
  margin-bottom: 1rem;
  border-radius: 3px;
  background: var(--accent);
}

/* O mne: dva odseky vedľa seba */
.about {
  display: grid;
  gap: 1.25rem;
  color: var(--muted);
  font-size: 1.125rem;
}
@media (min-width: 48rem) {
  .about {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

/* ---------- Karty ---------- */
.grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 40rem) {
  .grid-2,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 64rem) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 250ms var(--ease), box-shadow 250ms var(--ease), border-color 250ms;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #dbe4ff;
}

.card-small {
  padding: 1.5rem;
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
}
.card-small h3 {
  font-size: 1.0625rem;
}
.card p {
  margin-top: 0.5rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.card-small .tags {
  margin-top: 0.85rem;
}
.tags li {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ---------- Projekt so zoznamom služieb ---------- */
.project {
  display: grid;
  gap: 2rem;
}
@media (min-width: 56rem) {
  .project {
    grid-template-columns: 1fr 1.4fr;
    gap: 3rem;
    padding: 2.25rem;
  }
}

/* ---------- Ocenenia ---------- */
/* Odkaz v texte – modrý, podčiarknutie zvýrazní pri prejdení myšou */
.text-link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: #c7d4fe;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  transition: color 150ms, text-decoration-color 150ms;
}
.text-link:hover {
  color: var(--accent-dark);
  text-decoration-color: currentColor;
}

/* Logo projektu vedľa nadpisu */
.brand-head {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 48rem;
}
.brand-logo {
  flex: none;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  box-shadow: var(--shadow);
}
@media (min-width: 48rem) {
  .brand-logo {
    width: 6rem;
    height: 6rem;
  }
}

.section-lead {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1.125rem;
}

/* Logá súťaží v kartách – obe v rovnako vysokom boxe, aby texty pod nimi sedeli v jednej línii */
.award-logo {
  display: block;
  width: 100%;
  max-width: 12rem;
  height: 6rem;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 1.25rem;
}

/* Logá súťaží sú vycentrované v strede karty */
.award-logo-center {
  margin-inline: auto;
  object-position: center;
}

/* Logo školy je na šírku – namiesto kruhu biely zaoblený rámček */
.brand-logo-rect {
  width: 7.5rem;
  height: auto;
  padding: 0.4rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}
@media (min-width: 48rem) {
  .brand-logo-rect {
    width: 9rem;
    height: auto;
  }
}

/* Skupiny ocenení: každá má vlastnú hlavičku (logo/ikona + názov) */
.award-group + .award-group {
  margin-top: 3.5rem;
}
.award-group .brand-head {
  margin-bottom: 1.5rem;
}
.group-title {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 700;
}
.award-contest {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}
.card .award-contest {
  margin-top: 0;
}
.award-result {
  margin-top: 0.35rem;
}
.card .award-result {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---------- Topológia homelabu: router → switch → 2 servery ---------- */
.topology {
  --wire: #cbd5e1; /* farba káblov */
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}

/* Router a switch */
.node {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.9375rem;
  font-weight: 600;
}
.node svg {
  color: var(--accent);
}

/* Zvislý kábel medzi routerom a switchom */
.wire {
  width: 2px;
  height: 1.5rem;
  background: var(--wire);
}

/* Rozdvojenie kábla zo switchu k dvom serverom */
.servers {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  padding-top: 2.75rem;
}
.servers::before,
.servers::after {
  content: '';
  position: absolute;
  background: var(--wire);
}
.servers::before {
  top: 0;
  left: calc(50% - 1px);
  width: 2px;
  height: 1.375rem;
}
.servers::after {
  top: 1.375rem;
  left: calc(25% - 0.2rem);
  right: calc(25% - 0.2rem);
  height: 2px;
}

.server {
  position: relative;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.server::before {
  content: '';
  position: absolute;
  top: -1.375rem;
  left: calc(50% - 1px);
  width: 2px;
  height: 1.375rem;
  background: var(--wire);
}

.server-name {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}
.card .server-name {
  margin-top: 0;
}
.server-name span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  align-self: center;
}

/* Služby na serveri */
.apps {
  display: grid;
  gap: 0.5rem;
}
.apps li {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  align-items: center;
  column-gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 150ms, background-color 150ms;
}
.apps li:hover {
  border-color: #c7d4fe;
  background: var(--accent-soft);
}
.apps img {
  grid-row: span 2;
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
}
.apps strong {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
}
.apps span {
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--muted);
}

/* Na telefóne: menšie okraje a bez popisov, nech sa názvy služieb zmestia */
@media (max-width: 30rem) {
  .project {
    padding: 1.25rem;
  }
  .servers {
    gap: 0.5rem;
  }
  .server {
    padding: 0.6rem;
  }
  .server-name span {
    display: none;
  }
  .apps li {
    padding: 0.5rem;
    column-gap: 0.45rem;
  }
  .apps span {
    display: none;
  }
  .apps img {
    grid-row: auto;
  }
  .apps strong {
    font-size: 0.8125rem;
  }
}

/* ---------- Kontakt ---------- */
.contact {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 1.75rem;
  border-radius: 20px;
  background:
    radial-gradient(60% 80% at 100% 0%, rgb(59 130 246 / 0.18), transparent 70%),
    var(--navy);
  color: #fff;
}
@media (min-width: 56rem) {
  .contact {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 3rem;
    padding: 3.5rem;
  }
}

.contact h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  font-weight: 700;
}
.contact-lead {
  margin-top: 0.75rem;
  color: #cbd5e1;
}

.contact-links {
  display: grid;
  gap: 0.75rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.04);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: transform 200ms var(--ease), background-color 150ms, border-color 150ms;
}
.contact-link svg {
  flex: none;
  color: #93c5fd;
}
.contact-link:hover {
  transform: translateX(3px);
  background: rgb(255 255 255 / 0.08);
  border-color: rgb(255 255 255 / 0.28);
}

/* ---------- Pätička ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}
.footer a {
  text-decoration: none;
}
.footer a:hover {
  color: var(--text);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
@media (max-width: 40rem) {
  .footer {
    flex-direction: column;
  }
}

/* ---------- Podstránky: ochrana údajov, 404 ---------- */
.legal {
  max-width: 46rem;
}
.legal h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.legal h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
}
.legal p,
.legal li {
  color: var(--muted);
}
.legal p + p {
  margin-top: 0.75rem;
}
.legal ul {
  list-style: disc;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.35rem;
}
.legal .updated {
  font-size: 0.9375rem;
}
.legal .actions {
  margin-top: 2rem;
}

/* ---------- Animácia pri načítaní: úvod sa jemne objaví ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-text > *,
  .hero-photo {
    animation: rise 700ms var(--ease) both;
  }
  .hero-text > :nth-child(2) {
    animation-delay: 80ms;
  }
  .hero-text > :nth-child(3) {
    animation-delay: 160ms;
  }
  .hero-text > :nth-child(4) {
    animation-delay: 240ms;
  }
  .hero-photo {
    animation-delay: 200ms;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* Zelená bodka pomaly "dýcha" */
@media (prefers-reduced-motion: no-preference) {
  .eyebrow::before {
    animation: breathe 2.8s ease-out infinite;
  }
}
@keyframes breathe {
  70%,
  100% {
    box-shadow: 0 0 0 6px rgb(22 163 74 / 0);
  }
}

/* Sekcie sa pri posúvaní jemne objavia. Staršie prehliadače ich ukážu hneď. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .section-head,
    .about,
    .award-group,
    .grid-3,
    .contact {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}
