/* ==========================================================================
   aleksabozic.com  |  "Midnight Aurora"
   --------------------------------------------------------------------------
   Start with the :root block below. Colors and fonts are set once there and
   used everywhere else, so changing a value changes the whole site.
   ========================================================================== */

:root {
  /* Colors */
  --bg: #07080f;          /* page background */
  --text: #eceaf4;        /* main text */
  --muted: #a2a7c0;       /* secondary text */
  --faint: #8087a3;       /* small, quiet text */
  --violet: #8b7bff;      /* aurora accents */
  --teal: #3fe0c5;
  --rose: #ff7eb6;
  --line: rgba(255, 255, 255, 0.09);   /* thin borders */

  /* Font: the system font of each visitor's device. Fast, private, no downloads.
     To use a custom font later, see the @font-face example just below. */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Display",
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --gutter: 1.25rem;       /* side space on small screens */
  --max: 68rem;            /* widest content */
  --header-h: 4.5rem;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

/* OPTIONAL: self-hosting a font (for example Manrope).
   1. Put the .woff2 file in assets/fonts/
   2. Remove the comment marks around the block below
   3. Put "Manrope" first in the --font list above

@font-face {
  font-family: "Manrope";
  src: url("../assets/fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
*/


/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  /* No background here on purpose: the page color comes from <html>, so the
     aurora layer (z-index -1) can show through instead of being covered. */
  background: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, ul { margin: 0; }

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

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

::selection { background: rgba(139, 123, 255, 0.45); color: #fff; }

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

.skip-link {
  position: fixed;
  top: -4rem;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

.container {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* Keeps page content above the fixed background layers */
main,
.site-footer { position: relative; z-index: 1; }


/* ---------- Background: drifting aurora ---------- */

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

/* Darkens the edges slightly so text always stays easy to read */
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 38%, transparent 0%, rgba(7, 8, 15, 0.6) 90%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.7;
  will-change: transform;
}

.blob--violet {
  width: 70vmax;
  height: 70vmax;
  left: -15vmax;
  top: -25vmax;
  background: radial-gradient(closest-side, rgba(139, 123, 255, 0.75), rgba(139, 123, 255, 0));
  animation: drift-a 38s ease-in-out infinite alternate;
}

.blob--teal {
  width: 60vmax;
  height: 60vmax;
  right: -20vmax;
  top: 8vh;
  background: radial-gradient(closest-side, rgba(63, 224, 197, 0.5), rgba(63, 224, 197, 0));
  animation: drift-b 46s ease-in-out infinite alternate;
}

.blob--rose {
  width: 55vmax;
  height: 55vmax;
  left: 20vw;
  bottom: -30vmax;
  background: radial-gradient(closest-side, rgba(255, 126, 182, 0.42), rgba(255, 126, 182, 0));
  animation: drift-c 52s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(12vw, 10vh, 0) scale(1.15); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to   { transform: translate3d(-14vw, 12vh, 0) scale(0.9); }
}
@keyframes drift-c {
  from { transform: translate3d(0, 0, 0) scale(0.95); }
  to   { transform: translate3d(10vw, -14vh, 0) scale(1.12); }
}


/* ---------- Cursor glow (desktop only) ---------- */

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 34rem;
  height: 34rem;
  margin: -17rem 0 0 -17rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(139, 123, 255, 0.16), transparent);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(var(--x, 50vw), var(--y, 50vh), 0);
  transition: opacity 0.6s, transform 0.35s ease-out;
}
.cursor-glow.is-active { opacity: 1; }

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-glow { display: none; }
}


/* ---------- Navigation ---------- */

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  min-height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}

/* Added by JavaScript once the page is scrolled: frosted glass bar */
.site-header.is-scrolled {
  background: rgba(7, 8, 15, 0.92);
  border-bottom-color: var(--line);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header.is-scrolled {
    background: rgba(7, 8, 15, 0.7);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
  }
}

