/* ------------------------------------------------------------------
   Karina Chornenka — personal site
   Warm monochrome: beige paper tones, near-black ink, no accent color
------------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #faf7f2;
  --bg-alt: #f2ede5;
  --ink: #1a1a1a;
  --ink-soft: #6f675c;
  --line: #e6dfd3;
  --radius: 4px;
  --container: 1080px;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
}

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

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}

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

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.nav.scrolled {
  border-bottom-color: var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4.25rem;
}

.nav-name {
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.5vw, 1.75rem);
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.lang-switch {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.lang-switch:hover,
.lang-switch:focus-visible {
  color: var(--ink);
  border-color: var(--ink-soft);
}

/* Hide section links on small screens; name + language switch remain */
@media (max-width: 620px) {
  .nav-links li:not(.lang-item) {
    display: none;
  }
}

/* ---------- Hero (full-viewport split: text left, photo right) ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  overflow: hidden;
}

.hero-text-col {
  display: flex;
  align-items: center;
  padding-top: 6rem;
  padding-bottom: 6rem;
  /* left edge lines up with .container content */
  padding-left: calc(max((100vw - var(--container)) / 2, 0px) + var(--pad));
  padding-right: clamp(2rem, 4vw, 4rem);
}

.hero-media {
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
  animation: hero-zoom 1.8s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.hero-media img {
  position: absolute;
  left: 0;
  top: -6%;
  width: 100%;
  height: 112%;
  object-fit: cover;
  object-position: center 30%; /* keep the face in frame when cropped tall */
  image-orientation: from-image; /* honor EXIF rotation on phone photos */
  will-change: transform;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 5.5vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 650;
  margin-bottom: 1.5rem;
}

.hero-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 32em;
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Staggered entrance on load */
.hero-text > * {
  animation: rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.hero-text > *:nth-child(1) { animation-delay: 0.15s; }
.hero-text > *:nth-child(2) { animation-delay: 0.27s; }
.hero-text > *:nth-child(3) { animation-delay: 0.39s; }
.hero-text > *:nth-child(4) { animation-delay: 0.51s; }
.hero-text > *:nth-child(5) { animation-delay: 0.63s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hero-zoom {
  from {
    transform: scale(1.05);
  }
  to {
    transform: none;
  }
}

/* Animated scroll cue */
.scroll-hint {
  position: absolute;
  z-index: 2;
  left: calc(max((100vw - var(--container)) / 2, 0px) + var(--pad));
  bottom: 2.25rem;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  animation: rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.8s both;
}

.scroll-hint::after {
  content: "";
  width: 1px;
  height: 48px;
  margin-left: 2px;
  background: linear-gradient(to bottom, transparent, var(--ink) 40% 60%, transparent) no-repeat;
  background-size: 100% 200%;
  animation: scroll-line 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes scroll-line {
  0% {
    background-position: 0 -48px;
  }
  65%,
  100% {
    background-position: 0 48px;
  }
}

.btn {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  opacity: 0.85;
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--ink-soft);
}

/* Mobile: photo fills the screen, text overlaid at the bottom on a scrim */
@media (max-width: 760px) {
  .hero {
    display: block;
  }

  .hero-media {
    position: absolute;
    inset: 0;
  }

  .hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      rgba(250, 247, 242, 0) 30%,
      rgba(250, 247, 242, 0.9) 62%,
      var(--bg) 92%
    );
  }

  .hero-text-col {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100svh;
    align-items: flex-end;
    padding: 7rem var(--pad) 4.5rem;
  }

  .scroll-hint {
    display: none;
  }
}

/* ---------- Marquee strip ---------- */

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: 1.4rem;
}

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

.marquee-track span {
  white-space: nowrap;
  padding-right: 3.5rem;
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--ink);
}

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

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

.section {
  padding-block: clamp(4rem, 10vw, 7rem);
}

.section-alt {
  background: var(--bg-alt);
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.section h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.02em;
  font-weight: 650;
  line-height: 1.15;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
  max-width: 18em;
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}

.about-grid p + p {
  margin-top: 1.25rem;
}

.about-grid p {
  color: var(--ink-soft);
}

.about-grid .about-lede {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: -0.01em;
}

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

/* Timeline (education & credentials) */

.timeline {
  list-style: none;
  border-left: 1px solid var(--line);
  margin-left: 0.4rem;
}

.timeline li {
  position: relative;
  padding: 0 0 2.25rem 2rem;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -0.3rem;
  top: 0.5rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--ink);
}

.timeline time {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.timeline h3 {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.timeline p {
  color: var(--ink-soft);
  max-width: 38em;
}

/* Publications */

.pub-list {
  list-style: none;
}

.pub-list li {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0;
}

.pub-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.pub-list h3 {
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.pub-list h3 a {
  text-decoration: none;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
  transition: background-size 0.3s ease;
}

.pub-list h3 a:hover,
.pub-list h3 a:focus-visible {
  background-size: 100% 1px;
}

.pub-meta {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

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

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

.contact h2 {
  margin-bottom: 1rem;
}

.contact-note {
  color: var(--ink-soft);
  max-width: 34em;
  margin-bottom: 2.5rem;
}

.contact-email {
  display: inline-block;
  font-size: clamp(1.3rem, 3.5vw, 2.25rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: 0 100%;
  padding-bottom: 0.15em;
  transition: opacity 0.2s ease;
  overflow-wrap: anywhere;
}

.contact-email:hover,
.contact-email:focus-visible {
  opacity: 0.7;
}

.contact-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  list-style: none;
}

.contact-links a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-links a:hover,
.contact-links a:focus-visible {
  color: var(--ink);
}

.footer {
  border-top: 1px solid var(--line);
  padding-block: 1.75rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.footer-inner a {
  color: inherit;
  text-decoration: none;
}

.footer-inner a:hover,
.footer-inner a:focus-visible {
  color: var(--ink);
}

.footer-legal {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

/* ---------- Legal pages ---------- */

.legal-page {
  padding-top: clamp(7rem, 15vh, 9rem);
  padding-bottom: clamp(4rem, 10vw, 6rem);
  max-width: 42em;
}

.legal-page h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
  font-weight: 650;
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.25rem;
  font-weight: 650;
  margin: 2.5rem 0 0.75rem;
}

.legal-page p {
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

/* ---------- Scroll reveal ---------- */

/* Masked word-by-word headline reveal: JS wraps each word in
   .mr-w (mask) > .mr-i (sliding inner) and adds .in on scroll */
.mr-w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

.mr-i {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 0.75s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.mask-reveal.in .mr-i {
  transform: none;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-media,
  .hero-text > *,
  .scroll-hint,
  .scroll-hint::after,
  .marquee-track {
    animation: none;
  }
  .mr-i {
    transform: none;
    transition: none;
  }
}

/* No-JS fallback: never hide content */
.no-js .reveal {
  opacity: 1;
  transform: none;
}
