/* petarbeck.com - "Dusk Gradient".
   Dark base with a red->violet gradient as the signature motif (hero keyword,
   CTA, portrait ring, card hover, section rules). Muted, with a reddish/violet
   touch. Type: Archivo (display) / Inter (body) / JetBrains Mono (mono). */

:root {
  --bg: #0c0910;
  --surface: #171021;
  --surface-2: #20172f;

  --line: rgba(180, 110, 180, 0.16);
  --line-strong: rgba(180, 110, 180, 0.32);

  --ink: #efe8f2;
  --muted: #9e93ac;
  --accent: #b77ad8;

  /* the signature red -> violet gradient */
  --grad: linear-gradient(115deg, #d8607e, #7b57c9);
  --grad-soft: linear-gradient(115deg, rgba(216, 96, 126, 0.16), rgba(123, 87, 201, 0.16));

  --font-display: 'Archivo', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ---------- base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  position: relative;
}

/* ---------- shared type ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: '';
  width: 32px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  flex: none;
}

.eyebrow.is-centered {
  justify-content: center;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 9, 16, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding-block: 0.9rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: 0.01em;
}

.brand .mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--ink);
}

/* language switcher: shows the CURRENT locale, toggles to the other. Sibling of
   .nav-links (never inside it) so the mobile burger can't swallow it. */
.lang-switch {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 31px;
  padding-top: 0.14em;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lang-switch:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.nav-burger {
  display: none;
  width: 38px;
  height: 31px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.nav-burger span,
.nav-burger span::before,
.nav-burger span::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  transform: translateX(-50%);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-burger span {
  top: 50%;
  transform: translate(-50%, -50%);
}
.nav-burger span::before {
  top: -5px;
}
.nav-burger span::after {
  top: 5px;
}
.nav-burger[aria-expanded='true'] span {
  background: transparent;
}
.nav-burger[aria-expanded='true'] span::before {
  transform: translateX(-50%) translateY(5px) rotate(45deg);
}
.nav-burger[aria-expanded='true'] span::after {
  transform: translateX(-50%) translateY(-5px) rotate(-45deg);
}

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

.hero {
  padding-top: clamp(3rem, 7vw, 5rem);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 62% at 82% -5%, rgba(216, 96, 126, 0.18), transparent 60%),
    radial-gradient(50% 60% at 8% 8%, rgba(123, 87, 201, 0.16), transparent 62%);
}

.hero .container {
  position: relative;
}

.hero h1 {
  font-weight: 800;
  font-size: clamp(2.7rem, 7vw, 5rem);
  line-height: 1;
}

.hero .sub {
  max-width: 48ch;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  margin: 1.4rem 0 2rem;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: var(--grad);
  border: none;
  border-radius: 11px;
  padding: 0.9rem 1.7rem;
  box-shadow: 0 14px 30px -12px rgba(150, 90, 170, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-block;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -12px rgba(150, 90, 170, 0.75);
}

.link-arrow {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}

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

.about .container {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.about h2 {
  font-weight: 800;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  line-height: 1.08;
  margin-bottom: 1.1rem;
}

.about p {
  color: var(--muted);
  margin: 0 0 1rem;
  max-width: 52ch;
}

.about p strong {
  color: var(--ink);
  font-weight: 600;
}

.portrait {
  position: relative;
  justify-self: center;
  margin: 0;
}

.portrait::before {
  content: '';
  position: absolute;
  inset: -14px;
  background: var(--grad);
  filter: blur(38px);
  opacity: 0.35;
  border-radius: 26px;
  z-index: 0;
}

.portrait .frame {
  position: relative;
  z-index: 1;
  padding: 3px;
  border-radius: 22px;
  background: var(--grad);
}

.portrait img {
  border-radius: 19px;
  width: min(340px, 72vw);
  aspect-ratio: 1;
  object-fit: cover;
}

.portrait figcaption {
  position: relative;
  z-index: 1;
  margin-top: 0.9rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

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

.projects .head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.projects h2 {
  font-weight: 800;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 100%;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.card:hover::before {
  opacity: 1;
}

.card .emblem {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

/* two-tier kicker rendered on one line: components muted, topic accent */
.card .ktag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
  line-height: 1.4;
  color: var(--muted);
}

.card .ktag .comp {
  color: var(--muted);
}

.card .ktag .topic {
  color: var(--accent);
}

.card h3 {
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 1.2rem;
}

.card .more {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.card .more::after {
  content: ' \2192';
}

/* "coming soon" teaser: fills a full project block with a subtle dotted frame */
.soon {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.6rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--muted);
  line-height: 1.45;
  border: 1.5px dotted var(--line-strong);
  border-radius: 16px;
  min-height: 200px;
}

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

.contact {
  text-align: center;
}

.contact::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(50% 80% at 50% 0%, rgba(216, 96, 126, 0.14), rgba(123, 87, 201, 0.12) 55%, transparent 75%);
}

.contact .container {
  position: relative;
  max-width: 640px;
}

.contact h2 {
  font-weight: 800;
  font-size: clamp(2rem, 4.4vw, 3rem);
  margin-bottom: 0.9rem;
}

.contact p {
  color: var(--muted);
  margin: 0 0 2rem;
}

.contact .alt {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 1.4rem;
}

.contact .alt a {
  color: var(--accent);
}

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

.site-foot {
  border-top: 1px solid var(--line);
  padding-block: 2.4rem;
}

.foot-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.foot-row .links {
  display: flex;
  gap: 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.foot-row a:hover {
  color: var(--ink);
}

/* ---------- legal pages ---------- */

.legal {
  padding-block: clamp(3rem, 7vw, 5rem);
}

.legal .container {
  max-width: 760px;
}

.legal h1 {
  font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 2rem;
}

.legal h2 {
  font-weight: 700;
  font-size: 1.2rem;
  margin: 2rem 0 0.6rem;
}

.legal p {
  color: var(--muted);
  margin: 0 0 0.8rem;
}

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

.back-link {
  display: inline-block;
  margin-top: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

/* ---------- cookie toast (decorative — the site sets no cookies, no consent logic) ---------- */

.cookie-toast {
  position: fixed;
  right: clamp(14px, 3vw, 26px);
  bottom: clamp(14px, 3vw, 26px);
  z-index: 60;
  text-align: right;
  pointer-events: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cookie-toast.is-in {
  opacity: 1;
  transform: translateY(0);
}

.cookie-stamp {
  display: inline-block;
  transform: rotate(-6deg);
  padding: 8px 16px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: rgba(183, 122, 216, 0.1);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.cookie-cap {
  display: block;
  margin: 8px 2px 0;
  margin-left: auto;
  max-width: 30ch;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- responsive ---------- */

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

@media (max-width: 760px) {
  .nav-burger {
    display: inline-flex;
  }
  .lang-switch {
    order: -1;
  }
  .nav-links {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(12, 9, 16, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1.2rem;
    display: none;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
  }
  .nav {
    position: static;
  }
  .site-head .container {
    position: relative;
  }
}

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