/*
Theme Name: KR Portfolio
Author: Krystian Rodziewicz
Description: Personal portfolio — dark, animated.
Version: 1.0
*/

:root {
  --bg: #0b0b0c;
  --fg: #ededea;
  --dim: #6f6f6b;
  --accent: #d8f34a;
  --line: rgba(237, 237, 234, 0.12);
  --edge: clamp(20px, 4vw, 60px);
  --sans: "Space Grotesk", sans-serif;
  --serif: "Instrument Serif", serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }

@media (hover: hover) { * { cursor: none; } }

.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s var(--ease);
  mix-blend-mode: difference;
}
.cursor.is-hover { width: 46px; height: 46px; background: var(--fg); }
@media (hover: none) { .cursor { display: none; } }

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

.loader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: var(--edge);
}
.loader__num {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: 0.8;
  color: var(--fg);
}
.loader.is-done { transform: translateY(-100%); transition: transform 1s var(--ease); }

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--edge) var(--edge) 0;
  mix-blend-mode: difference;
}
.nav__logo { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.02em; }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: clamp(16px, 2vw, 34px); font-size: 0.9rem; }
.nav__links a { position: relative; padding-bottom: 3px; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.4s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__status { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--dim); }
.nav__status i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (max-width: 700px) { .nav__status { display: none; } }

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--edge);
  padding-bottom: clamp(30px, 5vh, 60px);
}
.hero__eyebrow {
  display: flex;
  gap: 2rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 2rem;
}
.hero__title {
  font-weight: 500;
  font-size: clamp(2.4rem, 10vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: block; transform: translateY(110%); }
.hero__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-top: clamp(2rem, 5vh, 4rem);
}
.hero__desc { max-width: 30rem; font-size: clamp(1rem, 1.4vw, 1.25rem); line-height: 1.5; color: var(--fg); }
.hero__desc em { color: var(--accent); }
.hero__scroll { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.hero__scroll i { width: 1px; height: 46px; background: var(--line); position: relative; overflow: hidden; }
.hero__scroll i::after { content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: var(--accent); animation: scrolldot 2s var(--ease) infinite; }
@keyframes scrolldot { to { top: 100%; } }
@media (max-width: 700px) { .hero__scroll { display: none; } }

.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 1.4rem 0;
  white-space: nowrap;
}
.marquee__track { display: inline-flex; align-items: center; gap: 2rem; animation: scroll 30s linear infinite; }
.marquee span { font-size: clamp(1rem, 2.2vw, 1.7rem); font-weight: 300; text-transform: uppercase; }
.marquee b { color: var(--accent); }
@keyframes scroll { to { transform: translateX(-50%); } }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0 var(--edge);
  margin-bottom: clamp(2rem, 5vh, 4rem);
}
.section-head__idx { font-size: 0.8rem; color: var(--accent); }
.section-head h2 { font-weight: 400; font-size: clamp(1.4rem, 3vw, 2.2rem); letter-spacing: -0.01em; }

.work { position: relative; padding: clamp(80px, 12vh, 160px) 0; }
.projects { list-style: none; border-top: 1px solid var(--line); }
.project { border-bottom: 1px solid var(--line); }
.project a {
  display: grid;
  grid-template-columns: 3rem 1fr auto 3rem;
  align-items: center;
  gap: 1.5rem;
  padding: clamp(1.4rem, 3.5vw, 2.6rem) var(--edge);
  transition: background 0.4s var(--ease), padding-left 0.4s var(--ease);
}
.project a:hover { background: var(--fg); color: var(--bg); padding-left: calc(var(--edge) + 20px); }
.project__idx { font-size: 0.8rem; color: var(--dim); }
.project a:hover .project__idx { color: var(--bg); }
.project__name { font-size: clamp(1.4rem, 3.6vw, 2.8rem); font-weight: 400; letter-spacing: -0.02em; }
.project__tags { font-size: 0.85rem; color: var(--dim); text-align: right; }
.project a:hover .project__tags { color: var(--bg); }
.project__arrow { font-size: 1.4rem; text-align: right; }
@media (max-width: 700px) {
  .project a { grid-template-columns: 2rem 1fr; }
  .project__tags, .project__arrow { display: none; }
}

.project-preview {
  position: fixed;
  top: 0; left: 0;
  width: 22vw;
  height: 28vh;
  border-radius: 6px;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  background-size: cover;
  background-position: center;
}
.project-preview.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (hover: none) { .project-preview { display: none; } }

.about { padding: clamp(80px, 12vh, 160px) 0; }
.about__grid { padding: 0 var(--edge); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); }
.about__lead { font-size: clamp(1.2rem, 2vw, 1.9rem); line-height: 1.4; font-weight: 300; letter-spacing: -0.01em; }
.about__lead em { color: var(--accent); }
.about__stack { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-content: start; }
.about__stack h3 { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.6rem; }
.about__stack p { color: var(--dim); line-height: 1.7; font-size: 0.95rem; }
@media (max-width: 820px) { .about__grid { grid-template-columns: 1fr; } }

.contact {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: var(--edge);
  text-align: center;
  border-top: 1px solid var(--line);
}
.contact__eyebrow { font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.contact__mail {
  font-size: clamp(1.6rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  position: relative;
}
.contact__mail::after { content: ""; position: absolute; left: 0; bottom: 4px; width: 100%; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease); }
.contact__mail:hover::after { transform: scaleX(1); transform-origin: left; }
.contact__social { list-style: none; display: flex; gap: 2.5rem; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; }
.contact__social a { color: var(--dim); transition: color 0.3s var(--ease); }
.contact__social a:hover { color: var(--fg); }

.�oot {
  display: flex;
  justify-content: space-between;
  padding: var(--edge);
  font-size: 0.8rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.reveal { opacity: 0; transform: translateY(30px); }
.reveal.in { opacity: 1; transform: translateY(0); transition: opacity 1s var(--ease), transform 1s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .marquee__track, .nav__status i, .hero__scroll i::after { animation: none; }
}
