/* =========================================================
   Renate Zimova — Illustration Portfolio
   Design tokens
   ========================================================= */
:root {
  --cream: #f0efec;
  --blue: #b2cff2;
  --blue-deep: #7ea3d6;
  --ink: #141414;
  --ink-soft: #2a2a2a;

  --font-display: "Anybody", "Arial Rounded MT Bold", sans-serif;
  --font-body: "Anybody", "Arial Rounded MT Bold", sans-serif;

  --header-h: clamp(72px, 10vh, 108px);

  /* Intro timing — tune these two numbers to change the whole
     rhythm of the animation without touching the JS. */
  --intro-total: 2000ms;
  --intro-ease-swish: cubic-bezier(0.62, 0.06, 0.28, 1);

  /* Custom cursor colors — used by the JS-driven cursor dot (see
     #cursor-dot below and initCustomCursor in main.js), not by the
     native CSS `cursor` property. A native `cursor: url(...)` swap
     can never transition/fade between two images in any browser —
     that's a hard platform limitation, not a styling choice — so
     getting an actual smooth color fade on the orange→blue handoff
     requires a real DOM element that follows the mouse instead. */
  --cursor-blue: #66b0fc;
  --cursor-orange: #ff4d25;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none; /* the JS-driven dot below replaces it entirely */
}

/* Only draw the custom dot on devices with an actual mouse — on
   touch devices there's no hover pointer to track, so this stays
   hidden and the browser's normal touch behavior applies. */
@media (pointer: fine) {
  #cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--cursor-blue);
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    /* This is the actual fix for "almost unnoticeable" — a real
       CSS transition on a real element, which native cursor swaps
       cannot do at all. */
    transition: background-color 500ms ease;
    opacity: 0;
  }

  #cursor-dot.is-visible { opacity: 1; }
  #cursor-dot.is-intro { background: var(--cursor-orange); }
}

body.is-locked {
  overflow: hidden;
  width: 100%;
  /* top is set inline by JS (lockScroll in main.js) to pin the body
     at its exact current scroll offset — that's what makes closing
     a modal restore your scroll position instead of jumping to the
     top. See the comment above lockScroll() for the full reasoning. */
}

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

/* =========================================================
   Intro overlay
   ========================================================= */
#intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  overflow: hidden;
}

#intro-bubble {
  position: absolute;
  width: min(94vw, 1500px);
  pointer-events: auto;
  user-select: none;
}

#intro-logo {
  position: absolute;
  width: min(15vw, 190px);
  pointer-events: none;
  user-select: none;
  overflow: visible;
  /* Light from the very first frame — matches the JS transform
     animation's first keyframe exactly, so there's no jump/flash
     when that animation kicks in after the hold. */
  filter: brightness(0) invert(1);
}

/* the mark reads white while it sits on the blue bubble */
.morph-path {
  fill: #ffffff;
}

/* When JS confirms the page is ready, this class removes the
   overlay from layout entirely so it never blocks clicks/scroll. */
#intro.is-done {
  display: none;
}

/* =========================================================
   Header / nav
   ========================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: var(--cream);
  pointer-events: none; /* re-enabled on the button itself below */
}

.menu-toggle {
  position: relative;
  pointer-events: auto;
  width: clamp(64px, 8vw, 88px);
  height: clamp(44px, 6vw, 60px);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  opacity: 0; /* revealed at the end of the intro handoff */
}

.menu-toggle img {
  /* Matches the width the old CSS-drawn bars rendered at — this
     artwork's own proportions (526:302) happen to produce almost
     the exact same height too, so the icon's footprint on screen
     is unchanged from before, just drawn by hand now instead of
     three <span> divs. The button itself (above) keeps the larger
     padded hit area from the tap-target fix. */
  width: clamp(52px, 6vw, 72px);
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
}

.menu-toggle.is-visible { opacity: 1; }

/* =========================================================
   About section
   ========================================================= */
.about {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 24px) 24px 64px;
  overflow: hidden;
}



.about__content {
  position: relative;
  z-index: 1;
  max-width: 587px;
  text-align: center;
}

.about__content h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 2.5rem); /* caps at 40px, per spec */
  line-height: 1.1; /* 110% */
  letter-spacing: -1px;
  color: #000;
  margin: 0 0 1.4rem;
}

.about__content p {
  font-weight: 400;
  font-size: 14px;
  line-height: 1.24; /* 124% */
  letter-spacing: -0.07px;
  color: #000;
  margin: 0 0 1.3rem;
  text-wrap: pretty;
}

.about__content p:last-child { margin-bottom: 0; }

/* Hand-placed line breaks that match the source design exactly on
   wider screens; dropped on narrow screens so the shorter column
   can reflow naturally instead of forcing tiny, awkward lines. */
@media (max-width: 640px) {
  .lb { display: none; }
}

@media (max-width: 640px) {
  .about__content { max-width: 90vw; }
}