.nav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
  padding-block: 0.5rem;
}

.brand {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-menu {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s, background-color 0.2s;
}
.nav-menu a:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }

.nav-toggle { display: none; }

/* Phones: the links fold into a menu button (only when JavaScript is on) */
@media (max-width: 44.9375rem) {
  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    cursor: pointer;
  }

  .nav-toggle__bars,
  .nav-toggle__bars::before,
  .nav-toggle__bars::after {
    display: block;
    width: 1.05rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.3s var(--ease), background-color 0.2s;
  }
  .nav-toggle__bars { position: relative; }
  .nav-toggle__bars::before,
  .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle__bars::before { top: -6px; }
  .nav-toggle__bars::after  { top: 6px; }

  .nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::after  { transform: translateY(-6px) rotate(-45deg); }

  .js .nav-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #0d0f1a;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0.25s;
  }
  .js .nav-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .js .nav-menu a { padding: 0.85rem 1rem; font-size: 1.05rem; }
}


/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + 2rem) 0 6rem;
  text-align: center;
}

.hero__title {
  font-size: clamp(2.75rem, 11vw, 8rem);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

/* Each word carries its own gradient so the entrance animation never hides the text */
.hero__word {
  display: inline-block;
  color: var(--text);
  animation: reveal-word 1.4s var(--ease) both;
}
.hero__word:nth-child(2) { animation-delay: 0.16s; }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero__word {
    background-image: linear-gradient(180deg, #ffffff 25%, #bdb6ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    padding-bottom: 0.08em; /* stops descenders from being clipped */
  }
}

.hero__tagline {
  max-width: 36ch;
  text-wrap: balance; /* avoids a single word on the last line */
  margin: 1.75rem auto 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 300;
  line-height: 1.5;
  animation: fade-in 1.2s 0.6s var(--ease) both;
}

.hero__more {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-left: -1.5rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  animation: fade-in 1.2s 1s var(--ease) both;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.hero__more svg { transition: transform 0.3s var(--ease); }
.hero__more:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.05); }
.hero__more:hover svg { transform: translateY(3px); }

@keyframes reveal-word {
  from { opacity: 0; transform: translateY(0.3em); filter: blur(14px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}


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

.section { padding-block: clamp(4.5rem, 11vw, 8rem); }

.section__inner {
  position: relative;
  display: grid;
  gap: 1.5rem 4rem;
  padding-top: clamp(2rem, 4vw, 3rem);
}

/* Thin line that fades out to the right */
.section__inner::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 85%);
}

@media (min-width: 56rem) {
  .section__inner { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

.section__title {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
}

.section__body { max-width: 40rem; color: var(--muted); }
.section__body p + p { margin-top: 1.25rem; }

.lead {
  color: var(--text);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 300;
  line-height: 1.45;
}


/* ---------- Projects ---------- */

.project-list {
  margin-top: 2rem;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.project {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.project__title {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.project__desc { margin-top: 0.25rem; font-size: 1rem; }
.project__status { flex: none; color: var(--faint); font-size: 0.875rem; }

/* For later: use class="project project--link" once a project has a real link */
.project--link { transition: padding-left 0.3s var(--ease); }
.project--link:hover { padding-left: 0.75rem; }
.project--link:hover .project__title { color: var(--teal); }


/* ---------- Interests ---------- */

.panel {
  margin-top: 2rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
}

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

/* Dashed outline = an empty slot waiting to be filled */
.chip {
  padding: 0.5rem 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}


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

.site-footer { padding: 2rem 0 3rem; }

.footer__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.75rem;
  color: var(--faint);
  font-size: 0.9rem;
}
.footer__inner::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--line);
}
.footer__inner a { transition: color 0.2s; }
.footer__inner a:hover { color: var(--text); }


/* ---------- Scroll reveal (a gentle fade as sections arrive) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .section__body.reveal { transition-delay: 0.12s; }


/* ---------- Respect "reduce motion" settings ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
