/* markredmer.com — rebuilt from Figma Sites as plain HTML/CSS/JS */

:root {
  --bg: #eeeeee;
  --ink: #000;
  --blue: #2d68f2;
  --blue-hover: #174fd1;
  --container: 992px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --font-text: "Stack Sans Text", system-ui, -apple-system, sans-serif;
  --font-head: "Stack Sans Headline", "Stack Sans Text", system-ui, sans-serif;
  color-scheme: light;
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; font-weight: inherit; }

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

/* Breakpoint helpers: the Figma site had two layouts, switching at 992px */
@media (max-width: 991.98px) { .d-only { display: none !important; } }
@media (min-width: 992px)    { .m-only { display: none !important; } }

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

/* ---------------------------------------------------------------- loader */

.loader {
  position: fixed;
  inset: -50vh 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 300ms var(--ease-soft), visibility 0s linear 300ms;
}
.loader::after {
  content: "";
  width: 120px;
  height: 3px;
  margin-top: 48px;
  border-radius: 999px;
  background: #d1d1d1 linear-gradient(#000, #000) no-repeat 0 50% / 22% 100%;
  animation: loader 900ms cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.is-loaded .loader { opacity: 0; visibility: hidden; }
@keyframes loader {
  0%   { background-size: 22% 100%; background-position: 0% 50%; }
  50%  { background-size: 68% 100%; background-position: 50% 50%; }
  100% { background-size: 22% 100%; background-position: 100% 50%; }
}

/* ---------------------------------------------------------------- header */

.menu {
  --top: 24px;
  --h: 80px;
  --btn-h: 64px;
  --w: min(calc(100vw - 32px), 1040px);
  position: fixed;
  z-index: 50;
  top: calc(var(--top) + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  margin-inline: auto;
  width: var(--w);
  height: var(--h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 8px 0 24px;
  border-radius: 48px;
  background: rgba(238, 238, 238, 0.5);
  -webkit-backdrop-filter: blur(56px);
  backdrop-filter: blur(56px);
  overflow: hidden;
  transition:
    transform 1000ms var(--ease-out),
    width 1000ms var(--ease-out);
}
.menu.is-compact { --w: min(calc(100vw - 32px), 600px); }
.menu.is-hidden { transform: translate3d(0, calc(-100% - var(--top) - 24px - env(safe-area-inset-top, 0px)), 0); }

.menu__logo { flex: none; display: block; color: #000; }
.menu__logo svg { height: 32px; width: auto; }
.menu__logo .logo-full  { width: 220px; }
.menu__logo .logo-short { width: 34px; margin-right: 14px; }

.menu__actions { margin-left: auto; display: flex; align-items: center; }

.menu__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-h);
  padding: 0 24px;
  border: 0;
  border-radius: 48px;
  background: transparent;
  font-size: 20px;
  line-height: 26px;
  letter-spacing: -0.04em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.menu__btn--dark { background: #000; color: #fff; }
.menu__btn:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) {
  .menu__btn:hover, .menu__logo:hover { opacity: 0.76; }
}
.menu__logo { transition: opacity 180ms var(--ease-out); }

/* full logo only in "desktop" mode (> 1100px) */
.menu .logo-short { display: none; }
@media (max-width: 1100px) {
  .menu .logo-full  { display: none; }
  .menu .logo-short { display: block; }
}
@media (max-width: 991.98px) {
  .menu { --top: 16px; --h: 64px; --btn-h: 56px; padding: 0 4px 0 16px; }
  .menu__btn { font-size: 18px; line-height: 24px; padding: 0 20px; }
}

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

.hero {
  /* Pinned to the top while the projects scroll over it (Figma: "sticky scrolls") */
  position: sticky;
  top: 0;
  z-index: 0;
  height: 978px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 192px;
  line-height: 0.76;
  letter-spacing: -7px;
  pointer-events: none;
}
.hero__line { display: block; white-space: nowrap; will-change: transform, opacity, filter; }

@media (max-width: 991.98px) {
  .hero {
    height: 579px;
    justify-content: flex-end;
    padding: 0 16px 150px;
    font-size: clamp(40px, 21.334vw, 120px); /* 80px at 375px wide, ×0.5…×1.5 */
    line-height: 0.8;
    letter-spacing: -4px;
  }
}

/* ---------------------------------------------------------------- projects */

.projects {
  position: relative;
  z-index: 1;
  margin-top: -64px;
  display: flex;
  flex-direction: column;
  gap: 96px;
}
@media (max-width: 991.98px) {
  .projects { margin-top: -24px; gap: 64px; }
}

.card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 56px 48px 64px;
  background: #fff;
  border-radius: 48px 48px 0 0;
}
.card__main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  min-height: 370px;
}
.card__title {
  font-family: var(--font-head);
  font-size: 48px;
  line-height: 44px;
  letter-spacing: -2.4px;
}
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0 0; padding: 0; list-style: none; }
.tags li {
  padding: 2px 10px;
  border-radius: 24px;
  background: #ededed;
  font-size: 16px;
  line-height: 20.8px;
  letter-spacing: -0.32px;
  white-space: nowrap;
}
.card__lead {
  font-size: 40px;
  line-height: 42px;
  letter-spacing: -1.2px;
}
.card__facts {
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: min(100%, 344px);
  margin: 0;
}
.fact { display: flex; gap: 10px; }
.fact img { flex: none; width: 17px; height: 19px; margin-top: 1px; }
.fact dt { font-weight: 600; font-size: 16px; line-height: 21px; }
.fact dd { margin: 0; font-weight: 300; font-size: 16px; line-height: 21px; }

