/* ============================================================
   Andrii Drok — personal site
   dark builder aesthetic · gold + azure (yes, that's the flag)
   ============================================================ */

:root {
  --bg: #06070b;
  --bg-2: #0b0d15;
  --ink: #eef0f6;
  --muted: #8b90a3;
  --gold: #f3c64f;
  --blue: #4f7dff;
  --hairline: rgba(255, 255, 255, 0.08);
  --display: "Unbounded", sans-serif;
  --serif: "Instrument Serif", serif;
  --mono: "IBM Plex Mono", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: #111; }

.mono { font-family: var(--mono); }

em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}

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

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

/* ---------- fixed layers ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 40%, rgba(6, 7, 11, 0.75) 100%),
    linear-gradient(to bottom, rgba(6, 7, 11, 0.45), transparent 18%, transparent 82%, rgba(6, 7, 11, 0.6));
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}

/* ---------- preloader ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.7s var(--ease-out), visibility 0.7s;
}

.loader__mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.1em;
  color: var(--gold);
  animation: loader-pulse 1.1s ease-in-out infinite;
}

@keyframes loader-pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1); }
}

body.loaded .loader { opacity: 0; visibility: hidden; }

/* ---------- cursor ---------- */

.cursor { display: none; }

@media (pointer: fine) {
  .cursor { display: block; position: fixed; inset: 0; z-index: 99; pointer-events: none; }

  .cursor__dot,
  .cursor__ring {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
  }

  .cursor__dot {
    width: 6px;
    height: 6px;
    background: var(--gold);
  }

  .cursor__ring {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(243, 198, 79, 0.5);
    transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out),
      border-color 0.25s, background-color 0.25s;
  }

  body.cursor-hover .cursor__ring {
    width: 64px;
    height: 64px;
    border-color: rgba(79, 125, 255, 0.8);
    background: rgba(79, 125, 255, 0.08);
  }
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.2rem, 4vw, 3rem);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: linear-gradient(to bottom, rgba(6, 7, 11, 0.75), rgba(6, 7, 11, 0.2));
}

.nav__flagline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--blue) 35%, var(--gold) 65%, transparent);
  opacity: 0.55;
}

.nav__mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.nav__links { display: flex; gap: clamp(1.2rem, 3vw, 2.6rem); }

.nav__links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  transition: color 0.25s;
  position: relative;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}

.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.nav__status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 10px rgba(61, 220, 132, 0.8);
  animation: status-blink 2.2s ease-in-out infinite;
}

@keyframes status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (max-width: 720px) {
  .nav__status { display: none; }
}

@media (max-width: 560px) {
  .nav { padding: 1rem 1.2rem; }
  .nav__links { gap: 1rem; }
  .nav__links a { font-size: 0.7rem; letter-spacing: 0.12em; }
}

/* ---------- layout primitives ---------- */

main { position: relative; z-index: 10; }

section {
  position: relative;
  padding: clamp(6rem, 14vh, 10rem) clamp(1.2rem, 6vw, 6rem);
  max-width: 1280px;
  margin: 0 auto;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}

.section-head__num {
  color: var(--blue);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
}

.section-head h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.section-head h2 em { font-weight: 400; text-transform: none; letter-spacing: 0; }

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

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  max-width: none;
}