/* =========================================================
   Nav dropdown
   ========================================================= */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.16);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-panel {
  position: fixed;
  top: 0;
  left: 50%;
  width: min(90vw, 480px);
  background: var(--cream);
  /* Only the bottom corners round — the top sits flush with the
     viewport edge, so there's no visible top edge to peek out when
     it's hidden, and it reads as unfurling from off-screen rather
     than a floating card. */
  border-radius: 0 0 28px 28px;
  /* No shadow while closed — even fully translated off-screen, its
     blur radius reached back down into the viewport as a faint grey
     gradient at the very top. Only present once actually open. */
  box-shadow: none;
  z-index: 200;
  padding: 28px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  /* Fully off-screen above the viewport when closed. Transform only
     — no opacity, no scale — so the only motion on open/close is the
     panel itself sliding straight down, nothing else moves. */
  transform: translate(-50%, -100%);
  pointer-events: none;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-panel.is-open {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.nav-panel__close {
  position: static;
  opacity: 1;
}

.nav-panel__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.nav-panel__link {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  color: var(--ink);
  text-decoration: none;
}

.nav-panel__socials {
  display: flex;
  gap: 20px;
}

.icon-link {
  color: var(--ink);
  width: 26px;
  height: 26px;
  display: block;
}

.icon-link svg,
.icon-link img { width: 100%; height: 100%; object-fit: contain; }

/* =========================================================
   Works section
   ========================================================= */
.works {
  padding: 40px 24px 20px;
}

.works__heading {
  text-align: center;
  margin: 0 auto 48px;
}

.works__logo {
  width: 56px;
  margin: 0 auto 8px;
}

.works__heading h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  margin: 0;
}

.works__grid {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  --works-gap: 20px;
}

.work-item {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: left 220ms ease, top 220ms ease, width 220ms ease, transform 220ms ease;
  /* width/left/top are set by the JS masonry layout in main.js —
     these are just a sane pre-layout fallback so nothing overlaps
     before that runs. */
  visibility: hidden;
}

.works__grid.is-laid-out .work-item {
  visibility: visible;
}

/* transform doesn't affect layout, so neighbouring items stay put */
.work-item:hover,
.work-item:focus-visible {
  transform: scale(1.03);
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .work-item { transition: none; }
}

.work-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

@media (max-width: 1100px) {
  .works__grid { --works-gap: 16px; }
}

@media (max-width: 760px) {
  .works__grid { --works-gap: 12px; }
}

/* =========================================================
   Contacts section
   ========================================================= */
.contacts {
  /* Section itself ends ~1.5cm above the true bottom of the page —
     a literal cm value here rather than converting to px, so it
     stays exactly what was asked for regardless of font/zoom. */
  padding: 60px 88px 1.5cm;
  /* Positioning context for .back-to-top once it breaks out of the
     row layout on narrow screens (see the media query below). */
  position: relative;
}

.contacts__list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  /* Spreads the four columns across the full width, left edge to
     right edge, matching the reference layout — not centered. */
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px 56px;
  max-width: 1400px;
  margin: 0 auto;
}

.contacts__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 6px;
}

.contacts__label {
  /* A touch smaller than the About-page copy (14px), matching the
     value's own proportional shrink below. */
  font-size: 12px;
  font-weight: 400;
  color: #66b0fc;
}

.contacts__value {
  /* A bit bigger than the label, black, left-aligned. */
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
}

.back-to-top {
  /* Sits inline as the last item in the Contacts row now — no more
     fixed positioning, no circle background, just the bare arrow.
     Flows as a normal 5th item in .contacts__list's own
     space-between spacing, rather than being pushed to an edge. */
  display: flex;
  align-items: center;
  border: none;
  background: none;
  padding: 0;
  align-self: center;
}

.back-to-top img {
  width: 22px;
  height: auto;
  transform: rotate(-90deg); /* the arrow points right by default */
  display: block;
}

@media (max-width: 640px) {
  /* Once the row no longer has room to keep the four columns
     legible side by side, drop the row layout entirely: the contact
     info becomes a plain left-aligned stacked list, and the
     back-to-top arrow breaks out to its own corner rather than
     fighting for space as a 5th column. Side/bottom padding here
     matches .works's own 24px exactly, per the request that this
     section's margins line up with the illustration section's. */
  .contacts { padding: 40px 24px 24px; }
  .contacts__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
  }
  .back-to-top {
    position: absolute;
    right: 24px;
    bottom: 24px;
  }
}

/* =========================================================
   Lightbox
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__img {
  max-width: min(90vw, 1100px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  transform: scale(0.92);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox.is-open .lightbox__img {
  transform: scale(1);
}

.lightbox__close {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 510;
}

.lightbox__close img { width: 28px; height: auto; display: block; }

.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 510;
}

.lightbox__nav img { width: 32px; height: auto; display: block; }

.lightbox__nav--prev { left: 24px; }
.lightbox__nav--next { right: 24px; }
.lightbox__nav--prev img { transform: scaleX(-1); }

@media (max-width: 640px) {
  .lightbox__nav { width: 44px; height: 44px; }
  .lightbox__nav--prev { left: 12px; }
  .lightbox__nav--next { right: 12px; }
}

/* Respect people who've asked for reduced motion: the JS also
   skips the animated timeline, this just guards any stray CSS
   transitions elsewhere on the page. */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.about__bg-image {
  position: absolute;
  top: 30%;
  left: 62%;
  transform: translate(-50%, -50%);
  /* Fixed pixel size, not a percentage — stays exactly this size at
     any viewport width. On narrower screens the section's own
     overflow: hidden just crops the edges instead of scaling it
     down, which is the intended behavior. */
  width: 1900px;
  /* The site-wide `img { max-width: 100% }` reset (near the top of
     this file) would otherwise still cap this at its container's
     width despite the fixed width above — this overrides that just
     for this image, which is the actual fix. */
  max-width: none;
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}
