/* ===========================
   Goran Petkovic — Portfolio
   Light theme matching helin.design
   =========================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #fff;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

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

a {
  color: inherit;
  cursor: pointer;
}

a:hover {
  cursor: pointer;
}

/* === Accessibility === */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 1000;
  padding: 0.6rem 1rem;
  background: #1a1a1a;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.875rem;
}

.skip-link:focus-visible {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === Layout wrapper === */

.hero,
.projects,
.site-footer {
  width: min(100% - 3rem, 920px);
  margin-inline: auto;
}

/* === Hero === */

.hero {
  padding-top: 2.5rem;
}

.hero-top {
  margin-bottom: 1.5rem;
}

.meta-line {
  margin: 0;
  font-size: 0.875rem;
  color: #888;
  line-height: 1.6;
}

.meta-line + .meta-line {
  margin-top: 0.1rem;
}

.meta-line strong {
  color: #1a1a1a;
  font-weight: 600;
}

/* Portrait coin-flip easter egg */
.portrait-flip {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  cursor: none;
  perspective: 600px;
  display: block;
}

.portrait-flip *{
  cursor: none;
}

.flip-cursor {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: #1a1a1a;
  color: #fff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  transform: translate(-50%, -50%);
}

.flip-cursor.visible {
  opacity: 1;
  visibility: visible;
}

.portrait-coin {
  display: block;
  width: 60px;
  height: 60px;
  position: relative;
  transform-style: preserve-3d;
}

.portrait {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
}

.portrait-front,
.portrait-back {
  position: absolute;
  top: 0;
  left: 0;
  backface-visibility: hidden;
}

.portrait-front {
  transform: rotateY(0deg);
}

.portrait-back {
  transform: rotateY(180deg);
}

.bio {
  margin: 1.25rem 0 0;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #1a1a1a;
  max-width: 640px;
  font-weight: 400;
}

/* === Social links + badge row === */

.links-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 1rem;
}

.social-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

.social-links a {
  font-size: 0.875rem;
  color: #888;
  text-decoration: none;
  transition: color 0.15s ease;
  cursor: pointer;
}

.social-links a:hover {
  color: #1a1a1a;
}

.framer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 0.3rem 0.7rem 0.3rem 0.5rem;
  font-size: 0.78rem;
  color: #1a1a1a;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease;
}

.framer-badge:hover {
  border-color: #0099FF;
}

.framer-badge svg {
  flex-shrink: 0;
}

/* === Projects === */

.projects {
  margin-top: 2.75rem;
  padding-bottom: 2.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 1.25rem;
}

.project-card {
  text-decoration: none;
  display: block;
  cursor: pointer;
}

.card-label {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: #999;
}

.card-label strong {
  color: #1a1a1a;
  font-weight: 600;
}

.card-label span {
  margin-left: 0.15rem;
}

.project-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 13 / 10;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid #eaeaea;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover img {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

/* === Footer === */

.site-footer {
  padding-bottom: 5.5rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #eaeaea;
}

.footer-row .copyright {
  margin: 0;
  font-size: 0.78rem;
  color: #999;
}

.gravity-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.78rem;
  color: #999;
  cursor: pointer;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.gravity-toggle:hover {
  color: #1a1a1a;
}

.gravity-icon {
  flex-shrink: 0;
}

.gravity-toggle:disabled {
  cursor: default;
  opacity: 0.7;
}

.copyright {
  white-space: nowrap;
  flex-shrink: 0;
}

/* When gravity is active, avoid hover-lift fighting transforms */
body.gravity-active .project-card:hover img {
  transform: none;
  box-shadow: none;
}

/* Gravity reset overlay */
.gravity-reset {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.gravity-reset.visible {
  opacity: 1;
  pointer-events: auto;
}

.gravity-reset-text {
  margin: 0;
  font-size: 0.95rem;
  color: #999;
  text-align: center;
  max-width: 360px;
  line-height: 1.7;
}

.gravity-reset-btn {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  color: #1a1a1a;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.gravity-reset-btn:hover {
  color: #555;
}

/* === Floating bottom nav pill === */

.bottom-nav {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0;
  background: #1a1a1a;
  border-radius: 999px;
  padding: 0.3rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.bottom-nav a {
  text-decoration: none;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
}

.bottom-nav a[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.bottom-nav a:hover {
  color: #fff;
}

.bottom-nav .nav-cta {
  background: #333;
  color: #fff;
}

.bottom-nav .nav-cta:hover {
  background: #444;
}

/* === Responsive === */

@media (max-width: 700px) {
  .hero {
    padding-top: 1.75rem;
  }

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

  .footer-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .bottom-nav {
    bottom: 0.75rem;
    padding: 0.25rem;
  }

  .bottom-nav a {
    font-size: 0.78rem;
    padding: 0.45rem 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .project-card img {
    transition: none;
  }

  .social-links a,
  .bottom-nav a {
    transition: none;
  }
}