.hero__inner {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.hero__kicker {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2rem;
}

.hero__title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3.4rem, 13vw, 11rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.hero__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.line__inner {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 1.1s var(--ease-out);
  transition-delay: var(--d, 0s);
}

body.loaded .line__inner { transform: translateY(0); }

.line__inner--ghost {
  color: transparent;
  -webkit-text-stroke: 2px var(--gold);
}

.hero__sub {
  max-width: 34rem;
  margin-top: 2.4rem;
  font-size: 1rem;
  color: var(--muted);
}

.hero__sub em { font-size: 1.15em; }

.hero__meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 3.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__scrollbar {
  position: relative;
  width: 110px;
  height: 1px;
  background: var(--hairline);
  overflow: hidden;
}

.hero__scrollbar span {
  position: absolute;
  inset: 0;
  background: var(--gold);
  animation: scroll-sweep 2.4s var(--ease-out) infinite;
}

@keyframes scroll-sweep {
  0% { transform: translateX(-100%); }
  55% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* load-in reveals (hero only) */
.reveal-load {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: var(--d, 0s);
}

body.loaded .reveal-load { opacity: 1; transform: none; }

/* ---------- marquee ---------- */

.marquee {
  position: relative;
  z-index: 10;
  overflow: hidden;
  padding: 1.1rem 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: rgba(11, 13, 21, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.marquee__track span {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  padding-right: 0.5rem;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- work / cards ---------- */

.cards { display: flex; flex-direction: column; }

.card {
  position: relative;
  display: grid;
  grid-template-columns: 5rem 1fr 3rem;
  gap: 1.5rem;
  align-items: start;
  padding: 2.6rem 1.2rem;
  border-top: 1px solid var(--hairline);
  transition: background-color 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.card:last-child { border-bottom: 1px solid var(--hairline); }

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 1px;
  width: 0;
  background: linear-gradient(to right, var(--blue), var(--gold));
  transition: width 0.6s var(--ease-out);
}

.card:hover {
  background: rgba(243, 198, 79, 0.03);
  transform: translateX(8px);
}

.card:hover::before { width: 100%; }

.card__index {
  color: var(--blue);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  padding-top: 0.5rem;
}

.card__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-bottom: 0.9rem;
  transition: color 0.3s;
}

.card:hover .card__title { color: var(--gold); }

.card__desc {
  max-width: 46rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin-top: 1.2rem;
}

.card__tags li {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  transition: border-color 0.3s, color 0.3s;
}

.card:hover .card__tags li { border-color: rgba(243, 198, 79, 0.35); color: var(--ink); }

.card__arrow {
  font-size: 1.4rem;
  color: var(--muted);
  justify-self: end;
  padding-top: 0.4rem;
  transition: transform 0.4s var(--ease-out), color 0.3s;
}

.card:hover .card__arrow {
  transform: translate(6px, -6px);
  color: var(--gold);
}

/* static status tag for non-link cards (live / 24-7 / v6) */
.card__meta {
  justify-self: end;
  align-self: start;
  padding-top: 0.6rem;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  white-space: nowrap;
  transition: color 0.3s, border-color 0.3s;
}

.card:hover .card__meta {
  color: var(--gold);
  border-color: rgba(243, 198, 79, 0.35);
}

@media (max-width: 720px) {
  .card { grid-template-columns: 1fr; gap: 0.6rem; }
  .card__arrow, .card__meta { display: none; }
}

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

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

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

.about__photo {
  position: relative;
  margin: 0;
  align-self: start;
}

.about__photo img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.78) contrast(1.06) brightness(0.94);
  transition: filter 0.6s var(--ease-out);
}

.about__photo picture {
  display: block;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--hairline);
}

/* cool-blue wash so the shot sits in the site's palette until hover */
.about__photo picture::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(79, 125, 255, 0.16), rgba(6, 7, 11, 0.28));
  mix-blend-mode: multiply;
  pointer-events: none;
  transition: opacity 0.6s var(--ease-out);
}

/* offset gold frame */
.about__photo::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translate(14px, 14px);
  border: 1px solid rgba(243, 198, 79, 0.35);
  pointer-events: none;
  transition: transform 0.6s var(--ease-out);
}

.about__photo:hover img { filter: none; }
.about__photo:hover picture::after { opacity: 0; }
.about__photo:hover::before { transform: translate(8px, 8px); }

.about__photo figcaption {
  margin-top: 1rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.about__photo figcaption span { color: var(--blue); }

.about__col { min-width: 0; }

.about__quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  line-height: 1.25;
  color: var(--ink);
  border-left: 2px solid var(--gold);
  padding-left: 1.6rem;
  margin-bottom: 2.2rem;
}

.about__text p {
  color: var(--muted);
  margin-bottom: 1.4rem;
  max-width: 40rem;
}

.about__now {
  grid-column: 1 / -1;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  margin-top: 2rem;
}

.about__now li {
  background: var(--bg);
  padding: 1.2rem 1.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  transition: background-color 0.3s;
}

.about__now li:hover { background: var(--bg-2); }

.about__now li span { color: var(--blue); margin-right: 0.6rem; }

@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
}

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

.contact { text-align: left; padding-bottom: clamp(5rem, 10vh, 8rem); }

.contact__lead {
  max-width: 30rem;
  color: var(--muted);
  margin-bottom: 3rem;
}

.contact__mail {
  position: relative;
  display: inline-block;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.6rem, 9vw, 7rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(238, 240, 246, 0.6);
  transition: -webkit-text-stroke-color 0.4s;
}

.contact__mail-fill {
  position: absolute;
  inset: 0;
  color: var(--gold);
  -webkit-text-stroke: 0;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.7s var(--ease-out);
}

.contact__mail:hover .contact__mail-fill { clip-path: inset(0 0 0 0); }

.contact__links {
  display: flex;
  gap: 2.2rem;
  margin-top: 3rem;
}

.contact__links a {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 0.3rem;
  transition: color 0.3s, border-color 0.3s;
}

.contact__links a:hover { color: var(--gold); border-color: var(--gold); }

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

.footer {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem);
  border-top: 1px solid var(--hairline);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: rgba(6, 7, 11, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.footer__ua { color: var(--gold); }

/* ---------- scroll reveals ---------- */

.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0s);
}

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

/* ---------- anime.js char effects ---------- */

.char {
  display: inline-block;
  will-change: transform;
}

.hero__title .char { transform-origin: 0 100%; }

/* once JS has split a hero line into chars, the line itself steps aside */
.line__inner.is-split {
  transform: none;
  transition: none;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-load, .line__inner { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