@media (max-width: 991.98px) {
  .card {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 32px 16px 40px;
  }
  .card__main { min-height: 0; gap: 24px; justify-content: flex-start; }
  .card__title { font-size: 40px; line-height: 44px; letter-spacing: -1.2px; }
  .tags { margin-top: 8px; }
  .card__lead { font-size: 28px; line-height: 28px; letter-spacing: -0.84px; }
  .card__facts { width: 100%; gap: 24px; justify-self: stretch; }
}

/* media block under each card */
.media {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  padding: 64px 0 24px;
  border-radius: 0 0 40px 40px;
  overflow: hidden;
  isolation: isolate;
  background: #d9dee6 center / cover no-repeat;
}
.media--sushi { background-image: url(../img/bg-sushi-desktop.webp); }
.media--onlypos { background-image: url(../img/bg-onlypos-desktop.webp); }
.media--sbertravel { background-image: url(../img/bg-sbertravel-desktop.webp); }
.media--slides { background-image: url(../img/bg-slides-desktop.webp); }
@media (max-width: 991.98px) {
  .media--sushi { background-image: url(../img/bg-sushi-mobile.webp); }
  .media--onlypos { background-image: url(../img/bg-onlypos-mobile.webp); }
  .media--sbertravel { background-image: url(../img/bg-sbertravel-mobile.webp); }
  .media--slides { background-image: url(../img/bg-slides-mobile.webp); }
  .media { gap: 24px; }
  .media--sushi  { padding-top: 32px; }
  .media--onlypos { padding-top: 32px; }
  .media--sbertravel { padding-top: 56px; gap: 16px; padding-bottom: 17px; }
  .media--slides { padding-top: 28px; padding-bottom: 22px; }
}

.media__video {
  position: relative;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* Safari radius+video fix */
}
.media__video video { pointer-events: none; }
/* never show native play buttons / controls (iOS Low Power Mode draws one) */
.media__video video::-webkit-media-controls,
.media__video video::-webkit-media-controls-start-playback-button,
.media__video video::-webkit-media-controls-overlay-play-button { display: none !important; -webkit-appearance: none; }
.media__video video,
.media__video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media__video--phone { width: 376px; height: 814px; border-radius: 56px; }
.media__video--wide  { width: calc(100% - 64px); aspect-ratio: 2560 / 1600; border-radius: 32px; }
.media__video--slides { width: calc(100% - 118px); aspect-ratio: 16 / 9; border-radius: 32px; }

@media (max-width: 991.98px) {
  .media__video--phone { width: 279px; height: 604px; border-radius: 40px; }
  .media__video--wide  { width: calc(100% - 32px); border-radius: 12px; }
  .media__video--slides { width: calc(100% - 32px); border-radius: 8px; }
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 16px;
  border-radius: 48px;
  background: #fff;
  font-size: 16px;
  line-height: 22px;
  white-space: nowrap;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.pill:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .pill:hover { opacity: 0.8; } }
@media (max-width: 991.98px) { .pill { height: 54px; } }

.media__note {
  width: min(369px, calc(100% - 32px));
  color: #fff;
  font-size: 12px;
  line-height: 14.4px;
  text-align: center;
}
@media (max-width: 991.98px) { .media__note { width: calc(100% - 32px); } }

/* ---------------------------------------------------------------- footer & falling buttons */

.page-end { position: relative; padding-top: 300px; }
@media (max-width: 991.98px) { .page-end { padding-top: 250px; } }
.page-end--about { padding-top: 160px; }

.fall-trigger { height: 220px; pointer-events: none; }

.footer {
  padding: 0 16px 24px;
  text-align: center;
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -0.36px;
  color: rgba(0, 0, 0, 0.3);
}
@media (max-width: 991.98px) { .footer { padding-bottom: 16px; } }

.fall-layer {
  position: fixed;
  inset: 0 0 auto 0;
  height: 100vh;
  height: 100dvh;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint style;
}
.fall-btn {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 100px;
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
}
.fall-btn:active { cursor: grabbing; }

/* ---------------------------------------------------------------- floating project tabs */

.tabs {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100vw - 32px);
  height: 64px;
  padding: 4px;
  border-radius: 48px;
  background: rgba(224, 225, 231, 0.5);
  -webkit-backdrop-filter: blur(32px);
  backdrop-filter: blur(32px);
  transform: translate3d(-50%, 128px, 0);
  opacity: 0;
  pointer-events: none;
  transition: transform 1000ms var(--ease-out), opacity 1000ms var(--ease-out);
}
.tabs.is-visible { transform: translate3d(-50%, 0, 0); opacity: 1; pointer-events: auto; }
.tabs__scroller {
  position: relative;
  display: flex;
  gap: 4px;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 44px;
}
.tabs__scroller::-webkit-scrollbar { display: none; }
.tabs__indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 56px;
  border-radius: 48px;
  background: #f8f8f8;
  transition: transform 600ms var(--ease-out), width 600ms var(--ease-out);
}
.tabs__btn {
  position: relative;
  flex: none;
  height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 48px;
  background: transparent;
  color: #8c8c8c;
  font-weight: 300;
  font-size: 18px;
  line-height: 26px;
  letter-spacing: -0.02em;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: color 300ms var(--ease-out), background-color 300ms var(--ease-out), transform 150ms var(--ease-out);
}
.tabs__btn.is-active { color: #000; }
.tabs__btn:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .tabs__btn:not(.is-active):hover { background: rgba(248, 248, 248, 0.35); }
}

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

.contact {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: rgba(238, 238, 238, 0.8);
  -webkit-backdrop-filter: blur(72px);
  backdrop-filter: blur(72px);
  opacity: 0;
  visibility: hidden;
  overscroll-behavior: none;
  transition: opacity 300ms var(--ease-soft), visibility 0s linear 300ms;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .contact { background: rgba(238, 238, 238, 0.96); }
}
.contact.is-open { opacity: 1; visibility: visible; transition: opacity 450ms var(--ease-soft); }

.contact__dialog {
  width: fit-content;
  max-width: min(100%, 520px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transform: translate3d(-10px, 12px, 0) scale(0.99);
  opacity: 0;
  transition: opacity 300ms var(--ease-soft), transform 300ms var(--ease-soft);
}
.contact.is-open .contact__dialog {
  transform: translate3d(-10px, 0, 0);
  opacity: 1;
  transition-duration: 450ms;
}
.contact__close {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.contact__close, .contact__link {
  color: var(--blue);
  font-weight: 300;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: -0.4px;
  transition: color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .contact__close:hover, .contact__link:hover { color: var(--blue-hover); }
}
.contact__title {
  font-size: 48px;
  line-height: 44px;
  letter-spacing: -2.4px;
}
.contact__list { display: flex; flex-direction: column; gap: 20px; margin: 44px 0 0; }
.contact__list dt {
  font-weight: 300;
  font-size: 16px;
  line-height: 22px;
  letter-spacing: -0.32px;
  color: rgba(0, 0, 0, 0.5);
}
.contact__list dd { margin: 0; }
.contact__link { white-space: nowrap; }
.contact :focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 2px; }

html.is-locked, html.is-locked body { overflow: hidden; overscroll-behavior: none; }

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

.about {
  width: min(100% - 32px, 488px);
  margin: 250px auto 0;
}
.about__title {
  font-family: var(--font-head);
  font-size: 102px;
  line-height: 87.72px;
  letter-spacing: -5.1px;
}
.cv { display: flex; flex-direction: column; gap: 40px; margin: 150px 0 0; }
.cv__row { display: grid; grid-template-columns: 72px 1fr; gap: 16px; }
.cv__when { font-weight: 600; font-size: 17px; line-height: 26px; letter-spacing: -0.34px; }
.cv__what { display: flex; flex-direction: column; gap: 6px; }
.cv__role { font-weight: 600; font-size: 18px; line-height: 26px; letter-spacing: -0.36px; }
.cv__role .sep::before { content: " • "; }
.cv__text { font-weight: 300; font-size: 16px; line-height: 21px; letter-spacing: -0.16px; }
.cv__intro { font-size: 22px; line-height: 26px; letter-spacing: -0.44px; }

@media (max-width: 991.98px) {
  .about { width: calc(100% - 32px); max-width: 560px; margin-top: 196px; }
  .about__title { font-size: 70px; line-height: 60.2px; letter-spacing: -3.5px; }
  .cv { margin-top: 96px; }
  .cv__row { grid-template-columns: 1fr; gap: 4px; }
  .cv__row--intro { gap: 0; }
  .cv__when { font-weight: 700; font-size: 15px; line-height: 22px; letter-spacing: -0.3px; }
  .cv__what { gap: 8px; }
  .cv__role { font-size: 16px; line-height: 21px; letter-spacing: -0.32px; }
  .cv__role .sep { display: block; }
  .cv__role .sep::before { content: none; }
  .cv__text { line-height: 20px; letter-spacing: -0.32px; }
  .cv__intro { font-size: 20px; line-height: 23px; letter-spacing: -0.4px; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
